"4898225","1","4898387","","2011-02-04 12:59:56","2","2461","<p>I'm looking for a nice programatic way I can use to refer to the images in my Bitmap[].</p><p>At the moment, I declare a bunch of integers in my class</p><pre><code>Bitmap[] mBmp = new Bitmap[6]    int image1 = 0, image2 = 1, image3 = 2, someimage = 3, otherimage = 4, yetanoimage = 5;</code></pre><p>I then refer to them as follows:</p><pre><code>mBmp[someimage] ...</code></pre><p>However, this is inefficient and I would like to refer to them (preferrably) according to their filename (minus the extension) or some other unique identifier than can be programatically determined.</p><p>The reason for this is that:</p><ol><li>number of images is arbitrary</li><li>file names are arbitrary</li><li>I want to automate the process as a template.</li></ol>","353674","","","","","2011-02-04 13:17:36","Android, want to reference Bitmaps in array using strings, programatically","<android><arrays><image><uniqueidentifier>","2","0","","",""
"4898237","1","7860788","","2011-02-04 13:01:24","8","2341","<p>I'm working on an app that wants to display lengths either in centimeters (cm) or in inches(""). Is there a way to select the right unit from the locale? In any event I'm also going to put in an option so that the user can to override the locale setting.</p><p>USA, Liberia, and Burma should use imperial units and the rest of the world normal units. One way is to put in this logic in my own classes, but I would prefer using any built in logic if available. Any pointers?</p>","363437","","27615","","2011-11-26 10:28:56","2013-08-05 19:48:51","Using locale settings to detect wheter to use imperial units","<android><localization><internationalization><units-of-measurement>","2","3","5","",""
"4898261","1","4898342","","2011-02-04 13:03:45","1","484","<p>I want to store preferences which are Android version dependent (eg. User Agent string obtained from <code>WebView</code>). </p><p>When user is upgrading system (say from 1.6 to 2.1), does those preferences last? </p><p>I want to retrieve User Agent from <code>WebView</code> once, then store it in <code>SharedPreferences</code>. When system is upgraded I want to update this value.</p>","296427","","296427","","2011-02-04 13:15:03","2011-02-04 13:15:03","Does application preferences remain after Android system upgrade?","<android><system><upgrade><android-preferences>","1","3","","",""
"4898271","1","4904082","","2011-02-04 13:04:48","2","3213","<p>I have an activity that I use in multiples modes, so I have to do things like this:</p><pre><code>    Intent i = new Intent(MainListActivity.this,MainActivity.class);    extras.putInt(""id"", c.getId());    extras.putInt(""mode"", AREA_MODE);    i.putExtra(""extras"", extras);    startActivity(i);</code></pre><p>and in the <code>onCreate</code>:</p><pre><code>    Intent i = this.getIntent();    extras = i.getBundleExtra(""extras"");    if(extras!=null){        id = extras.getInt(""id"", -1);        mode = extras.getInt(""mode"", COUNTRY_MODE);    }</code></pre><p>But the intent extras are always null. Am I missing something? Is there any way to do this?</p><p>EDIT: For some reason, the <code>getIntent()</code> method returns the previous <code>Intent</code> which in my case has no extra (main intent). I'm trying to figure out why.</p>","599826","","844882","","2012-03-21 07:47:14","2012-03-21 07:47:14","Unable to retrieve intent's extras","<android>","5","2","","",""
"4898318","1","4898348","","2011-02-04 13:10:14","0","123","<p>I have an android app. in that I am comparing two strings from the EditTest, but I get some strange results...</p><pre><code>if(v==findViewById(R.id.submit)){            //            if(email==crfm_email)            {                String warn=""Done!"";                Toast toast = Toast.makeText(getBaseContext(), warn, Toast.LENGTH_LONG);                toast.show();            }            else            {                oFN=(EditText)findViewById(R.id.owners_first_name);                String warn=""email addresses do not match ""+eMail+"" ""+crfEmail;                Toast toast = Toast.makeText(getBaseContext(), warn, Toast.LENGTH_LONG);                toast.show();            }        } </code></pre><p>the problem is that the control always goes to the else part even if the input for both variables are same.I know that its a simple mistake but cant crack it out...!</p>","573700","","299924","","2011-02-04 13:17:25","2011-02-04 13:19:59","Error in if statement","<java><android><if-statement>","4","4","1","",""
"4898330","1","","","2011-02-04 13:11:34","3","1593","<p>I want to disable the control of pinching to zoom in my app. How do I go about setting this?</p>","601327","","250259","","2011-12-12 14:03:10","2011-12-12 14:03:10","Android - Disable Pinch Zoom Control in Google Maps API","<java><android><google-maps-api-3><zoom>","1","2","1","",""
"4898372","1","","","2011-02-04 13:15:05","-1","763","<p>Can anyone help me,How to load the html page from the native android app.I am able to load native screen from html using '<strong>phoneGap</strong>'.Not the vise versa.</p><p>Plz help me in this.</p><p>Thanks,</p><p>Bharath</p>","548616","","2364847","","2013-05-14 11:07:17","2013-05-14 11:07:17","How to load html file from native using phonegap in android","<android><phonegap>","1","0","","2013-05-14 13:53:54",""
"4898468","1","","","2011-02-04 13:25:24","0","1863","<p>Have you succeeded in service discovery using jmdns in Android? I'm facing same problem not able to discover services using jmdns in Android.</p><p>From my code using jmdns I am trying to discover services of type:</p><pre><code>jmdns.addServiceListener(""_afpovertcp._tcp."", listener);ServiceInfo[] infos = jmdns.list(""_afpovertcp._tcp.""); </code></pre><p>I have installed _afpovertcp._tcp service type (Avahi package) on my Linux Ubuntu PC. My Android phone with my code and linux machine both are configured to WI-FI. Still not able to discover my Linux PC.</p>","603194","","1908677","","2013-04-29 21:42:05","2013-09-03 18:39:01","JmDNS on Android","<android><zeroconf><jmdns><mdns>","2","0","","",""
"4898523","1","4898562","","2011-02-04 13:32:26","2","1830","<p>I have a String object and I would like to set the text in a EditText object.  Can this be done</p>","589450","","","","","2013-06-15 18:11:06","How To Set Text In An EditText with Sting object","<java><android><edittext>","3","0","","",""
"4898577","1","","","2011-02-04 13:38:50","0","427","<p>I am new to android.I am trying to make the image to get to zoom out to a particular level when is get Focused and when the Focus is gone then the image should go to original size automatically.I don't want to zoom in and out a image. I just want that image to change size when it is get focused and once focus is gone it should get it to original size same as in iPhone.Thanks in advance.</p>","366916","","","","","2011-02-05 05:08:28","Android-Image Size change When get Focused","<android>","1","0","","",""
"4898616","1","4924120","","2011-02-04 13:43:38","2","985","<p>Does ""Create project from existing sample"" modify <em>anything</em> in the original sample project files?</p><p>If so, what is the best way to ""Create project from existing sample"" <em>without</em> modifying anything in the original sample project files?</p><p>(I am assuming project duplication is involved, but step-by-step instructions would be very helpful for future Android-newbies)</p><p>The following is a snapshot of the options available, to further clarify my question:</p><p><img src=""http://i.stack.imgur.com/Hva22.png"" alt=""enter image description here""></p>","418055","","418055","","2011-02-07 16:54:38","2011-02-07 17:53:27","Does ""Create project from existing source"" modify existing sample?","<android><eclipse><sample>","2","4","","",""
"4898634","1","","","2011-02-04 13:44:50","1","1730","<p>I have a ListView which after clicking on an item I want it to be permanently selected, so some other action can be taken depending on what button is pressed next. A bit like a RadioBox but within the list view. So when pressed, the background stays yellow and I keep a store of which item is selected. At the moment I have it when it is clicked the the background changes, but haveing weird behavior with when selected and I scroll the ListView the selected item changes. </p><p><strong>Code I have:</strong></p><pre><code>ArrayList&lt;HashMap&lt;String, String&gt;&gt; mylist = new ArrayList&lt;HashMap&lt;String, String&gt;&gt;();        for (int i = 0; i &lt; titles.size(); i++){            HashMap&lt;String, String&gt; map = new HashMap&lt;String, String&gt;();            map.put(""name"", titles.get(i));            mylist.add(map);        }        SimpleAdapter mSchedule = new SimpleAdapter(this, mylist, R.layout.listcell,                new String[] {""name""}, new int[] {R.id.txtItemName});         ListView listView1 = (ListView) findViewById(R.id.ListView01);         listView1.setAdapter(mSchedule);         listView1.setTextFilterEnabled(true);        listView1.setOnItemClickListener(new OnItemClickListener() {                     @Override                    public void onItemClick(AdapterView&lt;?&gt; a, View v, int position, long id) {                         Log.v(""Test"", v.toString());                        v.setBackgroundResource(R.drawable.newbackground);                    }                });}</code></pre>","400406","","400406","","2011-02-04 14:37:55","2011-02-17 21:16:44","Selected item ListView Background change","<java><android><listview>","2","0","","",""
"4898637","1","5536220","","2011-02-04 13:45:02","2","1564","<p>I'm trying to get SoundManager2 to work on Android, but so far it will not play any audio. Does anyone know if there is any way to get this to work on Android without flash being present? If so, please could you provide an example or a page that discusses the issues around this.</p>","68332","","","","","2012-04-06 05:47:51","Does SoundManager2 work on Android 2.2 without flash?","<javascript><android>","2","0","1","",""
"4898672","1","","","2011-02-04 13:47:50","1","1149","<p>I need to convert mapview to bitmap image. I used the code as below:</p><pre><code>MapView mapview = new MapView(this, ""map_id_String"");mapview.setBuiltInZoomControls(true);MapController mc = mapview.getController();GeoPoint p = new GeoPoint((int) (36 * 1E6),(int) (36 * 1E6));mc.animateTo(p);mc.setZoom(20);Bitmap viewCapture = null;mapview.setDrawingCacheEnabled(true);mapview.layout(0,0,400,400);mapview.buildDrawingCache();viewCapture = Bitmap.createBitmap(mapview.getDrawingCache());mapview.setDrawingCacheEnabled(false);return viewCapture; </code></pre><p>But this code returns the image of view at the beginning, the map which has not been fully resolved. I need to wait it until mapview is fully resolved. </p>","459904","","2642204","","2013-10-06 18:25:03","2013-10-06 18:25:03","Mapview to image convert","<android><bitmap><android-mapview>","0","2","","",""
"4898722","1","","","2011-02-04 13:53:42","2","5321","<p>I am new to Android and I am having trouble understanding the concept so basically this is what i want to do to understand it better..</p><ul><li><p>I created a DrawShape class that extends view. In this class in the OnDraw() I am creating a circle and filling it with a color.</p></li><li><p>From the Activity I am calling the application. //Until this point I am doing fine.</p></li></ul><p>Now, I need to re-paint the Circle multiple times (Blue, Red, Yellow etc..)</p><p>So I was reading and the best way is to use Threads.. I also read you need to use postInvalidate() to redraw (I still dont understand from where I should be calling this) is this called from the Activity?, or within the OnDraw()?.</p><p>Hopefully you understand what i want to accomplish, is just that i havent found a good tutorial that shows this, how to repaint something x amount of times .. when I do Thread.sleep() it all stops then it shows my app.. but now i understand why, because i am playing with the main Thread. </p><p>Please help me understand this..</p><p>Thank you</p>","603247","","","","","2012-11-10 12:58:43","Android OnDraw()","<android>","3","0","","",""
"4898739","1","","","2011-02-04 13:56:25","0","2577","<p>How to get multiple checkbox values in android expandable list view?</p>","515810","","","","","2011-02-15 19:59:54","Android ExpandableListView with multiple CheckBox","<android><list><view><expandable>","2","0","","",""
"4898774","1","4898783","","2011-02-04 14:00:11","2","9666","<p>how to play rtsp url in android ?</p>","491073","","","","","2012-12-08 18:15:51","how to play rtsp url in android?","<android>","2","0","0","",""
"4898796","1","4899109","","2011-02-04 14:01:36","2","137","<p>I have an application and i want to use Android Market License as copy protection. If i use this on my app's next version what happens to my existing users if they update their apps ? </p>","426815","","","","","2011-02-04 14:29:23","If i use app licensing on my app's update what happens to user already installed application?","<android><licensing><google-play>","1","0","","",""
"4899027","1","","","2011-02-04 14:22:44","0","1083","<p>i want to play mp3 file which is streamed mp3 file. i tried below  link example</p><p><a href=""http://blog.pocketjourney.com/2008/04/04/tutorial-custom-media-streaming-for-androids-mediaplayer/"" rel=""nofollow"">http://blog.pocketjourney.com/2008/04/04/tutorial-custom-media-streaming-for-androids-mediaplayer/</a> but the bellow error is coming</p><pre><code> 02-04 20:22:48.960: ERROR/PlayerDriver(31): Command PLAYER_PREPARE completed with an    error or info PVMFErrResource 02-04 20:22:48.970: ERROR/MediaPlayer(425): error (1, -17) 02-04 20:22:48.989: WARN/PlayerDriver(31): PVMFInfoErrorHandlingComplete 02-04 20:22:49.089: DEBUG/dalvikvm(425): GC freed 4622 objects / 982864 bytes in 120ms 02-04 20:22:49.350: ERROR/com.Boodang.StreamingMediaPlayer(425): Error updating to newly loaded content. 02-04 20:22:49.350: ERROR/com.Boodang.StreamingMediaPlayer(425): java.io.IOException: Prepare failed.: status=0x1 02-04 20:22:49.350: ERROR/com.Boodang.StreamingMediaPlayer(425):     at android.media.MediaPlayer.prepare(Native Method) 02-04 20:22:49.350: ERROR/com.Boodang.StreamingMediaPlayer(425):     at com.Boodang.StreamingMediaPlayer.createMediaPlayer(StreamingMediaPlayer.java:210) 02-04 20:22:49.350: ERROR/com.Boodang.StreamingMediaPlayer(425):     at com.Boodang.StreamingMediaPlayer.transferBufferToMediaPlayer(StreamingMediaPlayer.java:239) 02-04 20:22:49.350: ERROR/com.Boodang.StreamingMediaPlayer(425):     at com.Boodang.StreamingMediaPlayer.access$3(StreamingMediaPlayer.java:219) 02-04 20:22:49.350: ERROR/com.Boodang.StreamingMediaPlayer(425):     at com.Boodang.StreamingMediaPlayer$2.run(StreamingMediaPlayer.java:160) 02-04 20:22:49.350: ERROR/com.Boodang.StreamingMediaPlayer(425):     at android.os.Handler.handleCallback(Handler.java:587) 02-04 20:22:49.350: ERROR/com.Boodang.StreamingMediaPlayer(425):     at android.os.Handler.dispatchMessage(Handler.java:92) 02-04 20:22:49.350: ERROR/com.Boodang.StreamingMediaPlayer(425):     at android.os.Looper.loop(Looper.java:123) 02-04 20:22:49.350: ERROR/com.Boodang.StreamingMediaPlayer(425):     at android.app.ActivityThread.main(ActivityThread.java:4363) 02-04 20:22:49.350: ERROR/com.Boodang.StreamingMediaPlayer(425):     at java.lang.reflect.Method.invokeNative(Native Method) 02-04 20:22:49.350: ERROR/com.Boodang.StreamingMediaPlayer(425):     at java.lang.reflect.Method.invoke(Method.java:521) 02-04 20:22:49.350: ERROR/com.Boodang.StreamingMediaPlayer(425):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860) 02-04 20:22:49.350: ERROR/com.Boodang.StreamingMediaPlayer(425):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618) 02-04 20:22:49.350: ERROR/com.Boodang.StreamingMediaPlayer(425):     at dalvik.system.NativeStart.main(Native Method)</code></pre><p>so please tell me what i will do and i hope there is better way to do this one . so please tell me how to stream the mp3 file and play the mp3 file. </p><p>Thank you.</p><p>Best Regards.</p>","745367","","745367","","2011-02-04 15:00:27","2011-04-08 09:50:41","how to stream the audio and play that audio","<android><audio-streaming>","1","0","","",""
"4899035","1","4899182","","2011-02-04 14:23:10","6","2039","<p>I'm creating an scrollable image picker, but there's some info that I want to show for each Image while scrooling, my question is, there's an event on the Gallery that notify me that a Image is centered? This event should happen when scrolling.</p><p>My Layout is that:</p><p>    </p><pre><code>    &lt;Gallery android:id=""@+id/coverflow""        android:layout_width=""match_parent"" android:layout_height=""wrap_content""        android:layout_centerInParent=""true"" /&gt;    &lt;TextView android:id=""@+id/author"" android:layout_width=""match_parent""        android:layout_height=""wrap_content"" android:text=""Titulo livro""        android:layout_above=""@id/coverflow"" android:gravity=""center"" /&gt;    &lt;ImageView android:id=""@+id/div"" android:layout_width=""match_parent""        android:layout_height=""wrap_content"" android:src=""@drawable/library_div""        android:layout_above=""@id/author"" /&gt;    &lt;TextView android:id=""@+id/title"" android:layout_width=""match_parent""        android:layout_height=""wrap_content"" android:text=""Author""        android:layout_above=""@id/div"" android:gravity=""center"" /&gt;&lt;/RelativeLayout&gt;</code></pre><p>I want to when scroll happens and a new iten is the middle one, the author and title TextViews get updated.</p><p>Any tips?</p>","558433","","","","","2011-02-04 14:36:07","Gallery event to ""when image centered""","<android><events><scroll><gallery><coverflow>","1","0","1","",""
"4899112","1","","","2011-02-04 14:29:32","4","1862","<p>I just released my first Android app in my life. It's <a href=""http://audiko.net/ringtone/Android"" rel=""nofollow"">Audiko</a>.</p><p>I found an error that occurs on Samsung Galaxy S during streaming mp3 file when I use the Android MediaPlayer.</p><p>In logs I see this:</p><pre><code>E/PlayerDriver( 2747): PlayerDriver::it is a not Protected fileE/        ( 2747): IIIIIII Inside Constructor of PVMFMemoryBufferReadDataStreamImplE/        ( 2747): IIIIIII Inside Constructor of PVMFMemoryBufferReadDataStreamImplE/        ( 2747): IIIIIII Inside Constructor of PVMFMemoryBufferReadDataStreamImplE/        ( 2747): IIIIIII Inside Constructor of PVMFMemoryBufferReadDataStreamImplE/        ( 2747): IIIIIII Inside Constructor of PVMFMemoryBufferReadDataStreamImplE/        ( 2747): IIIIIII Inside Constructor of PVMFMemoryBufferReadDataStreamImplE/        ( 2747): IIIIIII Inside Constructor of PVMFMemoryBufferReadDataStreamImplE/        ( 2747): IIIIIII Inside Constructor of PVMFMemoryBufferReadDataStreamImplE/        ( 2747): IIIIIII Inside Constructor of PVMFMemoryBufferReadDataStreamImplE/        ( 2747): IIIIIII Inside Constructor of PVMFMemoryBufferReadDataStreamImplE/        ( 2747): IIIIIII Inside Constructor of PVMFMemoryBufferReadDataStreamImplD/        ( 2747): PVFile::GetFileNameE/        ( 2747): IIIIIII Inside Constructor of PVMFMemoryBufferReadDataStreamImplE/        ( 2747): IIIIIII Inside Constructor of PVMFMemoryBufferReadDataStreamImplE/        ( 2747): IIIIIII Inside Constructor of PVMFMemoryBufferReadDataStreamImplV/PlayerDriver( 2747): Completed command PLAYER_INIT status=-1E/PlayerDriver( 2747): Command PLAYER_INIT completed with an error or info -1E/MediaPlayer(13523): error (1, -1)E/MediaPlayer(13523): Error (1,-1)</code></pre><p>Any suggestions on what it can be?</p>","385302","","763080","","2011-08-16 20:30:42","2011-08-16 20:30:42","Problems with playing stream audio on android Samsung Galaxy S","<android>","2","4","3","",""
"4899132","1","4899333","","2011-02-04 14:30:58","1","465","<p>Quick question I couldn't find an answer for on Google.</p><p>I signed my app and accidentally left the ""alias_name"" as alias_name.</p><p>Does it really matter? (app uploaded to Market fine...)</p><p>Thanks</p>","444324","","","","","2011-02-04 14:51:15","Android keystore - signed without ""alias_name""","<android>","1","0","","",""
"4899170","1","4899293","","2011-02-04 14:34:43","0","444","<p>I want my app to be start automatically when my device is boot up. I have implemented the service. Now the problem is whenever my device is connected to the PC through data cable app does not crash. But when device is not connected to PC app gets crashed. I m not able it trace the log cat as well for this because device is not connected.</p><p>Pls advice me somethg</p><p>Thanks</p>","383597","","","","","2011-02-04 14:47:06","android autostart application","<android>","2","0","","",""
"4899222","1","4899312","","2011-02-04 14:39:27","2","883","<p>Where could someone get the code or guidelines to create a universal pedometer app for various phones? or would you have to create a different app for each phone? or could you just create an app for android &amp; iphone?</p><p>How would a coder go about doing the task? where to look for help?</p>","903785","","","","","2014-02-01 10:42:29","Pedometer App for a phone","<iphone><android>","3","4","","",""
"4899250","1","","","2011-02-04 14:42:06","3","3843","<p>I'm new to this. I'm creating an android application which locates my contacts. I have tried some tutorials and it runs. but how to replace google map to open street map. I have this 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.PositionLocator.android""&gt;&lt;application android:icon=""@drawable/icon""&gt;&lt;activity android:name="".PositionLocator"" android:label=""@string/app_name""&gt;&lt;/activity&gt;        &lt;activity android:name="".PositionLocatorMap"" 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:name=""com.google.android.maps""/&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-permission android:name=""android.permission.READ_CONTACTS""/&gt;&lt;/manifest&gt; </code></pre>","597954","","597954","","2011-02-04 14:50:41","2013-02-08 10:31:19","Replacing google maps to open street map","<android><eclipse><google-maps><openstreetmap>","3","2","2","",""
"4899328","1","","","2011-02-04 14:50:56","0","158","<p>Does anyone add Android Market Topics from developer.android.com to offline SDK docs? For using them without Internet.</p>","352024","","","","","2011-02-04 20:56:24","Android Market Topics offline documentation","<android>","1","0","","",""
"4899331","1","","","2011-02-04 14:51:11","2","924","<p>I am looking to mimic the behavior of a stored procedure in a sqlite database running on an Android device.  I am aware that SQLite does not do 'stored procedures', but it is possible to achieve the same effect through either loading some custom extension or by other means.  For example, in SQLite ADO.Net you can create user defined functions that are bound the Sqlite core at runtime.</p><p>Is there an equivalent for Androids flavor of sqlite?  Can I load an existing extension (in .so format) or write some type of Java based function that can behave like a stored procedure?</p>","163757","","","","","2011-02-04 15:39:26","Android Sqlite Load Extension / Mimic Stored Procedures","<android><sqlite><stored-procedures>","1","0","2","",""
"4899389","1","","","2011-02-04 14:57:01","5","999","<p>I am experiencing a problem where views with a visibility state of GONE are (undesirably) taking up space on the screen.  This problem occurs always on API level &lt;= 7 devices, but only recently on 8+ devices (after I utilized AsyncTasks to populate some fields, as per <a href=""http://stackoverflow.com/questions/4866846/show-a-progress-bar-when-an-activity-is-loading"">Show a progress bar when an Activity is loading</a>)</p><p>A bit of context:I created a custom view extending LinearLayout that contains a ""title"" button and (user defined; in some cases, it's a few TextViews, in others it's TableLayouts) ""contents"".  The purpose of this view is to toggle view of the contents onClick of the title button (I don't believe there is a built-in widget for this.. I may be wrong).</p><p>In onLayout() I explicitly set the visibility state of all child views except the title to GONE, the first time it is to be drawn:</p><pre><code>protected void onLayout(boolean changed, int l, int t, int r, int b) {    if(initialDraw) {        setContentsVisible(false);        initialDraw = false;    }    super.onLayout(changed, l, t, r, b);}public void setContentsVisible(boolean visible) {    for(int i = 0; i &lt; getChildCount(); i++) {        View child = getChildAt(i);        if(child != mTitle) {            child.setVisibility(visible ? VISIBLE : GONE);        }    }}</code></pre>","534173","","534173","","2011-02-04 16:00:32","2011-02-04 16:21:55","View with visibility state GONE taking up space on screen","<android><android-widget><android-layout>","3","0","","",""
"4899392","1","","","2011-02-04 14:57:06","0","913","<p>First I have defined a widget for the front end. I have two quick questions</p><p>I add this to the manifest xml </p><pre><code>    &lt;receiver android:name="".Widget"" android:label=""My Widget""&gt;        &lt;intent-filter&gt;            &lt;action android:name=""android.appwidget.action.APPWIDGET_CONFIGURE"" /&gt;        &lt;/intent-filter&gt;        &lt;meta-data android:name=""android.appwidget.provider""            android:resource=""@xml/widget"" /&gt;    &lt;/receiver&gt;</code></pre><p>This should load the configuration class when its added to the front end. It doesn't show up in the widget list anymore. Since changing the action to APPWIDGET_CONFIGURE</p><pre><code>    &lt;appwidget-provider xmlns:android=""http://schemas.android.com/apk/res/android""    android:minWidth=""146dip""     android:minHeight=""146dip""    android:updatePeriodMillis=""0""     android:initialLayout=""@layout/widget""     android:configure=""com.deliveryninja.yourclock.configuration.Configure""     android:icon=""@drawable/icon""   /&gt;</code></pre><p>That is the xml for the widget. Currently I'm just using a simple clock.</p><p>Now in the configuration class I populate a WidgetModel and add the path of a clock face to the shared attributes. </p><p>I want to use the configuration class to get the path, and then update the widget.</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/Widget"" android:layout_width=""fill_parent""    android:layout_height=""fill_parent"" android:gravity=""center""&gt;    &lt;AnalogClock android:id=""@+id/AnalogClock""        android:layout_width=""wrap_content"" android:layout_height=""wrap_content""        android:hand_hour=""@drawable/widgethour""        android:hand_minute=""@drawable/widgetminute""     /&gt;&lt;/RelativeLayout&gt;</code></pre><p>I want to be able to set the android:dial property to the path of the given resource which the user has selected. </p><p>This is where i'm struggling, how do I set a propery on the AttributeSet and either add a new AnalogClock to the widget using RemoteViews or how do I edit the property of the existing AnalogClock in the widget xml.</p><pre><code>public static void updateOne(Context context, int appWidgetId){    AppWidgetManager appWidgetManager = AppWidgetManager.getInstance(context);    WidgetModel widgetData = WidgetModel.getWidgetData(context, appWidgetId);    widgetData.getClockFacePath();    AnalogClock clock = new AnalogClock(context);    AttributeSet attributes = new //?? how do i make the AttributeSet    //RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.widget);    //views.setString(R.id.AnalogClock, , value)}</code></pre>","460449","","","","","2011-02-05 05:03:47","Setting a property on a widget using configuration","<java><android><android-widget>","1","0","","",""
"4899543","1","","","2011-02-04 15:12:17","0","533","<p><br>In my application i want to post multiple images to web component in  Android. I had done this in windows phone 7 by adding boundaries. I want to how i can i add boundaries for Android application. Can i have any sample code for doing so. </p><p>Regards,<br>Panache.  </p>","541776","","","","","2011-02-05 04:55:30","How to post multiple images in Android?","<android>","1","0","","",""
"4899732","1","4899896","","2011-02-04 15:33:04","1","632","<p>I m forwarding control from Activity1 to Activity2</p><p>In Activity2   i am using progressDialog in onCreate before setContentView</p><p>after some network operation i am using setcontentView</p><p>but progressDialog is not showing at all...</p><p>how to archive progressDialog.</p><p>Thank you.</p>","510491","","","","","2011-02-04 16:04:54","Android Blank screen Problem","<android><progressdialog>","2","1","1","",""
"4899893","1","4899963","","2011-02-04 15:45:45","1","942","<p>I am quite new to android development and I have the need to present the user with a 'full screen' menu, instead of an options or context menus.</p><p>I thought about using a ListView filled with an ArrayAdapter, but I don't know if there's a smarter/easier way.</p><p>Any ideas? </p><p>Thanks!</p>","1195638","","1195638","","2011-02-04 16:15:06","2011-02-04 16:15:06","'Full screen' menu for Android","<android><android-widget>","1","0","","",""
"4899917","1","","","2011-02-04 15:48:23","0","367","<p>It seems to me that if startActivity is called with an implicit categoryless intent, only activities with an intent filter specifying the default category (android.intent.category.DEFAULT) can be launched. </p><p>The category is not needed in the intent filter for services if we use startService instead of startActivity.</p><p>Does everybody see the same behavior ?</p><p>Is it documented somewhere in the Android official documentation ?</p>","603403","","","","","2011-02-04 20:01:04","startActivity with an implicit category-less intent","<android>","1","0","","",""
"4899967","1","4900349","","2011-02-04 15:53:02","3","4561","<p>I know that there are several threads posted about this issue, however I believe my problem to be a bit different:</p><p>I had my Android emulator working without any problems (using Eclipse plugin). I could start the emulator, run applications, and those apps would be able to connect to my computers internet.  I then updated the Android SDK's (as I wanted to try out my application on 2.2).  Since the update, the emulator will not connect to the internet.  If I go to the browser, the page will not be displayed.  I have tried everything - reverting back to the 2.1 SDK, even completely reinstalling Eclipse + Android, and the issue still remains.</p><p>I know that I have no firewall/proxy type issues. What could be causing this?  Does anyone have any ideas? I'd greatly appreciate it...</p><p>Thanks!</p>","123891","","","","","2011-02-04 16:26:49","Android Emulator - No internet connectivity","<android><connection><internet><emulator>","1","3","","",""
"4900014","1","4900389","","2011-02-04 15:57:26","7","1368","<p>I have been working on an Android game for the past 6 months or so, and have posted on here several times about various lag issues that I cannot get rid of.</p><p>I ended up grabbing the LunarLander example and stripping it down to its very core components to see if I could make anything at all that doesn't lag. All it really does is change the amount the canvas is translated each frame, and then draw a background onto the canvas. EVEN THIS, about as simple as you can get for a surfaceView application - stutters...</p><p>My game is a scrolling game where you continuously move up the screen (think of a flying game), but the way I am currently doing the background results in constant stuttering every second or so for about 50-100ms. This isn't game breaking, but it is very distracting and makes the game seem as if it was programmed by a complete moron (though I am starting to suspect this might be the case). </p><p>No, it is not the garbage collector, there are no new objects being created at all during the game's run loop, and the GC barely ever runs while my game is running.</p><p>I am practically tearing my hair out with frustration. I have spent over 40 hours just trying to get rid of the lag on this simple application example over the past week alone and it is driving me crazy. How can an application as simple as the one I have linked possibly have lag issues? You wouldn't think a scrolling background could get much simpler than that...</p><p>NOTE: This demonstration constantly gets about 60fps on my phone (A Motorola Milestone). Uncomment the FPS code in the example to see the FPS.</p><p>TL;DR: Extraordinarily simple program that is just a scrolling background shows stuttering. Please have a look...</p><p>Link to download simple stuttering example based off the LunarLander example:<a href=""http://dl.dropbox.com/u/4972001/LunarLander.rar"" rel=""nofollow"">http://dl.dropbox.com/u/4972001/LunarLander.rar</a></p>","549859","","","","","2011-03-13 23:48:47","Is it impossible to make an Android game stutter-free? I am going crazy here","<java><android>","3","3","2","",""
"4900032","1","","","2011-02-04 15:59:04","1","424","<p>I'm encountering issue displaying given text at given position using a custom textview.</p><p>I want to create N MyTextView disposed in a circular way, using this code:</p><pre><code>for (int i = 0; i &lt; player_num ; i++){         x = (x_offset+(raggio*Math.sin((degree_offset)*i)));         y = (y_offset+(raggio*Math.cos((degree_offset)*i)));         //System.out.println(""x: ""+x+"" y: ""+y);         player_name = new MyTextView(mCtx,x,y,String.valueOf(i+1));}</code></pre><p>This is a piece of my class which extends TextView, I pass x,y coordinates and the string to display:</p><pre><code>public MyTextView(Context context, double x, double y, String text) {    super(context);    System.out.println(""constructor called"");    mx = x;    my = y;    mtext = text;    initBrushes();    System.out.println(""constructor x: ""+mx+"" y: ""+my+"" text: ""+mtext);}@Overrideprotected void onDraw(Canvas canvas) {    super.onDraw(canvas);    // Get the size of the control based on the last call to onMeasure.    int height = getMeasuredHeight();    int width = getMeasuredWidth();    System.out.println(""ondraw called"");    System.out.println(""draw x: ""+mx+"" y: ""+my+"" text: ""+mtext);    // Find the center    int px = width / 2;    int py = height / 2;    // Define the string.    // Measure the width of the text string.    float textWidth = mTextPaint.measureText(mtext);    // Draw the text string in the center of the control.    canvas.drawText(mtext, Math.round(mx) - textWidth / 2, Math.round(my)- textWidth, mTextPaint);     //canvas.drawText(this.text, Math.round(this.x), Math.round(this.y),  mTextPaint);}</code></pre><p>With this code I get NullPointer because the onDraw cant access the content of the variables, with the      </p><pre><code>System.out.println(""draw x: ""+mx+"" y: ""+my+"" text: ""+mtext);</code></pre><p>I get "" 0.0 0.0 null "", instead, if I define variables as static, I get the last value assigned to them (of course):</p><pre><code>constructor calledconstructor x: 160.0 y: 320.0 text: 1constructor calledconstructor x: 206.44889473698515 y: 305.1344776421249 text: 2constructor calledconstructor x: 235.63561239368934 y: 266.0625044428118 text: 3ondraw calleddraw x: 235.63561239368934 y: 266.0625044428118 text: 3</code></pre><p>What am I doing wrong ? Why the onDraw cant access class variables except static ones ?</p><p>Thanks </p>","603419","","546999","","2011-02-04 16:05:02","2011-02-04 16:09:30","onDraw cannot access non-static variables","<android>","1","1","","",""
"4900261","1","4900320","","2011-02-04 16:19:42","0","5120","<p>i am new to java and android. I need some help with my main.xml file.<br>here is the error i have - error: Error parsing XML: unbound prefix    - Element type ""LinearLayout"" must be followed by either attribute specifications, "">""      or ""/>"".    - error: Error parsing XML: not well-formed (invalid token)<br>here is my main.xml file  </p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""      android:orientation=""vertical""      android:layout_width=""fill_parent""      android:layout_height=""fill_parent""  EditText      android:id=""@+id/myEditText""       android:layout_width=""fill_parent""       android:layout_height=""wrap_content""      andtoid:text=""New To Do Item""      EditText&gt;  ListView      android:id=""@+id/myListView""      android:layout_width=""fill_parent""      andtoid:layout_height=""wrap_content""      /&gt;  &lt;/LinearLayout&gt;  </code></pre><p>the error is with the edit text.thanks for all the help you can give<br>cs</p>","595137","","225","","2011-02-04 16:21:49","2012-10-23 12:25:52","Error parsing XML: unbound prefix - Element type ""LinearLayout"" must be followed by either attribute specifications","<java><android><xml>","2","0","","",""
"4900275","1","4900487","","2011-02-04 16:20:37","0","1044","<p>The tutoriel in question is“http://developer.android.com/resources/tutorials/views/hello-gridview.html”</p><p>The Tutorial asks that you<br>1- Create a new project named HelloGridView. In eclipse <strong>(OK)</strong><br>2- Find some images or download the ones at<br>    “http://developer.android.com/shareables/sample_images.zip”<br>    I downloaded the .ZIP file and extracted the images <strong>(OK)</strong><br>3- Save the image files into the project's res/drawable/ directory. <strong>(QUESTION!)</strong>  </p><p>When I expand the tree view that eclipse has created for this project, I do not see any directory labeled drawable, but instead see 3 choices (drawable-hdpi, drawable-ldpi &amp; drawable-mdpi)  </p><p>HelloGridView<br>    - res<br>        - - drawable-hdpi<br>        - - drawable-ldpi<br>        - - drawable-mdpi<br>        - - layout<br>        - - values  </p><p>Choices/Ideas that went threw my mind<br>a- Maker another directory under “res” called drawable?<br>b- Just pop them into any of the three already existing directories labeled drawable-?dpi<br>c- Since I just upgraded to the new eclipse (on 2/4/11) maybe the tutorial and eclipse are out of sync, and I should just wait a while for an updated tutorial?  </p><p>Comments, Ideas or Pointers to documentation or other already answered questions welcome. </p><p>I did search Stack Overflow and found lots of questions on the Grid View tutorial, but none seemed to address this particular problem.<br>-=-=-=</p><p>Also – When (and since this is my 3rd attempt at the Grid View tutorial,and I'm afraid it is more likely WHEN then IF) I have more questions on this tutorial, should I post separate questions, OR just extend this question for each problem I encounter?</p><p>Thanks for any help Joe</p>","515453","","","","","2011-02-04 18:18:31","Question on the Grid View tutorial “res/drawable/ “ directory","<android><eclipse>","1","2","","",""
"4900385","1","4900593","","2011-02-04 16:29:40","0","62","<p>I am using tabs, with Activity groups in each. I want to add an options menu to certain activities but it won't show on any. I have options menus working in other projects with the exact same code, so I can't figure out why they won't show up. This is the code I am using:</p><pre><code>@Overridepublic boolean onCreateOptionsMenu(Menu menu) {    menu.add(""Option 1"");    menu.add(""Option 2"");    menu.add(""Option 3"");    return super.onCreateOptionsMenu(menu);}</code></pre><p>Is there anything wrong with this code or anywhere else I should be looking at that might be blocking this menu from showing when I hit the menu button?</p>","348261","","","","","2011-02-04 16:49:20","Can anyone help me figure out why my OptionsMenu won't show up?","<android><button><tabs><options-menu>","1","0","","",""
"4900617","1","4900826","","2011-02-04 16:52:30","0","610","<pre><code>@Overrideprotected Dialog onCreateDialog (int id) {        AlertDialog.Builder builder = new AlertDialog.Builder(this);            builder.setTitle(R.string.instant_alert_screen_title);        builder.setInverseBackgroundForced(true);        ListView aa = new ListView(this);               aa.setAdapter( new IconicAdapter());        aa.setOnItemClickListener(new OnItemClickListener() {            public void onItemClick(AdapterView&lt;?&gt; arg0, View arg1, int arg2, long arg3) {                switch (arg2) {                case 0:                ......                   break;                case 1:                ......                break;                case 2:                ......                break;        builder.setView(aa);        builder.setPositiveButton(""Done"", new OnClickListener() {            public void onClick(DialogInterface dialog, int which) {                dialog.cancel();                }        });        builder.setNegativeButton(""Cancel"", new OnClickListener() {            public void onClick(DialogInterface dialog, int which) {            dialog.cancel();                }        });    return builder.create();</code></pre><p>Ok guys..I have a <code>AlertDialog</code>..In <code>Adapter</code> i set to dialog 3 <code>CheckedTextView</code>...How in on Positive Button Listener i could find a second item and check is it checked or not ? </p><p>Dont recomend me to do like this:</p><pre><code>   CheckedTextView a = (CheckedTextView)findViewById(R.id.text)   boolean b = a.isChecked();</code></pre><p>I need to use <code>onClick(DialogInterface dialog, int which)</code>  this dialog Interface...is that real ?</p>","602011","","","","","2011-02-04 17:19:47","Android: Alert Dialog","<android>","2","2","","",""
"4900624","1","","","2011-02-04 16:53:10","0","72","<p>I want to be able to have a scrollable set of data fetched from a SQLite database (ArrayList) in which when an item is clicked it remains clicked (i.e. the background changes) and some reference to which element has been clicked and then if another widget (say a button) is pressed it carries out some action on the highlighted item. See below for an illustration of what I mean. This is a very simplified version.</p><p><img src=""http://i.stack.imgur.com/KxKxP.jpg"" alt=""enter image description here""></p><p>So when 'Test Item 1' is selected the background stays yellow and when delete is pressed the item is deleted from the list and the database. </p><p>How do I go about this? Are there any tutorials out there? Any help is appreciated.</p>","400406","","","","","2011-04-02 23:39:48","UI help, maybe need to change from a list view?","<java><android><listview>","2","0","","",""
"4900725","1","4901155","","2011-02-04 17:03:40","7","10182","<p>Is there a best practices size (in dip?) that buttons should be in order to be easily touchable? </p>","426493","","126562","","2011-02-04 20:25:35","2012-03-01 05:42:39","Is there a standard button size?","<android><button>","3","0","2","",""
"4900969","1","","","2011-02-04 17:25:48","0","407","<p>I have a class that extends a `SimpleCursorAdapter.</p><pre><code>public class MyAdapter extends SimpleCursorAdapter {private Cursor cursor;private LayoutInflater inflater;private int columnIndexRowID;private int columnIndexFromAddrString;private int columnIndexToAddrString;public LastRequestsAdapter(Context context, int layout, Cursor c,        String[] from, int[] to) {    super(context, layout, c, from, to);    this.cursor = c;    this.inflater = LayoutInflater.from(context);    this.columnIndexRowID = c.getColumnIndex(MyDBAdapter.KEY_ROWID);    this.columnIndexFromAddrString = c            .getColumnIndex(MyDBAdapter.KEY_FROM_ADDR_STRING);    this.columnIndexToAddrString = c            .getColumnIndex(MyDBAdapter.KEY_TO_ADDR_STRING);}@Overridepublic View getView(int position, View convertView, ViewGroup parent) {    ViewHolder viewHolder;    if(convertView==null){        convertView = this.inflater.inflate(R.layout.main_activity_last_request_row, null);        viewHolder = new ViewHolder();        viewHolder.id = -1;        viewHolder.fromAddr = (TextView) convertView.findViewById(R.id.from);        viewHolder.toAddr =(TextView) convertView.findViewById(R.id.to);        viewHolder.arrow = (ImageView) convertView.findViewById(R.id.last_request_arrow);        convertView.setTag(viewHolder);    }else {        viewHolder = (ViewHolder) convertView.getTag();    }    this.cursor.moveToPosition(position);    viewHolder.id = this.cursor.getInt(columnIndexRowID);    viewHolder.fromAddr.setText(this.cursor.getString(this.columnIndexFromAddrString));    viewHolder.toAddr.setText(this.cursor.getString(this.columnIndexToAddrString));    viewHolder.arrow.setImageResource(R.drawable.arrow_alt);    return convertView;}public class ViewHolder{    public int id;    public TextView fromAddr;    public TextView toAddr;    public ImageView arrow; }}</code></pre><p>It's used that way:</p><pre><code>listView.setAdapter(new MyAdapter(this,            R.layout.main_activity_last_request_row, dbCursor,            new String[] { MyDBAdapter.KEY_FROM_ADDR_STRING,                    MyDBAdapter.KEY_TO_ADDR_STRING }, new int[] {                    R.id.from, R.id.to }));</code></pre><p>The list is created as expected. But: Sometimes the entries of this list seem to disappear (sometimes a few of them a still visible). This seems to happen each time, when I'm starting a new activity and (instantly) come back to this activity, e.g. changing to the home screen and then returning back to my activity. But, this happens only once: When switching again to the 'same other' activity and then come back, all list entries are still visible. I checked the list values and it seems like they're received correctly from the database but some kind of invisible. </p><p>Can someone explain to me what am I doing wrong? </p>","566904","","","","","2011-02-04 18:12:03","ListView empty when coming from other activity","<android><listview><simplecursoradapter>","1","5","","",""
"4901071","1","4901820","","2011-02-04 17:32:50","0","600","<p>Our application launches ListActivity that displays two menu options with launch a football game and a baseball game.  We are trying to implement licensing and we are having troubles figuring out how to get it working.  Two things are happening here: we are failing to bind to the licensing service (Unable to start service Intent act=com.android.vending.licensing.ILicensingService in logcat) and we are unable to see any of the status messages.  Here is our Launcher code:</p><pre><code>public class Launcher extends ListActivity {    private MenuAdapter mListAdapter;    private Handler mHandler;    private TextView mStatusText;    // protected Button mCheckLicenseButton;    private LicenseCheckerCallback mLicenseCheckerCallback;    private LicenseChecker mChecker;    private static final String BASE64_PUBLIC_KEY = ""blah"";    private static final byte[] SALT = new byte[] { 15, -43, -69, 107, 104,            -111, -105, -76, -18, -24, 62, 118, 45, 67, -89, 70, 79, 123, -3,            13 };    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);        setContentView(R.layout.launcher_menu);        mStatusText = (TextView) findViewById(R.id.status_text);        mHandler = new Handler();        String android_id = Secure.getString(this.getContentResolver(),                Secure.ANDROID_ID);        mLicenseCheckerCallback = new MyLicenseCheckerCallback();        mChecker = new LicenseChecker(this, new ServerManagedPolicy(this,                new AESObfuscator(SALT, getPackageName(), android_id)),                BASE64_PUBLIC_KEY);        doCheck();        // We want to see the license check and then launch the menuadapter.        // mListAdapter = new MenuAdapter(this);        // this.setListAdapter(mListAdapter);    }    protected Dialog onCreateDialog(int id) {        // We have only one dialog.        return new AlertDialog.Builder(this).setTitle(                R.string.unlicensed_dialog_title).setMessage(                R.string.unlicensed_dialog_body).setPositiveButton(                R.string.buy_button, new DialogInterface.OnClickListener() {                    public void onClick(DialogInterface dialog, int which) {                        Intent marketIntent = new Intent(                                Intent.ACTION_VIEW,                                Uri                                        .parse(""http://market.android.com/details?id=""                                                + getPackageName()));                        startActivity(marketIntent);                    }                }).setNegativeButton(R.string.quit_button,                new DialogInterface.OnClickListener() {                    public void onClick(DialogInterface dialog, int which) {                        finish();                    }                }).create();    }    private void doCheck() {        // mCheckLicenseButton.setEnabled(false);        setProgressBarIndeterminateVisibility(true);        mStatusText.setText(R.string.checking_license);        mChecker.checkAccess(mLicenseCheckerCallback);    }    private void displayResult(final String result) {        mHandler.post(new Runnable() {            public void run() {                mStatusText.setText(result);                setProgressBarIndeterminateVisibility(false);                // mCheckLicenseButton.setEnabled(true);            }        });    }    private class MyLicenseCheckerCallback implements LicenseCheckerCallback {        public void allow() {            if (isFinishing()) {                // Don't update UI if Activity is finishing.                return;            }            // Should allow user access.            displayResult(getString(R.string.allow));            // If allowed we should display our menu options            // mListAdapter = new MenuAdapter(this);            // this.setListAdapter(mListAdapter);        }        public void dontAllow() {            if (isFinishing()) {                return;            }            displayResult(getString(R.string.dont_allow));            // Should not allow access. In most cases, the app should assume            // the user has access unless it encounters this. If it does,            // the app should inform the user of their unlicensed ways            // and then either shut down the app or limit the user to a            // restricted set of features.            // In our case, we are failing to bind to the licensing service, so showDialog will always display.            // Temporarily disable it till we get this working.            // showDialog(0);        }        public void applicationError(ApplicationErrorCode errorCode) {            if (isFinishing()) {                // Don't update UI if Activity is finishing.                return;            }            String result = String.format(                    getString(R.string.application_error), errorCode);            displayResult(result);        }    }    @Override    protected void onDestroy() {        super.onDestroy();        mChecker.onDestroy();    }    @Override    protected void onListItemClick(ListView lv, View v, int position, long id) {        super.onListItemClick(lv, v, position, id);        Activity act = (Activity) this.getListAdapter().getItem(position);        this.startActivity(new Intent(this, act.Class));    }}</code></pre><p>All the examples show how to work with an Activity, not a list activity, and this is what is throwing us off.  I'm thinking we need to create a MainActivity which extends Activity that does the check then call the ListActivity if the check is successful.  Does that sound like the correct approach?  </p><p>As for failing to bind to the licensing service, this could be network related.  We are testing on a Google API lvl 9 emulator, but we don't get the same failure to bind on the Nexus One or Galaxy Tab.  </p>","404762","","","","","2011-02-04 18:52:25","How to do Android licensing checks from a ListActivity","<android>","1","0","","",""
"4901093","1","","","2011-02-04 17:35:24","1","1298","<p>Does anyone know of a current Android cell phone that actually supports the Bluetooth SPP Profile? I have spent days online trying to find one, and nowhere do I see any cell phones that say they support the SPP profile. Furthermore, I have noticed all kinds of postings where people cant get their applications to work correctly because the phone they are using does not support the SPP profile, or it has been disabled on their phone. Am I missing something here? Before I commit to developing my Bluetooth application for Android, I want to make sure it can actually be done.</p><p>I am hoping that the answer is that we implement the SPP profile via the Bluetooth API, and therefore we can use RFCOMM on any Android OS level that supports it, i.e., 2.0 or above. Is this correct?</p>","603555","","21234","","2011-02-04 18:28:03","2012-02-25 04:55:35","Are there any actual android cell phones that implement the bluetooth spp profile","<android><bluetooth><rfcomm>","3","1","","",""
"4901104","1","6221175","","2011-02-04 17:36:08","8","1762","<p>I am using a method to detect pdf support on an Android device that goes like this</p><pre><code>public boolean canDisplayPdf() {    PackageManager packageManager = application.getPackageManager();    Intent testIntent = new Intent(Intent.ACTION_VIEW);    testIntent.setType(""application/pdf"");    if (packageManager.queryIntentActivities(testIntent, PackageManager.MATCH_DEFAULT_ONLY).size() &gt; 0) {        return true;    } else {        return false;    }}</code></pre><p>And that has been working great so far. I know that at least the HTC default viewer, droidreader and adobe acrobat get reported that way and the right result is returned. However I now got a comment on the market console by a user that says that he has pdf support on the device, but from the described behaviour of the app I conclude that this method returns false. </p><p>Is there any better way to detect pdf support?</p><p>PS: I would love to be able to ask the user for details on the market.</p>","136445","","","","","2013-10-26 00:41:39","Reliably detect PDF support on Android device","<android><pdf>","2","8","4","",""
"4901131","1","","","2011-02-04 17:39:35","0","1355","<p>I'm developing an Android app where a user can add a marker tapping on the screen;it works, but i have a problem when I want to remove one of the markers by tapping it; here is my code (i followed the NooYawk example):</p><pre><code>private class PoiOverlay extends ItemizedOverlay&lt;MyOverlayItem&gt;{    private ArrayList&lt;MyOverlayItem&gt; mOverlays = new ArrayList&lt;MyOverlayItem&gt;();    public PoiOverlay() {        super(null);        populate();        // TODO Auto-generated constructor stub    }    @Override    protected boolean onTap(int index) {        Log.d(""toccato"","":""+index);        mOverlays.remove(index);        doPopulate();        return true;    }    public boolean onTap(GeoPoint point, MapView view) {        if (super.onTap(point, view))            return true;        int icon;            if (type==1)                icon=R.drawable.bluedot;            else                icon=R.drawable.reddot;            MyOverlayItem overlay=new MyOverlayItem(point, """"+id, """"+id, id, icon);            addOverlay(overlay);            doPopulate();            Poi poi=new Poi(id, point, type);            pois.addLast(poi);            inserted.addLast(id);            id+=1;            return true;    }     public void doPopulate(){        setLastFocusedIndex(-1);        populate();    }    public void addOverlay(MyOverlayItem overlay){        Drawable drawable=getMarker(overlay.markerInt);        overlay.marker=drawable;        mOverlays.add(overlay);        populate();    }</code></pre><p>But it doesn't work. I'm able to add markers, but when I try to remove one of them i get an Array out of bounds exception, and I don't know why.</p><p>This is the excpetion I got when tapping on a marker:</p><pre><code>    02-04 22:17:29.418: ERROR/AndroidRuntime(9979): FATAL EXCEPTION: main    02-04 22:17:29.418: ERROR/AndroidRuntime(9979): java.lang.IndexOutOfBoundsException:       Invalid index 1, size is 1    02-04 22:17:29.418: ERROR/AndroidRuntime(9979):     at java.util.ArrayList.throwIndexOutOfBoundsException(ArrayList.java:257)    02-04 22:17:29.418: ERROR/AndroidRuntime(9979):     at java.util.ArrayList.get(ArrayList.java:311)   02-04 22:17:29.418: ERROR/AndroidRuntime(9979):     at com.google.android.maps.ItemizedOverlay.getItem(ItemizedOverlay.java:419)    02-04 22:17:29.418: ERROR/AndroidRuntime(9979):     at com.google.android.maps.ItemizedOverlay.focus(ItemizedOverlay.java:538)    02-04 22:17:29.418: ERROR/AndroidRuntime(9979):     at com.google.android.maps.ItemizedOverlay.onTap(ItemizedOverlay.java:455)    02-04 22:17:29.418: ERROR/AndroidRuntime(9979):     at offscreen.tagger.Main$PoiOverlay.onTap(Main.java:280)    02-04 22:17:29.418: ERROR/AndroidRuntime(9979):     at com.google.android.maps.OverlayBundle.onTap(OverlayBundle.java:83)    02-04 22:17:29.418: ERROR/AndroidRuntime(9979):     at com.google.android.maps.MapView$1.onSingleTapUp(MapView.java:347)02-04 22:17:29.418: ERROR/AndroidRuntime(9979):     at com.google.android.maps.GestureDetector.onTouchEvent(GestureDetector.java:533)02-04 22:17:29.418: ERROR/AndroidRuntime(9979):     at com.google.android.maps.MapView.onTouchEvent(MapView.java:647)02-04 22:17:29.418: ERROR/AndroidRuntime(9979):     at android.view.View.dispatchTouchEvent(View.java:3765)02-04 22:17:29.418: ERROR/AndroidRuntime(9979):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:905)02-04 22:17:29.418: ERROR/AndroidRuntime(9979):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:944)02-04 22:17:29.418: ERROR/AndroidRuntime(9979):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:944)02-04 22:17:29.418: ERROR/AndroidRuntime(9979):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:944)02-04 22:17:29.418: ERROR/AndroidRuntime(9979):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:944)02-04 22:17:29.418: ERROR/AndroidRuntime(9979):     at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1701)02-04 22:17:29.418: ERROR/AndroidRuntime(9979):     at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1116)02-04 22:17:29.418: ERROR/AndroidRuntime(9979):     at android.app.Activity.dispatchTouchEvent(Activity.java:2093)02-04 22:17:29.418: ERROR/AndroidRuntime(9979):     at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1685)02-04 22:17:29.418: ERROR/AndroidRuntime(9979):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1802)02-04 22:17:29.418: ERROR/AndroidRuntime(9979):     at android.os.Handler.dispatchMessage(Handler.java:99)02-04 22:17:29.418: ERROR/AndroidRuntime(9979):     at android.os.Looper.loop(Looper.java:144)02-04 22:17:29.418: ERROR/AndroidRuntime(9979):     at android.app.ActivityThread.main(ActivityThread.java:4937)02-04 22:17:29.418: ERROR/AndroidRuntime(9979):     at java.lang.reflect.Method.invokeNative(Native Method)02-04 22:17:29.418: ERROR/AndroidRuntime(9979):     at java.lang.reflect.Method.invoke(Method.java:521)02-04 22:17:29.418: ERROR/AndroidRuntime(9979):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)02-04 22:17:29.418: ERROR/AndroidRuntime(9979):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)02-04 22:17:29.418: ERROR/AndroidRuntime(9979):     at dalvik.system.NativeStart.main(Native Method)</code></pre>","525105","","525105","","2011-02-04 21:21:27","2011-02-04 21:27:33","unable to remove marker onTap","<android><map><itemizedoverlay>","1","4","","",""
"4901147","1","4917721","","2011-02-04 17:41:19","0","245","<blockquote>  <p><a href=""http://api.geoapi.com/v1/q"" rel=""nofollow"">http://api.geoapi.com/v1/q</a></p>    <p>My query: {""lat"": 37.75629, ""lon"": -122.4213, ""radius"": ""1km"", ""entity"": [{""type"": ""business"", ""guid"": null}]}<br>  <a href=""http://api.geoapi.com/v1/q?q=%7B%22lat%22%3A+37.75629%2C+%22lon%22%3A+-122.4213%2C+%22radius%22%3A+%221km%22%2C+%22entity%22%3A+%5B%7B%22type%22%3A+%22business%22%2C+%22guid%22%3A+null%7D%5D%7D&amp;apikey=demo&amp;pretty=1"" rel=""nofollow"">http://api.geoapi.com/v1/q?q=%7B%22lat%22%3A+37.75629%2C+%22lon%22%3A+-122.4213%2C+%22radius%22%3A+%221km%22%2C+%22entity%22%3A+%5B%7B%22type%22%3A+%22business%22%2C+%22guid%22%3A+null%7D%5D%7D&amp;apikey=demo&amp;pretty=1</a></p></blockquote><p>I am currently working on android. How to convert query string into parsed URL. Is there any tool translate URL for this? or otherwise i want to implement logic. I dont know whether my question right or wrong? can anyone help me.</p>","405640","","","","","2011-02-07 03:01:21","How to MQL query string into Tranlated URL?","<android><mql><geoapi>","1","0","","",""
"4901157","1","","","2011-02-04 17:42:14","3","1688","<p>I'm attempting some Android system integration on a <a href=""http://beagleboard.org/"" rel=""nofollow"">BeagleBoard</a> like device.  I have complete file system access as I can read/write/format the CF card hosting the boot and rootfs partitions.  For example, I can easily modify init.rc to execute arbitrary commands during the device bootup.</p><p>Based on this, how can I enable root access for the user on the device?  If that's not possible, how can I setup dropbear SSH (or any other service) such that it runs with root privileges?  <strong>z4root does not work</strong>, and I'm sure there must be a better method given complete file system access.  This is Android 2.2 (Froyo) for what it's worth.</p>","187986","","110028","","2011-03-21 12:15:02","2011-03-21 12:15:02","Enabling root access","<beagleboard><android>","1","0","2","",""
"4901163","1","5256772","","2011-02-04 17:42:26","0","481","<p>What is the difference between VM heap and native heap shown in ddms? What do they mean and which of them is limited to 16 mb?</p>","580318","","546999","","2011-02-04 17:50:59","2011-03-10 07:39:22","Heap showed in ddms","<android>","1","0","1","",""
"4901261","1","4902404","","2011-02-04 17:54:44","0","299","<p>I have an application that uses call activity to call people. However, when the call is made, the number will be logged to recent call list, and I don't want this to happen. </p><p>What would be the best way for the phone to not to log the calls made?</p>","584700","","85950","","2012-10-12 19:30:55","2012-10-12 19:30:55","Use Call Activity without logging in recent calls","<java><android><security><logging><android-activity>","1","1","","",""
"4901281","1","4901359","","2011-02-04 17:57:28","1","5055","<p>i have two arrays (actually one, but i created two for each columns). I want to populate a hashmap with the values for a listview but all elements of the listview is the last element of the arrays:</p><pre><code>ArrayList&lt;HashMap&lt;String, String&gt;&gt; mylist = new ArrayList&lt;HashMap&lt;String, String&gt;&gt;();HashMap&lt;String, String&gt; map = new HashMap&lt;String, String&gt;();    for (int i=0; i&lt;13; i++)    {        map.put(""left1"", date[i]);        map.put(""right1"", name[i]);        mylist.add(map);    }SimpleAdapter  simpleAdapter = new SimpleAdapter(this, mylist, R.layout.row,        new String[] {""left1"", ""right1""}, new int[] {R.id.left, R.id.right});lv1.setAdapter(simpleAdapter);</code></pre><p>Any ideas?Thanks</p>","571648","","512958","","2011-02-04 18:01:47","2012-01-13 05:42:41","How to populate a hashmap from an array","<java><android><hashmap>","1","2","","",""
"4901294","1","4903010","","2011-02-04 17:57:58","4","5414","<p>I'm just trying to figure out the best approach for running a scolling background on an android device. The method I have so far.... its pretty laggy. I use threads, which I believe is not the best bet for android platforms</p><pre><code>@Override    public void run() {        // Game Loop        while(runningThread){            //Scroll background down            bgY += 1;            try {                this.postInvalidate();                t.sleep(10);            } catch (Exception e) {                // TODO Auto-generated catch block                e.printStackTrace();            }        }    }</code></pre><p>where postinvalidate in the onDraw function simply pushings the background image down</p><pre><code>canvas.drawBitmap(backgroundImage, bgX, bgY, null);</code></pre><p>Thanks in advance</p><hr><p><strong>UPDATE</strong></p><p>I've identified the problem. And it is the fact that my player updates the same rate as the background scrolls (making it look choppy). from top to bottom. This is because both get drawn in the same function. I'm not really sure how to tackle this and would be grateful for any help. i.e so that player movement is handled separately from the map scrolling</p><p>Also how can I control the speed at which onDraw(canvas) get called?</p><p>Thanks in advance.</p><p>However, I have patched together a different run loop for anyone having the same problem. This is partially from the jetboy example on google.</p><p>Below is my inner class in my surfaceview</p><pre><code>class MapThread extends Thread{    private Map map;    private SurfaceHolder holder;    private boolean run = false;    public MapThread(Map map, SurfaceHolder holder){        this.holder = holder;        this.map = map;        setRunning(true);    }    public void setRunning(boolean run){        this.run = run;    }    @Override    public void run(){        while(run){            try{                Canvas c = null;                 try {                       c = holder.lockCanvas(null);                       synchronized (holder) {                            map.onDraw(c);                     }                 } finally {                     if (c != null) {                         holder.unlockCanvasAndPost(c);                     }                 }        }    }}</code></pre><hr><p><strong>SOLUTION</strong></p><p><a href=""http://gamedev.stackexchange.com/questions/8127/android-game-scrolling-background"">http://gamedev.stackexchange.com/questions/8127/android-game-scrolling-background</a></p>","425226","","425226","","2011-02-25 13:44:07","2012-02-22 00:11:35","Android game scrolling background","<android><background><drawing><2d>","3","1","2","",""
"4901313","1","4901378","","2011-02-04 17:59:58","3","11011","<p>So I asked something similar yesterday and did receive an answer to my question, however I don't really think I asked it correctly and therefore didn't receive the exact information I needed.</p><p>I'm in search of an API, some open source code, or even just a way that someone else has achieved this on the Android. I'm making an app that needs to find all other Android devices within a specified radius. For example, when you open your Android Google Maps App, and you search for say ""Restaurants [ZipCode]"", it uses a radius modified from your zip code and finds all of those places. The GPS gets YOUR location, and maps uses that information to find restaurants within an address close to that passed in location.</p><p>Instead, I want to be able to use the GPS to find my location (as it can now easily), but instead of finding things on a map (which is already built in), I want to be able to find other GPS enabled Android phones. I get that they will have to be broadcasting their GPS signal at the same time as well (since they don't have their data stored with some sort of central database as a restaurant would). However, I don't just want to FIND these phones, I want to send/receive data from these phones (with correct permissions obviously).</p><p>Now, I've found things like the Bump API. However, BUMP uses the phones sensors to spark this search. So basically, if you ""bump"" your phone with another and have the app running, it will THEN go ahead and use GPS to find the location of the other phone you just bumped with and exchange data between them. This is like EXACTLY what I want to do however in their API, they do not provide the functionality to just say, ""Hey, give me all phones within a mile from me.""</p><p>I've also found API's that can do exactly what I need but they have to be on the same Bluetooth range or on the same Wi-Fi network, which doesn't suit what I need at all.</p><p>Do you guys know of anything that can fit exactly what I need that already exists? Or a way to maybe modify Bump API (if you've done it), to not have to use the phone sensors and find phone information directly through GPS for phones around you? Or is there something that exists over a 3g/4g network instead of only wi-fi/Bluetooth?</p><p>Thanks guys.</p>","534101","","","","","2013-10-16 14:29:29","Use Android GPS to detect and connect with other phones","<android>","6","0","4","",""
"4901382","1","","","2011-02-04 18:07:06","0","369","<p>The app which i worked is now in Google Market.</p><p>How we will identify and report possible production problems to Google?</p><p>Please let me know any URLs to report Production issues to GOOgle.</p><p>Thanks</p>","603580","","469983","","2011-10-27 08:51:55","2011-10-27 08:51:55","Procedures for production C2DM issues","<android><android-c2dm>","2","0","","",""
"4901408","1","4901991","","2011-02-04 18:10:08","20","34357","<p>I have 2 views that takes the whole screen and I want to display both views at the same time. My layout looks like this:</p><pre><code>&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:orientation=""vertical""&gt;    &lt;WebView         android:id=""@+id/webview""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""    /&gt;    &lt;org.example.myCustomView        xmlns:android=""http://schemas.android.com/apk/res/android""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""    /&gt;&lt;/LinearLayout&gt;</code></pre><p>Note that myCustomView uses onDraw ( this method last statement is invalidate()) to draw custom graphics. The problem I am getting is that it only displays myCustomView; WebView is hidden. I tried to change the background color of mycustomView to transparent but this makes no difference.I would also like to have the abilty to make myCustomView as an overlay on WebView or vice versa.</p>","574122","","2039292","","2014-02-09 02:54:51","2014-02-09 02:54:51","In Android how to display one view as overlay on top of another view?","<android><android-webview><relativelayout>","3","0","8","",""
"4901515","1","4901750","","2011-02-04 18:22:48","2","552","<p>I have a ListView with an ArrayAdapter providing the data. I'm adding paging, so when you scroll to the bottom it loads more rows.</p><p>But as I'm using an array I'm finding a problem. I can't extend the array as the size is obviously fixed, and if I create a new one, the ListView either ignores the new items (notifyDataSetChanged), or (if I refresh the list with the new array) it jumps to the top.</p><p>What's the usual way to do this? Use a different collection type? Use a large array with capacity for the maximum number of rows? Or is there a way to notify an adapter the dataset has changed and it actually works (notifyDataSetChanged() is not working in my scenario, probably because the array hasn't just changed, it's a completely different one, so the notify is probably working with the old one). Or should I set the adapter up with the new larger array, and jump it to the right position?</p>","477415","","477415","","2011-02-04 18:48:03","2011-02-04 18:48:03","How to add more items at the bottom of an Android Array-backed ListView, and keep position?","<android>","1","0","","",""
"4901595","1","4901636","","2011-02-04 18:30:13","1","1482","<p>A client is releasing a product (employee training/guide), and have contracted us to create a companion application for the Android OS.</p><p>Being a global entity that routinely has employees in areas without network access, they are releasing their product via CD.</p><p>They would like the ability for their users to optionally install this companion application to their personal Android devices (their own cell phones/tablets etc).</p><p>Since some will be in areas without network/internet access, they would really like the ability for an installer to be on this CD to install the Android application.</p><p>I am somewhat familiar with being able to install applications onto Android using ADB, but was under the impression this would require root.</p><p>Is there a method by which an application could be installed from a computer, in such a way that a non-tech savvy user could use it (IE classic installer application, just different target).</p><p>Don't want to be asking these people to root their devices, install ADB and so forth.</p>","224111","","","","","2011-02-05 05:22:50","Easily install Android Application from computer?","<android><installer><apk>","3","2","","",""
"4901607","1","4990909","","2011-02-04 18:31:05","2","2427","<p>Is there a way to programmatically remove certain keys from the standard software keyboard. By setting some of the input type flags I am so close to having the keyboard I need. From the calling application is there a way to modify the keyboard directly. I know how to make my own custom keyboard but it seems such a waste to remove one button from the standard one.</p><p>////// edit/////// <BR>I think I found a way around this if any one has tried this method please let me know if it worked for you.</p><p>I have going to grab the softKeyboard service and using the start hook the keyboard uses to grab its view object inflate my own and swap them.</p>","310678","","546999","","2011-02-04 20:04:30","2011-02-14 10:11:21","android soft keyboard modifications","<android><android-softkeyboard>","2","2","","",""
"4901662","1","5171244","","2011-02-04 18:37:00","7","4153","<p>I'm creating an rss aggregator for my Android phone.  I'd like to be able to subscribe to an rss feed from the browser since most websites have a subscribe via rss button. </p><p>How can I build an intent filter to receive those links?</p><p>This question was similar and showed how to create an intent filter to handle browser links:<a href=""http://stackoverflow.com/questions/3469908/make-a-link-in-the-android-browser-start-up-my-app"">Make a link in the Android browser start up my app?</a></p><p>However, I don't know how to make it specific to rss feeds.As an attempt I tried this filter:</p><pre><code>        &lt;intent-filter&gt;            &lt;action android:name=""android.intent.action.VIEW"" /&gt;            &lt;data android:mimeType=""application/rss+xml"" /&gt;            &lt;category android:name=""android.intent.category.DEFAULT"" /&gt;            &lt;category android:name=""android.intent.category.BROWSABLE"" /&gt;         &lt;/intent-filter&gt;</code></pre><p>Am I on the right track?  What should I be filtering on?</p>","131871","","131871","","2011-02-04 23:06:00","2011-08-04 07:49:28","How to open my Android app when rss link is opened in browser?","<android><rss><android-intent><intentfilter>","4","1","8","",""
"4901752","1","4901781","","2011-02-04 18:45:06","1","846","<p>I noticed the default camera activity I call on a Droid X is different looking than the one on my Droid and Nexus One.  After selecting ""OK"" on the Droid and Nexus One, the activity would finish - the Droid X has a ""Done"" button (which takes you back to the Camera, instead of finishing the activity), and the only way to get to the screen I want is to hit the ""Back"" button.  </p><p>Here is the class that works on Android 2.2/2.3, but not for Droid X's:</p><pre><code>package com.android.xxx;import java.io.File;import android.content.Intent;import android.net.Uri;import android.os.Bundle;import android.os.Environment;import android.provider.MediaStore;import android.view.Window;public class CameraView extends MenusHolder {    protected String _path;    protected boolean _taken;    protected static final String PHOTO_TAKEN = ""photo_taken"";    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        requestWindowFeature(Window.FEATURE_NO_TITLE);        setContentView(R.layout.create_event_view);        /*         * save to sd         */        File imageDirectory = new File(                Environment.getExternalStorageDirectory() + ""/MyPath/"");        imageDirectory.mkdirs();        /*         * temp image overwrites each time for space         */        _path = Environment.getExternalStorageDirectory()                + ""/MyPath/temporary_image.jpg"";        startCameraActivity();    }    protected void startCameraActivity() {        File file = new File(_path);        Uri outputFileUri = Uri.fromFile(file);        Intent intent = new Intent(                android.provider.MediaStore.ACTION_IMAGE_CAPTURE);        intent.putExtra(MediaStore.EXTRA_OUTPUT, outputFileUri);        startActivityForResult(intent, 0);    }    @Override    protected void onActivityResult(int requestCode, int resultCode, Intent data) {        switch (resultCode) {        case 0:            setResult(5);            finish();            break;        case -1:            onPhotoTaken();            break;        }    }    protected void onPhotoTaken() {        _taken = true;        setResult(0);        finish();    }    @Override    protected void onSaveInstanceState(Bundle outState) {        outState.putBoolean(CameraView.PHOTO_TAKEN, _taken);    }    @Override    protected void onRestoreInstanceState(Bundle savedInstanceState) {        if (savedInstanceState.getBoolean(CameraView.PHOTO_TAKEN)) {            onPhotoTaken();        }    }}</code></pre>","375566","","","","","2011-12-30 13:23:02","Android 2.2 SDK - Droid X Camera Activity doesn't finish properly","<java><android><mobile><android-sdk-2.2>","2","0","1","",""
"4901768","1","4901869","","2011-02-04 18:47:15","2","1288","<p>I am writing application using PhoneGap on Android. I need to call some PhoneGap methods from native Java code. Anyone knows how to do that??</p>","396033","","","","","2011-02-04 18:59:14","Running JavaScript methods from Java in Android","<android><phonegap>","1","0","","",""
"4901837","1","4902160","","2011-02-04 18:54:57","0","1666","<p>I have a dialog with five <code>CheckedTextView</code>. When I open dialog and Click on some CheckBoxes and than I click Cancel Button. But when I open dialog again. The changes made is saved. Why? How to cancel what I clicked when I press Cancel button ?</p>","602011","","457982","","2011-02-04 19:08:46","2011-02-04 21:00:39","Android :Alert Dialog, Cancel Button","<android><button><alertdialog>","1","1","","",""
"4901892","1","4903853","","2011-02-04 19:01:42","0","786","<p>Hey I got a problem here. </p><p>I'm trying to retrieve the date from the Database based on Date passed to the method, and it returns the value. </p><p>The problem is that, when I try to pass the variable that receives the date, the method that select the data from the DB, returns nothing. (and I print the date variable on the LogCat and it's ok, the date value is correct), but if I pass a String value like this (""1/01/1111"") it returns correctly.</p><p>here is the method on the activity that get the value and set the text.</p><pre><code>public void setBasicContent() {    date = (mMonth + 1) + ""/"" + mDay + ""/"" + mYear + "" "";    hpdData = this.hpd.selectDuration(date);    mDateDisplay.setText(hpdData);}</code></pre><p>And here is the selectDuration() method that select the data from the DB based on the date parameter.</p><p>Ah, when I pass the variable date in the activity, the code doesn't reach the <code>if(cursor.moveToFirst())</code> scope. But I don't know why, because the variable value is completely correctly exactly like a normal string. </p><pre><code>public String selectDuration(String date) {    String duration = """";    Integer value = 0;    String returnment = """";    Log.i(TAG, ""date to select: "" + date);    Cursor cursor = this.db.query(TABLE_NAME, new String[] { ""duration"" },            ""date = ?"", new String[] { date }, null, null, null);    if (cursor.moveToFirst()) {        do {            Log.i(""SELECTDURATION"", ""inside cursor.moveToFirst()"");            duration = cursor.getString(0);            value += Integer.parseInt(duration);        } while (cursor.moveToNext());        returnment = Integer.toString(value);    }    if (cursor != null &amp;&amp; !cursor.isClosed()) {        cursor.close();    }    Log.i(TAG, ""valor do returnment: "" + returnment);    return returnment;}</code></pre>","399459","","135152","","2011-07-05 17:49:32","2012-02-29 13:19:08","Problem getting data from DB using DatePicker date","<android><sqlite><android-datepicker>","3","1","1","",""
"4902185","1","","","2011-02-04 19:39:53","3","5269","<p>Is it possible to send and receive response on USSD requests?I've googled this question and i found that this issue isn't implemented yet:</p><p><a href=""http://code.google.com/p/android/issues/detail?id=1285"" rel=""nofollow"">http://code.google.com/p/android/issues/detail?id=1285</a></p><p>Is there any ways do process USSD requests for Android applications?</p>","112467","","","","","2013-09-07 08:48:47","USSD on Android from applications","<android>","3","1","2","",""
"4902325","1","4902368","","2011-02-04 19:55:54","0","249","<p>I'm using the GSON library and calling the fromJson() method:<a href=""http://google-gson.googlecode.com/svn/tags/1.2.3/docs/javadocs/com/google/gson/Gson.html"" rel=""nofollow"">http://google-gson.googlecode.com/svn/tags/1.2.3/docs/javadocs/com/google/gson/Gson.html</a></p><p>My old code:</p><pre><code>String s = new GsonBuilder().create().fromJson(responseString,myClass[].class);</code></pre><p>Works fine, but I'm moving the collection from an array to an ArrayList and I can't figure out the syntax to use to pass the type to this method. If I understand correctly the existing code is passing the type (an array of myClass objects) to the method, which it then creates from the JSON response.</p><p>But I have tried all the syntax combinations I can think of and I'm stumped for how to do what I thought would look like this:</p><pre><code>String s = new GsonBuilder().create().fromJson(responseString, ArrayList&lt;myClass&gt;.class );</code></pre>","477415","","","","","2011-02-04 20:00:47","How do I do the equivalent of ""myClass[].class"" with ArrayList<myClass>?","<java><android>","3","0","","",""
"4902391","1","","","2011-02-04 20:03:11","4","17996","<p>new to Android.  I get the following message in the debugger perspective:</p><p>The source attachment does not contain the source for the file ListView.classYou can change the source attachment by clicking the change attached Source Below</p><p>Needless to say the app errors.  I've tried to change the source attachment to the location path: </p><p>C:/Program Files/Android/android-sdk-windows/platforms/android-8/android.jar</p><p>However, this did not work.</p><p>Any thoughts would be much appreciated.</p><p>Code is:</p><pre><code>import android.app.ListActivity;import android.os.Bundle;import android.view.*;import android.widget.*;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.main, COUNTRIES));      ListView lv = getListView();      lv.setTextFilterEnabled(true);     lv.setOnItemClickListener(new AdapterView.OnItemClickListener() {        public void onItemClick(AdapterView&lt;?&gt; 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();        }      });    }    static final String[] COUNTRIES = new String[] {        ""Afghanistan"", ""Albania"", ""Algeria"", ""American Samoa...</code></pre><p>Thanks!</p>","603695","","683261","","2012-02-08 12:23:02","2013-06-04 10:35:22","Error Message-The source attachment does not contain the source for the file ListView.class","<android><listactivity>","3","1","","",""
"4902575","1","","","2011-02-04 20:26:58","2","2648","<p>I have this database code and the file where I want to write to the database. But when trying to find the database in the filexplorer there is no database. In logcat I'm getting this:</p><pre><code>02-04 21:16:02.722: INFO/Database(3361): sqlite returned: error code = 14, msg = cannot open file at source line 2546702-04 21:16:02.722: ERROR/Database(3361): sqlite3_open_v2(""/data/data/com.sr.android/databases/myapp"", &amp;handle, 6, NULL) failed</code></pre><p>Why don't I have any database? Where is the error?</p><pre><code>public class Main extends TabActivity {    DataBaseHandler db = new DataBaseHandler(this);public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        getBrands(); private boolean getBrands() {        JsonGetBrands reader = new JsonGetBrands(""testa2.php"");        String Brand = reader.getBrands();         System.out.println(""hej plus "" +Brand);        db.open();        long id = 0 ;        db.InsertBrand(Brand);        id = db.getAllEntries();        Context context = getApplicationContext();        CharSequence text = ""The Brands"" + Brand +""har lagts till i databasen\n brands total= "" +id;         int duration = Toast.LENGTH_LONG;          Toast toast = Toast.makeText(context, text, duration);          toast.show();          db.close(); int id = 0;        public static final String KEY_ROWID = ""_id"";        public static final String KEY_BRAND = ""Brand"";        private static final String TAG = ""DBAdapter"";        private static final String DATABASE_NAME = ""mydb"";        private static final String DATABASE_TABLE = ""tblBrands"";        private static final int DATABASE_VERSION = 1;        private static final String DATABASE_CREATE =            ""create table tblBrands (_id integer primary key autoincrement, ""            + ""Brand text not null );"";        private final Context context;        private DatabaseHelper DBHelper;        private SQLiteDatabase db;        public DataBaseHandler(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(DATABASE_CREATE);            }            @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 tblBrands"");                onCreate(db);            }        }    //---opens the database---     public DataBaseHandler open() throws SQLException     {         db = DBHelper.getWritableDatabase();         return this;     }     //---closes the database---     public void close()     {         DBHelper.close();     }    //---insert a title into the database---     public long InsertBrand(String Brand)     {         ContentValues initialValues = new ContentValues();         initialValues.put(KEY_BRAND, Brand);         return db.insert(DATABASE_TABLE, null, initialValues);     }     public int getAllEntries()     {         Cursor cursor = db.rawQuery(                     ""SELECT COUNT(Brand) FROM tblBrands"", null);                 if(cursor.moveToFirst()) {                     return cursor.getInt(0);                 }                 return cursor.getInt(0);     }     public String getRandomEntry()        {            id = getAllEntries();            Random random = new Random();             int rand = random.nextInt(getAllEntries());                if(rand == 0)                ++rand;                Cursor cursor = db.rawQuery(                        ""SELECT Brand FROM tblBrands WHERE _id = "" + rand, null);                    if(cursor.moveToFirst()) {                        return cursor.getString(0);                    }                    return cursor.getString(0);        }    }</code></pre>","511895","","496830","","2011-11-08 13:53:11","2012-08-08 20:51:46","Why am I getting this error when attempting to write to a database?","<android>","3","2","1","",""
"4902680","1","4903054","","2011-02-04 20:39:08","0","2328","<p>I want to use a button click to pass selection parameters to another class that will build a map screen using the passed parameters. I am focused on getting my button action working. I a using onCLickListener and onCLickView as follows</p><pre><code>Class1:public class Class1  extends Activity implements OnClickListener {    Class2 class2;    protected void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);..........       Button button = (Button)findViewById(R.id.btn_configup1);        button.setOnClickListener(this);           }    public void onClick(View v) {        Class2 class2 = new Class2();        //Save state.. selections and params and use bundle        //to pass into class2        class2.execMapBuild();    }    }Class2:</code></pre><p>public class Class2 extends MapActivity { </p><pre><code>public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.drawable.navup);}public void execMapBuild() {            finish(); //just in case we return.        Intent intent = new Intent(CLass2.this, Class2.class);        startActivity(intent);    }</code></pre><p>I have everything working except the desired button action. I want the button click in Class1.onVlickView  to call Class2.execMapBuild using the button click action. I have the button click capturing the action and calling the execMapBuild method on Class2. But I get a NullPointerException as it moves from startActivity(intent) into onCreate.</p><p>I have tried several other ways of nailing this down, but this seems the best and I seem close to figuring it out. I would really appreciate an explanation of what I may be missing.Added code that was initially not copied in.</p>","625983","","625983","","2011-02-05 01:05:57","2011-02-05 01:16:59","using onClickView to call another class","<android><button><oncreate>","2","0","0","",""
"4902695","1","4911005","","2011-02-04 20:40:55","0","883","<p>I haved succesfully implemented an Augmented Reality Application using the following softwares:</p><ol><li>Adobe Flash Professional CS5</li><li>Adobe Air For Android</li><li>FLARToolKit</li><li>Papervision3D</li></ol><p>Can you please let me know if any sources is available for me to find out how to start?</p><p>Thank you</p>","495296","","495296","","2011-02-27 18:11:35","2011-02-27 18:11:35","How to use Away3d Lite and FLARToolKiT for Augmented Reality Application","<android><air><augmented-reality><away3d><flartoolkit>","1","0","","",""
"4902902","1","","","2011-02-04 21:02:35","2","1299","<p>I've been trying to have either the email or gmail applications give me the option of using my application to open a PDF attachments to no avail. My intent-filter looks like:</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:mimeType=""application/pdf"" /&gt;        &lt;/intent-filter&gt;</code></pre><p>When I look in the emulator, the activity manager broadcasts this:</p><pre><code>02-04 15:45:03.626: INFO/ActivityManager(59): Starting activity: Intent { act=android.intent.action.VIEW dat=content://com.android.email.attachmentprovider/1/17/RAW flg=0x80001 }</code></pre><p>What I'm I doing wrong?</p><p>Thanks in advance... </p>","603802","","142162","","2011-08-30 20:56:29","2014-01-05 18:57:34","Android: How to use intent-filter to process a PDF email attachment?","<android><email><pdf><gmail><intentfilter>","1","2","","",""
"4902913","1","","","2011-02-04 21:03:46","0","615","<p>What is the best client side library (framework) for creating web-based  applications  (not phone specific appsfor modern smartphones (WEbkit compatible).</p><p>I 'm mostly thinking of a modern, light JavaScript framework that is specially designed to work with modern Web-kit enabled smart phones.</p><p>I heard <a href=""http://jquerymobile.com"" rel=""nofollow"">http://jquerymobile.com</a> was pretty good any suggestions or comments..</p>","299319","","","","","2011-02-04 22:36:54","Best client side library for creating webkit (Android IOS) Web App Interfaces","<javascript><android><ios><webkit>","1","0","","",""
"4902946","1","4903005","","2011-02-04 21:06:54","0","593","<p>Help....I have a problem...Here is the cod...</p><pre><code>@Overrideprotected Dialog onCreateDialog(int id) {switch (id) {case IDD_COLOR:    AlertDialog.Builder builder = new AlertDialog.Builder(this);    builder.setTitle(""Pick a color"");    ListView listView = new ListView (this);    builder.setInverseBackgroundForced(true);    listView.setAdapter(new ArrayAdapter(this, android.R.layout.select_dialog_multichoice, mColors ));    listView.setOnItemClickListener(new OnItemClickListener() {          @Override        public void onItemClick(AdapterView&lt;?&gt; arg0, View arg1,                int arg2, long arg3) {            switch (arg2) {            case 0:                 if (!((CheckedTextView)arg0.getChildAt(arg2)).isChecked())                 {                    ((CheckedTextView)arg0.getChildAt(arg2)).setChecked(true);                } else                     ((CheckedTextView)arg0.getChildAt(arg2)).setChecked(false);            break;            case 1:                 if (!((CheckedTextView)arg0.getChildAt(arg2)).isChecked())                 {                    ((CheckedTextView)arg0.getChildAt(arg2)).setChecked(true);                } else                     ((CheckedTextView)arg0.getChildAt(arg2)).setChecked(false);                break;            case 2:                 if (!((CheckedTextView)arg0.getChildAt(arg2)).isChecked())                 {                    ((CheckedTextView)arg0.getChildAt(arg2)).setChecked(true);                } else                     ((CheckedTextView)arg0.getChildAt(arg2)).setChecked(false);                break;            }        }    });    builder.setPositiveButton(""OK"", new DialogInterface.OnClickListener() {        public void onClick(DialogInterface dialog, int id) {        }    });    builder.setNegativeButton(""Cancel"", new DialogInterface.OnClickListener() {        public void onClick(DialogInterface dialog, int id) {            }    });    builder.setView(listView);    return builder.create();default:return null;}</code></pre><p>How to cancel what was clicked by pressing Cancel Button ? Because It all the time save what was clicked.</p>","602011","","","","","2011-02-04 21:13:16","Android: Alert Dialog","<android>","1","0","","",""
"4902957","1","","","2011-02-04 21:07:59","0","412","<p>I see that SQLiteOpenHelper class has a SQLiteDatabase instance called mDatabase.I also see that, it calls mDatabase.lock(); However there is no lock() function for SQLiteDatabase class, which I am guessing lock() function was implemented for the older APIS. </p><p>So my question is , is there a newer verion of SQLiteOpenHelper which is implemented with out using the lock() functions. I looked at the source tree of android but I could not find it. </p><p>I am asking this because I need to implement my own SQLiteOpenHelper with has a little more control. </p><p>For instance I want to be able to set the locale option here when you open the data base and I don't want re invent the wheel so I was thinking I can use SQLiteOpenHelper but change it slightly. </p><p>Thanks </p>","498584","","","","","2012-07-22 08:51:58","SQLiteOpenHelper and locking","<android><database><sqlite><locking><locale>","1","0","","",""
"4902990","1","","","2011-02-04 21:11:35","0","80","<p>First, sorry for my poor language skills.</p><p>I tried to modify the SearchableDictionary v2 sample from here: <a href=""http://developer.android.com/resources/samples/SearchableDictionary/index.html"" rel=""nofollow"">http://developer.android.com/resources/samples/SearchableDictionary/index.html</a>I need this for a school project.</p><p>I replaced the definitions in dev/raw/definitons.txt with some other definitions, which was written in Cyrillic, but now when I run the project and search for a word it doesn't show me word I was searching for. </p><p>However, if I enter some words in Latin symbols in definitions.txt, then the app works great, but when I put some words in Cyrillic it doesn't show me the words, when I search for them.</p><p>I assume that this is due to some encoding issues?Thanks!</p>","603813","","205245","","2012-05-03 11:32:45","2012-05-03 11:32:45","I want to modify a sample from the http://developer.android.com/, but have some problems with Cyrillic symbols","<android><character-encoding><internationalization>","1","1","","",""
"4903004","1","4903756","","2011-02-04 21:13:10","3","3446","<p>I have three gps points in android app. How to set on map connect first and second with red and second and third with blue line ? How to connect any two points on map, draw line between them?</p>","486578","","486578","","2011-02-04 21:39:47","2011-02-04 22:59:28","Connect points on map with lines","<android>","1","0","8","",""
"4903160","1","","","2011-02-04 21:33:57","0","942","<p>I'm getting an error when i click my link in my first activity(Explorer), i would like it to bring up the file picker i have created (AndroidExplorer) Is there something wrong with my code activity code or my manifest.</p><p>Any help would be appreciated</p><p>Explorer Class</p><pre><code>public class Explorer extends Activity{@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    Button picture = (Button)findViewById(R.id.picture);    picture.setOnClickListener(new View.OnClickListener() {        @Override        public void onClick(View view) {          Intent intent = new Intent(Explorer.this, AndroidExplorer.class);          startActivity(intent);          finish();        }      });    }}</code></pre><p>AndroidExplorer class</p><pre><code>public class AndroidExplorer extends ListActivity {private List&lt;String&gt; item = null;private List&lt;String&gt; path = null;private String root=""/sdcard/DCIM/camera/"";private TextView myPath;/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main2);    myPath = (TextView)findViewById(R.id.path);    getDir(root);}private void getDir(String dirPath){    myPath.setText(""Location: "" + dirPath);    item = new ArrayList&lt;String&gt;();    path = new ArrayList&lt;String&gt;();    File f = new File(dirPath);    File[] files = f.listFiles();    if(!dirPath.equals(root))    {        item.add(root);        path.add(root);        item.add(""../"");        path.add(f.getParent());    }    for(int i=0; i &lt; files.length; i++)    {            File file = files[i];            path.add(file.getPath());            if(file.isDirectory())                item.add(file.getName() + ""/"");            else                item.add(file.getName());    }    ArrayAdapter&lt;String&gt; fileList =        new ArrayAdapter&lt;String&gt;(this, R.layout.row, item);    setListAdapter(fileList);}@Overrideprotected void onListItemClick(ListView l, View v, int position, long id) {    File file = new File(path.get(position));    if (file.isDirectory())    {        if(file.canRead())            getDir(path.get(position));        else        {            new AlertDialog.Builder(this)            .setIcon(R.drawable.icon)            .setTitle(""["" + file.getName() + ""] folder can't be read!"")            .setPositiveButton(""OK"",                     new DialogInterface.OnClickListener() {                        @Override                        public void onClick(DialogInterface dialog, int which) {                            // TODO Auto-generated method stub                        }                    }).show();        }    }    else    {        new AlertDialog.Builder(this)            .setIcon(R.drawable.icon)            .setTitle(""["" + file.getName() + ""]"")            .setPositiveButton(""OK"",                     new DialogInterface.OnClickListener() {                        @Override                        public void onClick(DialogInterface dialog, int which) {                            // TODO Auto-generated method stub                        }                    }).show();    }}}</code></pre><p>Manifest file</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.Explorer""  android:versionCode=""1""  android:versionName=""1.0""&gt;&lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;    &lt;activity android:name="".Explorer""              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="".AndroidExplorer""        android:label=""Screen 2 - New actvity.""&gt;    &lt;/activity&gt;&lt;/application&gt;&lt;/manifest&gt; </code></pre>","601915","","","","","2011-06-16 14:41:50","Switching from activity to another manifest file problem?","<android><android-manifest><android-intent>","1","3","","",""
"4903180","1","4903389","","2011-02-04 21:36:36","1","618","<p><br>I have an application which runs a long task and returns a value. While the task is running, a <code>ProgressDialog</code> shows the progress. After the task is done I want to show the result in a <code>TextView</code>. I run the task in a FutureTask.<br>My problem is that if I try to get the result, the <code>.get()</code> method of FutureTask blocks the UI Thread and I don't see the <code>ProgressDialog</code> (the <code>TextView</code> displays the result propertly).  </p><p>My code for the task (pool is ExecutorService):  </p><pre><code>final FutureTask&lt;String&gt; future = new FutureTask&lt;String&gt;(new Callable&lt;String&gt;() {      @Override      public String call() {          return myLongTask();      }  });  pool.execute(future);</code></pre><p>And afterwards I call <code>updateProgressBar()</code> in a <code>Runnable</code> which updates the <code>ProgressDialog</code> with a <code>Handler</code>:  </p><pre><code>Runnable pb = new Runnable() {      public void run() {          myUpdateProgressBar();      }  };  pool.execute(pb);</code></pre><p>Now I'm getting the result, which blocks the UI Thread preventing the <code>ProgressDialog</code> to show up:  </p><pre><code>String result = future.get()</code></pre><p>If I try to put the result inside the updateProgressBar() method (by passing the future as a parameter) after the ProgressDialog dismisses, an Exception is thrown:  </p><blockquote>  <p>Only the original thread that created a view hierarchy can touch its views.</p></blockquote><p>Any ideas how to solve this problem? (I've heard about AsyncTasks but I can't figure out how to use them propertly.)</p>","603841","","512958","","2011-02-04 21:46:50","2012-03-09 12:08:39","Show result of long task after a ProgressDialog","<android>","2","0","1","",""
"4903239","1","4903536","","2011-02-04 21:41:33","3","131","<p>I am using floats for some Android Java game graphics, but the Math library trig functions all return double, so I have to explicitly cast them.</p><p>I understand that floats are quicker to process than doubles, and I do not need high precision answers.</p><p>e.g. which is better:</p><pre><code>screenXf = (float) (shipXf + offsetXf * Math.sin(headingf) - screenMinXf);</code></pre><p>or</p><pre><code>screenXf = shipXf + offsetXf * (float) (Math.sin(headingf)) - floatScreenMinXf;</code></pre><p>I suppose other questions would be 'how can I test this on an emulator without other factors (e.g. PC services) confusing the issue?' and 'Is it going to be different on different hardware anyway?'</p><p>Oh dear, that's three questions. Life is never simple :-(</p><p>-Frink</p>","131209","","","","","2011-02-04 22:31:51","Is it better to cast a whole expression, or just the different type variable","<java><android><types><trigonometry>","2","2","2","",""
"4903240","1","","","2011-02-04 21:41:40","7","4443","<p>Basically, I need help importing downloaded source or creating a project from sample source programs.  I'm looking for step by step instructions for both if anyone can point me there or post the steps.</p><p>I'm very new to Android/Eclipse.  I have the environments installed and have successfully written a very minor app that works on the emulator and my real Droid X.  I cannot, however, get any of the Android samples into a project without errors.  I've tried importing, creating from existing source, and etcetera and it's all a mess with errors everywhere.</p><p>I have, however, successfully created a new empty project, then brought the components into the project one at a time typing or pasting in code for every file.  I'd hover over and import Android and other components as needed.  The WiktionarySimple, for example, ran with only a couple of changes and several warnings that I left alone.  (I had to add 'formatted=""false"" in the statements below...)</p><pre><code>&lt;string name=""template_user_agent"" formatted=""false""&gt;""%s/%s (Linux; Android)""&lt;/string&gt;&lt;string name=""template_wotd_title"" formatted=""false""&gt;""Wiktionary:Word of the day/%s %s""&lt;/string&gt;</code></pre><p>But there has to be an easier way to import!  I've done the intuitive and I've followed instructions that I've found, but to no avail.  Can anyone give me a complete list as to how to import or create a project from existing source or from source I've downloaded from the web?</p>","603848","","","","","2013-10-11 08:37:54","Can't import or create new project from samples or downloads on Android/Eclipse","<android><eclipse><import><sample>","3","0","","",""
"4903287","1","4903442","","2011-02-04 21:47:08","0","816","<p>I am trying to perform basic task of rotating a canvas 20 times asecond using timer but it doesn't seem to be working properly and itslagging. for example, if I rotate rectangle 0.3 degrees per 50 ms itshould rotate 6 degree in on second, but that is not the case. Itreally slow in rotation. Here is my sample code:</p><pre><code>//Code for update taskclass UpdateTimeTask extends TimerTask {      public void run() {              hndView.post(new Runnable() {                   public void run() {                           hndView.invalidate(); //this code invalidates custom view that calls onDraw to draw rotated hand                   }                 });      }}//Code for onDraw method of custom view that needs to be update@Override protected void onDraw(Canvas canvas){    super.onDraw(canvas);    //ang is angle to rotate and inc is float value of 0.3 degree to be incremented    ang = ang + inc;    if (ang &gt;= 360) ang = ang - 360;    canvas.rotate(ang, canvas.getWidth()/2, canvas.getHeight()/2);      canvas.drawRect((canvas.getWidth()/2 - 2), (canvas.getHeight()/2 - 125), (canvas.getWidth()/2 + 2), (canvas.getHeight()/2 + 10), mTextPaint);    canvas.restore();}//code to schedule taskTimer timer = new Timer();UpdateTimeTask tt = new UpdateTimeTask();timer.schedule(tt, 0, 50);</code></pre><p>Can anyone please tell me what am I doing wrong here? Should I useddifferent approach to perform this task? Because its hard to believethat you cannot have simple smooth rotation of rectangle 20 times inone second.</p>","603858","","512958","","2011-02-04 23:19:22","2011-02-04 23:19:22","Timer task not being performed accurately","<android><timer><scheduled-tasks><rotation>","3","0","","",""
"4903364","1","4903378","","2011-02-04 21:55:35","0","1336","<p>I have problem with eclipse &amp; android sdk  after latest update ,<br>my question is  can anyone send us or share this file proguard.cfg,so we do not download again the same sdk ?</p>","365860","","","","","2011-02-04 21:57:28","android : can anyone send link or file proguard.cfg for download","<android><download><proguard>","1","0","","",""
"4903458","1","4903694","","2011-02-04 22:08:30","1","765","<p>One of my colleagues was trying to load my APK from an internal web site and then opening it from the installer.  The application crashes at launch time with the following stack and referring to an activity that I do not have.  I believe it is because I (temporarily) have two entry points for my application from the manifest, therefore, a resolver (chooser) is needed.</p><p>Is this true?</p><pre><code>02-04 13:57:15.880 E/AndroidRuntime( 4183): android.content.ActivityNotFoundException: Unable to find explicit activity class {com.mycompany.android.myapp/com.android.internal.app.ResolverActivity}; have you declared this activity in your AndroidManifest.xml?02-04 13:57:15.880 E/AndroidRuntime( 4183):     at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1404)02-04 13:57:15.880 E/AndroidRuntime( 4183):     at android.app.Instrumentation.execStartActivity(Instrumentation.java:1378)02-04 13:57:15.880 E/AndroidRuntime( 4183):     at android.app.Activity.startActivityForResult(Activity.java:2758)02-04 13:57:15.880 E/AndroidRuntime( 4183):     at android.app.Activity.startActivity(Activity.java:2864)02-04 13:57:15.880 E/AndroidRuntime( 4183):     at com.android.packageinstaller.InstallAppProgress.onClick(InstallAppProgress.java:191)02-04 13:57:15.880 E/AndroidRuntime( 4183):     at android.view.View.performClick(View.java:2420)02-04 13:57:15.880 E/AndroidRuntime( 4183):     at android.view.View.onTouchEvent(View.java:4235)02-04 13:57:15.880 E/AndroidRuntime( 4183):     at android.widget.TextView.onTouchEvent(TextView.java:6642)02-04 13:57:15.880 E/AndroidRuntime( 4183):     at android.view.View.dispatchTouchEvent(View.java:3765)02-04 13:57:15.880 E/AndroidRuntime( 4183):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)02-04 13:57:15.880 E/AndroidRuntime( 4183):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)02-04 13:57:15.880 E/AndroidRuntime( 4183):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)02-04 13:57:15.880 E/AndroidRuntime( 4183):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)02-04 13:57:15.880 E/AndroidRuntime( 4183):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)02-04 13:57:15.880 E/AndroidRuntime( 4183):     at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1713)02-04 13:57:15.880 E/AndroidRuntime( 4183):     at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1131)02-04 13:57:15.880 E/AndroidRuntime( 4183):     at android.app.Activity.dispatchTouchEvent(Activity.java:2070)02-04 13:57:15.880 E/AndroidRuntime( 4183):     at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1697)02-04 13:57:15.880 E/AndroidRuntime( 4183):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1716)02-04 13:57:15.880 E/AndroidRuntime( 4183):     at android.os.Handler.dispatchMessage(Handler.java:99)02-04 13:57:15.880 E/AndroidRuntime( 4183):     at android.os.Looper.loop(Looper.java:123)02-04 13:57:15.880 E/AndroidRuntime( 4183):     at android.app.ActivityThread.main(ActivityThread.java:4363)02-04 13:57:15.880 E/AndroidRuntime( 4183):     at java.lang.reflect.Method.invokeNative(Native Method)02-04 13:57:15.880 E/AndroidRuntime( 4183):     at java.lang.reflect.Method.invoke(Method.java:521)02-04 13:57:15.880 E/AndroidRuntime( 4183):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:862)02-04 13:57:15.880 E/AndroidRuntime( 4183):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:620)02-04 13:57:15.880 E/AndroidRuntime( 4183):     at dalvik.system.NativeStart.main(Native Method)</code></pre><p>Here is a piece of the manifest.  Notice the Welcome and the Settings activities.  Both have intent filters for Launcher with Main and that is what needs to be ""resolved"" before starting the activity.  Apparently other installers just grab one (at random, first, etc.)?</p><pre><code>    &lt;activity android:name="".ui.WelcomeActivity""              android:label=""@string/title_welcome""&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="".ui.AboutActivity""              android:label=""@string/title_edit_profile""&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;   &lt;activity android:name="".ui.SettingsActivity""              android:label=""@string/title_settings""               android:windowSoftInputMode=""stateAlwaysHidden|adjustPan""&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.MAIN"" /&gt;            &lt;action android:name=""android.provider.Settings.ACTION_SYNC_SETTINGS""/&gt;            &lt;category android:name=""android.intent.category.DEFAULT"" /&gt;        &lt;/intent-filter&gt;    &lt;/activity&gt;</code></pre>","157804","","157804","","2011-02-04 22:49:01","2011-02-04 22:50:48","Launching Android apk from installation crashes looking for ResolverActivity?","<android><installer><apk><resolver>","1","2","","",""
"4903460","1","4903786","","2011-02-04 22:08:45","0","1051","<p>Well, i have a task to write <strong>Tcp Client</strong> for Andoid on java. Before, i have only work with C++ &amp; Qt, it was easy =)</p><p>Now i tried to find out the best way to solve this task.I want to devide Client on two thread. The first one will be waiting and handling requests from server, on the second i will have GUI or ill can sending some requests to server (not matter).</p><p>Client will be connecting to the server and waiting for the some updating. On the server we have DB which can be edited by client. We must notify about changes on server definite group of users and they can do smth after.</p><p>Do you think is ok to devide it, or there are more good way? And how it can be implemented more clear.</p><p>ps guys, i have a some practice with Tcp-Ip, i dont needed on basic tutorials in this area! And i'm ok with Java. I need help just with architecture for building Client. Please, my question is strongly definite. </p><p>pps really sorry if it was hard to understand ;)</p>","590952","","590952","","2011-02-04 23:29:52","2011-02-04 23:29:52","Should i split my Tcp Client implementation on the threads?","<java><android><tcp><client><ip>","2","5","","",""
"4903515","1","4903531","","2011-02-04 22:17:31","15","42705","<p>Basically, I want an EditText in Android where I can have an integer value entered into. Perhaps there is a more appropriate object than EditText for this?</p><p>Thanks in advance to any and all responses which I receive.</p>","473481","","473481","","2013-02-26 23:21:03","2013-02-26 23:21:03","How do I return an int from EditText? (Android)","<java><android><edittext><android-edittext>","3","0","7","",""
"4903658","1","","","2011-02-04 22:44:10","2","1708","<p>I'm trying to open a link from my Gmail Application.  If I send myapp://custom/params, Gmail only recognizes it as text.  I can get the link to open my application ""myapp"" from a browser, though.  How can I get around this?  </p>","375566","","","","","2011-02-05 01:53:19","Android Custom URI Handler - Gmail App doesn't recognize?","<android><mobile><android-sdk-2.2>","2","0","1","",""
"4903708","1","5133992","","2011-02-04 22:52:34","3","1732","<p>This seems to be a <a href=""http://blog.alsutton.com/2010/07/03/android-tablets-and-mdpi-large/"" rel=""nofollow"">widespread problem</a>.</p><p>I have the following drawable directories:</p><pre><code>drwxr-xr-x  18 mike  staff   612 Feb  4 17:28 drawable/drwxr-xr-x  51 mike  staff  1734 Feb  4 17:32 drawable-nodpi/drwxr-xr-x  44 mike  staff  1496 Feb  4 17:30 drawable-normal-mdpi/</code></pre><p>My xml drawable resources are in drawable.  My resources intended for the large-mdpi (Dell Streak) and normal-hdpi (Droid, Nexus, Incredible, etc.) are all in drawable-nodpi.  My resources for normal-mdpi (older phones like the G1) are in drawable-normal-mdpi.</p><p>Unfortunately, the normal-hdpi phones like the Droid are pulling their resources from drawable-normal-mdpi instead of from drawable-nodpi.  This is likely because of the rules in <a href=""http://developer.android.com/intl/fr/guide/topics/resources/providing-resources.html"" rel=""nofollow"">How Android Finds the Best-matching Resource</a>.</p><p>So the question is, how do I provide support for large-mdpi devices like the Streak along with normal-hdpi devices like the Droid, as well as normal-mdpi devices like the G1?</p><p>The simplest solution would probably be to make two copies of my large resources, one in normal-hdpi for the droid and one in large-mdpi for the streak, but i'd like to avoid duplicating all of these resources.</p><p><em>Update</em></p><p>Per Mayra's suggestion, I could make an alias for every resource.  However, there are a lot of resources I'd have to make aliases for, which would make maintenance a nightmare going forward, so I'm hoping for another solution.</p>","82156","","1228","","2014-03-17 19:06:55","2014-03-17 19:06:55","What is the proper way to set my drawable directories to support the new Dell Streak without losing support for older devices?","<android>","5","1","3","",""
"4903758","1","12662994","","2011-02-04 23:00:05","18","52267","<p>My ListView is using an extension of BaseAdapter, I can not get it to refresh properly.  When I refresh, it appears that the old data draws on top of the new data, until a scroll event happens.  The old rows draw on top of the new rows, but the old rows disappear when I start scrolling.   </p><p>I have tried calling invalidateViews(), notifyDataSetChanged(), and notifyDataSetInvalidated().  My code looks something like:</p><pre><code>private void updateData(){   List&lt;DataItems&gt; newList = getNewList();   MyAdapter adapter = new MyAdapter(getContext());   //my adapter holds an internal list of DataItems   adapter.setList(newList);   mList.setAdapter(adapter);   adapter.notifyDataSetChanged();   mList.invalidateViews();}</code></pre>","426493","","","","","2014-03-17 14:27:22","Android: how to refresh ListView contents?","<android><listview>","6","2","12","",""
"4903763","1","4903815","","2011-02-04 23:00:23","7","6006","<p>I want to implement a ""Google instant"" like list in my app. Having an editText on top and a list below it, that is updated every time the user types in a new character.</p><p>Can you point me to the right direction? Is there any widget or anything that I could use or do I have to drop the list and recreate it each time the users types something?</p><p>Thanks in advanceMike</p>","582665","","","","","2011-02-04 23:07:49","EditText with suggestion list below","<android><listview><rss><edittext>","1","0","2","",""
"4903804","1","","","2011-02-04 23:06:50","1","655","<p>I have a simple android app (API 1.5) developed for Motorola i1 from Nextel.It creates a simple SMS listener via BroadcastReveiver and it works when I test it on the i1 emulator that came with MOTODEV android studio.</p><p>When I install it on the actual device nothing... onReceive never gets called.I can see this via debug trace...</p><p>I tried some other receivers i.e Intent.ACTION_AIRPLANE_MODE_CHANGEDto see if this is a SMS specific issue but same thing...works on emulator not on device.What am I missing here? Any ideas?</p><p>Here is the code:</p><pre><code>package com.smsmanager;import android.app.Activity;import android.content.BroadcastReceiver;import android.content.Context;import android.content.Intent;import android.content.IntentFilter;import android.os.Bundle;import android.widget.Toast;public class MainActivity extends Activity {    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        registerReceiver(br, new IntentFilter(""android.provider.Telephony.SMS_RECEIVED""));    }    private BroadcastReceiver br = new BroadcastReceiver() {        @Override        public void onReceive(Context context, Intent intent) {            Toast.makeText(context, ""Hello SMS"", Toast.LENGTH_LONG).show();        }    };}</code></pre><p>AND here is the manifest:</p><pre><code>&lt;?xml version=""1.0"" encoding=""UTF-8""?&gt;&lt;manifest android:versionCode=""1"" android:versionName=""1.0""    package=""com.smsmanager"" mlns:android=""http://schemas.android.com/apk/res/android""&gt;    &lt;uses-permission android:name=""android.permission.INTERNET"" /&gt;    &lt;uses-permission android:name=""android.permission.READ_SMS"" /&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:name="".MainActivity"" 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=""3"" /&gt;&lt;/manifest&gt;</code></pre><p>I am starting to think that this may be due to changes made by Motorola!?</p>","603922","","881229","","2014-04-01 19:56:29","2014-04-01 19:56:29","Android BroadcastReceiver works on MOTODEV Emulator but not on Actual Motorola i1 device","<android><sms><broadcastreceiver>","1","0","1","",""
"4903913","1","5477968","","2011-02-04 23:25:35","1","1103","<p>How can I check if the device has SMS capabilities (e.g phones probably will but tablets might not)?</p>","560065","","","","","2011-03-29 19:40:48","android check sms","<android><sms><check>","2","0","1","",""
"4903948","1","4904598","","2011-02-04 23:31:12","16","6294","<p>Ok I'm looking right past something here..</p><p>Every time I'm in my app and I change activities, logcat reports series of warnings:</p><pre><code>02-04 14:42:36.524: WARN/Resources(1832): Converting to string: TypedValue{t=0x12/d=0x0 a=2 r=0x7f08002b}02-04 14:42:36.524: WARN/Resources(1832): Converting to string: TypedValue{t=0x12/d=0x0 a=2 r=0x7f08002c}02-04 14:42:36.524: WARN/Resources(1832): Converting to string: TypedValue{t=0x12/d=0x0 a=2 r=0x7f08002d}</code></pre><p>Other apps are not showing such warnings.  Is this a pre-release/aapt compression thing?</p>","294973","","","","","2012-10-19 09:26:44","Android Resources converting to string","<android><resources>","2","1","3","",""
"4904013","1","4904030","","2011-02-04 23:43:11","0","2759","<p>I have a fullscreen drawing app that disables the title and status bars using the Android Theme.NoTitleBar.Fullscreen theme.  One of the requests I am getting would be the ability to have these UI elements set to auto-hide, such that is the user touches near where they would be, they are shown.  I can imagine ways to accomplish this using a custom Activity that emulates the title bar, but replacing the notification bar just isn't feasible.</p><p>So, just wondering if there is any way to auto-hide the OS standard title and status bars.  I would imagine this is NO, as these elements look to be tied to the Activity in onCreate (or inflated from XML in onCreate), so once active, it wouldn't be possible to change their behavior.</p>","357801","","746010","","2012-01-29 21:57:14","2012-01-29 21:57:14","Android: Ability to Auto-Hide the Title/Status Bars?","<android><animation><statusbar><titlebar>","2","0","","",""
"4904098","1","4912484","","2011-02-04 23:59:17","0","2691","<p>@Ian G. Clifton Here is the code for the first type of soundpool I tried. when the button to load the activity the program FCs back to the previous activity. </p><p>code starts here but it doesnt' transfer over::::::</p><pre><code>public class SoundManager {    private  SoundPool mSoundPool;     private  HashMap&lt;Integer, Integer&gt; mSoundPoolMap;     private  AudioManager  mAudioManager;    private  Context mContext;    public SoundManager()    {    }    public void initSounds(Context theContext) {          mContext = theContext;         mSoundPool = new SoundPool(16, AudioManager.STREAM_MUSIC, 0);          mSoundPoolMap = new HashMap&lt;Integer, Integer&gt;();          mAudioManager = (AudioManager)mContext.getSystemService(Context.AUDIO_SERVICE);              }     public void addSound(int Index,int SoundID)    {        mSoundPoolMap.put(Index, mSoundPool.load(mContext, SoundID, 1));    }    public void playSound(int index) {          int streamVolume = mAudioManager.getStreamVolume(AudioManager.STREAM_MUSIC);          mSoundPool.play(mSoundPoolMap.get(index), streamVolume, streamVolume, 1, 0, 1f);     }    public void playLoopedSound(int index) {          int streamVolume = mAudioManager.getStreamVolume(AudioManager.STREAM_MUSIC);          mSoundPool.play(mSoundPoolMap.get(index), streamVolume, streamVolume, 1, -1, 1f);     }}</code></pre><p>:::::::::::::::::::activity:::::::::::::::::::::::::</p><pre><code>Activity  {    private SoundManager mSoundManager;    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);          setContentView(R.layout.nouns);          mSoundManager = new SoundManager();          mSoundManager.initSounds(getBaseContext());          mSoundManager.addSound(1, R.raw.age);          mSoundManager.addSound(2, R.raw.air);          mSoundManager.addSound(3, R.raw.anger);          mSoundManager.addSound(4, R.raw.animal);          mSoundManager.addSound(5, R.raw.answer);          mSoundManager.addSound(6, R.raw.apple);          mSoundManager.addSound(7, R.raw.area);          mSoundManager.addSound(8, R.raw.arm);          mSoundManager.addSound(9, R.raw.art);          mSoundManager.addSound(10, R.raw.atom);          mSoundManager.addSound(11, R.raw.baby);          mSoundManager.addSound(12, R.raw.lback);          mSoundManager.addSound(13, R.raw.ball);          mSoundManager.addSound(14, R.raw.band);          mSoundManager.addSound(15, R.raw.bank);      Button onebutton = (Button) this.findViewById(R.id.n1_button);            onebutton.setOnClickListener(new OnClickListener() {              public void onClick(View v) {                  mSoundManager.playSound(1);                  Toast.makeText(NounsActivity.this, ""AGE"",                          Toast.LENGTH_LONG).show();              }            });     Button twobutton = (Button) this.findViewById(R.id.n2_button);            twobutton.setOnClickListener(new OnClickListener() {              public void onClick(View v) {                  mSoundManager.playSound(2);                  Toast.makeText(NounsActivity.this, ""AIR"",                          Toast.LENGTH_LONG).show();              }            });        Button threebutton = (Button) this.findViewById(R.id.n3_button);            threebutton.setOnClickListener(new OnClickListener() {              public void onClick(View v) {                  mSoundManager.playSound(3);                  Toast.makeText(NounsActivity.this, ""ANGER"",                          Toast.LENGTH_LONG).show();              }            });        Button fourbutton = (Button) this.findViewById(R.id.n4_button);            fourbutton.setOnClickListener(new OnClickListener() {              public void onClick(View v) {                  mSoundManager.playSound(4);                  Toast.makeText(NounsActivity.this, ""ANIMAL"",                          Toast.LENGTH_LONG).show();              }            });        Button fivebutton = (Button) this.findViewById(R.id.n5_button);            fivebutton.setOnClickListener(new OnClickListener() {              public void onClick(View v) {                 mSoundManager.playSound(5);                  Toast.makeText(NounsActivity.this, ""ANSWER"",                          Toast.LENGTH_LONG).show();              }            });        Button sixbutton = (Button) this.findViewById(R.id.n6_button);            sixbutton.setOnClickListener(new OnClickListener() {              public void onClick(View v) {                  mSoundManager.playSound(6);                  Toast.makeText(NounsActivity.this, ""APPLE"",                          Toast.LENGTH_LONG).show();              }            });        Button sevenbutton = (Button) this.findViewById(R.id.n7_button);        sevenbutton.setOnClickListener(new OnClickListener() {              public void onClick(View v) {                  mSoundManager.playSound(7);                  Toast.makeText(NounsActivity.this, ""AREA"",                          Toast.LENGTH_LONG).show();              }            });        Button eightbutton = (Button) this.findViewById(R.id.n8_button);            eightbutton.setOnClickListener(new OnClickListener() {              public void onClick(View v) {                 mSoundManager.playSound(8);                  Toast.makeText(NounsActivity.this, ""ARM"",                          Toast.LENGTH_LONG).show();              }            });        Button ninebutton = (Button) this.findViewById(R.id.n9_button);            ninebutton.setOnClickListener(new OnClickListener() {              public void onClick(View v) {                  mSoundManager.playSound(9);                  Toast.makeText(NounsActivity.this, ""ART"",                          Toast.LENGTH_LONG).show();              }            });        Button tenbutton = (Button) this.findViewById(R.id.n10_button);            tenbutton.setOnClickListener(new OnClickListener() {              public void onClick(View v) {                  mSoundManager.playSound(10);                  Toast.makeText(NounsActivity.this, ""ATOM"",                          Toast.LENGTH_LONG).show();              }            });        Button elevenbutton = (Button) this.findViewById(R.id.n11_button);            elevenbutton.setOnClickListener(new OnClickListener() {              public void onClick(View v) {                  mSoundManager.playSound(11);                  Toast.makeText(NounsActivity.this, ""BABY"",                          Toast.LENGTH_LONG).show();              }            });        Button twelvebutton = (Button) this.findViewById(R.id.n12_button);            twelvebutton.setOnClickListener(new OnClickListener() {              public void onClick(View v) {                  mSoundManager.playSound(12);                  Toast.makeText(NounsActivity.this, ""BACK"",                          Toast.LENGTH_LONG).show();              }            });        Button thirteenbutton = (Button) this.findViewById(R.id.n13_button);            thirteenbutton.setOnClickListener(new OnClickListener() {              public void onClick(View v) {                  mSoundManager.playSound(13);                  Toast.makeText(NounsActivity.this, ""BALL"",                          Toast.LENGTH_LONG).show();              }            });        Button fourteenbutton = (Button) this.findViewById(R.id.n14_button);            fourteenbutton.setOnClickListener(new OnClickListener() {              public void onClick(View v) {                  mSoundManager.playSound(14);                  Toast.makeText(NounsActivity.this, ""BAND"",                          Toast.LENGTH_LONG).show();              }            });        Button fifteenbutton = (Button) this.findViewById(R.id.n15_button);            fifteenbutton.setOnClickListener(new OnClickListener() {              public void onClick(View v) {                  mSoundManager.playSound(15);                  Toast.makeText(NounsActivity.this, ""BANK"",                          Toast.LENGTH_LONG).show();              }            });         Button Backbutton = (Button) this.findViewById(R.id.Back_Button);              Backbutton.setOnClickListener(new OnClickListener() {                public void onClick(View v) {                    finish();                }              });    }}</code></pre><p>::::::::::::tried soundpool and got error log:::::::::::::::</p><pre><code>02-04 15:40:05.534: DEBUG/dalvikvm(471): Trying to load lib /system/lib/libsoundpool.so 0x002-04 15:40:05.613: DEBUG/dalvikvm(471): Added shared lib /system/lib/libsoundpool.so 0x002-04 15:40:09.220: ERROR/AudioCache(172): Heap size overflow! req size: 1049856, max size: 104857602-04 15:40:09.223: ERROR/AudioCache(172): Heap size overflow! req size: 1052672, max size: 104857602-04 15:40:09.234: ERROR/AudioCache(172): Heap size overflow! req size: 1052672, max size: 104857602-04 15:40:09.243: ERROR/AudioCache(172): Heap size overflow! req size: 1052672, max size: 104857602-04 15:40:09.254: ERROR/AudioCache(172): Heap size overflow! req size: 1052672, max size: 104857602-04 15:40:09.264: ERROR/AudioCache(172): Heap size overflow! req size: 1052672, max size: 104857602-04 15:40:09.333: ERROR/AudioCache(172): Heap size overflow! req size: 1052672, max size: 104857602-04 15:40:09.333: ERROR/AudioCache(172): Heap size overflow! req size: 1052672, max size: 104857602-04 15:40:09.333: ERROR/AudioCache(172): Heap size overflow! req size: 1052672, max size: 104857602-04 15:40:09.344: ERROR/AudioCache(172): Heap size overflow! req size: 1052672, max size: 104857602-04 15:40:09.344: ERROR/AudioCache(172): Heap size overflow! req size: 1052672, max size: 104857602-04 15:40:09.344: ERROR/AudioCache(172): Heap size overflow! req size: 1052672, max size: 104857602-04 15:40:09.353: ERROR/AudioCache(172): Heap size overflow! req size: 1052672, max size: 104857602-04 15:40:09.353: ERROR/AudioCache(172): Heap size overflow! req size: 1052672, max size: 104857602-04 15:40:09.353: ERROR/AudioCache(172): Heap size overflow! req size: 1052672, max size: 104857602-04 15:40:09.353: ERROR/AudioCache(172): Heap size overflow! req size: 1052672, max size: 104857602-04 15:40:09.364: ERROR/AudioCache(172): Heap size overflow! req size: 1051392, max size: 104857602-04 15:40:15.313: WARN/ActivityManager(179): Launch timeout has expired, giving up wake lock!02-04 15:40:15.363: WARN/ActivityManager(179): Activity idle timeout for HistoryRecord{43c86078 com.BluMouse.MNEKRENFULL2/.NounsActivity}02-04 15:40:17.943: DEBUG/AndroidRuntime(471): Shutting down VM02-04 15:40:18.133: WARN/dalvikvm(471): threadid=3: thread exiting with uncaught exception (group=0x4001b188)02-04 15:40:18.186: ERROR/AndroidRuntime(471): Uncaught handler: thread main exiting due to uncaught exception02-04 15:40:19.433: ERROR/AndroidRuntime(471): java.lang.RuntimeException: Unable to start activity ComponentInfo{package.nameActivity}: java.lang.NullPointerException02-04 15:40:19.433: ERROR/AndroidRuntime(471):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2496)02-04 15:40:19.433: ERROR/AndroidRuntime(471):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512)02-04 15:40:19.433: ERROR/AndroidRuntime(471):     at android.app.ActivityThread.access$2200(ActivityThread.java:119)02-04 15:40:19.433: ERROR/AndroidRuntime(471):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863)02-04 15:40:19.433: ERROR/AndroidRuntime(471):     at android.os.Handler.dispatchMessage(Handler.java:99)02-04 15:40:19.433: ERROR/AndroidRuntime(471):     at android.os.Looper.loop(Looper.java:123)02-04 15:40:19.433: ERROR/AndroidRuntime(471):     at android.app.ActivityThread.main(ActivityThread.java:4363)02-04 15:40:19.433: ERROR/AndroidRuntime(471):     at java.lang.reflect.Method.invokeNative(Native Method)02-04 15:40:19.433: ERROR/AndroidRuntime(471):     at java.lang.reflect.Method.invoke(Method.java:521)02-04 15:40:19.433: ERROR/AndroidRuntime(471):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)02-04 15:40:19.433: ERROR/AndroidRuntime(471):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)02-04 15:40:19.433: ERROR/AndroidRuntime(471):     at dalvik.system.NativeStart.main(Native Method)02-04 15:40:19.433: ERROR/AndroidRuntime(471): Caused by: java.lang.NullPointerException02-04 15:40:19.433: ERROR/AndroidRuntime(471):     at package.nameActivity.onCreate(nameActivity.java:168)02-04 15:40:19.433: ERROR/AndroidRuntime(471):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)02-04 15:40:19.433: ERROR/AndroidRuntime(471):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2459)02-04 15:40:19.433: ERROR/AndroidRuntime(471):     ... 11 more02-04 15:40:19.573: INFO/Process(179): Sending signal. PID: 471 SIG: 302-04 15:40:19.583: INFO/dalvikvm(471): threadid=7: reacting to signal 302-04 15:40:21.363: INFO/dalvikvm(471): Wrote stack trace to '/data/anr/traces.txt'02-04 15:40:29.603: DEBUG/dalvikvm(351): GC freed 44 objects / 2136 bytes in 8302ms02-04 15:40:29.863: DEBUG/dalvikvm(227): GC freed 2193 objects / 127504 bytes in 1879ms</code></pre>","577265","","512958","","2011-02-05 00:30:19","2011-10-11 09:22:59","SoundPool crashes in two scenerios. Code for first scenerio crashes","<android><audio><media><soundpool>","2","4","","",""
"4904276","1","4904730","","2011-02-05 00:31:29","1","1579","<p>So that IO doesn't block the UI thread in my Android app, I'm trying to move a file write operation into a separate thread. This is the code I'm using to start a low priority thread to write about 1Mb from a byte buffer:</p><pre><code>Thread t = new Thread(new Runnable(){  @Override  public void run()  {    Process.setThreadPriority(Process.THREAD_PRIORITY_BACKGROUND);      try      {        FileOutputStream fos = new FileOutputStream(filename));        try        {          final java.nio.channels.FileChannel outChannel = fos.getChannel();          outChannel.write(byteBuffer);          fos.getFD().sync();        }        finally        {          if (fos != null)            fos.close();        }      }    catch (Exception e)    {      e.printStackTrace();    }}});t.setPriority(Thread.MIN_PRIORITY);t.start();</code></pre><p>These threads are started in my app when certain UI events happen. Unfortunately, I still notice a huge amount of lag sometimes. My UI will freeze for ~2 seconds every 10 or so times I start/finish one of the above threads. If I comment out the thread code, these delays disappear.</p><p><b>What can I do to stop this IO operation from blocking my UI thread?</b></p><p>I'm not sure what to do now to diagnose the problem. My understand was that the IO thread would become blocked when ""outChannel.write"" happened as it was waiting for an IO operation to finish, which would mean my UI thread would immediately take over. Is it the case the write operation actually requires a big chunk of CPU power?</p><p>Edit:</p><p>With StrictView on (which I'm sure of because it caught some unrelated IO problems in the UI thread that I fixed first), I can confirm no IO occurs in my IO thread.</p><p>The results of running traceview are quite puzzling. The UI problem is that, when I'm performing drag and drop actions, every 10 or so times I do this the device seems to freeze for about 0.5 to 1s. The thing you're dragging will freeze and after a delay will eventually jump to where your finger is. In traceview, I kept dragging and dropping until this happened. For the case where this happens in traceview, my background threads aren't running  but there's a sudden block of about 1 second where operations on my UI thread that are usually fast to call are taking about x10 longer to perform. For example, a call to .drawBitmap (with a fixed size bitmap) is shown as taking ~0.2s to execute when every time before this the same .drawBitamp call is taking a tenth of this time. I could just be reading it wrong, but I don't know where to go from here or what to look for.</p>","580100","","580100","","2011-02-05 05:43:28","2011-02-05 05:43:28","IO operation in other thread blocking my UI thread?","<java><android><file-io><mobile>","1","2","","",""
"4904321","1","4905330","","2011-02-05 00:41:48","0","514","<p>I am developing an Android application that uses a number of python scripts in <code>res/raw</code> that are deployed via SL4A and included in the app's APK. As the scripts make use of python packages, their directories contain a number of 0byte sized <code>__init__.py</code> files that are necessary for python to recognize the directories as packages.My problem is that <code>aapt</code> skips those files during packaging, thus preventing the scripts from working on the device/emulator, as the modules are not found by the interpreter:</p><pre><code>[aapt] Creating full resource package... [null]     (skipping (null) file '/home/user/app/res/raw/pypackage/__init__.py')</code></pre><p>Is there a way to tell <code>aapt</code> to include the files nevertheless, or do I have to pad the files manually to make them >0kb sized? I already looked at the <code>aapt</code> command-line options but I didn't find anything.</p>","487903","","","","","2011-02-05 05:35:23","aapt: Do not skip (null) files when packaging","<python><android><aapt>","1","1","","",""
"4904381","1","","","2011-02-05 00:55:28","0","567","<pre><code>EditText etHomePhone = (EditText)findViewById(R.id.et_pi_home_phone);EditText etMobilePhone = (EditText)findViewById(R.id.et_pi_home_phone);etHomePhone.setOnClickListener(showPopUpClickListener);etMobilePhone.setOnClickListener(showPopUpClickListener);    private View.OnClickListener showPopUpClickListener = new View.OnClickListener() {            public void onClick(View v) {              /* I like to get both EditText.getText().toString() value in this one ClickListener  is it Possible, there is something in ActionScript call event.currentTarget...*/              }        };</code></pre>","591418","","416631","","2011-02-05 01:03:36","2011-02-05 01:26:09","ClickListener current target","<android><event-handling><listener>","2","0","","",""
"4904420","1","","","2011-02-05 01:03:14","0","157","<p>I'm very new to using GL, so please, bear with me!</p><p>I have a plane with a cube resting on top of it. I have 3 SeekBars in the Activity which allow the user to rotate along the x and z axis (aka tilt and rotate), and one to ""zoom-in"" (aka translate on z-axis). What I'd like to do is allow the user to go into a ""bird's-eye view"" of the plane and drag their finger along to place a ""marker"" which will just be a semi-transparent circle.</p><p>When the player releases their finger, I'd like the marker to stay where the user has left it. Now, I'd like to be able to rotate the 3D scene and see that the marker is not just a flat circle, but almost like a spotlight - it interacts with other objects (ie the cube).</p><p>How would this be done? Do I need to look into something like lighting?</p>","408178","","","","","2011-02-05 01:35:39","Project a circlular ""shade"" onto objects in OpenGL ES","<android><opengl-es>","1","0","","",""
"4904497","1","4904505","","2011-02-05 01:23:30","1","1066","<p>I need to dump all the attributes of a Java object. I have found a few functions that do this but none of them handle self references and all of the functions I have found spiral into infinite recursion.</p><p>//I will be running this function on Android but that shouldn't really matter.</p>","310678","","","","","2011-02-05 01:25:08","Java dump an object","<java><android><object><dump>","1","1","","",""
"4904529","1","4904554","","2011-02-05 01:31:08","0","557","<p>I have a <code>ListActivity</code> in which I am trying to display an <code>ImageView</code> under the List.  I'm attempting to do this by creating my own <code>BaseAdapter</code> and using two different methods inside the <code>getView</code> method, one for the List and one for the <code>ImageView</code>.  I managed to get the <code>ImageView</code> displayed under the List how I want it, but the problem I am having is the List isn't displayed correctly.</p><p>For some reason any item in the list that isn't on the screen until the user scrolls down gets populated with the wrong data like so:</p><pre><code>----Top Screen------|     Item 1       ||     Item 2       ||     Item 3       ||     Item 4       |----Bottom Screen---|     Item 1       |   &lt;--Items not on the screen show|     Item 1       |   &lt;--as item 1 once the user scrolls|     Image View   |   </code></pre><p>What it should be is like so:</p><pre><code>----Top Screen------|     Item 1       ||     Item 2       ||     Item 3       ||     Item 4       |----Bottom Screen---|     Item 5       ||     Item 6       ||     Image View   |</code></pre><p>My custom <code>BaseAdapter</code></p><pre><code>    private class MyCustomAdapter extends BaseAdapter {        private static final int TYPE_ITEM = 0;        private static final int TYPE_SEPARATOR = 1;        private static final int TYPE_MAX_COUNT = TYPE_SEPARATOR + 1;        private ArrayList&lt;HashMap&lt;String,String&gt;&gt; mData = new ArrayList&lt;HashMap&lt;String,String&gt;&gt;();        private LayoutInflater mInflater;            private TreeSet mSeparatorsSet = new TreeSet();        public MyCustomAdapter() {            mInflater = (LayoutInflater)getSystemService(Context.LAYOUT_INFLATER_SERVICE);        }        public void addItem(final String header, final String message) {            HashMap&lt;String,String&gt; item = new HashMap&lt;String,String&gt;();            item.put(LINE_1, header);            item.put(LINE_2, message);            mData.add(item);            notifyDataSetChanged();        }        public void addImageItem() {            HashMap&lt;String,String&gt; item = new HashMap&lt;String,String&gt;();            item.put(LINE_1, """");            item.put(LINE_2, """");            mData.add(item);            mSeparatorsSet.add(mData.size() - 1);            notifyDataSetChanged();        }        @Override        public int getItemViewType(int position) {            return mSeparatorsSet.contains(position) ? TYPE_SEPARATOR : TYPE_ITEM;        }        @Override        public int getViewTypeCount() {            return TYPE_MAX_COUNT;        }        public int getCount() {            return mData.size();        }        public Object getItem(int position) {            return mData.get(position);        }        public long getItemId(int position) {            return position;        }        public View getView(int position, View convertView, ViewGroup parent) {            ViewHolder vh = null;            int type = getItemViewType(position);            System.out.println(""getView "" + position + "" "" + convertView + "" type = "" + type);            if (convertView == null) {                vh = new ViewHolder();                switch (type) {                    case TYPE_ITEM:                        convertView = mInflater.inflate(R.layout.instructions_two_row, null);                        vh.header = (TextView) convertView.findViewById(R.id.instructions_header);                        vh.message = (TextView) convertView.findViewById(R.id.instructions_message);                        vh.header.setText((CharSequence) mData.get(position).get(LINE_1));                        vh.message.setText((CharSequence) mData.get(position).get(LINE_2));                        break;                    case TYPE_SEPARATOR:                        convertView = mInflater.inflate(R.layout.instructions_image, null);                        vh.imageView = (ImageView) convertView.findViewById(R.id.instuct_image);                        vh.imageView.setImageDrawable(getResources().getDrawable(R.drawable.instructions));                        break;                }                convertView.setTag(vh);            }            else {                vh = (ViewHolder) convertView.getTag();            }                       return convertView;        }       }    public static class ViewHolder {        public TextView header;        public TextView message;        public ImageView imageView;    }</code></pre><p>Thanks for the help all!</p>","432209","","","","","2011-02-05 01:38:58","BaseAdapter in ListActivity isn't displaying the correct items","<java><android><adapter><listactivity>","1","0","","",""
"4904551","1","4904795","","2011-02-05 01:37:52","1","723","<p>I have a LinearLayout A which is set inside onCreate() method by setContentView(), However i am creating a PopUp at runtime in same activity which is also a LinearLayout B, PopUp placed just bottom of the screen/activity, I want to to disable the background screen so that no touch/tap/click work.</p><p>How can i do that. </p><p>Thanks</p>","591418","","","","","2011-02-05 02:45:07","How to disable background screen","<android>","1","0","","",""
"4904560","1","","","2011-02-05 01:39:47","10","13473","<p>I am new android developer and I was wondering where could I get good tutorial videos for android. I tried Youtube and it does help but the videos over there are so sparse that there is no continuity. I was wondering if there were any video tutorials for android in a systematic manner, or if there is a site where developers post android videos...</p>","590849","","244296","","2011-02-05 03:30:45","2013-11-29 03:01:14","Where can I find Android video tutorials?","<android>","2","4","4","2012-01-12 18:15:54",""
"4904603","1","4905049","","2011-02-05 01:50:27","1","2540","<p>I need to add an alerting system to my application. When some data is read i need to alert the user of the data. I need a dialog to pop up letting the user know the time it occurred and tell them some other stuff. The user needs to click ok and that is it. Just to bring their attention to something. <strong>I need it to make noise and vibrate.</strong> I was looking into notifications and alertdialogs. AlertDialog seems to be what i want, however, i do not see anything about sounds and vibrations in the documentation for alertdialog. <strong>Is there noise and vibration for alertdialog?</strong> Or is there another way for me to do this with sounds and vibration? I need the window to stay active until the user presses ok.</p><p>Thanks!</p>","427763","","427763","","2011-02-05 02:53:24","2014-04-09 11:32:31","android alert with sound, vibration","<android><notifications><alertdialog>","2","2","4","",""
"4904641","1","4908570","","2011-02-05 01:58:45","4","928","<p>So Android 3.0 (honeycomb) is out now and <a href=""http://developer.android.com/sdk/android-3.0-highlights.html"" rel=""nofollow"">boasts</a> some kind of new hardware-accelerated 3D graphics engine called Renderscript. </p><blockquote>  <p><strong>Renderscript 3D graphics engine</strong></p>    <p>Renderscript is a runtime 3D framework that provides both an API for building 3D scenes as well as a special, platform-independent shader language for maximum performance. Using Renderscript, you can accelerate graphics operations and data processing. Renderscript is an ideal way to create high-performance 3D effects for applications, wallpapers, carousels, and more.</p></blockquote><p>And according to this blog <a href=""http://www.inter-fuser.com/2009/11/android-renderscript-more-info-and.html"" rel=""nofollow"">post</a> dating back from 2009, this graphics engine could already be found used in a class named Fountain (even before honeycomb). This last clue was helpful to me, because now I can easily find that <a href=""http://www.andrada-dev.org/android-sdk-mac_x86/samples/android-Honeycomb/RenderScript/Fountain/src/com/android/fountain/"" rel=""nofollow"">class name</a> in the Honeycomb code.  </p><p>Can any of you supply any more insights into Renderscript? and ways to learn more about how to use it? Now that this has become a public api, I'm assuming that the people in-the-know may be able to get the permission to freely talk about it (I hope). </p>","320111","","750987","","2011-05-29 06:47:12","2011-05-29 06:47:12","Now that we have Honeycomb, what is RenderScript?","<android><3d><android-3.0-honeycomb><renderscript>","2","0","","",""
"4904654","1","4904768","","2011-02-05 02:02:40","0","2066","<p>First off, this is not aimed at perpetuating bloatware and other bad practices.  I know many will say ""don't do that"" but I promise to respect users.</p><p>I am building an app where I would like a service to run indefinitely.  A couple questions:</p><ol><li><p>Are services listed in Advanced Task Killer? Or just Activities?</p></li><li><p>What's with the services that are always running (Settings -> Apps -> Running Services) like Skype, Swype, etc?  I realize Skype could be a process with higher permissions than any Market apps (like packaged into kernel by Verizon or HTC), but Swype was something I installed (Beta for Incredible).  So how does that manage to always run in the background?  Furthermore - these items are not listed by Advanced Task Killer.</p></li><li><p>How does Pandora work.  It keeps running even when you Task Kill it?  Furthermore it's not re-launching itself because the music keeps playing smoothly.  </p></li></ol><p>Ideally I would like to build a Pandora-esque app where the users explicity hit the OFF button, but it will survive trigger happy task killers like myself.  This would be a feature users are aware of / would agree to.</p>","569246","","","","","2011-02-05 02:35:02","Service that survives Task Killers like Pandora / How do Services actually work?","<android><service><background><task><long-running-processes>","1","0","","",""
"4904660","1","4904927","","2011-02-05 02:03:35","0","2049","<p>I'm trying to load an image from the web.  The code I have so far is as follows: </p><pre>Resources res = getResources();InputStream is = (InputStream) new URL(url).getContent();BitmapDrawable bitmapDrawable = new BitmapDrawable(res, is); // Error: The constructor BitmapDrawable(Resources, InputStream) is undefined</pre><p>The last line produces an error as if the constructor doesn't exist.  However, the documentation says the following:</p><hr><p>BitmapDrawable(InputStream is)This constructor is deprecated. Use BitmapDrawable(Resources, java.io.InputStream) to ensure that the drawable has correctly set its target density.</p><p>BitmapDrawable(Resources res, InputStream is)Create a drawable by decoding a bitmap from the given input stream.</p><hr><p>So, I'm at a loss.  Either this should work and I've got something set up wrong or I need to find another way to load the image from the web.  Does anyone know why this code doesn't compile or suggest a better way to load the image (or both)?  </p>","405821","","","","","2011-02-05 03:28:07","Android BitmapDrawable Constructor Undefined","<android><image><bitmap><inputstream><drawable>","1","1","","",""
"4904685","1","","","2011-02-05 02:11:24","0","2414","<p>since, im trying to learn the code. I decided to make one of those soundboards. Since, i like having them on my phone. I've been googling for he source codes of these.  I've found one main source code of a soundboard project. And, it seems this is really the main one out there that everyone else talks about. Then, I wanted to learn how to set a sound on the soundboard as a ringtone, and notification.  Ive been googling for hours and running into the same codes that dont work for me. I can't figure out the codes to set a sound as a ringtone, and or anything else. I've even tried from scratch with no luck. </p><p>I can't find anything else on this topic. please help me, and im all googled out just to find the same information. </p><p>i want to be able to program a soundboard to set a sound as a ringtone or notification in android/java. </p><p>thanks.</p><p>i guess i should put in some code i suppose. :) - i know this is simple, but its giving me such a hard time, and id really like to know this part. the menu does come up, but its not saving it to the sdcard file. i just have no clue whats happening here in java/android. im a php guy, ty for all help</p><pre><code>            Button btn = (Button) findViewById(R.id.sound1);            registerForContextMenu(btn);        }        @Override        public void onCreateContextMenu(ContextMenu menu, View v,ContextMenuInfo menuInfo) {        super.onCreateContextMenu(menu, v, menuInfo);            menu.setHeaderTitle(""Set as..."");            menu.add(0, v.getId(), 0, ""Ringtone"");            menu.add(0, v.getId(), 0, ""Notification"");        }        @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){            Toast.makeText(this, ""Ringtone Saved"", Toast.LENGTH_SHORT).show();        }        public void function2(int id){            Toast.makeText(this, ""Notification Saved"", Toast.LENGTH_SHORT).show();        }    boolean saveas(int sound1){         byte[] buffer=null;         InputStream fIn = getBaseContext().getResources().openRawResource(sound1);         int size=36462;         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=""sound1.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, ""sound1"");         values.put(MediaStore.MediaColumns.MIME_TYPE, ""audio/ogg"");         values.put(MediaStore.Audio.Media.ARTIST, ""we"");         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);         //Insert it into the database         this.getContentResolver().insert(MediaStore.Audio.Media.getContentUriForPath(k.getAbsolutePath()), values);         return false;}</code></pre><p>};</p>","604037","","604037","","2011-02-05 04:39:37","2012-03-29 20:16:26","set sound as ringtone or notification in android app","<android><notifications><click><long-integer><ringtone>","2","0","","",""
"4904842","1","","","2011-02-05 03:01:12","2","3496","<p>I want to make an Htttp Connection Here is my code</p><pre><code>try{HttpClient client = new DefaultHttpClient();HttpPost httpMethod = new HttpPost(""http://www.google.co.in/"");String requestBody = ""some text"";HttpMethod.setEntity(new StringEntity(requestBody));HttpResponse response = client.execute(httpMethod);textView.setText(response.getStatusLine().toString());}</code></pre><p>But i m unable to and get the ""HTTP/1.0 405 Method not Allowed"" errorI will be thankfull your help</p>","582788","","1845869","","2012-11-30 02:08:19","2012-11-30 02:08:19","Error HTTP/1.0 405 Method not Allowed","<android><http-status-code-405>","2","0","1","",""
"4904863","1","4906822","","2011-02-05 03:07:00","3","1287","<p>My Application has an Activity for the UI and a Service for background polling fun.  Seems like standard fare.</p><ol><li><p>Can AlarmManager trigger the Service Intent without Activity OnCreate being called?</p></li><li><p>Is there any benefit to putting the Activity &amp; Service into different Applications?  Would this create 2 apk's and make it impossible to put into Market as one app?  Can you put 2 applications into one manifest somehow?</p></li><li><p>Regarding communication between the two:</p></li></ol><p>-If Activity &amp; Service are part of the same Application - can't I just store common objects (like User object) at the Application scope for the 2 to share?  </p><p>-It seems like I don't even need to bother with AIDL - the two could just have weak references to each other at the Application scope as well - and they can call methods on each other that way?  Or should they pub/sub each other with some kind of Observer Pattern or BroadcastListener thing? </p>","569246","","60117","","2011-12-29 23:26:23","2011-12-29 23:26:23","Best Practices for developing an Activity with a background Service","<android><manifest><background-process><alarmmanager>","1","0","","",""
"4904947","1","","","2011-02-05 03:27:50","1","1844","<p>I'm attempting to build a layout programmatically.</p><p>This layout is dynamic. Based on the data read from a database, it could look different every time.</p><p>I have a LinearLayout with its orientation set to vertical.</p><p>I want to fit as many TextViews with text (the data from database) as I can on a ""row"".</p><p>What I'm doing is building LinearLayouts that are the rows.  These LinearLayouts are populated with TextViews.  I build the TextView, set the text, and then check the width to see if it will fit on this row (by subtracting the sum of all TextView widths from the screen width and see if the new TextView will fit).  If not, I create a new LinearLayout and start adding TextViews to that one.</p><p>The problem is myTextView.getWidth() and myTextView.getMeasuredWidth() both return 0.</p><p>Why?  How can I get the width of the TextView?</p>","406790","","","","","2011-02-05 03:55:42","Programmatically getting the width of a TextView","<android><view><textview>","1","1","","",""
"4905027","1","4905044","","2011-02-05 03:54:43","2","1387","<p>I have a question regarding the recommended/best practice for managing a large array of bitmaps. (It's a flipbook type app where the user goes through and creates new pages...like a virtual pile of sticky notes k?)Previously, I had an arraylist of objects that held bitmaps, (good performance) but I quickly ran into Out of Memory issues with the dalvik vm's heap limit.</p><p>I later tried storing the bitmaps not displayed on the screen to the sd card as cache and then grabbed them on demand, but I found this to be significantly slower on my phone than the previous method.</p><p>What is the best plan of attack for this problem?</p>","413488","","","","","2012-04-10 09:53:54","Efficient way to manage large array of bitmaps android","<android><performance><bitmap><storage><dalvik>","3","0","1","",""
"4905043","1","4932788","","2011-02-05 04:00:55","0","394","<p>I've got a strange problem ... </p><p>My service that uses HTTPS via HttpClient almost always fails on Gingerbread when the screen is turned off <em>and</em> USB/power disconnected. The error is javax.net.ssl.SSLPeerUnverifiedException.</p><p>Never saw this behaviour with Froyo or older, and of course can't repro in emulator as can't disconnect power or turn off screen.</p><p>Also, seems to be only failing when using mobile data.  Wifi (set to always on) seems to work fine.</p><p>My phone is a CyanogenMod7/HTC Hero.  This is the only gingerbread I have available to test on.  Works fine on friends Froyo and Eclair</p><p>Have tried extending timeouts with</p><pre><code>HttpConnectionParams.setConnectionTimeout(httpClientParams,3*60*1000);HttpConnectionParams.setSoTimeout(httpClientParams,3*60*1000);</code></pre><p>but didn't help.</p><p>feels like gingerbread or CM7 has added some sleep low power stuff that screws with me?</p><p>any ideas?</p>","252871","","","","","2011-02-08 12:07:10","HTTPS via HttpClient during a Service failing on gingerbread","<android><httpclient>","1","0","","",""
"4905050","1","","","2011-02-05 04:02:14","0","1178","<p>I see a lot of applications that do SMS popups. Why can't I get my app working? If a SMS message comes in, I would like it to popup on the screen.</p><p>Here's my code:</p><pre><code>public class NotifySMSReceived extends Activity {    private static final String LOG_TAG = ""SMSReceiver"";    public static final int NOTIFICATION_ID_RECEIVED = 0x1221;    static final String ACTION = ""android.provider.Telephony.SMS_RECEIVED"";    protected void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        IntentFilter filter = new IntentFilter(ACTION);        this.registerReceiver(mReceivedSMSReceiver, filter);    }    private void displayAlert()    {        AlertDialog.Builder builder = new AlertDialog.Builder(this);        builder.setMessage(""Are you sure you want to exit?"").setCancelable(                false).setPositiveButton(""Yes"",                new DialogInterface.OnClickListener() {                    public void onClick(DialogInterface dialog, int id) {                        dialog.cancel();                    }                }).setNegativeButton(""No"",                new DialogInterface.OnClickListener() {                    public void onClick(DialogInterface dialog, int id) {                        dialog.cancel();                    }                });        AlertDialog alert = builder.create();        alert.show();    }    private final BroadcastReceiver mReceivedSMSReceiver = new BroadcastReceiver() {        @Override        public void onReceive(Context context, Intent intent) {            String action = intent.getAction();            if (ACTION.equals(action))             {                //your SMS processing code                displayAlert();            }        }    };    }</code></pre>","589450","","457982","","2011-02-05 04:54:57","2011-05-24 18:05:29","SMS Popup: AlertDialog does not show as I get a SMS message","<android><sms><alertdialog>","1","1","","",""
"4905075","1","","","2011-02-05 04:10:22","4","5760","<p>Is there a good way to avoid the ""host is not resolved"" error that crashes an app? Some sort of a way to try connecting to a host ( like a URL ) and see if it's even valid?</p>","450407","","168868","","2013-12-06 21:49:50","2014-01-27 10:43:42","How to check if URL is valid in Android","<android><url><url-validation>","3","1","1","",""
"4905088","1","4905417","","2011-02-05 04:12:54","4","6958","<p>I am trying to show an AlertDialog when an item in a ListActivity is clicked. My app displays the ListActivity under a tab of a TabActivity, and the AlertDialog shows up no problem. The ListActivity (called FavouritesActivity) is pretty much straight from the Android docs, with this setting:</p><pre><code>    lv.setOnItemClickListener(new OnItemClickListener() {            public void onItemClick(AdapterView&lt;?&gt; parent, View view,                                    int position, long id) {                //... code to set the strings station, number, route, and direction                FavouritesActivity.this.confirmSend(position);            }        });</code></pre><p>and then </p><pre><code>public void confirmSend(final int position) {    AlertDialog.Builder builder = new AlertDialog.Builder(this);    builder.setMessage(""Are you sure?"")        .setCancelable(true)        .setPositiveButton(""Yes"", new DialogInterface.OnClickListener() {                public void onClick(DialogInterface dialog, int id) {                    //... some code to run here                                                                              }            })        .setNegativeButton(""No"", new DialogInterface.OnClickListener() {                public void onClick(DialogInterface dialog, int id) {                    dialog.cancel();                }            });    AlertDialog alert = builder.create();    alert.show();}</code></pre><p>However, in a second tab of the TabActivity, I have an ActivityGroup that uses the LocalActivityManager to start another ListActivity, like so (again, pretty much unchanged from a tutorial on nesting lists under tabs online):</p><pre><code>public class MyGroupActivity extends ActivityGroup {// Keep this in a static variable to make it accessible for all the nesten activities, lets them manipulate the view                                      public static MyGroupActivity group;// Need to keep track of the history if you want the back-button to work properly, don't use this if your activities requires a lot of memory.            private ArrayList&lt;View&gt; history;@Overrideprotected void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    this.history = new ArrayList&lt;View&gt;();    group = this;    // Start the root activity withing the group and get its view                                                                                             View view = getLocalActivityManager().startActivity(""FirstListActivity"", new                                                        Intent(this,FirstListActivity.class)                                                        .addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP))        .getDecorView();    // Replace the view of this ActivityGroup                                                                                                                 replaceView(view);}public void replaceView(View v) {    // Changes this Groups View to the new View.                                                                                                              setContentView(v);}</code></pre><p>The FirstListActivity here is a ListActivity that is the first in a series. The user picks an item and is presented with another ListActivity, with code like this:</p><pre><code>    lv.setOnItemClickListener(new OnItemClickListener() {            public void onItemClick(AdapterView&lt;?&gt; parent, View view,                                    int position, long id) {                Intent intent = new Intent();                intent.setClass(FirstListActivity.this, TheNextListActivity.class);                                                                                                                                // Create View using the Group Activity's LocalActivityManager                                                                                            View newview = MyGroupActivity.group.getLocalActivityManager()                    .startActivity(""show_routes"", intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP))                    .getDecorView();                // And replace the view                                                                                                                                   MyGroupActivity.group.replaceView(newview);            }        });</code></pre><p>The last ListActivity in this series has EXACTLY the same onItemClick listener and associated confirmSend function as the first ListActivity example I showed (the one which does work), but now when the user clicks on an item, the AlertDialog fails to show and the application stops unexpectedly, with this debug output:</p><pre><code>W/WindowManager(  570): Attempted to add application window with unknown token android.os.BinderProxy@4373af30.  Aborting.D/AndroidRuntime( 1953): Shutting down VMW/dalvikvm( 1953): threadid=3: thread exiting with uncaught exception (group=0x4000fe70)E/AndroidRuntime( 1953): Uncaught handler: thread main exiting due to uncaught exceptionE/AndroidRuntime( 1953): android.view.WindowManager$BadTokenException: Unable to add window -- token android.app.LocalActivityManager$LocalActivityRecord@43750f98 is not valid; is your activity running?E/AndroidRuntime( 1953):    at android.view.ViewRoot.setView(ViewRoot.java:425)E/AndroidRuntime( 1953):    at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:178)E/AndroidRuntime( 1953):    at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:91)E/AndroidRuntime( 1953):    at android.view.Window$LocalWindowManager.addView(Window.java:392)E/AndroidRuntime( 1953):    at android.app.Dialog.show(Dialog.java:231)E/AndroidRuntime( 1953):    at com.ttcsms.LastListActivity.confirmSend(LastListActivity.java:119)E/AndroidRuntime( 1953):    at com.ttcsms.LastListActivity$1.onItemClick(LastListActivity.java:66)E/AndroidRuntime( 1953):    at android.widget.AdapterView.performItemClick(AdapterView.java:283)E/AndroidRuntime( 1953):    at android.widget.ListView.performItemClick(ListView.java:3132)E/AndroidRuntime( 1953):    at android.widget.AbsListView$PerformClick.run(AbsListView.java:1620)E/AndroidRuntime( 1953):    at android.os.Handler.handleCallback(Handler.java:587)E/AndroidRuntime( 1953):    at android.os.Handler.dispatchMessage(Handler.java:92)E/AndroidRuntime( 1953):    at android.os.Looper.loop(Looper.java:123)E/AndroidRuntime( 1953):    at android.app.ActivityThread.main(ActivityThread.java:3948)E/AndroidRuntime( 1953):    at java.lang.reflect.Method.invokeNative(Native Method)E/AndroidRuntime( 1953):    at java.lang.reflect.Method.invoke(Method.java:521)E/AndroidRuntime( 1953):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:782)E/AndroidRuntime( 1953):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)E/AndroidRuntime( 1953):    at dalvik.system.NativeStart.main(Native Method)I/Process (  570): Sending signal. PID: 1953 SIG: 3I/dalvikvm( 1953): threadid=7: reacting to signal 3I/dalvikvm( 1953): Wrote stack trace to '/data/anr/traces.txt'I/Process ( 1953): Sending signal. PID: 1953 SIG: 9I/ActivityManager(  570): Process com.ttcsms (pid 1953) has died.</code></pre><p>What is the difference between these two routes to the AlertDialog that cause this failure? It seems to have something to do with the AlertDialog.Building(this) bit. When within the ActivityGroup, it's getting the wrong context or something. Every example I found online of this error was solved by changing between ""this"" and ""getApplicationContext()"", but in this case neither of those work. I tried other variations on getting the context but as I mostly guessing at random I thought it would be better to ask here for advice. What context should I be passing, or, what else is wrong?</p>","604084","","","","","2013-05-07 12:27:59","AlertDialog cannot be shown from ListActivity within ActivityGroup","<android><listactivity><alertdialog><activitygroup>","4","0","4","",""
"4905119","1","","","2011-02-05 04:20:24","0","160","<pre><code>notificationManager = (NotificationManager) ctx.getSystemService(Context.NOTIFICATION_SERVICE);note = new Notification(android.R.drawable.btn_star_big_on, ""Ticker Text"", System.currentTimeMillis() );note.defaults |= Notification.DEFAULT_SOUND;note.defaults |= Notification.DEFAULT_VIBRATE;note.defaults |= Notification.FLAG_AUTO_CANCEL;Intent notificationIntent = new Intent(ctx, com.mindfsck.PossAff.MainActivity.class);//Intent notificationIntent = new Intent();notificationIntent.setAction(Intent.ACTION_MAIN);notificationIntent = notificationIntent.setFlags(Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED);contentIntent = PendingIntent.getActivity(ctx, 0, notificationIntent, 0);note.setLatestEventInfo(ctx, ""contentTitle"", ""contentText"", contentIntent);note.number = 1;  //Just created notification so number=1. Remove this line if you dont want numbersnotificationManager.notify(notif_ID,note);</code></pre><p>I have a notification with a intent. When you click the notification it launches the activity however in MainActivity I have no idea how to consume the intent. I also assume once I know how to read the Intent in my Main Activity I can use putExtra() to pass data.</p><p>Thanks</p>","97464","","","","","2012-10-11 10:40:27","I have a notification which has a attached intent, how do I pass data to the intents activity?","<android>","2","0","","",""
"4905143","1","","","2011-02-05 04:26:07","7","2090","<p>I am developing an Android app and I currently have about 8 layout xml files in the <code>layout</code> folder.  The need for organizing this folder is increasing with each additional layout resource file. However, when I create a folder inside of the layout folder and move a resource to it via the refactor operation, it breaks my project.</p><p>For example, my resource is being refernced here:</p><pre><code>setContentView(R.layout.login);</code></pre><p>After moving the <strong>login.xml</strong> file to a newly created folder called <code>""test""</code>, it breaks my build.</p><p>If I update the reference to:</p><pre><code>setContentView(R.layout.test.login);</code></pre><p>It still doesn't compile.</p><p>Any help would be greatly appreciated.</p>","600925","","469983","","2012-06-25 17:13:26","2012-10-09 03:27:29","Android layout folder organization","<android>","2","0","6","",""
"4905182","1","4905276","","2011-02-05 04:39:43","6","5810","<p>The problem is not that the tests are failing, but that they simply do not run at all.That is to say, the console tells me they run, but I see absolutely no results from them at all.</p><p>Note that I 'have' remembered to annotate methods with @Test</p><p>Here's the code for the test class:</p><pre><code>package module.jakway.JournalEntry.test;import module.jakway.JournalEntry.Module_JournalEntry;import org.junit.After;import org.junit.AfterClass;import org.junit.Before;import org.junit.BeforeClass;import org.junit.Test;public class MainTest extends android.test.ActivityInstrumentationTestCase2&lt;Module_JournalEntry&gt;{    public MainTest(Class activityClass) {        super(""module.jakway.JournalEntry"", Module_JournalEntry.class);        // TODO Auto-generated constructor stub    }    @BeforeClass    public static void setUpBeforeClass() throws Exception {    }    @AfterClass    public static void tearDownAfterClass() throws Exception {    }    @Before    public void setUp() throws Exception {        super.setUp();        Module_JournalEntry journalentry = getActivity();        assertTrue(true);    }    @After    public void tearDown() throws Exception {    }    @Test    public void myTestCase()    {        assertTrue(false);    }}</code></pre><p>The project I'm testing is named Module_JournalEntry with package module.jakway.JournalEntry and Activity Module_JournalEntry.java</p><p>Here's the console output:</p><pre><code>[2011-02-04 20:37:10 - Module_JournalEntryTest] Performing android.test.InstrumentationTestRunner JUnit launch[2011-02-04 20:37:10 - Module_JournalEntryTest] Automatic Target Mode: using existing emulator 'emulator-5554' running compatible AVD 'my2.3Emulator'[2011-02-04 20:37:12 - Module_JournalEntryTest] Application already deployed. No need to reinstall.[2011-02-04 20:37:12 - Module_JournalEntryTest] Project dependency found, installing: Module_JournalEntry[2011-02-04 20:37:14 - Module_JournalEntry] Application already deployed. No need to reinstall.[2011-02-04 20:37:14 - Module_JournalEntryTest] Launching instrumentation android.test.InstrumentationTestRunner on device emulator-5554[2011-02-04 20:37:14 - Module_JournalEntryTest] Collecting test information[2011-02-04 20:37:17 - Module_JournalEntryTest] Sending test information to Eclipse[2011-02-04 20:37:17 - Module_JournalEntryTest] Running tests...[2011-02-04 20:37:19 - Module_JournalEntryTest] Test run finished</code></pre><p>and the logcat output:</p><pre><code>02-04 20:37:10.266: DEBUG/AndroidRuntime(524): &gt;&gt;&gt;&gt;&gt;&gt; AndroidRuntime START com.android.internal.os.RuntimeInit &lt;&lt;&lt;&lt;&lt;&lt;02-04 20:37:10.266: DEBUG/AndroidRuntime(524): CheckJNI is ON02-04 20:37:11.236: DEBUG/AndroidRuntime(524): Calling main entry com.android.commands.pm.Pm02-04 20:37:11.316: DEBUG/AndroidRuntime(524): Shutting down VM02-04 20:37:11.336: INFO/AndroidRuntime(524): NOTE: attach of thread 'Binder Thread #3' failed02-04 20:37:11.346: DEBUG/dalvikvm(524): GC_CONCURRENT freed 102K, 71% free 297K/1024K, external 0K/0K, paused 3ms+8ms02-04 20:37:11.346: DEBUG/jdwp(524): Got wake-up signal, bailing out of select02-04 20:37:11.346: DEBUG/dalvikvm(524): Debugger has detached; object registry had 1 entries02-04 20:37:12.316: DEBUG/AndroidRuntime(534): &gt;&gt;&gt;&gt;&gt;&gt; AndroidRuntime START com.android.internal.os.RuntimeInit &lt;&lt;&lt;&lt;&lt;&lt;02-04 20:37:12.316: DEBUG/AndroidRuntime(534): CheckJNI is ON02-04 20:37:13.136: DEBUG/AndroidRuntime(534): Calling main entry com.android.commands.pm.Pm02-04 20:37:13.186: DEBUG/AndroidRuntime(534): Shutting down VM02-04 20:37:13.216: INFO/AndroidRuntime(534): NOTE: attach of thread 'Binder Thread #3' failed02-04 20:37:13.216: DEBUG/dalvikvm(534): GC_CONCURRENT freed 102K, 71% free 297K/1024K, external 0K/0K, paused 1ms+1ms02-04 20:37:13.216: DEBUG/dalvikvm(534): Debugger has detached; object registry had 1 entries02-04 20:37:14.256: DEBUG/AndroidRuntime(544): &gt;&gt;&gt;&gt;&gt;&gt; AndroidRuntime START com.android.internal.os.RuntimeInit &lt;&lt;&lt;&lt;&lt;&lt;02-04 20:37:14.256: DEBUG/AndroidRuntime(544): CheckJNI is ON02-04 20:37:15.126: DEBUG/AndroidRuntime(544): Calling main entry com.android.commands.am.Am02-04 20:37:15.176: INFO/ActivityManager(75): Force stopping package module.jakway.JournalEntry uid=1003502-04 20:37:15.206: INFO/ActivityManager(75): Start proc module.jakway.JournalEntry for added application module.jakway.JournalEntry: pid=552 uid=10035 gids={1015}02-04 20:37:15.876: WARN/TestGrouping(552): Invalid Package: '' could not be found or has no tests02-04 20:37:15.976: INFO/ActivityManager(75): Force stopping package module.jakway.JournalEntry uid=1003502-04 20:37:15.976: INFO/Process(75): Sending signal. PID: 552 SIG: 902-04 20:37:15.986: DEBUG/AndroidRuntime(544): Shutting down VM02-04 20:37:16.016: DEBUG/dalvikvm(544): GC_CONCURRENT freed 103K, 71% free 299K/1024K, external 0K/0K, paused 1ms+4ms02-04 20:37:16.036: INFO/AndroidRuntime(544): NOTE: attach of thread 'Binder Thread #3' failed02-04 20:37:16.046: DEBUG/jdwp(544): Got wake-up signal, bailing out of select02-04 20:37:16.046: DEBUG/dalvikvm(544): Debugger has detached; object registry had 1 entries02-04 20:37:16.656: DEBUG/AndroidRuntime(563): &gt;&gt;&gt;&gt;&gt;&gt; AndroidRuntime START com.android.internal.os.RuntimeInit &lt;&lt;&lt;&lt;&lt;&lt;02-04 20:37:16.665: DEBUG/AndroidRuntime(563): CheckJNI is ON02-04 20:37:17.646: DEBUG/AndroidRuntime(563): Calling main entry com.android.commands.am.Am02-04 20:37:17.716: INFO/ActivityManager(75): Force stopping package module.jakway.JournalEntry uid=1003502-04 20:37:17.746: INFO/ActivityManager(75): Start proc module.jakway.JournalEntry for added application module.jakway.JournalEntry: pid=572 uid=10035 gids={1015}02-04 20:37:18.606: WARN/TestGrouping(572): Invalid Package: '' could not be found or has no tests02-04 20:37:18.826: INFO/ActivityManager(75): Force stopping package module.jakway.JournalEntry uid=1003502-04 20:37:18.826: INFO/Process(75): Sending signal. PID: 572 SIG: 902-04 20:37:18.846: DEBUG/AndroidRuntime(563): Shutting down VM02-04 20:37:18.906: INFO/AndroidRuntime(563): NOTE: attach of thread 'Binder Thread #4' failed02-04 20:37:18.916: DEBUG/dalvikvm(563): GC_CONCURRENT freed 103K, 71% free 298K/1024K, external 0K/0K, paused 2ms+28ms02-04 20:37:18.916: DEBUG/jdwp(563): Got wake-up signal, bailing out of select02-04 20:37:18.926: DEBUG/dalvikvm(563): Debugger has detached; object registry had 1 entries</code></pre><p>Thanks very much!</p>","450153","","","","","2014-02-27 23:07:31","android JUnit Tests not running","<java><android><junit>","3","0","1","",""
"4905269","1","","","2011-02-05 05:13:19","0","303","<p>So I have a ViewFlipper that links to a .xml file and when I shake it, it switches images, simple. I want it to switch images inside the java. how would I go about this?here is my main Java</p><pre><code>package www.straightapp.com.shakerTest.html;import android.app.Activity;import android.os.Bundle;import android.util.Log;import android.widget.ViewFlipper;public  class ShakerTest extends Activityimplements Shaker.Callback {private Shaker shaker=null;ViewFlipper flipper;@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    flipper=(ViewFlipper)findViewById(R.id.flipper);    shaker=new Shaker(this, 1.25d, 500, this);}@Overridepublic void onDestroy() {    super.onDestroy();    shaker.close();}public void shakingStarted() {    Log.d(""ShakerDemo"", ""Shaking started!"");    flipper.showNext();}public void shakingStopped() {    Log.d(""ShakerDemo"", ""Shaking stopped!"");}}</code></pre><p>thanks-Chistian</p>","424421","","424421","","2011-02-05 05:34:25","2011-02-06 04:58:50","shaking between images inside Java?","<android><eclipse><viewflipper>","3","2","","",""
"4905315","1","","","2011-02-05 05:31:49","18","24179","<p>I want to make an Http Connection to my own servlet. Here is my code:</p><pre><code>try{    HttpClient client = new DefaultHttpClient();    HttpPost httpMethod = new HttpPost(""http://localhost:8080/getHeader/HeaderServlet"");    httppost.setHeader(""Content-Type"", ""application/x-www-form-urlencoded"");     ResponseHandler&lt;String&gt; responseHandler = new BasicResponseHandler();    String response = client.execute(httppost, responseHandler);    String result = response.toString();}</code></pre><p>But i'm unable to, and I get the error:</p><pre><code>org.apache.http.conn.HttpHostConnectionException:Connection to http://localhost:8080 refused</code></pre><p>I will be thankful your help</p>","582788","","496830","","2011-02-05 05:48:34","2013-12-11 12:03:18","error connection refused","<android>","3","0","3","",""
"4905366","1","4906660","","2011-02-05 05:50:13","0","160","<p>I am writing an android application and I need to have two classes use the same KeyguardLock object but I am experiencing extreme difficulty in sharing (via serialization) that object.  I have tried using the <a href=""http://stackoverflow.com/questions/4118751/how-do-i-serialize-an-object-and-save-it-to-a-file-in-android"">serialization stackoverflow example link</a> but that didn't work at all.  I get a ""not serializable"" IO exception trying to save the object.   I have also tried using JSONObject. </p><p>Any ideas?  Has anyone run into a similar problem? </p>","586907","","","","","2011-02-05 16:45:09","Serialize KeyguardLock","<java><android><serialization>","1","1","","",""
"4905370","1","4905403","","2011-02-05 05:51:19","32","36068","<p>I am confused about the difference between LinearLayout, RelativeLayout, and AbsoluteLayout. Could someone please tell me the exact differences between them? </p>","565106","","403455","","2012-08-14 05:04:37","2014-02-05 17:04:54","What are the differences between LinearLayout, RelativeLayout, and AbsoluteLayout?","<android><android-layout><android-linearlayout><relativelayout><absolutelayout>","4","0","9","",""
"4905377","1","","","2011-02-05 05:52:37","0","518","<p>I m connect to my local server throgh HttpPost classBut getting the </p><p>""HttpResponseException: Internal Server Error""</p>","582788","","759866","","2014-02-20 17:51:06","2014-02-20 17:51:06","Error HttpResponseException: Internal Server Error","<android>","1","1","","",""
"4905385","1","4905423","","2011-02-05 05:55:14","2","14408","<p>I'm trying to get the user's current location via GPS capability,</p><p>Wrote a simple class that implements <code>LocationListener</code></p><pre><code>public class LocationManagerHelper implements LocationListener {    private static double latitude;    private static double longitude;    @Override    public void onLocationChanged(Location loc) {        latitude = loc.getLatitude();        longitude = loc.getLongitude();    }    @Override    public void onProviderDisabled(String provider) { }    @Override    public void onProviderEnabled(String provider) { }    @Override    public void onStatusChanged(String provider, int status, Bundle extras) {        // TODO Auto-generated method stub    }    public static double getLatitude() {        return latitude;    }    public static double getLongitude() {        return longitude;    }}</code></pre><p>and from a simple Action I'm accessing these longitude and latitude values</p><pre><code>public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    /** create a TextView and write Hello World! */    TextView tv = new TextView(this);    LocationManager mlocManager =                     (LocationManager) getSystemService(Context.LOCATION_SERVICE);    LocationListener mlocListener = new LocationManagerHelper();    mlocManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0,            mlocListener);    if (mlocManager.isProviderEnabled(LocationManager.GPS_PROVIDER)) {            tv.append(""Latitude:- "" + LocationManagerHelper.getLatitude()                    + '\n');            tv.append(""Longitude:- "" + LocationManagerHelper.getLongitude()                    + '\n');    } else {        tv.setText(""GPS is not turned on..."");    }    /** set the content view to the TextView */    setContentView(tv);</code></pre><p>But it always returns 0.0 as the result.Couldn't figure out the problem.</p>","87072","","213269","","2011-02-05 07:27:59","2012-06-15 15:39:59","Getting the current GPS location on Android","<java><android><gps><locationmanager><locationlistener>","5","0","7","",""
"4905421","1","","","2011-02-05 06:05:42","0","672","<p>When I run an ajax script client on the Android native browser to access a simple remote web service, I can see the service execute the incoming GET command but the returned response is never posted on the browser. The same script works fine on Firefox on a laptop. Are there restrictions by Android (I am using both 1.6 and 2.2) in returning such HTTP responses?Why this behavior?</p><p>Thanks</p>","586185","","","","","2011-02-05 06:05:42","Ajax and Android native browser","<android><browser><native>","0","2","","",""
"4905426","1","4905444","","2011-02-05 06:06:44","1","955","<p>First of all, here is a chunk of affected code:</p><pre><code>// (somewhere above, data is initialized as a String with a value)Pattern detailsPattern = Pattern.compile(""**this is a valid regex, omitted due to length**"", Pattern.DOTALL | Pattern.CASE_INSENSITIVE);Matcher detailsMatcher = detailsPattern.matcher(data);Log.i(""Scraper"", ""Initialized pattern and matcher, data length ""+data.length());boolean found = detailsMatcher.find();Log.i(""Scraper"", ""Found? ""+((found)?""yep"":""nope""));</code></pre><p>I omitted the regex inside Pattern.compile because it's very long, but I know it works with the given data set; or if it doesn't, it shoudn't break anything anyway.</p><p>The trouble is, I do get the feedback <code>I/Scraper(23773): Initialized pattern and matcher, data length 18861</code> but I never see the ""Found?"" line, it is just stuck on the <code>find()</code> call.</p><p>Is this a known Android bug? I've tried it over and over and just can't get it to work. Somehow, I think something over the past few days broke this because my app was working fine before, and I have in the past couple days received several comments of the app not working so it is clearly affecting other users as well.</p><p>How can I further debug this?</p>","47493","","","","","2011-02-05 23:24:23","Android: Matcher.find() never returns","<java><android>","3","3","","",""
"4905446","1","4910606","","2011-02-05 06:13:17","2","2913","<p>I can't get adb to recognize my device (ViewSonic ViewPad 7).</p><p>On my device under Settings/Applications/Development/ ""USB debugging"" is checked.</p><p>When I plug in my USB cable I see two ongoing items in the task bar: ""USB debugging connected"" and ""USB connected"".</p><p>However if I then go into my Mac' (Mac OS X 10.6.6) Terminal.app I can't find the device.</p><pre><code>$ adb devices* daemon not running. starting it now on port 5037 ** daemon started successfully *List of devices attached $ adb versionAndroid Debug Bridge version 1.0.26</code></pre><p>Anyone have any idea what else I can try?</p><p>EDIT, 2-5-2011:</p><p>For a little more background it seems that the same version of adb on an older Macbook running OS 10.6.5 IS able to detect my device. Both versions of adb are 1.0.26.</p>","160985","","160985","","2011-02-05 18:29:02","2012-09-04 18:44:36","adb can't find ViewSonic ViewPad 7 on Mac OS X","<android><terminal><adb>","2","2","2","",""
"4905487","1","","","2011-02-05 06:24:21","1","791","<p>I am trying to compile Android (Froyo) from the source for my Nexus One. I pretty much followed all instructions from <a href=""http://forum.xda-developers.com/showthread.php?t=899674"" rel=""nofollow"">here</a>.</p><p>Though the instructions are for Gingerbread, I don't really see much of a difference for Froyo. After I do a ""make -j4"", the following error is thrown:</p><pre><code>Install: out/target/product/passion/system/lib/libmedia.sotarget SharedLib: libstagefright_foundation (out/target/product/passion/obj/SHARED_LIBRARIES/libstagefright_foundation_intermediates/LINKED/libstagefright_foundation.so)target SharedLib: libstagefright_color_conversion (out/target/product/passion/obj/SHARED_LIBRARIES/libstagefright_color_conversion_intermediates/LINKED/libstagefright_color_conversion.so)target SharedLib: libaudio (out/target/product/passion/obj/SHARED_LIBRARIES/libaudio_intermediates/LINKED/libaudio.so)target SharedLib: libaudiopolicy (out/target/product/passion/obj/SHARED_LIBRARIES/libaudiopolicy_intermediates/LINKED/libaudiopolicy.so)target SharedLib: libcameraservice (out/target/product/passion/obj/SHARED_LIBRARIES/libcameraservice_intermediates/LINKED/libcameraservice.so)prebuilt/darwin-x86/toolchain/arm-eabi-4.4.3/bin/../lib/gcc/arm-eabi/4.4.3/../../../../arm-eabi/bin/ld: out/target/product/passion/obj/SHARED_LIBRARIES/libcameraservice_intermediates/CameraService.o: in function android::CameraService::getCameraInfo(int, android::CameraInfo*):frameworks/base/services/camera/libcameraservice/CameraService.cpp:109: error: undefined reference to 'HAL_getCameraInfo'prebuilt/darwin-x86/toolchain/arm-eabi-4.4.3/bin/../lib/gcc/arm-eabi/4.4.3/../../../../arm-eabi/bin/ld: out/target/product/passion/obj/SHARED_LIBRARIES/libcameraservice_intermediates/CameraService.o: in function android::CameraService::CameraService():frameworks/base/services/camera/libcameraservice/CameraService.cpp:75: error: undefined reference to 'HAL_getNumberOfCameras'prebuilt/darwin-x86/toolchain/arm-eabi-4.4.3/bin/../lib/gcc/arm-eabi/4.4.3/../../../../arm-eabi/bin/ld: out/target/product/passion/obj/SHARED_LIBRARIES/libcameraservice_intermediates/CameraService.o: in function android::CameraService::CameraService():frameworks/base/services/camera/libcameraservice/CameraService.cpp:75: error: undefined reference to 'HAL_getNumberOfCameras'prebuilt/darwin-x86/toolchain/arm-eabi-4.4.3/bin/../lib/gcc/arm-eabi/4.4.3/../../../../arm-eabi/bin/ld: out/target/product/passion/obj/SHARED_LIBRARIES/libcameraservice_intermediates/CameraService.o: in function android::CameraService::connect(android::sp&lt;android::ICameraClient&gt; const&amp;, int):frameworks/base/services/camera/libcameraservice/CameraService.cpp:148: error: undefined reference to 'HAL_openCameraHardware'prebuilt/darwin-x86/toolchain/arm-eabi-4.4.3/bin/../lib/gcc/arm-eabi/4.4.3/../../../../arm-eabi/bin/ld: out/target/product/passion/obj/SHARED_LIBRARIES/libcameraservice_intermediates/CameraService.o: in function android::CameraService::connect(android::sp&lt;android::ICameraClient&gt; const&amp;, int):frameworks/base/services/camera/libcameraservice/CameraService.cpp:154: error: undefined reference to 'HAL_getCameraInfo'collect2: ld returned 1 exit statusmake: *** [out/target/product/passion/obj/SHARED_LIBRARIES/libcameraservice_intermediates/LINKED/libcameraservice.so] Error 1make: *** Waiting for unfinished jobs....Note: cts/tools/dx-tests/src/dxc/junit/opcodes/invokeinterface/jm/T_invokeinterface_1.java uses unchecked or unsafe operations.Note: Recompile with -Xlint:unchecked for details.compiling all jasmin (*.j)compiling all .cfh files into .class filesgenerating Main_*.java files reading from cts/tools/dx-tests writing to out/host/darwin-x86/obj/EXECUTABLES/dx-tests_intermediates/mainfilesusing java src:cts/tools/dx-tests/srcCollecting all junit tests...Time: 0.025OK (0 tests)</code></pre><p>Can someone please help me resolve this issue?</p>","184046","","","","","2011-11-13 04:41:59","Compilation error while playing around with Stock Android (Froyo)?","<android><build><compilation><android-source>","1","0","","",""
"4905523","1","","","2011-02-05 06:40:23","0","180","<p>I inserted edittext value in database,Please help me how to get all the datas in table show in a next activity, please help me. I use the following code for inserting:</p><p>private static final String DATABASE_CREATE = ""create table pill (id integer primary key autoincrement, ""    + ""med VARCHAR, "" + ""dose1 VARCHAR,""+""dose2 VARCHAR,""+""dose3 VARCHAR);"";</p><p>// ---insert data into the database---    public long insertData(String med, String dose1,String dose2,String dose3) {    ContentValues initialValues = new ContentValues();</p><pre><code>initialValues.put(Med, med);initialValues.put(Dose1, dose1);initialValues.put(Dose2, dose2);initialValues.put(Dose3, dose3);return db.insert(DATABASE_TABLE, null, initialValues);}</code></pre><p>med,dose1,dose2,dose3 are the value from the edittext which is in another class.</p>","555910","","","","","2011-02-05 06:44:32","how to view a datas in table in android","<android><sqlite><select><delete><insert>","1","0","","",""
"4905525","1","4905538","","2011-02-05 06:41:01","1","4797","<p>AlertDialog not showing send button. Below is the code. Please tell me what mistake I have made in my code.</p><pre><code>protected Dialog onCreateDialog(int id) {    final AlertDialog.Builder dialog = new AlertDialog.Builder(this);    dialog.setMessage(""Enter Holla message"");    EditText hollaMessage = new EditText(this);    dialog.setView(hollaMessage);    dialog.setCancelable(false);    dialog.setPositiveButton(""Send"", new DialogInterface.OnClickListener() {       public void onClick(DialogInterface dialog, int id) {          List result = new ArrayList();       }    });    dialog.setPositiveButton(""Cancel"", new DialogInterface.OnClickListener() {        public void onClick(DialogInterface dialog, int which) {            dismissDialog(0);        }    });    AlertDialog alert = dialog.create();    return alert;}</code></pre>","221846","","","","","2013-01-05 07:57:54","AlertDialog not showing two buttons","<android><alertdialog>","2","0","","",""
"4905534","1","4905570","","2011-02-05 06:46:04","0","467","<p>I know my question isn't formulated well.</p><p>I'm adding items to an ArrayList downloaded from JSON file and the ArrayList is passed to a ListView.</p><p><strong>So what is my problem?</strong></p><p>After displaying the data from the ArrayList i wan't to add new items to it so they can be show right after they are added. I managed to do this by setting the Adapter for the ListView again after the data is added.<br>Displaying the new items should look smooth but instead it looks very sluggish and i know it's not the right way to do this.</p><p>I've searched about this problem but couldn't manage to find anything, so for anyone answering<br><strong>Thanks in advance</strong>.</p>","494498","","","","","2011-02-05 07:24:13","Displaying ArrayList in ListView","<android>","1","0","1","",""
"4905599","1","4905979","","2011-02-05 07:03:11","3","4686","<p>I am intercepting sms messages with some information in them. Then in my SmsListener I'm creating notification to show in statusbar.Then, when user clicks on a notification I want</p><ol><li>Bring MainActivity to foreground (If such activity does not exist yet it should be created)</li><li>Pass to it data from the sms</li><li>Perform some ui changes basing on this data in this MainActivity</li></ol><p>My activity is defined as </p><pre><code>    &lt;activity        android:name="".MainActivity""        android:screenOrientation=""sensor""        android:label=""@string/app_name""        android:launchMode=""singleTask""/&gt;</code></pre><p>Activity is launched as</p><pre><code> Intent i = new Intent(); i.setClass(context, MainActivity.class); i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); context.startActivity(i);</code></pre><p>Also in my activity I have overridden method onNewActivity</p><pre><code> @Override public void onNewIntent(Intent intent){    super.onNewIntent(intent);    // I have data from broadcast in intent variable passed to this activity    processDataFromBroadcast(intent);}</code></pre><p>It works fine if the MainActivity already exists but if MainActivity does not exist it is started however onNewIntent was not called</p><p>Then I tried to invoke processDataFromBroadcast from onCreate: <code>processDataFromBroadcast(getIntent())</code>.First time data is passed correctly from my broadcast to the activity.However if MainActivity is sent to background and then again brought to foreground either onCreate or onNewIntent is called and processDataFromBroadcast is executed again with intent sent by broadcast and thus my MainActivity is updated with data from broadcast every-time the app is bringing to foreground - the latter is unwanted, how can I make my activity to forget this intent after first handling.<a href=""http://www.box.net/shared/si6krushrv"" rel=""nofollow"">Here is sample application.</a></p>","120574","","120574","","2011-02-06 11:22:48","2012-05-23 11:32:36","How to bring an Activity to foreground (or create if not existing)?","<android><activity><task><broadcast>","2","0","1","",""
"4905670","1","","","2011-02-05 07:22:26","1","2973","<p>please help me how to play song during call if we are in samecall both should listen that song, and call must be disconnectedautomatically once playing done...</p><p>present my application behaving like,if i call to anyone once call lifted song is playing but i am only hearing that song but i want to do other person also should listen that song.</p><p>but i found in one forum to do like : The closest thing you can do, is have the call set to speaker-phone and then play the voice over the speaker.sounds straight to the mic in a phone call then that would be done.</p><p>but that i didn't find in API.</p><p>please help me how to do if anyone knows this. </p>","533182","","","","","2011-11-18 09:39:22","Play song during call","<android>","1","0","0","",""
"4905682","1","","","2011-02-05 07:28:58","0","516","<p>I am trying to play a YouTube video using WebView. To do this I use the following code but it doesn't work for me. It works in system browser.</p><pre><code>&lt;html&gt;    &lt;head&gt;        &lt;style type=\""text/css\""&gt;             body{ background-color: transparent; color: white; }        &lt;/style&gt;    &lt;/head&gt;    &lt;body style=\""margin:0\""&gt;        &lt;embed id=\""yt\"" src=""  +'""'+youTubeDetails.getVideoUrl()+'""'+""type=\""application/x-shockwave-flash\"" width=\""%0.0f\"" height=\""%0.0f\""&gt;        &lt;/embed&gt;     &lt;/body&gt;&lt;/html&gt;</code></pre>","487219","","270","","2012-12-12 15:16:32","2012-12-12 15:16:32","Android WebView and YouTube","<android><video><webview><youtube>","1","0","","",""
"4905736","1","4905759","","2011-02-05 07:49:25","0","909","<p>Hello i am created Sms app witch shows me content of Inbox.I am using TextView but there is problem with screen.I can't see all sms but only sms of screen size.. I can't scroll down.How can i see all sms with scroll down / up? Or is it supported on TextView?Sorry for my english i am czech .Thanks</p><p>Source code:</p><pre><code>import android.app.Activity;import android.database.Cursor;import android.net.Uri;import android.os.Bundle;import android.widget.TextView;    public class Mynew extends Activity {      @Override      public void onCreate(Bundle savedInstanceState) {          super.onCreate(savedInstanceState);          TextView view = new TextView(this);          Uri uriSMSURI = Uri.parse(""content://sms/inbox"");          Cursor cur = getContentResolver().query(uriSMSURI, null, null, null, null);          String sms = """";          while (cur.moveToNext()) {              String address = cur.getString(cur.getColumnIndex(""address""));              String body = cur.getString(cur.getColumnIndexOrThrow(""body""));              sms += ""From :"" + address  + "" : "" + body+""\n"";                   }          view.setText(sms);          setContentView(view);      }    }</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""    &gt;&lt;TextView      android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:text=""@string/hello""    android:id=""@+id/row_entry""/&gt;/&gt;&lt;/LinearLayout&gt;</code></pre><p>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=""New.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="".Mynew""                  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-permission android:name=""android.permission.READ_SMS""&gt;&lt;/uses-permission&gt;&lt;/manifest&gt; </code></pre>","600468","","","","","2011-02-05 07:56:05","Sms Inbox - TextView","<android>","1","0","","",""
"4905743","1","7102780","","2011-02-05 07:51:11","11","21018","<p>I'm developing my first Android application, and I'm curious if there are any ""standard"" ways for executing privileged shell commands. I've only been able to find one way to do it, by executing su, and then appending my commands to stdin of the su process.</p><pre><code>DataOutputStream pOut = new DataOutputStream(p.getOutputStream());DataInputStream pIn = new DataInputStream(p.getInputStream());String rv = """";// su must exit before its output can be readpOut.writeBytes(cmd + ""\nexit\n"");pOut.flush();p.waitFor();while (pIn.available() &gt; 0)    rv += pIn.readLine() + ""\n"";</code></pre><p>I've read about wrapping privileged (superuser) calls up in JNI: is this possible? If so, how would one go about accomplishing it? Other than that, are there any other ways of calling privileged instructions from Java?</p>","347808","","347808","","2011-04-03 07:13:11","2011-08-18 05:26:40","ANDROID: How to gain root access in an Android application?","<java><android><jni><root>","2","3","7","",""
"4905779","1","","","2011-02-05 08:01:11","-1","2061","<p>How do I control my android phone with the ADB shell?</p><p>Pls show me the commands for ADB</p>","604190","","320111","","2011-02-05 11:22:51","2011-02-05 11:22:51","How do I use the ADB shell?","<android><adb>","2","2","1","",""
"4905811","1","","","2011-02-05 08:08:37","1","396","<p>Imagine a piano like touch based application. Now all that has to be done is to assign different sound files to different keys. I am using the SoundPool class but the following problems are happening:</p><ul><li>The sounds don't play simultaneously. Rarely do I hear two sounds playing together</li><li>A few touches don't get detected when a sound is playing</li><li>The responsiveness is way too bad, for example a sound will play about 200-300 ms after the corresponding key has been touched</li></ul><p>I have seen other piano applications for Android and they work fine in this department, so what am I missing here? Thanks already for reading through.</p>","225499","","","","","2013-08-15 20:12:24","How does one play sounds asynchronously and simultaneously(polyphony) on Android?","<android><android-sdk-2.1><soundpool>","1","1","1","",""
"4905887","1","","","2011-02-05 08:29:21","8","2649","<p>I'm writing my first Android app, which is more or less going to be a mount point manager. Local mounts and NFS mounts have been easy, but I'm not sure of how to go about CIFS shares.</p><p>Ideally, after selecting a host, a list of CIFS shares would be displayed. At the bare minimum, I should be able to enter a CIFS URI/share string and mount it (eg: //192.168.1.100/mount_point). I'm thinking of EStrongs, where you can select a host, and it will display shares, which you can then further explore.</p><p>I've seen jCIFS (I think this is what Astro uses), and I've seen mention of the cifs.ko module on xda-developers. Are there any other standard approaches? Any tips/recommendations on how to go about using jCIFS or cifs.ko and doing this in general? I would prefer not to have to gain root access.</p>","347808","","762442","","2011-12-20 23:35:20","2011-12-28 23:04:01","ANDROID: Accessing CIFS Shares in Java","<java><android><smb><cifs>","3","2","","",""
"4905892","1","","","2011-02-05 08:31:31","2","490","<p>No matter what app i build it seems like the <code>R.Java</code> file always disappears no matter what!</p><p>It is fine up in till i clean the project. From there it disappears.</p><p>I have ""Build Automatically"" enabled as well</p><p>Does any one know how to fix this. It is starting to get <strong>very</strong> annoying!</p>","583952","","213269","","2011-09-23 15:02:35","2011-09-23 15:02:35","R.Java is ALWAYS disappearing?","<android><r.java-file>","2","2","","",""
"4905942","1","","","2011-02-05 08:43:05","1","1466","<p>Any application that has a service going obviousely counts on it to be always running. It's part of the product and if it's a paid app - the user expects it.</p><p>However, it seems that there is no way for a service not to get wacked if the Android OS feels the memory pressure or if something goes wrong and the service crashes.</p><p>What is the best way of making sure that a service is always running?</p><p>Is it wise to create a second service that once in a while start the ""useful"" service and if it's alredy running it'll be ignored?</p>","450407","","244296","","2011-02-05 18:01:49","2011-02-05 18:01:49","How to keep service alive?","<android><service><kill><running><alive>","2","1","","",""
"4905944","1","4906217","","2011-02-05 08:43:17","1","2649","<p>Hello i am trying to create aplication witch shows me sms in ListView but i dont know how i can fill listview by datas.I tried do that but it doesn't work.Can you check my source code and give me some resolution? Thanks</p><p>Source code:</p><pre><code>import java.util.ArrayList;import java.util.List;import android.app.Activity;import android.database.Cursor;import android.net.Uri;import android.os.Bundle;import android.widget.ArrayAdapter;import android.widget.ListView;public class Mynewtwo extends Activity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        ListView list = (ListView) findViewById(R.id.list);        List&lt;String&gt; msgList = getSMS();        ArrayAdapter&lt;String&gt; adapter = new ArrayAdapter&lt;String&gt;(this,R.layout.main, msgList);         list.setAdapter(adapter);    }    public List&lt;String&gt; getSMS(){         List&lt;String&gt; sms = new ArrayList&lt;String&gt;();            Uri uriSMSURI = Uri.parse(""content://sms/inbox"");            Cursor cur = getContentResolver().query(uriSMSURI, null, null, null, null);            while (cur.moveToNext()) {                   String address = cur.getString(cur.getColumnIndex(""address""));                   String body = cur.getString(cur.getColumnIndexOrThrow(""body""));                  sms.add(""Number: "" + address + "" .Message: "" + body);                }            return sms;        }</code></pre><p>}</p><p>XML : </p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayoutandroid:id=""@+id/widget30""android:layout_width=""fill_parent""android:layout_height=""fill_parent""android:orientation=""vertical""xmlns:android=""http://schemas.android.com/apk/res/android""&gt;&lt;ListViewandroid:id=""@+id/list""android:layout_width=""fill_parent""android:layout_height=""fill_parent""&gt;&lt;/ListView&gt;&lt;/LinearLayout&gt;</code></pre>","600468","","457982","","2011-02-05 10:01:27","2013-10-20 21:54:28","Sms Inbox - ListView","<android>","1","2","2","",""
"4905964","1","4930198","","2011-02-05 08:49:26","0","2455","<p>i call the dialog in my parent activity.. where as the dialog is in another activity...i faced error while setting the adapter  ""setListAdapter(new ListViewAdapter(this));""... can any one plz assist me</p><hr><p>CustomizeDialog.class </p><pre><code>package org.me.dailogfrmchildact;/** Class Must extends with Dialog *//** Implement onClickListener to dismiss dialog when OK Button is pressed */public class CustomizeDialog extends Dialog implements OnClickListener {    Button okButton;    public CustomizeDialog(Context context) {        super(context);        /** 'Window.FEATURE_NO_TITLE' - Used to hide the title */        requestWindowFeature(Window.FEATURE_NO_TITLE);        /** Design the dialog in main.xml file */        setContentView(R.layout.main);        okButton = (Button) findViewById(R.id.OkButton);        okButton.setOnClickListener(this);    }    @Override    public void onClick(View v) {        /** When OK Button is clicked, dismiss the dialog */        if (v == okButton){            ListviewContent.add(""sadas"");        ListviewCount.add(""dasasd"");        setListAdapter(new ListViewAdapter(this));        }    }private static ArrayList&lt;String&gt; ListviewContent = new ArrayList&lt;String&gt;();    private static ArrayList&lt;String&gt; ListviewCount = new ArrayList&lt;String&gt;();    private static class ListViewAdapter extends BaseAdapter {        private LayoutInflater mInflater;        public ListViewAdapter(Context context) {            mInflater = LayoutInflater.from(context);        }        public int getCount() {            return ListviewContent.size();        }        public Object getItem(int position) {            return position;        }        public String getCount(int position) {            return ListviewCount.get(position);        }        public String[] getSizeType(int position) {            String[] str = new String[2];            str[0] = ListviewContent.get(position);            str[1] = ListviewCount.get(position);            return str;        }        public long getItemId(int position) {            return position;        }        public View getView(int position, View convertView, ViewGroup parent) {            ListContent holder;            if (convertView == null) {                convertView = mInflater.inflate(R.layout.listviewinflate, null);                holder = new ListContent();                holder.text = (TextView) convertView.findViewById(R.id.TextView01);                holder.text.setCompoundDrawables(null, null, null, null);                holder.count = (TextView) convertView.findViewById(R.id.TextView02);                holder.count.setCompoundDrawables(null, null, null, null);                convertView.setTag(holder);            } else {                holder = (ListContent) convertView.getTag();            }            holder.text.setText(ListviewContent.get(position));            holder.count.setText(ListviewCount.get(position));            return convertView;        }        static class ListContent {            TextView text;            TextView count;        }    }}</code></pre><hr><p>mainactivity.class</p><pre><code>package org.me.dailogfrmchildact;public class MainActivity extends Activity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle icicle) {        super.onCreate(icicle);        /** Display Custom Dialog */        CustomizeDialog customizeDialog = new CustomizeDialog(this);        customizeDialog.show();// ToDo add your GUI initialization code here            }}</code></pre>","569553","","345717","","2011-02-05 08:53:46","2011-03-19 16:55:10","problem with custom dialog listview","<android>","3","0","1","",""
"4905988","1","4905998","","2011-02-05 08:57:06","1","472","<p>I want the user to select which Activity the application should start on. I am trying to avoid tabs because I don't like the layout of tabs, but I have a custom title bar that has three icons on which to select functionality/activity.</p><p>I want the user to select which activity the application should start from the beginning with a user preferences.</p><p>How can I do this?</p>","553770","","484073","","2011-02-16 08:32:44","2011-02-16 08:32:44","How to let the user select which Activity to start when application starts?","<android><activity><startup>","3","1","1","",""
"4906056","1","4906067","","2011-02-05 09:18:35","0","2221","<p>i'm just starting out with Android and i think i'm missing something. It seems like in Android you decide at development time which activity will be the first to be displayed in your application.</p><p>i would like to write my application in such a way that some kind of a centralized controller starts executing and it decides which activity should be first (for example, based on some data obtained from somewhere)</p><p>is that possible to do, and if so, how?thanks.</p>","604237","","554233","","2013-05-02 15:20:19","2013-05-02 15:20:19","how can first activity be chosen at run time based on data?","<android><activity><uiviewcontroller>","3","0","1","",""
"4906104","1","4906844","","2011-02-05 09:32:57","0","423","<p>My application makes heavy use of the <code>Text to Speech API</code>. </p><p>It is a game which leads the player to change the orientation frequently. I do have different layouts for portrait and landscape and this is ok. </p><p>I use <code>onRetainNonConfigurationInstance()</code> and <code>onCreate()</code> to keep the state. </p><p>However, there is one fact that causes problems: </p><p>I am calling <code>tts.shutdown()</code> in <code>onDestroy()</code> which I think is necessary to free resources properly. However, this causes the current text and all queued messages to be lost when the user changes the orientation. As the Text-to-Speech object has a reference on the ""<strong><em>old</em></strong>"" activity, I cannot transfer it to the new activity. </p><p>How can I solve this problem?</p>","292233","","244296","","2011-02-05 18:00:01","2011-02-05 18:00:01","Text to speech and Orientation change","<android><orientation><text-to-speech>","1","0","","",""
"4906158","1","4906890","","2011-02-05 09:46:54","3","5225","<p>I have written a piece of Java code which is intended as to call Java code from Javascript by a android WebView gateway.</p><pre><code>webView = (WebView) findViewById(R.id.captchaView);WebSettings ws = webView.getSettings();ws.setJavaScriptEnabled(true);webView.loadUrl(""https://google.com/"");webView.setWebViewClient(BrowserHandler);webView.addJavascriptInterface(new IJavascriptHandler(), ""cpjs"");WebViewClient BrowserHandler = new WebViewClient() {   @Override   public void onPageFinished(WebView view, String url) {      view.loadUrl(""javascript:window.cpjs.onPageLoaded(document.body.innerHTML);void(0);"");   }};final class IJavascriptHandler {   IJavascriptHandler() {   }   public void onPageLoaded(String html) {      // this is called from JS      Toast t = Toast.makeText(getApplicationContext(), ""Yes"", 2000);      t.show();   }}</code></pre><p>The above code checks for web page load and once the page is finished loading, it will call javascript function which is exposed from Java so it could carry what I need from the page.</p><p>This is not working as expected what it does is simply refresh the page every few seconds. I am not sure what is wrong here?</p>","355507","","","","","2011-02-05 12:46:51","Passing Data From Javascript To Android WebView","<java><javascript><android><webview>","1","0","1","",""
"4906256","1","","","2011-02-05 10:10:21","0","250","<p>I develop android application, my advisor told me to use XMPP(openfire) to send a message to the server. Furthermore, I want to be use LDAP because I want to mix with mysql server.At this time, i don't know all processes which its work together. Any one can help? Thanks</p>","538788","","","","","2011-02-05 10:10:21","How LDAP Openfire IM+ work together?","<android><mysql><ldap><openfire>","0","4","","",""
"4906274","1","","","2011-02-05 10:13:52","2","591","<p>I am facing an issue with tab view at bottom and scroll view. </p><p>Actually in my application i have an activity having multiple edit boxes so that to scroll the view i have used scroll view.But now the problem is that i have tabs at bottom so when we tap on any edit box the soft keyboard pops up and it move the whole view to upward (means the bottom tab also).While i don't want this i just to show the keyboard over the tabs at bottom.</p><p>For reference i am attaching a screen shot also</p><p><a href=""https://picasaweb.google.com/101436805822316575664/Test#5558753509930483714"" rel=""nofollow"">https://picasaweb.google.com/101436805822316575664/Test#5558753509930483714</a></p><p>Please tell me why it is happening. and is it possible that bottom tab will not show when keypad comes in scroll view.</p>","565942","","881286","","2013-08-18 02:36:26","2013-08-18 02:36:26","issue with tab view at bottom and scroll view","<android><tabs><android-widget>","0","0","","",""
"4906323","1","5005811","","2011-02-05 10:24:50","0","338","<p>Notice that my notification icon is not always removed when my Service finish.<br>Thinking about possible reason for this.</p><p>My service start some nested threads and the deepest one puts a notification with iconin the title bar of the phone.</p><p>I can see that onDestroy() in my Service is executed on stop Service.I run the mNotificationManager.cancel(setServiceRunNotifNumber);</p><p>I cant see that i miss running the cancel to remove the notification.This only happens sometimes that the notification remains after onDestroy().</p><p>Are there something else I forgot?In what situation would the notification remain after Service killed?</p>","538837","","244296","","2011-02-05 17:57:40","2011-06-20 02:49:29","Possible reason why the notification is not removed","<android>","1","0","","",""
"4906389","1","","","2011-02-05 10:42:24","0","313","<p>I have edittext view and listview  in activity if user click the edittext virtual keypad  arrived at the time my screen layout is going up.If virtual keypad hide at the time my screen is going down How to avoid that I want layout to be in same posistion and show virtual keypad to user the above layout .I used listview in layout so only layout is moving up   can anybody tell how to avoid layout moving up using list view?this 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:background=""@color/white""  android:id=""@+id/mainrelativelayout""  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:background=""@color/white""&gt;  &lt;TableRow&gt;  &lt;EditText android:layout_column=""0"" android:focusable=""true"" android:focusableInTouchMode=""true"" android:id=""@+id/edtsearch"" android:singleLine=""true"" android:hint=""Enter company name or ticker"" android:layout_width=""300dip"" android:layout_height=""40dip"" android:textSize=""13dip"" android:textColor=""@color/gray1""&gt;&lt;/EditText&gt;&lt;ImageView android:layout_column=""1"" android:src=""@drawable/clearbutton""  android:paddingTop=""5dip"" android:id=""@+id/imgsearch"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;&lt;/ImageView&gt;  &lt;/TableRow&gt;  &lt;TableRow&gt;  &lt;ListView android:layout_column=""0"" android:layout_span=""2"" android:id=""@+id/lstcontent"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;&lt;/ListView&gt;  &lt;/TableRow&gt;  &lt;/TableLayout&gt;  &lt;TableLayout  xmlns:android=""http://schemas.android.com/apk/res/android""  android:layout_width=""fill_parent""  android:layout_height=""30dip""  android:id=""@+id/imglinear""  android:background=""@color/white""  android:layout_alignParentBottom=""true""  android:paddingTop=""5dip""  android:orientation=""horizontal""  &gt;  &lt;TableRow&gt;&lt;ImageView android:id=""@+id/ImageView15"" android:paddingRight=""20dip"" android:layout_gravity=""left"" android:src=""@drawable/questbutton""  android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;&lt;/ImageView&gt;&lt;/TableRow&gt;&lt;/TableLayout&gt;&lt;/RelativeLayout&gt;</code></pre><p>any help would be appreciated</p><p>even I gave in androidmanifest.xml</p><pre><code>android:windowSoftInputMode=""adjustPan|adjustResize""</code></pre><p>that is not working</p><p>Thanks</p>","426344","","426344","","2011-02-07 15:07:53","2011-02-07 15:07:53","listview with virtual keypad shown in android","<android>","1","0","","",""
"4906422","1","4906653","","2011-02-05 10:49:59","7","14417","<p>I have downloaded image at run time. Now I want to set it as a background for relative layout how to it? Does it possible.</p>","484073","","","","","2014-01-15 12:27:45","Setting background image for relative layout?","<android><layout><relativelayout>","3","0","1","",""
"4906433","1","","","2011-02-05 10:54:11","0","637","<p>Is there in Android an efficent way to run a task only for a limited time? Currently I use a Handler with onPostDelayed() and check each run if the current timestamp is higher than my predefined timestamp.</p><p>I'm searching for a solution like <a href=""http://developer.android.com/reference/android/os/CountDownTimer.html"" rel=""nofollow"">CountdownTimer</a> but without ticks. I only want define a start and endtime and my task should perform in this period.</p>","604295","","244296","","2011-02-05 16:42:37","2011-02-05 16:42:37","Run task for defined time","<android><timer><countdown>","1","2","1","",""
"4906626","1","","","2011-02-05 11:37:39","0","1784","<p>How can I get a user to select from the native gallery in Android, rather than other gallery-like applications such as ASTRO File Manager?</p><p>The following code gives a list of activities that can select an image:</p><pre><code>Intent intent = new Intent();intent.setType(""image/*"");intent.setAction(Intent.ACTION_GET_CONTENT);List&lt;ResolveInfo&gt; infos = activity.getPackageManager().queryIntentActivities(intent, 0);</code></pre><p>If I then do something like this:</p><pre><code>activity.startActivityForResult(Intent.createChooser(intent, ""Select Picture""), REQUEST_CHOOSE_IMAGE);</code></pre><p>then if the user has more than one application that can act like a gallery (such as ASTRO File Manager), s/he is prompted to select one of them, with no ""set as default"" option.</p><p>I don't want the user to be prompted to choose between them each time, so I'd like to just use the native gallery.</p><p>The hacky code sample below uses a whitelist to test for known native gallery names:</p><pre><code>    for (ResolveInfo info : infos) {        if (    0==info.activityInfo.name.compareTo(""com.cooliris.media.Gallery"")            ||  0==info.activityInfo.name.compareTo(""com.htc.album.CollectionsActivity"")        ) {            // found the native gallery            doSomethingWithNativeGallery();        }    }</code></pre><p>Feels kinda dirty. Is there a better way? I suspect I'm missing something in my intent.</p>","408227","","","","","2011-02-05 12:36:24","Accessing Android native gallery via an intent","<android>","1","0","1","",""
"4906632","1","5001709","","2011-02-05 11:39:46","1","4226","<p>I'm currently implementing Pull To Refresh functionality in Android. Now I have it working by creating a custom ListView using Header Views above the list items. In essence: when the top header view is in view, a refresh is started via a listener.</p><p>On starting the ListView, it automatically scrolls itself below the HeaderViews, hiding them until the user scrolls down. This works great when the the height of List Items exceeds the height the ListView itself (therefore there is scrolling), but when the Height of the Children is less than the height of the ListView, there is no scrolling and HeaderViews are forced to be shown.</p><p>Basically what I'm after is a way to force the Scrolling region of the ListView to be at least the height of the ListView + height of my HeaderViews. I've already got the height of my HeaderViews, I just can't find a way of getting the actual height of the ListView (i.e. when fill_parent is used) and a way of setting the minimum scrolling height. Any ideas?</p><p><em>This will be released on GitHub after I'm finished it, and works on Android 1.5+.</em></p>","474997","","474997","","2011-02-05 12:17:22","2011-02-15 09:17:49","ListView - Set Minimum Height so that it always allows Scrolling","<android><listview><scroll>","2","1","1","",""
"4906717","1","","","2011-02-05 11:59:47","1","135","<p>I am new to the developement of SBS app in android. I wanted to know the requirements for implemeting push notifications on the app side.</p><p>Suppose if i am using jive services for my SBS. What are the things which are required to implement push notifications?</p>","604339","","119895","","2011-02-05 13:06:34","2011-02-05 13:06:34","How to implement push email notifactions for my SBS app in android","<android>","0","1","","",""
"4906778","1","4906878","","2011-02-05 12:17:28","1","675","<p>The Android documentation being the mess that it is, I have big problem understanding what sizes my icons should be for each of the densities. The ultra-lengthy article( <a href=""http://developer.android.com/guide/practices/screens_support.html"" rel=""nofollow"">http://developer.android.com/guide/practices/screens_support.html</a> ) on supporting multiple-screen doesn't provide the information. </p><p>So I was going to just guess some sizes when I finally hit that this gem in the ""providing ressources"" article ( <a href=""http://developer.android.com/guide/topics/resources/providing-resources.html#AlternativeResources"" rel=""nofollow"">http://developer.android.com/guide/topics/resources/providing-resources.html#AlternativeResources</a> ) : </p><blockquote>  <p>There is thus a 3:4:6 scaling ratio  between the three densities, so a 9x9  bitmap in ldpi is 12x12 in mdpi and  18x18 in hdpi.</p></blockquote><p>Thing is they just introduced the xhdpi density. </p><p>So now what is the x in 3:4:6:x ??</p><p><strong>EDIT :</strong> Added link as asked by commenter</p>","578746","","1140748","","2012-05-06 16:14:13","2012-05-06 16:14:13","Bitmap resources depending on screen densities","<android><resources><screen>","1","1","","",""
"4906815","1","","","2011-02-05 12:28:59","0","150","<p>I'm using an Alarm Manager to trigger an IntentService every hour. However, originally the alarm gets registered when the user runs the app. The problem is that when the user opens the app again it makes the manager create a new service run and if the current service is already running they trip over each other because of the database connection and everything dies!</p><p>Another problem is that the alarm service completely stops. Why? I thought the alarm should go on every hour no matter what!</p>","450407","","","","","2011-02-05 12:49:02","How to not get my alarm on its own way?","<android><service><alarm><alarmmanager>","1","0","","",""
"4906855","1","","","2011-02-05 12:39:49","2","808","<p>I've just found out, because of a stack trace reported by a 'hang' in our fing android application:</p><p>constructor <code>InetSocketAddress(InetAddress address, int port)</code> creates a socket address with an address and the port, but it seems that it also tries to do reverse dns lookup for that provided address, in order to get the hostname.</p><p>This is not desired at all, since not only it's not used by our code, but moreover it slows down the application, as our app creates a relevant number of <code>InetSocketAddress</code> but always with a yet resolved/translated inet address.</p><p>Do you know if there is a way to get rid of this undesired reverse dns lookup?</p>","528469","","881286","","2013-08-18 02:36:17","2013-08-18 02:36:17","InetSocketAddress constructor performs reverse dns","<android><network-programming><android-networking>","0","2","","",""
"4906876","1","4906903","","2011-02-05 12:44:04","0","665","<p>When a notification arrives it hides the network signal and battery status icons.</p><p>Is there any possibility to show the notification without hiding the network icons?</p>","548435","","","user142019","2011-02-05 12:45:55","2011-02-05 12:50:17","How to set the Notification Area in Android?","<android>","1","1","","",""
"4906950","1","4906982","","2011-02-05 12:58:33","4","2575","<p>I'd like my app to work on phones (320x480 usually) and tablets (840x600, 800x600 and 1024x600). </p><p>I'm not sure which resolution to design for and how it would scale on various devices. Can anyone please suggest what resolution and dpi should I use?</p>","172637","","244296","","2011-02-05 16:33:30","2011-02-05 16:33:30","UI for Android - What resolution to design for?","<java><android><design><resolution><photoshop>","4","2","","",""
"4907045","1","4908116","","2011-02-05 13:16:49","2","14023","<p>I have WebView in which I want to open links belong to domain www.example.org in webview while all other links (if clicked) open by the default browser outside of my application.</p><p>I tried to use public boolean shouldOverrideUrlLoading(WebView view, String url)  but it does not work properly.</p><p>Here is the code that does not work:</p><pre><code>public class MyWebViewClient extends WebViewClient {    @Override               public boolean shouldOverrideUrlLoading(WebView view, String url) {                   try {                   URL urlObj = new URL(url);                   if (urlObj.getHost().equals(""192.168.1.34"")) {                       view.loadUrl(url);                       return true;                   } else {                       view.loadUrl(url);                       return false;                     }                   } catch (Exception e) {                   }               }}</code></pre><p>In both cases ( return true and return false) the URL is handled by my application.</p>","574122","","574122","","2011-02-05 18:45:40","2013-01-21 18:45:03","How to make links open within webview or open by default browser depending on domain name?","<android>","2","1","3","",""
"4907052","1","4907484","","2011-02-05 13:17:46","0","1435","<p>my initial screen is basically from a listactivity which displays a list of records. i created a menu that should open a new window for entry but always force closes when i click it. below are my codes:</p><pre><code>Guestbook.java (ListActivity)    @Override    public boolean onOptionsItemSelected(MenuItem item) {        // Handle item selection        switch (item.getItemId()) {        case R.id.mnuNew:            //setContentView(R.layout.form);            Intent mIntent  = new Intent(getApplicationContext(), Maintenance.class);            startActivityForResult(mIntent, 0);            //Toast.makeText(getApplicationContext(), ""Test"", Toast.LENGTH_SHORT).show();            return true;        default:            return super.onOptionsItemSelected(item);        }    }</code></pre><p>here is the code for Maintenance.class</p><pre><code>package com.android.guestbook;import android.app.Activity;import android.os.Bundle;public class Maintenance extends Activity {    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.form);    }}</code></pre><p>is there something wrong with my code?</p><p>here is the logcat info.</p><pre><code>02-06 07:02:29.617: INFO/ActivityManager(59): Starting activity: Intent { cmp=com.android.guestbook/.Maintenance }02-06 07:02:29.956: DEBUG/AndroidRuntime(276): Shutting down VM02-06 07:02:29.956: WARN/dalvikvm(276): threadid=1: thread exiting with uncaught exception (group=0x4001d800)02-06 07:02:30.107: ERROR/AndroidRuntime(276): FATAL EXCEPTION: main02-06 07:02:30.107: ERROR/AndroidRuntime(276): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.android.guestbook/com.android.guestbook.Maintenance}: java.lang.RuntimeException: Binary XML file line #82: You must supply a layout_width attribute.02-06 07:02:30.107: ERROR/AndroidRuntime(276):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)02-06 07:02:30.107: ERROR/AndroidRuntime(276):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)02-06 07:02:30.107: ERROR/AndroidRuntime(276):     at android.app.ActivityThread.access$2300(ActivityThread.java:125)02-06 07:02:30.107: ERROR/AndroidRuntime(276):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)02-06 07:02:30.107: ERROR/AndroidRuntime(276):     at android.os.Handler.dispatchMessage(Handler.java:99)02-06 07:02:30.107: ERROR/AndroidRuntime(276):     at android.os.Looper.loop(Looper.java:123)02-06 07:02:30.107: ERROR/AndroidRuntime(276):     at android.app.ActivityThread.main(ActivityThread.java:4627)02-06 07:02:30.107: ERROR/AndroidRuntime(276):     at java.lang.reflect.Method.invokeNative(Native Method)02-06 07:02:30.107: ERROR/AndroidRuntime(276):     at java.lang.reflect.Method.invoke(Method.java:521)02-06 07:02:30.107: ERROR/AndroidRuntime(276):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)02-06 07:02:30.107: ERROR/AndroidRuntime(276):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)02-06 07:02:30.107: ERROR/AndroidRuntime(276):     at dalvik.system.NativeStart.main(Native Method)02-06 07:02:30.107: ERROR/AndroidRuntime(276): Caused by: java.lang.RuntimeException: Binary XML file line #82: You must supply a layout_width attribute.02-06 07:02:30.107: ERROR/AndroidRuntime(276):     at android.content.res.TypedArray.getLayoutDimension(TypedArray.java:491)02-06 07:02:30.107: ERROR/AndroidRuntime(276):     at android.view.ViewGroup$LayoutParams.setBaseAttributes(ViewGroup.java:3592)02-06 07:02:30.107: ERROR/AndroidRuntime(276):     at android.view.ViewGroup$MarginLayoutParams.&lt;init&gt;(ViewGroup.java:3672)02-06 07:02:30.107: ERROR/AndroidRuntime(276):     at android.widget.LinearLayout$LayoutParams.&lt;init&gt;(LinearLayout.java:1395)02-06 07:02:30.107: ERROR/AndroidRuntime(276):     at android.widget.LinearLayout.generateLayoutParams(LinearLayout.java:1321)02-06 07:02:30.107: ERROR/AndroidRuntime(276):     at android.widget.LinearLayout.generateLayoutParams(LinearLayout.java:45)02-06 07:02:30.107: ERROR/AndroidRuntime(276):     at android.view.LayoutInflater.rInflate(LayoutInflater.java:620)02-06 07:02:30.107: ERROR/AndroidRuntime(276):     at android.view.LayoutInflater.inflate(LayoutInflater.java:407)02-06 07:02:30.107: ERROR/AndroidRuntime(276):     at android.view.LayoutInflater.inflate(LayoutInflater.java:320)02-06 07:02:30.107: ERROR/AndroidRuntime(276):     at android.view.LayoutInflater.inflate(LayoutInflater.java:276)02-06 07:02:30.107: ERROR/AndroidRuntime(276):     at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:198)02-06 07:02:30.107: ERROR/AndroidRuntime(276):     at android.app.Activity.setContentView(Activity.java:1647)02-06 07:02:30.107: ERROR/AndroidRuntime(276):     at com.android.guestbook.Maintenance.onCreate(Maintenance.java:11)02-06 07:02:30.107: ERROR/AndroidRuntime(276):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)02-06 07:02:30.107: ERROR/AndroidRuntime(276):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)02-06 07:02:30.107: ERROR/AndroidRuntime(276):     ... 11 more02-06 07:02:30.216: WARN/ActivityManager(59):   Force finishing activity com.android.guestbook/.Maintenance02-06 07:02:30.267: WARN/ActivityManager(59):   Force finishing activity com.android.guestbook/.GuestBook</code></pre><p>here is my form.xml for the Maintenance class.</p><pre><code>&gt; &lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&gt; &lt;LinearLayout  &gt; xmlns:android=""http://schemas.android.com/apk/res/android""&gt; android:layout_width=""fill_parent""  &gt; android:layout_height=""fill_parent""  &gt; android:orientation=""vertical""&gt;&gt;     &lt;LinearLayout         &gt;       android:layout_height=""wrap_content""&gt;       android:layout_width=""fill_parent""&gt;&gt;         &lt;TextView &gt;           android:layout_width=""fill_parent"" &gt;           android:layout_height=""wrap_content"" &gt;           android:text=""@string/name"" /&gt;&gt;     &lt;/LinearLayout&gt;&gt;     &lt;LinearLayout &gt;       android:layout_height=""wrap_content"" &gt;       android:layout_width=""fill_parent""&gt;&gt;         &lt;EditText &gt;           android:inputType=""textPersonName""&gt;           android:layout_width=""fill_parent"" &gt;           android:layout_height=""wrap_content"" &gt;           android:id=""@+id/name"" &gt;           android:hint=""Enter your name here"" /&gt;&gt;     &lt;/LinearLayout&gt;&gt;     &lt;LinearLayout &gt;       android:layout_height=""wrap_content""&gt;       android:layout_width=""fill_parent""&gt;&gt;         &lt;TextView &gt;           android:layout_width=""wrap_content"" &gt;           android:layout_height=""wrap_content"" &gt;           android:text=""@string/email"" /&gt;&gt;     &lt;/LinearLayout&gt;&gt;     &lt;LinearLayout &gt;       android:layout_height=""wrap_content"" &gt;       android:layout_width=""fill_parent""&gt;&gt;         &lt;EditText &gt;           android:inputType=""textEmailAddress""&gt;           android:layout_width=""fill_parent"" &gt;           android:layout_height=""wrap_content"" &gt;           android:id=""@+id/email"" &gt;           android:hint=""Enter your email here"" /&gt;&gt;     &lt;/LinearLayout&gt;&gt;     &lt;LinearLayout &gt;       android:layout_height=""wrap_content"" &gt;       android:layout_width=""fill_parent""&gt;&gt;         &lt;TextView &gt;           android:layout_width=""wrap_content"" &gt;           android:layout_height=""wrap_content"" &gt;           android:text=""@string/message"" /&gt;&gt;     &lt;/LinearLayout&gt;&gt;     &lt;LinearLayout &gt;       android:layout_height=""wrap_content"" &gt;       android:layout_width=""fill_parent""&gt;&gt;         &lt;EditText &gt;           android:inputType=""textMultiLine""&gt;           android:layout_width=""fill_parent"" &gt;           android:layout_height=""wrap_content"" &gt;           android:id=""@+id/message"" &gt;           android:hint=""Enter your message here""&gt;&lt;/EditText&gt;&gt;     &lt;/LinearLayout&gt;&gt;     &lt;LinearLayout &gt;       android:layout_height=""wrap_content"" &gt;       android:layout_width=""fill_parent""&gt;&gt;         &lt;Button &gt;           android:onClick=""onClick""&gt;           android:layout_weight=""1""&gt;           android:layout_width=""fill_parent"" &gt;           android:layout_height=""wrap_content"" &gt;           android:id=""@+id/submit"" &gt;           android:text=""@string/submit"" /&gt;&gt;         &lt;Button &gt;           android:onClick=""onClick""&gt;           android:layout_weight=""1""&gt;           android:layout_width=""fill_parent"" &gt;           android:layout_height=""wrap_content"" &gt;           android:id=""@+id/cancel"" &gt;           android:text=""@string/cancel"" /&gt;&gt;     &lt;/LinearLayout&gt;&gt;     &lt;ListView&gt;       android:id=""@+id/list"" /&gt; &lt;/LinearLayout&gt;</code></pre>","604385","","604385","","2011-02-05 23:12:42","2011-03-04 08:23:17","how to switch to activity from listactivity using menu","<android><listactivity>","3","4","","",""
"4907116","1","","","2011-02-05 13:33:33","1","6221","<p>I am using Appcelerator's Titanium to develop an Android application. When focus comes over one of the EditText(at lower end of page) the keypad covers the EditText so when I am keying text, I can't see what's being keyed in. What are my options ?</p><ol><li>How to move EditText higher on the screen ?</li><li>Some applications show ""model"" form behavior where just that EditText &amp; keyboard shows, any examples of how to do this?</li></ol>","603800","","244296","","2011-02-05 16:27:07","2013-09-27 11:28:27","Soft Keyboard comes over the EditText","<android><textbox><keyboard><titanium>","2","1","2","",""
"4907119","1","","","2011-02-05 13:34:29","0","176","<p>I have the following problem. In my app I have one ListView and both picture and text inside.| [pic]  <strong>__ text <em>_</em></strong>  | I need to do two different tasks where position is significant e.g. if I click on pic toast shows ""Hi Im pic &amp; my position in the ListView is 3"", whereas if I click on text toast shows ""Hi Im text &amp; my position in the Listview is 3"". There is no problem if there is one item in the ListView as I can invoke onListItemClick, or there is also no problem if position is not important - I can add onClick in XML and implement listener with View parameter. However there is a problem if I need to know in both cases what was the position of clicked item.</p><p>Would be grateful for any responses.</p>","577604","","","","","2011-02-05 17:52:08","One ListView. Two objects inside. Two different tasks. How to?","<android>","1","0","","",""
"4907128","1","","","2011-02-05 13:37:00","0","761","<p>This is my code</p><pre><code>SQLiteDatabase sb= openOrCreateDatabase(""/data/data/helios.maggi/Recipe.db"",SQLiteDatabase.CREATE_IF_NECESSARY,null);    Cursor c=sb.rawQuery(""SELECT * FROM RecipeDetails"", null);    byte []myarray=c.getBlob(c.getColumnIndex(""recipeimage""));</code></pre><p>The error that this code is giving is that RecipeDetails does not exist. Well the table does exist and i have checked it. What could be going wrong.</p><p>thank you in advance.</p>","590849","","539542","","2012-01-15 05:32:44","2012-01-15 05:32:44","sqlite query error in android","<android><sqlite>","1","0","","",""
"4907214","1","4907641","","2011-02-05 13:59:08","3","1107","<p>So I need to upload multiple images to a webserver. I have the upload method created. I now need a way to make an upload queue so that I can manage and cancel the uploads. What is the best way to do something like this? I will defenetly be running a service for this. I was looking over the IntentService class and it seems like a good way to do the queue (since I just need to upload 1 file at a time), but my uploading will consist of 3 parts- the first part I am calling a server to get authorization, the second will be the actual upload and the third will be sending a confirmation that the file was successfully sent.</p><p>Ok so here is the deal. How do I cancel a specific download in the queue? How do I postpone the destroying of the service if the process is in the third part of the upload (posting the successful upload info to a webService)? </p>","448192","","244296","","2011-02-05 14:29:36","2012-08-13 11:06:07","Creating an upload queue","<android><service><upload><android-intent>","2","0","1","",""
"4907387","1","","","2011-02-05 14:32:13","0","392","<p>I have a table in which my 2nd field is of type blob.Now when i am trying to access the contents of this field i am getting the following error.</p><h3>CODE</h3><pre><code>SQLiteDatabase sb= openOrCreateDatabase(""/data/data/helios.maggi/Recipe.db"",SQLiteDatabase.CREATE_IF_NECESSARY,null);if(sb.isOpen())   Log.i(""mytag"",""the database is open ""+sb.getPath());   //sb.execSQL(""drop database Recipe"");   Cursor c = sb.rawQuery(""SELECT * FROM RecipeDetails"", null);   byte []myarray = c.getBlob(c.getColumnIndex(""recipeimage""));</code></pre><h3>ERROR</h3><blockquote>  <p>02-06 19:54:16.626: ERROR/AndroidRuntime(1812): Caused by: android.database.CursorIndexOutOfBoundsException: Index -1 requested, with a size of 4</p></blockquote><p>What is causing this error? I have verified that the content of the field recipeimage is blob, this is because i extracted the table from the device and checked the field names myself. the second field is of type blob and has 4 entries.</p>","590849","","135152","","2011-05-25 02:57:45","2011-09-20 03:29:28","Retriveing blob content from sqlite database error","<android><sqlite>","1","0","","",""
"4907487","1","5489516","","2011-02-05 14:51:46","1","279","<p>How can i implement an onGroupLongClickListener?If i use onItemLongClick then i just get the position of the element seen by the listview, so i need to convert this position to groupposition and childposition</p><p>How can i do that?</p>","601616","","601616","","2011-03-30 16:57:01","2011-03-30 16:57:17","ExpandableListView onGroupLongClick","<android><expandablelistview>","1","0","0","",""
"4907491","1","4908315","","2011-02-05 14:52:48","0","560","<p>I have an activity which includes a declaration of </p><pre><code>public String progressArray[][] = new String[3][3]</code></pre><p>In another file (a service) I want to access the values of this array.  I code:</p><pre><code>ListViewLoader lvl = new ListViewLoader</code></pre><p>Now I find that <code>lvl.progressArray[0][0]</code> returns null although I know that data has been put in it in its own class.   Is this because a new instance doesnt contain the values of the original, if so how can I access the values in the original?  </p>","538847","","189950","","2011-02-05 14:58:38","2011-02-05 19:07:36","accessing array values across classes","<android>","3","0","","",""
"4907520","1","","","2011-02-05 14:57:20","2","1735","<p>How is encryption using Triple DES done in android? Are there any predefined classes available?</p>","600910","","","","","2012-10-11 11:10:30","encryption in android","<android>","3","0","1","",""
"4907530","1","4907971","","2011-02-05 14:59:37","1","1447","<p>I'm trying to install a new font for my emulator. Currently android doesn't support ""Tamil"" but rooted phones do have partial support with extra hic ups.</p><p>I wanna try and install a tamil font in my emulator. so I went to font directory under android sdk folder and replaced it with a Tamil unicode font latha.ttf</p><p>when I create a emulator for dat specfic version and runs it, I still see boxes instead of Tamil script??</p><p>wot am I missing?? can someone help me out.</p><p>Thanks in advance.</p>","348301","","","","","2012-05-07 19:44:24","Installing a new font in Android Emulator","<android><android-emulator><tamil>","2","0","1","",""
"4907564","1","16106616","","2011-02-05 15:06:08","6","3553","<p>I have an <code>ListActivity</code> that is bound to a cursor, when items in the <code>ListView</code> are selected an <code>EditItem</code> activity is launched by <code>startActivityForResult</code>, this <code>EditItem</code> activity preforms several queries, each placed in their own separate Cursor.  These are used to populate spinners, much like a lookup field in an Access DB.  </p><p>My issue is that once the user leaves this <code>EditItem</code> activity, either via submit, cancel or back button, goes back to the <code>ListView</code> Activity and selects another entry in the <code>ListView</code> (same item or a different one) I get <code>IllegalStateException</code> errors in my <code>SQLiteCursor</code> class (Android's, not mine).  I <strong>am</strong> closing my cursors in the <code>onDestroy</code> method of <strong>both</strong> activities, since sometimes calling for a result will still destroy the calling activity.  </p><p>This does not always occur on the second selection of an Item, sometimes it will occur on the third selection.  I thought maybe I was just moving faster than the OS, so I starting pausing, up to 30 seconds, between my actions, the error is only thrown after calling the activity for result a second or third time.  No amount of pausing fixes this.</p><p><strong>Edit:</strong> The error is in the <code>SQLiteCursor finalize</code> method at the call to <code>super.finalize();</code></p><p><strong>Edit #2:</strong> Stack trace for thread:</p><pre><code>Daemon System Thread [&lt;5&gt; HeapWorker] (Suspended (exception IllegalStateException)) SQLiteCursor.finalize() line: 603   NativeStart.run() line: not available [native method]   </code></pre><p><strong>Edit #3</strong> Stack trace from LogCat (partslist is the table name):</p><pre><code>INFO/dalvikvm(599): Ljava/lang/IllegalStateException;: Finalizing cursor android.database.sqlite.SQLiteCursor@437541a0 on partslist that has not been deactivated or closedINFO/dalvikvm(599):     at android.database.sqlite.SQLiteCursor.finalize(SQLiteCursor.java:596)INFO/dalvikvm(599):     at dalvik.system.NativeStart.run(Native Method)</code></pre>","388992","","388992","","2011-02-05 23:04:45","2013-04-19 14:09:40","Prevent IllegalStateException in SQLiteCursor for Android","<android><sqlite><cursors>","2","6","","",""
"4907609","1","4907864","","2011-02-05 15:13:22","4","49291","<p>I'm having trouble adding a button to a layout that I've created in XML. Here's what I want to achieve:</p><pre><code>//some classelse {        startActivity(new Intent(StatisticsScreen.this, ScreenTemperature.class));}//////ScreenTemperatureClass@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    //this is where I call another class that    //displays a nice graph    setContentView(new GraphTemperature(getApplicationContext()));}</code></pre><p>I want to add a <code>Button</code> to this new screen so that it'll appear below the graph.I've tried creating a <code>LinearLayout</code> view, then create a <code>Button</code> and add it to this view but I just get <code>NullPointerException</code>s..</p><p>Any help would be appreciated. Thanks</p><p><strong>EDIT#1</strong></p><p>Here's what I've tried using that created a <code>NullPointerException</code> and 'force close':</p><pre><code>Button buybutton;LinearLayout layout;@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(new GraphTemperature(getApplicationContext()));    layout = (LinearLayout) findViewById(R.id.statsviewlayout);    Button buyButton = new Button(this);    buyButton.setText(R.string.button_back);    buyButton.setLayoutParams(new LayoutParams(        ViewGroup.LayoutParams.WRAP_CONTENT,            ViewGroup.LayoutParams.WRAP_CONTENT));    layout.addView(buyButton);}</code></pre><p>And here's the logcat error:</p><pre><code>ERROR/AndroidRuntime(293): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.weatherapp/com.weatherapp.ScreenTemperature}: java.lang.NullPointerExceptionERROR/AndroidRuntime(293):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)ERROR/AndroidRuntime(293):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)ERROR/AndroidRuntime(293):     at android.app.ActivityThread.access$2300(ActivityThread.java:125)ERROR/AndroidRuntime(293):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)</code></pre><p>theres abviously more lines to do with this error in logcat, not sure if you want it?</p><p><strong>EDIT#2</strong></p><p>So i tried bhups method:</p><pre><code>@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    GraphTemperature GT = new GraphTemperature(getApplicationContext());                 layout = (LinearLayout) findViewById(R.id.statsviewlayout);    Button buyButton = new Button(this);    buyButton.setText(R.string.button_back);    buyButton.setLayoutParams(new LayoutParams(        ViewGroup.LayoutParams.WRAP_CONTENT,            ViewGroup.LayoutParams.WRAP_CONTENT));    layout.addView(GT); // line 27    layout.addView(buyButton);           setContentView(layout);           }</code></pre><p>This method produced the same logcat error as above, <code>NullPointerException</code>, indicating it was something to do with line no. 27 which is the <code>layout.addView</code> line of code. Any ideas? Thanks again</p>","604469","","603444","","2012-06-23 06:19:05","2014-03-17 23:08:55","Add button to a layout programmatically","<android><button><activity>","2","2","1","",""
"4907669","1","","","2011-02-05 15:23:48","2","521","<p><br>I've found that my live wallpaper doesn't seem to receive ACTION_MOVE events when the CPU is maxed out. It does, however, still receive the ACTION_DOWN and ACTION_UP events.</p><p>I've set up a minimal eclipse project to demonstrate. Menu->Configure allows you toggle a frame rate cap.</p><p><a href=""http://www.mediafire.com/file/m7v0czmovtatuu1/TouchTest.zip"" rel=""nofollow"">http://www.mediafire.com/file/m7v0czmovtatuu1/TouchTest.zip</a>  </p><p>Has anyone else encountered this, or have an explanation as to why?  </p><p>Edit: I've since found that this only occurs in gingerbread. Still no solution, though.</p>","491236","","491236","","2011-02-16 11:57:50","2011-07-26 23:30:11","Live wallpaper not receiving ACTION_MOVE events?","<android><wallpaper><ontouchevent>","1","0","1","",""
"4907696","1","4907760","","2011-02-05 15:29:14","2","3215","<p>I use Android to make an application.I have an activity where I create an option menu like below</p><pre><code>    @Overridepublic boolean onCreateOptionsMenu(Menu menu) {    MenuInflater inflater = getMenuInflater();    inflater.inflate(R.menu.mymenu, menu);    return true;}</code></pre><p>The menu is loaded from an xml file :</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;item android:title=""Item1"" android:id=""@+id/item1"" /&gt;&lt;/menu&gt;</code></pre><p>When I click on item 1, I use onOptionsItemSelected on my activity to work after the click like that :</p><pre><code>    @Overridepublic boolean onOptionsItemSelected(MenuItem item) {    switch(item.getItemId()) {    case R.id.item1 :        // here, I would like to open a contextual menu        return true;    default :        return super.onOptionsItemSelected(item);    }}</code></pre><p>So, when user click on item 1 I would like to open a contextual menu. First, I don't know if it's possible to open a contextual menu directly without using hold position on screen like several tutorials on internet show it.</p><p>If it's possible how can I open a contextual menu in that way ? </p><p>I thought to use <code>registerForContextMenu()</code> and <code>openContextMenu()</code> in the case of my item 1 but which view should I put in parameter ?</p><p>If someone has an idea about the way to make that, I would like to know how I must do that.</p>","342990","","1289473","","2012-03-24 11:06:55","2012-07-10 10:07:33","Open context menu by clicking on menu options item","<android><menu><contextmenu><item>","2","0","1","",""
"4907762","1","4907839","","2011-02-05 15:40:06","0","2434","<pre><code>@Overrideprotected Dialog onCreateDialog(int id) {    switch (id) {        case IDD_COLOR:            return new AlertDialog(this); // The constructor AlertDialog(context) is not visible    }    return null;}</code></pre><p>Why? What's wrong?</p>","602011","","390177","","2012-02-03 11:07:57","2012-02-03 11:09:36","AlertDialog doesn't work","<java><android><android-alertdialog>","3","0","","",""
"4907769","1","4913858","","2011-02-05 15:40:43","12","16277","<p>I want to select a LocationProvider that is enabled in Android. The project build target is Android 2.1.</p><p>This is what I do in onCreate().</p><pre><code>// ...LocationManager locationMgr = (LocationManager) getSystemService(Context.LOCATION_SERVICE);Criteria criteria = new Criteria();criteria.setAccuracy(Criteria.NO_REQUIREMENT);criteria.setPowerRequirement(Criteria.NO_REQUIREMENT);criteria.setCostAllowed(false);     String bestProvider = locationMgr.getBestProvider(criteria, true);  Toast.makeText(getApplicationContext(),   ""Provider = "" + bestProvider + "" enabled= "" + locationMgr.isProviderEnabled(bestProvider), Toast.LENGTH_LONG).show();// ...</code></pre><p>Now, I switch each network interface off and set flight mode on my device (HTC Desire, Android 2.2). I disconnect the device from USB. There is clearly no provider alive who  could actually provide location data to the device. I specifically ask <strong>getBestProvider</strong> for enabled providers only, so I expect it to return null or an empty string in that case. I expect <strong>isProviderEnabled</strong> to return false. </p><p>The actual result is that <strong>getBestProvider</strong> returns ""network"" and <strong>isProviderEnabled</strong> reports it to be ""enabled"". Is ""network"" always ""enabled"" even when its not?</p>","550152","","244296","","2011-02-05 16:15:31","2014-03-03 18:02:03","LocationManager: is the ""network"" provider always enabled?","<android><location>","3","1","7","",""
"4907873","1","4912288","","2011-02-05 15:56:29","1","122","<p><img src=""http://i.stack.imgur.com/NGTGh.jpg"" alt=""enter image description here"">I was developing an android app using java language.  The body of the method was below: a string ""3"" was passed to it as first argument--nextCmdId, but in the method it turned out to be a Rect, and the application crashed. Quite odd!! thanksBRshawn</p><pre><code>public String formatSyncTagPreamble(String nextCmdId,                                    String sourceName,                                    String sourceUri){    StringBuffer syncTag = new StringBuffer();    syncTag.append(""&lt;CmdID&gt;"").append(nextCmdId)           .append(""&lt;/CmdID&gt;\n"")           .append(""&lt;Target&gt;&lt;LocURI&gt;"")           .append(sourceUri)           .append(""&lt;/LocURI&gt;&lt;/Target&gt;\n"")           .append(""&lt;Source&gt;&lt;LocURI&gt;"")           .append(sourceName)           .append(""&lt;/LocURI&gt;&lt;/Source&gt;\n"");    return syncTag.toString();}</code></pre><p><img src=""http://i.stack.imgur.com/dKrf2.jpg"" alt=""enter image description here""></p>","557911","","557911","","2011-02-06 08:03:22","2011-02-06 08:12:03","String was passed as argument, but in the function it turned out to be a Rec","<java><android><arguments><changed>","1","6","","",""
"4907894","1","4908019","","2011-02-05 15:59:54","2","8567","<p>How can i open new window (TextView) from ListView by setOnItemClickListener?I have tried it but it's failed.I have two Xml files (i don't know if i can have 2) and in second Xml file is that TextView. I am trying if i click on any item in ListView it will open new window with TextView.</p><p>There is my attempt:</p><pre><code> list.setOnItemClickListener(new OnItemClickListener() {            @Override            public void onItemClick(AdapterView&lt;?&gt; arg0, View view, int position,                    long id) {                 TextView message = (TextView)findViewById(R.id.message);                 Uri uriSMSURIs = Uri.parse(""content://sms/inbox"");                 Cursor c = getContentResolver().query(uriSMSURIs, null, null, null, null);                 String bodys = c.getString(c.getColumnIndexOrThrow(""body""));                         setContentView(R.layout.text);  ----&gt; this is name of second Xml file ""Text.xml""                 message.setText(bodys);            }        });</code></pre>","600468","","244296","","2011-02-05 16:06:24","2011-11-17 14:09:58","OnItemClickListener - open new window","<android>","4","2","","",""
"4907926","1","6944648","","2011-02-05 16:06:01","3","372","<p>I have a flex app that I need to pass FlashVars into.It works great on desktop browsers(chrome, firefox, ie) but for some reason the flashvar is always undefined when i load it on my Android browser(webkit on a droid incredible).</p><p>Has anyone successfully passed flashvars into a swf on an Android Device?</p>","604504","","","","","2011-08-04 15:57:53","flashvars not working on Android Browser","<android><actionscript-3><flex4><flashvars>","1","6","1","",""
"4908048","1","4909079","","2011-02-05 16:32:56","13","6703","<p>There are a lot of cool widgets out there that will enable and disable auto rotate on your phone.  Disabling it turns it off across all apps on the phone.</p><p>Any ideas how they are accomplishing it?</p>","242904","","","","","2014-01-10 09:45:01","Enable and disable auto rotate programatically?","<android>","4","0","6","",""
"4908114","1","4908227","","2011-02-05 16:43:04","1","24575","<p><br>using <code>onSaveInstanceState(Bundle ..) and onRestoreInstanceState(Bundle ..)</code><br>was really good and work, but it is working when click Turn off button on Emulator.<br>Now, i want to save state and restore the saved data when below button used:<br><img src=""http://i.stack.imgur.com/wEWUY.jpg"" alt=""Emulator""></p><p>I think it is possible to use OnPause() OR oOnStop(), if i am right, How to use it,<br>it will be enough to show me Java source of saving one boolean variable, and restore it,<br>Thanks.</p>","315264","","","","","2012-04-23 07:14:52","How to use onPause with Android?","<android>","6","0","3","",""
"4908215","1","4908946","","2011-02-05 17:03:10","0","325","<p>I'm fairly new to Android/Java and wanted to make an app that displays info on the installed apps on a device.</p><p>I've successfully used resolveInfo to get an app list as described <a href=""http://stackoverflow.com/questions/2695746/how-to-get-a-list-of-installed-android-applications-and-pick-one-to-run"">here</a>.</p><p>But I was interested in determining things like the app category, current cache size, or last time the app was used.  I thought I could access this using /data/data/, but I guess I can't do that due to security issues.</p><p>Any coding magic that can get this kind of information?</p>","522660","","","","","2011-02-05 19:02:21","Accessing basic data on installed Apps","<android><list><caching>","1","0","","",""
"4908251","1","4908959","","2011-02-05 17:09:41","0","480","<p>I am making an application that creates and allows the user to edit an HTML file by adding notes and / or links to it. It then allows the user to sync it via dropbox so that they can view the file from any other Android device, or from a browser on their computer. In this program I have a WebView which loads the html page and shows it to the user. However if I tell the webview to load the shortened version of the URL(E.g. <a href=""http://db.tt/DrSmhwq"" rel=""nofollow"">http://db.tt/DrSmhwq</a>) instead of putting it inside my WebView it opens it in the browser on top of my app. If I use the long version of the URL(E.g. <a href=""http://dl.dropbox.com/u/5724095/DBNotes.html"" rel=""nofollow"">http://dl.dropbox.com/u/5724095/DBNotes.html</a>) it loads it inside my WebView just fine. So I have a few questions: What is the difference between the shortened URLs and the long ones? Is there something about the URL that is causing this behavior, or is it more likely that this is an issue with the Android WebView? And does anyone know if there a way to generate the long versions of the URLs from within the dropbox Android app? Otherwise I am going to have to direct my users to go to the website on their computer and generate the long link and type it in to my app, this does not seem like a good solution.</p><p>Edit:I made a bitly url that points to the longer dropbox url and tried to call wv.loadUrl() on that, it also opened up the browser instead of loading it into the WebView. So I am guessing that this is the default behavior for how the WebView handles redirects. Does anyone know how I can make it load the page that its directed to inside itself instead of a browser window?</p>","507810","","507810","","2011-02-05 18:02:44","2011-02-05 19:04:37","Android WebView loading dropbox shortened URLs","<android><url><webview><dropbox>","1","0","","",""
"4908255","1","","","2011-02-05 17:10:24","0","2101","<p>I just got this stack trace from the marketplace error reporting and have no idea where to being to track the problem down, any help appreciated.</p><pre><code>java.lang.OutOfMemoryError: bitmap size exceeds VM budgetat android.graphics.Bitmap.nativeCreate(Native Method)at android.graphics.Bitmap.createBitmap(Bitmap.java:477)at android.graphics.Bitmap.createBitmap(Bitmap.java:444)at android.graphics.Bitmap.createScaledBitmap(Bitmap.java:349)at android.graphics.BitmapFactory.finishDecode(BitmapFactory.java:488)at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:463)at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:326)at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:697)at android.content.res.Resources.loadDrawable(Resources.java:1709)at android.content.res.Resources.getDrawable(Resources.java:581)at com.android.internal.view.menu.MenuItemImpl.getIcon(MenuItemImpl.java:440)at com.android.internal.view.menu.IconMenuItemView.initialize(IconMenuItemView.java:109)at com.android.internal.view.menu.MenuItemImpl.createItemView(MenuItemImpl.java:594)at com.android.internal.view.menu.MenuItemImpl.getItemView(MenuItemImpl.java:577)at com.android.internal.view.menu.IconMenuView.updateChildren(IconMenuView.java:351)at com.android.internal.view.menu.IconMenuView.initialize(IconMenuView.java:333)at com.android.internal.view.menu.MenuBuilder$MenuType.getMenuView(MenuBuilder.java:199)at com.android.internal.view.menu.MenuBuilder.getMenuView(MenuBuilder.java:323)at com.android.internal.policy.impl.PhoneWindow.initializePanelContent(PhoneWindow.java:858)at com.android.internal.policy.impl.PhoneWindow.openPanel(PhoneWindow.java:435)at com.android.internal.policy.impl.PhoneWindow.onKeyUpPanel(PhoneWindow.java:621)at com.android.internal.policy.impl.PhoneWindow.onKeyUp(PhoneWindow.java:1339)at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchKeyEvent(PhoneWindow.java:1668)at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:789)at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:789)at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:789)at android.widget.TabHost.dispatchKeyEvent(TabHost.java:278)at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:789)at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:789)at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchKeyEvent(PhoneWindow.java:1687)at com.android.internal.policy.impl.PhoneWindow.superDispatchKeyEvent(PhoneWindow.java:1120)at android.app.Activity.dispatchKeyEvent(Activity.java:2073)at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchKeyEvent(PhoneWindow.java:1663)at android.view.ViewRoot.deliverKeyEventToViewHierarchy(ViewRoot.java:2560)at android.view.ViewRoot.handleFinishedEvent(ViewRoot.java:2535)at android.view.ViewRoot.handleMessage(ViewRoot.java:1867)at android.os.Handler.dispatchMessage(Handler.java:99)at android.os.Looper.loop(Looper.java:123)at android.app.ActivityThread.main(ActivityThread.java:3647)at java.lang.reflect.Method.invokeNative(Native Method)at java.lang.reflect.Method.invoke(Method.java:507)at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)at dalvik.system.NativeStart.main(Native Method)</code></pre>","507991","","512958","","2011-02-05 17:34:31","2012-03-27 05:12:10","java.lang.OutOfMemoryError bitmap create?","<android><out-of-memory>","1","0","","",""
"4908256","1","","","2011-02-05 17:10:32","0","261","<p>Seemingly out of no where, I launch Eclipse, start coding, and I have a ton of errors, all relating to me overriding functions of some base classes (the onclicks, the adapters, etc).  I remove the overrides and the functionality still works but I have no clue why this happened suddenly.  I'm worried it could cause bigger issues.  Any ideas?</p>","550587","","","","","2011-02-05 17:54:27","Eclipse suddenly doesn't like my overrides","<android><onclick><adapter>","1","3","","",""
"4908267","1","4908975","","2011-02-05 17:13:08","13","16531","<p>Common scenario - Activity with a background Service to poll server.</p><p>The Service will run periodically via AlarmManager and also perform tasks for the Activity (user hits a button, go fetch something from server).</p><p>I'd like to know the best practices here.   I think the best design would be the Android LocalService example:<a href=""http://developer.android.com/reference/android/app/Service.html#LocalServiceSample"">http://developer.android.com/reference/android/app/Service.html#LocalServiceSample</a></p><p>However in the example the Activity has a reference to the activity <code>mBoundService</code> but there is no reverse connection (<strong>the Service has no way to call the Activity</strong>).</p><p>What is the best way for the Service to call the Activity?</p><p>Do I use Intents, BroadcastReceivers, Messages?  How?  </p>","569246","","","","","2011-02-05 20:53:47","Communicate with Activity from Service (LocalService) - Android Best Practices","<android><service><activity><android-intent><communication>","2","0","5","",""
"4908289","1","","","2011-02-05 17:17:57","0","2775","<p>Spent half day to understand how to change some styles to progress dialog , but I am not able to do so.</p><p>Very simple thing I wanted to start with, change the spinner color in progress dialog to some other color other than white ! , Got stuck  here itself.</p><p>In Android SDK , they are using some image and applying animation to it , I will have to do everything from scratch to change the color of the spinner ?</p><p>Any good examples where progress dialog has been modified would be helpful , I have seen in documentation , google search results upto 4-6 pages :) ,still not able to get it.</p><p>Any interesting way to show progress dialog other than default one ?</p><p>I would appreciate if someone can provide good blog on Applying themes and styles , which explains in detail.</p><p>Some code which I am using,</p><pre>dialog1 = new ProgressDialog(this);      dialog1 = ProgressDialog.show(this, """", ""Loading. Please wait..."", true);</pre><p>Trying to do lot with dialog1, but not getting any desired result.</p><p>Thank you</p>","207646","","","","","2013-01-08 11:20:31","Styling progress dialog in android","<android><android-widget>","1","3","","",""
"4908416","1","4908467","","2011-02-05 17:37:19","2","4037","<p>I can't for the life of me wrap my brain around this layout. I've managed to get the buttons to the bottom but since they are in a relativelayout I can't get them to both be 50%. Here is what I've got so far, with some code removed for simplification:</p><p></p><pre><code>&lt;ScrollView android:id=""@+id/ScrollView01""android:layout_width=""fill_parent""android:layout_height=""wrap_content""android:layout_marginBottom=""50dip""&gt;    &lt;LinearLayout android:id=""@+id/LinearLayout02""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:orientation=""vertical""    android:padding=""15px""&gt;        &lt;ImageView android:id=""@+id/ImageView02""        android:layout_height=""wrap_content""        android:layout_width=""wrap_content""        android:layout_marginBottom=""15px""        android:layout_gravity=""center_vertical|center_horizontal|center""/&gt;        &lt;TextView           android:id=""@+id/barcode""           android:layout_width=""fill_parent""           android:layout_height=""wrap_content""/&gt;        &lt;TextView            android:id=""@+id/item_number""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""/&gt;        &lt;TextView            android:id=""@+id/release""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""/&gt;        &lt;TextView            android:id=""@+id/other_text""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""/&gt;        &lt;TextView            android:id=""@+id/box_text""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""/&gt;    &lt;/LinearLayout&gt;&lt;/ScrollView&gt;&lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""android:layout_height=""fill_parent""android:layout_width=""fill_parent""android:layout_alignParentBottom=""true""&gt;    &lt;Button android:layout_width=""wrap_content""         android:layout_height=""wrap_content""         android:layout_alignParentBottom=""true""        android:layout_alignParentLeft=""true""                   android:id=""@+id/add_bt""         android:text=""Add to Collection"" /&gt;    &lt;Button android:layout_width=""wrap_content""        android:layout_height=""wrap_content""         android:layout_alignParentBottom=""true""        android:layout_alignParentRight=""true""        android:id=""@+id/back_bt""         android:text=""Go Back"" /&gt;&lt;/RelativeLayout&gt;</code></pre><p></p>","579059","","","","","2011-02-05 18:00:42","Two equal sized buttons at bottom of scrollview","<android><xml>","2","1","","",""
"4908482","1","4911758","","2011-02-05 17:47:08","1","340","<p>I am planning on purchasing the Motorola Atrix 4G for AT&amp;T. As is, you will not be able to side load apps without using <a href=""http://www.androidcentral.com/sideload-android-apps-all-you-want-sideload-wonder-machine"" rel=""nofollow"">Sideload Wonder</a> or something similar. </p><p>Does Google App Inventor work with AT&amp;T phones?</p>","363829","","","","","2011-02-06 05:31:23","Does Google App Inventor work on AT&T phones?","<android>","2","0","","",""
"4908486","1","","","2011-02-05 17:48:14","6","723","<p>The Android Canvas class supports a rich set of drawing primitives - circles, lines, etc.   I have an app that uses these to chart some statistical data.</p><p>After reading the description on <a href=""http://developer.android.com/reference/android/graphics/Canvas.html#drawLine%28float,%20float,%20float,%20float,%20android.graphics.Paint%29"">http://developer.android.com/reference/android/graphics/Canvas.html#drawLine%28float,%20float,%20float,%20float,%20android.graphics.Paint%29</a>. . . I was unclear what units the coordinates were in or how to make them device / resolution independent.</p><p>What units are these in and what's ""best practice"" for drawing lines and circles and rectangles that work on lots of different screen sizes and resolutions?   Thanks in advance.</p>","424690","","","","","2012-03-29 19:23:29","Devide independence for Canvas class drawing primitives","<android>","1","0","1","",""
"4908635","1","","","2011-02-05 18:11:21","0","701","<p>How exactly does GIMP convert a jpg into a ppm? I'm trying to convert a jpg to a ppm on Android. In Android I use the API to create an ARGB_8888 Bitmap of the jpg then drop the Alpha channel and throw the RGB values into a ppm.  But I get different values for RGB from GIMP.</p>","604591","","","","","2011-05-18 15:08:34","Android GIMP JPG to PPM conversion","<android><jpeg><gimp><ppm>","1","0","","",""
"4908731","1","","","2011-02-05 18:27:10","0","2137","<p>I'm trying to hide an administrator password window (to access system settings), so that users of my public access app wouldn't even know how to reach the password dialog.I've figured hiding it under one of the buttons with a long-press would do it, but it seems the <code>onLongClick</code> (about 500ms) is still a bit too short. Is there a way to make it longer? Or do you guys have a better idea, how to manage access to system settings (i.e. wifi and stuff) from a kiosk app.</p><p>Help much appreciated, I've hit a dead end so far.Thanks!</p><p>_ I know one of the options would be to place the app over the lock-screen (with FLAG_SHOW_WHEN_LOCKED) and make a dialog to kill my activity, which would show the lockscreen, unlock it with a nice alphanumeric pin and access the settings. But I don't really like the idea of it, since (once again) my app is intended for public use _</p>","567370","","","","","2012-07-29 23:25:17","Android: onLongClick ->longer time?","<android><onlongclicklistener>","3","1","1","",""
"4908739","1","","","2011-02-05 18:28:23","3","3327","<p>I'm bit new to android animations. Currently I'm developing an story activity which needs to use page curl animation like in iphones. As I found there is a way to do that in iphone. But still i couldn't find a way to do in android. so please help me on this.</p><p>Thanks to you all</p>","604606","","93747","","2011-02-07 09:32:23","2013-08-26 08:16:24","Android Page Curl Animation","<android><animation><flip>","2","1","2","",""
"4908794","1","8276511","","2011-02-05 18:37:15","7","1516","<p>I see this exception sporadically raising up in my application (in the wild).The WebView is used to display a jpg (using the zoom/scroll-capabilities of the Android version/the device instead reinventing the wheel and do all the reflection stuff).</p><p>I have no idea why this exception eventually could come up. Basically I can only think of an Android bug.</p><p>What I do (everything in GUI thread):</p><ul><li>display a thumbnail as preview first</li><li>set getSettings().setBuiltInZoomControls(false)</li><li>when the regular picture is loaded, display that one instead</li><li>set getSettings().setBuiltInZoomControls(true)</li></ul><p>Why setting ZoomControls on/off: The thumb should not be zoomable, as the WebView resets this on loadData as soon as the regular picture is available and displayed. Would be some bad user experience.</p><p>Example device this is happening:HTC Desire@htc_wwe/htc_bravo/bravo/bravo:2.2/FRF91/226611:user/release-keys</p><p>I have exactly the same device/software and it never happend to me...</p><p>Any ideas?</p><p>Regards,Oliver</p>","586722","","","","","2013-01-09 20:12:13","WebView throws Receiver not registered: android.widget.ZoomButtonsController","<android><webview>","1","7","","",""
"4908795","1","","","2011-02-05 18:37:33","0","242","<p>I am learning how to code with Android but I am still confused bby the way it works, I am able to create simple draws like circles and stuff but now i want to paint the circle multiple times with a delay of 2 seconds.. I would appreciatge if you experts can help me improve my code and to put the stuff in the correct place</p><pre><code>public class ColorChanges extends Activity {DrawCircle dc;@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);                drawCircleToCanvas() }void drawCircleToCanvas()  {     final Handler handler = new Handler() {                 public void handleMessage(Message msg) {                         dc.postInvalidate();                        }                 };          Thread updateUI = new Thread()      {                       public void run() {                             dc = new DrawCircle(this);  //this line does not work                dc.setBackgroundColor(Color.WHITE);                     setContentView(dc);             handler.sendEmptyMessage(0);                            }                    };                    updateUI.start();         }      }</code></pre><p>public class DrawCircle extends View {    Paint p1 = new Paint();    Paint p2 = new Paint();    Paint p3 = new Paint();</p><pre><code>Paint pAll[] = new Paint[3];public DrawCircle(Context context, AttributeSet attrs) {    super(context, attrs);    // TODO Auto-generated constructor stub}public DrawCircle(Context context, AttributeSet attrs, int defStyle) {    super(context, attrs, defStyle);    // TODO Auto-generated constructor stub}public DrawCircle(Context context) {    super(context);       p1.setStyle(Paint.Style.STROKE);       p1.setColor(Color.GREEN);       p1.setStyle(Paint.Style.FILL);       p2.setStyle(Paint.Style.STROKE);       p2.setColor(Color.BLUE);       p2.setStyle(Paint.Style.FILL);       p3.setStyle(Paint.Style.STROKE);       p3.setColor(Color.YELLOW);       p3.setStyle(Paint.Style.FILL);       pAll[1] = p1;       pAll[2] = p2;       pAll[3] = p3;    // TODO Auto-generated constructor stub}@Override  public void onDraw(Canvas canvas) {         for (int i = 0; i &lt; pAll.length;i++)    {     canvas.drawCircle(200, 200, 100, pAll[i]);    }}</code></pre><p>}</p>","604620","","604620","","2011-02-05 19:18:10","2011-02-05 19:18:10","Android Drawing","<android><testing>","0","2","","",""
"4909066","1","","","2011-02-05 19:19:03","0","318","<p>I have a ListView containing numbered items with unique IDs. What I want to do is when I change an item's ID from e.g. 85 to 3, I would also want to update all other items to increase all IDs >= 3 by 1:</p><pre><code>3-&gt;44-&gt;55-&gt;6...</code></pre><p>To do that, I would need to update (worst case) all rows in my table. Should I avoid doing that? What do you think?</p>","577604","","496830","","2011-03-14 20:43:30","2011-03-14 20:43:30","Changing data items in ListView and SQLite table update - is it too expensive?","<android><sqlite>","0","3","","",""
"4909101","1","4909159","","2011-02-05 19:24:39","1","13581","<p>i have two buttons next to each other. I want them to be the same size and fill the whole width of the screen. I've been trying with this code:(It's relativelayout, if that matters)</p><pre><code>&lt;Button android:text=""Names"" android:id=""@+id/Button01"" android:layout_width=""fill_parent"" android:layout_height=""wrap_content""android:layout_weight=""1""&gt;&lt;/Button&gt;&lt;Button android:text=""Dates"" android:id=""@+id/Button02"" android:layout_toRightOf=""@+id/Button01""android:layout_width=""fill_parent""android:layout_height=""wrap_content""android:layout_weight=""1""&gt;&lt;/Button&gt;</code></pre>","571648","","","","","2011-06-28 02:10:30","Android align two buttons","<android><alignment>","1","0","1","",""
"4909137","1","4909355","","2011-02-05 19:28:50","0","868","<p>I'm looking for the accessor version of Activity's setResult(). Imagine getResult() to return a Bundle if a resultCode and Intent have been used in setResult().</p><p>The reason for this is by default activities load with the resultCode set to RESULT_CANCELED: <a href=""http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/2.3_r1/android/app/Activity.java#669"" rel=""nofollow"">http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/2.3_r1/android/app/Activity.java#669</a>, and I would like to be able to query the resultCode from the onPause method. This might save a listener for the back button pressed.</p>","202076","","","","","2011-02-05 20:08:49","Getting activity result in OnPause after call to finish()","<android>","1","0","","",""
"4909301","1","","","2011-02-05 19:56:56","2","9264","<p>I have a listview that consists of two textviews. One for dates, one for names.Config.xml includes the listview:</p><pre><code>&lt;ListView android:id=""@+id/ListView01"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content""android:layout_below=""@+id/linlay""&gt;&lt;/ListView&gt;</code></pre><p>Row.xml includes the two textviews:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout     xmlns:android=""http://schemas.android.com/apk/res/android""     android:paddingTop=""4dip""     android:paddingBottom=""6dip""     android:layout_width=""fill_parent""     android:layout_height=""wrap_content""     android:orientation=""horizontal""&gt; &lt;LinearLayout android:orientation=""horizontal""    android:id=""@+id/linlay""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""&gt;     &lt;TextView android:id=""@+id/left""         android:layout_width=""wrap_content""         android:layout_height=""wrap_content""       /&gt;     &lt;TextView android:id=""@+id/right""         android:layout_width=""wrap_content""         android:layout_height=""fill_parent""/&gt;  &lt;/LinearLayout&gt;&lt;/LinearLayout&gt;</code></pre><p>I have two more buttons to change the content of the textviews with each other but as the content of the first one (initially) is wider than the second one, i need to set the width of the layout in the code.Unfortunately there is no txt.setLayoutWidth or similar command, and txt.setWidth() is not working.I need something like this in this code:</p><pre><code> Button sortname = (Button)findViewById(R.id.Button02);  sortname.setOnClickListener(new View.OnClickListener()   {    public void onClick(View v)     {        lv1.setAdapter(simpleAdapter2);            LinearLayout.LayoutParams layoutparams = new LinearLayout.LayoutParams(200,120);        txt1.setLayoutParams(layoutparams);    }  });</code></pre><p>This two rows makes the app freeze (stopped unexpectedly):</p><pre><code>LinearLayout.LayoutParams layoutparams = new LinearLayout.LayoutParams(200,120);    txt1.setLayoutParams(layoutparams);</code></pre><p>Logcat:</p><pre><code>02-05 22:58:11.040: INFO/ActivityManager(58): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.bfarago.nevnap/.MainActivity }02-05 22:58:11.210: DEBUG/AndroidRuntime(415): Shutting down VM02-05 22:58:11.230: DEBUG/dalvikvm(415): Debugger has detached; object registry had 1 entries02-05 22:58:11.330: INFO/AndroidRuntime(415): NOTE: attach of thread 'Binder Thread #3' failed02-05 22:58:12.310: INFO/ActivityManager(58): Displayed activity com.bfarago.nevnap/.MainActivity: 1108 ms (total 1108 ms)02-05 22:58:17.560: DEBUG/dalvikvm(125): GC_EXPLICIT freed 1274 objects / 73520 bytes in 185ms02-05 22:58:17.660: DEBUG/AndroidRuntime(405): Shutting down VM02-05 22:58:17.660: WARN/dalvikvm(405): threadid=1: thread exiting with uncaught exception (group=0x4001d800)02-05 22:58:17.670: ERROR/AndroidRuntime(405): FATAL EXCEPTION: main02-05 22:58:17.670: ERROR/AndroidRuntime(405): java.lang.NullPointerException02-05 22:58:17.670: ERROR/AndroidRuntime(405):     at com.bfarago.nevnap.MainActivity$2.onClick(MainActivity.java:129)02-05 22:58:17.670: ERROR/AndroidRuntime(405):     at android.view.View.performClick(View.java:2408)02-05 22:58:17.670: ERROR/AndroidRuntime(405):     at android.view.View$PerformClick.run(View.java:8816)02-05 22:58:17.670: ERROR/AndroidRuntime(405):     at android.os.Handler.handleCallback(Handler.java:587)02-05 22:58:17.670: ERROR/AndroidRuntime(405):     at android.os.Handler.dispatchMessage(Handler.java:92)02-05 22:58:17.670: ERROR/AndroidRuntime(405):     at android.os.Looper.loop(Looper.java:123)02-05 22:58:17.670: ERROR/AndroidRuntime(405):     at android.app.ActivityThread.main(ActivityThread.java:4627)02-05 22:58:17.670: ERROR/AndroidRuntime(405):     at java.lang.reflect.Method.invokeNative(Native Method)02-05 22:58:17.670: ERROR/AndroidRuntime(405):     at java.lang.reflect.Method.invoke(Method.java:521)02-05 22:58:17.670: ERROR/AndroidRuntime(405):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)02-05 22:58:17.670: ERROR/AndroidRuntime(405):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)02-05 22:58:17.670: ERROR/AndroidRuntime(405):     at dalvik.system.NativeStart.main(Native Method)02-05 22:58:17.680: WARN/ActivityManager(58):   Force finishing activity com.bfarago.nevnap/.MainActivity02-05 22:58:18.200: WARN/ActivityManager(58): Activity pause timeout for HistoryRecord{43e9a940 com.bfarago.nevnap/.MainActivity}02-05 22:58:19.790: INFO/Process(405): Sending signal. PID: 405 SIG: 902-05 22:58:19.820: INFO/ActivityManager(58): Process com.bfarago.nevnap (pid 405) has died.02-05 22:58:19.820: WARN/ActivityManager(58): Scheduling restart of crashed service com.bfarago.nevnap/.UpdateService in 5000ms02-05 22:58:19.820: INFO/WindowManager(58): WIN DEATH: Window{43fce1d8 com.bfarago.nevnap/com.bfarago.nevnap.MainActivity paused=false}02-05 22:58:19.920: WARN/InputManagerService(58): Got RemoteException sending setActive(false) notification to pid 405 uid 1004802-05 22:58:24.291: DEBUG/dalvikvm(216): GC_EXPLICIT freed 93 objects / 3736 bytes in 153ms02-05 22:58:24.901: INFO/ActivityManager(58): Start proc com.bfarago.nevnap for service com.bfarago.nevnap/.UpdateService: pid=425 uid=10048 gids={1015}02-05 22:58:28.966: WARN/ActivityManager(58): Activity destroy timeout for HistoryRecord{43e9a940 com.bfarago.nevnap/.MainActivity}02-05 22:58:29.350: DEBUG/dalvikvm(263): GC_EXPLICIT freed 44 objects / 2032 bytes in 164ms</code></pre>","571648","","16487","","2011-02-07 14:06:21","2013-07-17 08:14:55","Android Set textview layout width dynamically","<android><listview><textview>","1","1","1","",""
"4909305","1","4909568","","2011-02-05 19:57:27","0","789","<p><br>I'm writing an AppWidget on which I must programatically control it's background image. Additionally, I must display [overlaying] text messages. I must also react to user interaction (""clicks"").My (already working) proof-of-concept is as follows:</p><p>a) I have an ImageButton on my main layout.<br>b) I have a custom intent that I'm processing onReceive(). I then change it's background image via RemoteViews.setImageViewResource method. This works almost fine, except for the fact that I cannot have/set text on a ImageButton.<br> c) I replaced a) by a Button. I now can write text to the Button, but I cannot find a way to change it's background image.</p><p>So I'm basically stuck on a loop: I could not find a way yet to accomplish all the three goals on my appWidget: an image + clickable + with text.</p><p>Since I'm new to Android, I ask you folks for some pointers/directions.<br>Thanks in advance<br>Pedro</p>","228913","","","","","2011-02-05 20:50:56","AppWidget with Background image + Text + click (tap) event","<android><android-widget>","1","0","","",""
"4909354","1","","","2011-02-05 20:08:25","0","514","<p>I want to change the contents of an <code>EditText</code> on another <code>Activity</code> with a button.</p><p>Both activities extend from the same parent.</p><p>How can I do this?</p>","576820","","418183","","2011-02-05 20:19:08","2011-02-05 20:19:08","Change text from other activity","<android><activity><edittext>","1","6","","",""
"4909367","1","","","2011-02-05 20:10:09","13","14649","<p>Target: Android >= 1.6 on a pure Canvas.</p><p>Suppose I want to write a function that will draw a (width, height) large red rectangle and then draw a black <em>Hello World</em> text inside. I want the text to be visually in the center of the rectangle. So let's try:</p><pre><code>void drawHelloRectangle(Canvas c, int topLeftX,         int topLeftY, int width, int height) {    Paint mPaint = new Paint();    // height of 'Hello World'; height*0.7 looks good    int fontHeight = (int)(height*0.7);    mPaint.setColor(COLOR_RED);    mPaint.setStyle(Style.FILL);    c.drawRect( topLeftX, topLeftY, topLeftX+width, topLeftY+height, mPaint);    mPaint.setTextSize(fontHeight);    mPaint.setColor(COLOR_BLACK);    mPaint.setTextAlign(Align.CENTER);    c.drawText( ""Hello World"", topLeftX+width/2, ????, mPaint);}</code></pre><p>Now I don't know what to put in drawText's argument marked by <code>????</code>, i.e. I don't know how to vertically align the text. </p><p>Something like</p><blockquote>  <p>???? = topLeftY + height/2 +  fontHeight/2 - fontHeight/8;</p></blockquote><p>appears to work more or less ok, but there must be a better way.</p>","583075","","418183","","2011-02-05 20:15:15","2013-04-16 12:53:22","How to align text vertically?","<android><canvas><drawtext>","5","1","3","",""
"4909526","1","","","2011-02-05 20:42:16","0","4245","<p>I have been trying to find a code snippet for getting all the contacts but none of the existing ones allow us to get us all the information for all the contacts. I went through the existing question (similar)<a href=""http://stackoverflow.com/questions/2205246/how-to-obtain-all-details-of-a-contact/4909411#4909411"">How to obtain all details of a contact</a></p><p>but again the code is not a working one. I am working on Froyo Api Level 7</p>","592773","","418183","","2011-02-05 20:49:31","2011-02-05 22:01:36","How do we get all contact information?","<android><contact>","0","2","","2014-01-09 23:31:01",""
"4909530","1","","","2011-02-05 20:42:44","1","833","<p>I am attempting to make an android application with a pre-populated database. When learning about how to go about this, I came across this article <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> , which basically takes an existing sqlite database and streams it into the correct location on the android device. The data I had was dealt with in ruby, so I grabbed the sqlite gem, and created a database like so. </p><pre><code>db = SQLite3::Database.new( ""cards.db"" )db.execute(""CREATE TABLE android_metadata (locale TEXT DEFAULT \""en_US\"")"")db.execute(""INSERT INTO android_metadata VALUES (\""en_US\"")"")db.execute(""  CREATE TABLE #{@@card_table_name} (  _id INTEGER PRIMARY KEY,  name TEXT UNIQUE  )"")cards.each do |card|  begin    db.execute(""INSERT INTO #{@card_table_name} (_id, name) VALUES (?, ?)"",               card.id, card.name)  rescue =&gt; e    puts ""#{card.name} (#{card.id})""    puts e  endend</code></pre><p>When I go into the database, both the one made from the ruby script, and the one from using adb and examining the database on the emulator, I get this for the schema.</p><pre><code>sqlite&gt; .schemaCREATE TABLE Cards (  _id INTEGER PRIMARY KEY,  name TEXT UNIQUE  );</code></pre><p>However, when I pull the data back out in my application, getString can't deal with the name, specifically, this block gets into the exception clause, and prints the name successfully within that block</p><pre><code>Cursor cursor = myDataBase.query(""Cards"", new String[] {""_id"", ""name""}, null, null, null, null, null, ""5"");while (cursor.moveToNext()) {    try {        cards.add(new Card(cursor.getInt(0), new String(cursor.getString(1))));    } catch (Exception e) {        byte[] blob = cursor.getBlob(1);        String translated = new String(blob);        Log.i(MagicApp.TAG, ""DB retrival blew up on "" + cursor.getInt(0) + "", "" + blob + "" : "" + translated);        e.printStackTrace();    }}</code></pre><p>I can deal with that, but it seems like I shouldn't have to do that. Any one else encountered this, or know what I'm doing wrong?</p>","9276","","9276","","2011-02-06 02:21:58","2011-02-06 02:21:58","In android, sqlite text field is retrieved using getBlob, not getString","<android><ruby><sqlite3>","0","1","","",""
"4909588","1","4909629","","2011-02-05 20:54:47","2","376","<p>In my application I'm storing all data in ApplicationData so that it can be easily shared between activities.  My understanding is that this data should persist for the full life cycle of the application from the initial onCreate to the final onDestroy.  That being the case, is there any need for me to store data in persistent storage during the onPause of all but the top activity?</p>","574740","","","","","2011-02-05 21:02:10","Is ApplicationData safe place to store data during onPause?","<android><lifecycle>","1","0","1","",""
"4909601","1","4919279","","2011-02-05 20:57:28","0","430","<p>I have an Activity that uses a layout that contains a TextView, an ImageButton, and an ExpandableListView.  As far as I can tell, there are no default views for ExpandableListView's group and child views.  As such, the cursor adapter I provide to ExpandableListView is a subclass of CursorTreeAdapter that overrides newGroupView() and newChildView().  The group view contains a TextView and an ImageButton.  The child view contains a TextView and a RatingBar.</p><p>Is there anything special I need to do to (1) have the behavior where pressing a group item in the list causes the item's background to turn the default Android yellow/orange (2) have the group expand to show the children when the group item is pressed.</p><p>I thought these 2 behaviors were built into the ExpandableListView and didn't require any sort of special wiring up by the developer.  Is this incorrect?</p><p>Thanks.</p>","369722","","1016716","","2012-04-30 08:10:52","2012-04-30 08:10:52","Do ExpandableListView list item ""press"" behaviors have to be wired up by the developer?","<android><expandablelistview><pressed>","1","0","1","",""
"4909626","1","4909723","","2011-02-05 21:01:17","0","184","<p>I have a ""database"" class that handles SQLites actions. Part of its constructor is the application's context. So far so good but now, I have a ""monitor"" class that extends BroadcastReceiver that needs to use this database class and I have no context to build that instance. So there are two alternatives:</p><p>1.- How can I get the application's context from the ""monitor"" class or2-. How can I get the application's context from the ""database"" class</p><p>Thanks</p>","253944","","","","","2011-02-05 21:18:46","How to get the application context from a ""non-graphic"" class","<android><context>","1","1","","",""
"4909634","1","4909967","","2011-02-05 21:03:45","0","846","<p>I'm trying to make an Android app which contacts a webserver every 15 minutes to retrieve som kind of RSS. I know how to retrieve the RSS, but my problem is how I make the app contact the webserver periodically.</p><p>I've read about services, handlers, timers and runnables but I don't know which of them I should use, and how I should use them.</p><p>Thanks in advance.</p>","604724","","","","","2011-03-16 18:27:21","Service, handler, timer, runnable - which to use and how?","<android>","2","1","","",""
"4909646","1","","","2011-02-05 21:06:36","0","708","<p>I working with android and JSON. I came so far, but I can's set the ID in the arraylist.The error will be in ""json_data.getInt(""ID"")"" </p><p>Can sombody help me</p><pre><code>    public void klussenlijst()    {ArrayList&lt;String&gt; results = new ArrayList&lt;String&gt;();        JSONObject json_data;        mysql client = new mysql(""http://www.****************/klussen.php?actie=klussen"");        try {            client.Execute(RequestMethod.POST);        } catch (Exception e) {            e.printStackTrace();        }        String response = client.getResponse();        try{;        JSONArray jArray = new JSONArray(response);             for(int i=0;i&lt;jArray.length();i++){             json_data = jArray.getJSONObject(i);             results.add(json_data.getInt(""ID""),(String) json_data.get(""titel"").toString());            }             filllist();             }             catch(JSONException e){                 e.printStackTrace();             }    }</code></pre>","451405","","","","","2011-04-14 17:24:47","android json to listview","<android><json><arraylist>","1","3","","",""
"4909669","1","","","2011-02-05 21:10:11","2","3538","<p>I'm using CSS media queries to adjust a site's layout based on the resolution/device. I've got the layout looking nice, but I can't make the horizontal scrollbar disappear. I've also tried eliminating the ability to zoom out to no avail... any advice would be appreciated. The site is dev.javelinexperiential.com. </p>","588488","","","","","2011-07-24 04:50:38","Overflow-x:hidden not working w/ Android (Samsung Epic) and possibly others","<android><css><mobile><overflow><android-scrollbar>","1","0","","",""
"4909701","1","4909752","","2011-02-05 21:14:57","8","2043","<p>For persistent storage of data is there any distinct advantage of using a SQLlite database over SharedPreferences or vice versa?  Currently my application data is only a couple of kilobytes in size, though it could conceivably rise to ten times that size in the future.  I can't find anywhere that states how much storage is available using SharedPreferences but would imagine this would be one limitation of using it?  Is there any difference in speed between the two methods?  I'm looking to weigh up the pros and cons of those two storage methods.</p>","574740","","236247","","2011-06-27 04:11:27","2011-06-27 04:11:27","SQLite or SharedPreferences for persistent data storage?","<android><storage><lifecycle>","1","0","1","",""
"4909738","1","4909770","","2011-02-05 21:20:45","0","4473","<p>HelloI have a multi choice listview. I would like to add more than one line of text to each list item. e.g.</p><p><strong>List Item 1</strong><br><em>Subtext</em>  </p><p>With subtext being smaller text.etc.</p><p>I can't find a solid example of this bar making my own custom list adapter which adds complications for multi select and is sort of over my head. The way I add items currently is</p><pre><code>private static final String[] items={""my"", ""name"", ""is"", ""mark"", ""i"", ""am"", ""testing"", ""lists""};theList = new ArrayAdapter&lt;String&gt;(this,                android.R.layout.simple_list_item_multiple_choice, items);        setListAdapter(theList);</code></pre><p>Is there any way to do this?</p>","602279","","","","","2012-03-08 19:52:57","Multi-line Listview in Android","<android>","2","0","","",""
"4909798","1","4910025","","2011-02-05 21:30:53","6","3056","<p>With the blogpost yesterday regarding us getting a healthy dose of Fragments all the way back to 1.6, I was wondering, will the ActionBar APIs be included in this backport?</p><p>They <strong>appear</strong> to be somewhat linked together, from the API Docs at the least. However, I could see the Fragments being separate from the ActionBar, but not visa-versa.</p><p>Anybody have any news?</p><p>Thanks -- Selig</p>","604742","","750987","","2011-05-29 06:47:05","2011-11-30 11:30:03","Will the new ActionBar API be included in the Fragment backport?","<android><android-3.0-honeycomb>","3","3","2","",""
"4909836","1","","","2011-02-05 21:37:27","3","1009","<p>I would like to change the profile of the phone, for instance change from vibrator mode to normal mode or even plane mode. I cannot find in the permission list anything to allow this type of change. Is this possible ?</p>","604761","","508666","","2012-01-29 13:12:07","2012-12-12 09:41:33","Android, change the profile of the phone","<android><vibrate><plane>","3","0","","2013-11-21 23:13:58",""
"4909844","1","4910211","","2011-02-05 21:39:01","0","459","<p>I am a bit frustrated as to how to do this.., Can anyone please help me or guide me in the right direction?, with the code below. I just need to make a circle change colors in 2 second intervals, and i cant find anything out there.. basically if I could understand the following it would be enough</p><p>1.I have a class call DrawCircle that Exatends View2.I have the Activity program where I instantiate the DrawCircle Class.Questions:</p><p>1 - Where Do I create the Thread? in Activity or in the DrawCircle class?, and if I do, what should i put in the run();</p><p>2 - Where would I put the ""Thread.sleep(2000)""? 3. and Finally, what do i need to make sure I have in the DrawCircle class and what should I make sure I have in the Activity or main program?</p><p>I just need to make a circle change colors in intervals of 2 seconds</p><p>Thank you very much for all the help ( I have spent 12 hours already trying to make this work and maybe I just shouldnt do it anymore)</p><p>Here is the code</p><pre><code>public class ColorChanges extends Activity {   DrawCircle dc;     Paint pa = new Paint();  @Override   public void onCreate(Bundle savedInstanceState)     {              super.onCreate(savedInstanceState);               //this line does not work            dc = new DrawCircle(this,pa);             dc.setBackgroundColor(Color.WHITE);                 drawCircleToCanvas();            setContentView(dc);              }     void drawCircleToCanvas()       {             final Handler handler = new Handler()           {                              public void handleMessage(Message msg) {                pa.setColor(Color.BLUE);                 dc.setBackgroundColor(Color.RED);                 dc.postInvalidate();                                          }                             };                      Thread updateUI = new Thread()                   {                                        public void run() {                                                  try {                        for (int i=0;i&lt;20;i++){                        Thread.sleep(2000);                        handler.sendMessage(handler.obtainMessage());                        }                    } catch (InterruptedException e) {                        // TODO Auto-generated catch block                        e.printStackTrace();                    }                }                                     };                                     updateUI.start();                       }  </code></pre><p>}</p><p>That is the Activity and here is my Class</p><pre><code>public class DrawCircle extends View {Paint p1 = new Paint();Paint p2 = new Paint();Paint p3 = new Paint();Paint pAll[] = new Paint[3];public DrawCircle(Context context, AttributeSet attrs) {    super(context, attrs);    // TODO Auto-generated constructor stub}public DrawCircle(Context context, AttributeSet attrs, int defStyle) {    super(context, attrs, defStyle);    // TODO Auto-generated constructor stub}public DrawCircle(Context context, Paint p) {    super(context);       p1 = p;       p1.setStyle(Paint.Style.STROKE);       p1.setColor(Color.GREEN);       p1.setStyle(Paint.Style.FILL);    // TODO Auto-generated constructor stub}@Override  public void onDraw(Canvas canvas) {                  canvas.drawCircle(200, 200, 100, p1); }</code></pre><p>}</p>","604620","","604620","","2011-02-05 22:04:11","2011-02-05 22:49:56","Android Changing Colors with Thread","<android>","1","2","0","",""
"4909877","1","","","2011-02-05 21:45:49","2","4948","<p>I have just stripped out the medialytics api from my app because i found it a waste of time and more of a problem than anything else.</p><p>Problem is, now my app crashes on start up with the above message in the logcat</p><p>Here is the source code for my main activity</p><pre><code>public abstract class Converter extends Activity {    private ListView lv1;    private String lv_arr[] = {""Area"", ""Density"", ""Distance"", ""Energy"",            ""Pressure"", ""Temperature"", ""Velocity"", ""Volume"", ""Weight""};    @Override    public void onCreate(Bundle savedInstanceState) {         super.onCreate(savedInstanceState);         setContentView(R.layout.main);        AdView adView = (AdView)findViewById(R.id.ad);        adView.requestFreshAd();        AdManager.setTestDevices( new String[] {            AdManager.TEST_EMULATOR,                ""E83D20734F72FB3108F104ABC0FFC738"",         } );        lv1 = (ListView)findViewById(R.id.MainList);        lv1.setAdapter(new ArrayAdapter&lt;String&gt;(            this, android.R.layout.simple_list_item_1, v_arr));            lv1.setOnItemClickListener(new OnItemClickListener(){            @Override            public void onItemClick(AdapterView&lt;?&gt; arg0, View arg1, int arg2,                    long arg3) {                if (""Area"".equals(lv_arr[arg2])){                    Intent i = new Intent(Converter.this, Area.class);                    startActivity(i);                }if (""Density"".equals(lv_arr[arg2])){                    Intent i = new Intent(Converter.this,Density.class);                    startActivity(i);                }if (""Distance"".equals(lv_arr[arg2])){                    Intent i = new Intent(Converter.this,Distance.class);                    startActivity(i);                }if (""Energy"".equals(lv_arr[arg2])){                    Intent i = new Intent(Converter.this,Energy.class);                    startActivity(i);                     }if (""Pressure"".equals(lv_arr[arg2])){                    Intent i = new Intent(Converter.this,Pressure.class);                    startActivity(i);                }if (""Temperature"".equals(lv_arr[arg2])){                    Intent i = new Intent(Converter.this,Temperature2.class);                    startActivity(i);                }if (""Velocity"".equals(lv_arr[arg2])){                    Intent i = new Intent(Converter.this,Velocity.class);                    startActivity(i);                }if (""Volume"".equals(lv_arr[arg2])){                    Intent i = new Intent(Converter.this,Volume.class);                    startActivity(i);                }if (""Weight"".equals(lv_arr[arg2])){                    Intent i = new Intent(Converter.this,Weight.class);                    startActivity(i);                }            }        });    }}</code></pre><p>And here is the layout xml</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/app.android.converter""    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""        myapp:backgroundColor=""#000000""        myapp:primaryTextColor=""#FFFFFF""        myapp:secondaryTextColor=""#CCCCCC"" /&gt;    &lt;TextView android:id=""@+id/MenuText""         android:text=""Pick a Category to Begin""         android:layout_width=""wrap_content""         android:layout_height=""wrap_content""         android:layout_centerHorizontal=""true""         android:layout_below=""@id/ad""        android:textStyle=""bold"" /&gt;     &lt;ListView        android:id=""@+id/MainList""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:layout_below=""@id/MenuText"" /&gt;&lt;/RelativeLayout&gt;</code></pre><p>Can anyone spot the problem because for the life of me I cannot.</p>","562562","","418183","","2011-02-05 21:56:08","2011-02-05 22:05:52","Runtime Exception: Unable to instantiate activity component info","<android><crash><instantiation><android-logcat>","2","2","","",""
"4909886","1","","","2011-02-05 21:46:46","5","1380","<p>I have an AppWidget with 2 pending intents. They work most of the time, but after a while they stop responding. Only thing I have been able to pinpoint is that they are crippled after a Launcher restart, i.e. I use Launcher Pro, and sometimes fiddle with settings and have to restart it. After that they don't work at all.</p><p>Here are my <code>onRecieve()</code> and <code>onUpdate()</code> methods:</p><pre><code>   public void onReceive(Context context, Intent intent){    super.onReceive(context, intent);    String action = intent.getAction();    if(action.equals(""android.tristan.widget.digiclock.CLICK""))    {        PackageManager packageManager = context.getPackageManager();        Intent alarmClockIntent = new Intent(Intent.ACTION_MAIN).addCategory(Intent.CATEGORY_LAUNCHER);        String clockImpls[][] = {                {""HTC Alarm Clock"", ""com.htc.android.worldclock"", ""com.htc.android.worldclock.AlarmClock"" },                {""Standar Alarm Clock"", ""com.android.deskclock"", ""com.android.deskclock.AlarmClock""},                {""Froyo Nexus Alarm Clock"", ""com.google.android.deskclock"", ""com.android.deskclock.DeskClock""},                {""Moto Blur Alarm Clock"", ""com.motorola.blur.alarmclock"",  ""com.motorola.blur.alarmclock.AlarmClock""}        };        boolean foundClockImpl = false;        for(int i=0; i&lt;clockImpls.length; i++) {            String vendor = clockImpls[i][0];            String packageName = clockImpls[i][1];            String className = clockImpls[i][2];            try {                ComponentName cn = new ComponentName(packageName, className);                ActivityInfo aInfo = packageManager.getActivityInfo(cn, PackageManager.GET_META_DATA);                alarmClockIntent.setComponent(cn);                foundClockImpl = true;            } catch (NameNotFoundException e) {                Log.d(LOGTAG, ""Error,"" + vendor + "" does not exist"");            }        }        if (foundClockImpl) {        Vibrator vibrator = (Vibrator) context.getSystemService(Context.VIBRATOR_SERVICE);        vibrator.vibrate(50);        final RemoteViews views = new RemoteViews(context.getPackageName(), layoutID);        views.setOnClickPendingIntent(R.id.TopRow, PendingIntent.getActivity(context, 0, new Intent(context, DigiClock.class).setFlags(Intent.FLAG_ACTIVITY_NEW_TASK), PendingIntent.FLAG_UPDATE_CURRENT));        AppWidgetManager.getInstance(context).updateAppWidget(intent.getIntArrayExtra(AppWidgetManager.EXTRA_APPWIDGET_IDS), views);        alarmClockIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);        context.startActivity(alarmClockIntent);          }    }}        public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {super.onUpdate(context, appWidgetManager, appWidgetIds);    context.startService(new Intent(UpdateService.ACTION_UPDATE));    context.startService(new Intent(context, ScreenUpdateService.class));    final int Top = appWidgetIds.length;    final int Bottom = appWidgetIds.length;    for (int i=0; i&lt;Top; i++)    {    int[] appWidgetId = appWidgetIds;    final RemoteViews top=new RemoteViews(context.getPackageName(), layoutID);    Intent clickintent=new Intent(""android.tristan.widget.digiclock.CLICK"");    PendingIntent pendingIntentClick=PendingIntent.getBroadcast(context, 0, clickintent, 0);    top.setOnClickPendingIntent(R.id.TopRow, pendingIntentClick);    appWidgetManager.updateAppWidget(appWidgetId, top);}for (int i=0; i&lt;Bottom; i++){    int[] appWidgetId = appWidgetIds;    RemoteViews bottom=new RemoteViews(context.getPackageName(), layoutID);    Intent clickintent=new Intent(""android.tristan.widget.digiclock.CLICK_2"");    PendingIntent pendingIntentClick=PendingIntent.getBroadcast(context, 0, clickintent, 0);    bottom.setOnClickPendingIntent(R.id.BottomRow, pendingIntentClick);    appWidgetManager.updateAppWidget(appWidgetId, bottom);}}</code></pre><p>I have read about putting the intents in a service, but have tried and failed. Any help is appreciated.</p>","525720","","1073832","","2012-08-20 18:04:34","2012-08-20 18:04:34","AppWidget PendingIntent not working after Launcher restart","<android><android-intent><onclick><appwidget><android-pendingintent>","1","0","1","",""
"4909903","1","4909934","","2011-02-05 21:49:22","3","10247","<p>I am creating a web service that queries my database and returns a list of the object in the database. I get the error: NullPointerAccess: The variable ""varname"" can only be null at this location. No matter where I put the variable, I get the same warnings. No matter what I put inside the variable, it returns null. Below is the method that it occurs in:</p><pre><code>    public List&lt;Contacts&gt; getUsers()  {     String test = null;        String username = ""root"";        String password = ""ticket"";        String tablename = ""users"";        String fieldname = ""*"";        String query = ""SELECT "" + fieldname + "" FROM "" + ""android."" + tablename + "";"";        Contacts cont = new Contacts();        List&lt;Contacts&gt; lstc = null;        /* this chnk of code can appear more or less verbatim */        /* in your database apps (including JSPs) */        String url = ""jdbc:mysql://""my IP address"":3306/android"";        try{        Class.forName(""com.mysql.jdbc.Driver"").newInstance();        Connection con = DriverManager.getConnection(url, username, password);        Statement stmt = con.createStatement();        ResultSet rs = stmt.executeQuery(query);        while (rs.next()){            if (!(rs.getString(""username"") == null)){             cont.setUsername(rs.getString(""username""));            }            if (!(rs.getString(""location"") == null)){             cont.setLocation(rs.getString(""location""));            }            if (!(rs.getString(""updated_at"") == null)){             cont.setUpdated_at(rs.getDate(""updated_at""));            }            if (!(rs.getString(""idUsers"") == null)){             cont.setId(rs.getInt(""idUsers""));            }        }        rs.close();        stmt.close();        con.close();        }catch(Exception e){            test = e.toString();        }         lstc.add(cont); //THIS IS THE VARIABLE THAT IS GIVING THE WARNINGS        test = ""blahbadslf"";        return lstc;        }</code></pre><p>The variable that is getting the warnings is my List lstc variable. When I try to add a  Object to the List I get the errors. Any help would be much appreciated. Here is the Class just in case: </p><pre><code>public class Contacts{private int id;private String username;private String location;private Date updated_at;public void setId(int id) {    this.id = id;}public int getId() {    return id;}public void setUsername(String username) {    this.username = username;}public String getUsername() {    return username;}public void setLocation(String location) {    this.location = location;}public String getLocation() {    return location;}public void setUpdated_at(Date updated_at) {    this.updated_at = updated_at;}public Date getUpdated_at() {    return updated_at;}</code></pre><p>}</p><p>Thanks!</p>","600137","","","","","2011-02-05 21:58:39","Error: NullPointerAccess: The variable "" "" can only be null at this location","<java><android><mysql><web-services>","3","0","","",""
"4909937","1","","","2011-02-05 21:53:12","-1","2170","<p>Hi I am trying to make a app that will pull a list the logged in users friends from facebook into my application I am using the facebook SDK the code compiles and seems to work but hangs on the spinner animation when I select the get friends option from the menu! here is the code I am using bellow</p><pre><code>public static final String APP_ID = ""IDHERE"";private static final String[] PERMISSIONS =    new String[]{ ""offline_access"", ""read_stream"",             ""publish_stream"",""create_event"",""user_events"",""friends_events"",            ""publish_checkins"", ""friends_checkins"" };private TextView mText;private Handler mHandler = new Handler();private ProgressDialog mSpinner;private final ArrayList&lt;Friend&gt; friends = new ArrayList&lt;Friend&gt;();private FriendsArrayAdapter friendsArrayAdapter;private ListView listView;private Facebook mFacebook;private AsyncFacebookRunner mAsyncRunner;/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    // Make sure the app client_app has been set    if (APP_ID == null) {        Util.showAlert(this,        ""Warning"", ""Facebook Applicaton ID must be set..."");    }    // Initialize the content view    setContentView(R.layout.main);    // Get the status text line resource    mText = (TextView) workdammit.this.findViewById(R.id.txt);    // Setup the ListView Adapter that is loaded when selecting ""get friends""    listView = (ListView) findViewById(R.id.friendsview);    friendsArrayAdapter = new FriendsArrayAdapter(this, R.layout.rowlayout, friends);    listView.setAdapter(friendsArrayAdapter);    // Define a spinner used when loading the friends over the network    mSpinner = new ProgressDialog(listView.getContext());    mSpinner.requestWindowFeature(Window.FEATURE_NO_TITLE);    mSpinner.setMessage(""Loading..."");    // Initialize the Facebook session    mFacebook = new Facebook(APP_ID);    mAsyncRunner = new AsyncFacebookRunner(mFacebook);}//////////////////////////////////////////////////////////////////////public void onActivityResult(int requestCode, int resultCode, Intent data) {  super.onActivityResult(requestCode, resultCode, data);  Log.d(""FB Sample App"", ""onActivityResult(): "" + requestCode);  mFacebook.authorizeCallback(requestCode, resultCode, data);}//////////////////////////////////////////////////////////////////////// Get Friends request listener///////////////////////////////////////////////////////////////////////** * FriendsRequestListener implements a request lister/callback *  for ""get friends"" requests */public class FriendsRequestListener implements        com.facebook.android.AsyncFacebookRunner.RequestListener {    /**     * Called when the request to get friends has been completed.     * Retrieve and parse and display the JSON stream.     */    public void onComplete(final String response) {        mSpinner.dismiss();        try {            // process the response here: executed in background thread            Log.d(""Facebook-Example-Friends Request"", ""response.length(): "" + response.length());            Log.d(""Facebook-Example-Friends Request"", ""Response: "" + response);            final JSONObject json = new JSONObject(response);            JSONArray d = json.getJSONArray(""data"");            int l = (d != null ? d.length() : 0);            Log.d(""Facebook-Example-Friends Request"", ""d.length(): "" + l);            for (int i=0; i&lt;l; i++) {                JSONObject o = d.getJSONObject(i);                String n = o.getString(""name"");                String id = o.getString(""id"");                Friend f = new Friend();                f.id = id;                f.name = n;                friends.add(f);            }            // Only the original owner thread can touch its views            workdammit.this.runOnUiThread(new Runnable() {                public void run() {                    friendsArrayAdapter = new FriendsArrayAdapter(                            workdammit.this, R.layout.rowlayout, friends);                    listView.setAdapter(friendsArrayAdapter);                    friendsArrayAdapter.notifyDataSetChanged();                }            });        } catch (JSONException e) {            Log.w(""Facebook-Example"", ""JSON Error in response"");        }    }    @Override    public void onComplete(String response, Object state) {        mSpinner.dismiss();    }    @Override    public void onIOException(IOException e, Object state) {        mSpinner.dismiss();    }    @Override    public void onFileNotFoundException(FileNotFoundException e,            Object state) {        mSpinner.dismiss();    }    @Override    public void onMalformedURLException(MalformedURLException e,            Object state) {        mSpinner.dismiss();    }    @Override    public void onFacebookError(FacebookError e, Object state) {        mSpinner.dismiss();    }}//////////////////////////////////////////////////////////////////////// Wall Post request listener///////////////////////////////////////////////////////////////////////** * WallPostRequestListener implements a request lister/callback *  for ""wall post requests"" */public class WallPostRequestListener implements        com.facebook.android.AsyncFacebookRunner.RequestListener {    /**     * Called when the wall post request has completed     */    public void onComplete(final String response) {        Log.d(""Facebook-Example"", ""Got response: "" + response);    }    @Override    public void onComplete(String response, Object state) {        // TODO Auto-generated method stub    }    @Override    public void onIOException(IOException e, Object state) {        // TODO Auto-generated method stub    }    @Override    public void onFileNotFoundException(FileNotFoundException e,            Object state) {        // TODO Auto-generated method stub    }    @Override    public void onMalformedURLException(MalformedURLException e,            Object state) {        // TODO Auto-generated method stub    }    @Override    public void onFacebookError(FacebookError e, Object state) {        // TODO Auto-generated method stub    }}//////////////////////////////////////////////////////////////////////// Wall post dialog completion listener///////////////////////////////////////////////////////////////////////** * WallPostDialogListener implements a dialog lister/callback */public class WallPostDialogListener implements        com.facebook.android.Facebook.DialogListener {    /**     * Called when the dialog has completed successfully     */    public void onComplete(Bundle values) {        final String postId = values.getString(""post_id"");        if (postId != null) {            Log.d(""FB Sample App"", ""Dialog Success! post_id="" + postId);            mAsyncRunner.request(postId, new WallPostRequestListener());        } else {            Log.d(""FB Sample App"", ""No wall post made"");        }    }    @Override    public void onCancel() {        // No special processing if dialog has been canceled    }    @Override    public void onError(DialogError e) {        // No special processing if dialog has been canceled    }    @Override    public void onFacebookError(FacebookError e) {        // No special processing if dialog has been canceled    }}/////////////////////////////////////////////////////////// Login / Logout Listeners//////////////////////////////////////////////////////////** * Listener for login dialog completion status */private final class LoginDialogListener implements        com.facebook.android.Facebook.DialogListener {    /**     * Called when the dialog has completed successfully     */    public void onComplete(Bundle values) {        // Process onComplete        Log.d(""FB Sample App"", ""LoginDialogListener.onComplete()"");        // Dispatch on its own thread        mHandler.post(new Runnable() {            public void run() {                mText.setText(""Facebook login successful. Press Menu..."");            }        });    }    /**     *     */    public void onFacebookError(FacebookError error) {        // Process error        Log.d(""FB Sample App"", ""LoginDialogListener.onFacebookError()"");    }    /**     *     */    public void onError(DialogError error) {        // Process error message        Log.d(""FB Sample App"", ""LoginDialogListener.onError()"");    }    /**     *     */    public void onCancel() {        // Process cancel message        Log.d(""FB Sample App"", ""LoginDialogListener.onCancel()"");</code></pre><p>}    }</p><pre><code>/** * Listener for logout status message */private class LogoutRequestListener implements RequestListener {    /** Called when the request completes w/o error */    public void onComplete(String response) {        // Only the original owner thread can touch its views        workdammit.this.runOnUiThread(new Runnable() {            public void run() {                mText.setText(""Thanks for using FB Sample App. Bye bye..."");                friends.clear();                friendsArrayAdapter.notifyDataSetChanged();            }        });        // Dispatch on its own thread        mHandler.post(new Runnable() {            public void run() {            }        });    }    @Override    public void onComplete(String response, Object state) {        // TODO Auto-generated method stub    }    @Override    public void onIOException(IOException e, Object state) {        // TODO Auto-generated method stub    }    @Override    public void onFileNotFoundException(FileNotFoundException e,            Object state) {        // TODO Auto-generated method stub    }    @Override    public void onMalformedURLException(MalformedURLException e,            Object state) {        // TODO Auto-generated method stub    }    @Override    public void onFacebookError(FacebookError e, Object state) {        // TODO Auto-generated method stub    }}///////////////////////////////////////////////////////////////////// Menu handlers////////////////////////////////////////////////////////////////////** * Invoked at the time to create the menu * @param menu is the menu to create */@Overridepublic boolean onCreateOptionsMenu(Menu menu) {    MenuInflater inflater = getMenuInflater();    inflater.inflate(R.menu.main_menu, menu);    return true;}/** * Invoked when preparing to display the menu * @param menu is the menu to prepare */@Overridepublic boolean onPrepareOptionsMenu(Menu menu) {    MenuItem loginItem = menu.findItem(R.id.login);    MenuItem postItem = menu.findItem(R.id.wallpost);    MenuItem getfriendsItem = menu.findItem(R.id.getfriends);    if (mFacebook.isSessionValid()) {        loginItem.setTitle(""Logout"");        postItem.setEnabled(true);        getfriendsItem.setEnabled(true);    } else {        loginItem.setTitle(""Login"");        postItem.setEnabled(false);        getfriendsItem.setEnabled(false);    }    loginItem.setEnabled(true);    return super.onPrepareOptionsMenu(menu);}/** * Invoked when a menu item has been selected * @param item is the selected menu items */@Overridepublic boolean onOptionsItemSelected(MenuItem item) {    switch (item.getItemId()) {        // Login/logout toggle        case R.id.login:            // Toggle the button state.            //  If coming from login transition to logout.            if (mFacebook.isSessionValid()) {                AsyncFacebookRunner asyncRunner = new AsyncFacebookRunner(mFacebook);                asyncRunner.logout(this.getBaseContext(), new LogoutRequestListener());            } else {                // Toggle the button state.                //  If coming from logout transition to login (authorize).                mFacebook.authorize(this, PERMISSIONS, new LoginDialogListener());            }            break;        // Wall Post        case R.id.wallpost: // Wall Post            mFacebook.dialog(workdammit.this, ""stream.publish"", new WallPostDialogListener());            break;        // Get Friend's List        case R.id.getfriends: // Wall Post            // Get the authenticated user's friends            mSpinner.show();            mAsyncRunner.request(""me/friends"", new FriendsRequestListener());            break;        default:            return false;    }    return true;}</code></pre><p>}</p><p>there are also two other classes that work with the application the code for these are bellow also</p><p>/** * ListView Friends ArrayAdapter */public class FriendsArrayAdapter extends ArrayAdapter {    private final Activity context;    private final ArrayList friends;    private int resourceId;</p><pre><code>/** * Constructor * @param context the application content * @param resourceId the ID of the resource/view * @param friends the bound ArrayList */public FriendsArrayAdapter(        Activity context,         int resourceId,         ArrayList&lt;Friend&gt; friends) {    super(context, resourceId, friends);    this.context = context;    this.friends = friends;    this.resourceId = resourceId;}/** * Updates the view * @param position the ArrayList position to update * @param convertView the view to update/inflate if needed * @param parent the groups parent view */@Overridepublic View getView(int position, View convertView, ViewGroup parent) {    View rowView = convertView;    if (rowView == null) {        LayoutInflater vi = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);        rowView = vi.inflate(resourceId, null);    }    Friend f = friends.get(position);    TextView rowTxt = (TextView) rowView.findViewById(R.id.rowtext_top);    rowTxt.setText(f.name);    return rowView;}</code></pre><p>}   </p><pre><code>public class Friend {public String id;public String name;public byte[] picture;public Bitmap pictureBitmap;;</code></pre><p>}</p><p>any help would be great  :D</p>","604769","","","","","2011-04-06 07:28:46","Android project wont pull facebook events","<android><facebook><list>","1","1","1","",""
"4909977","1","4910096","","2011-02-05 22:02:29","0","951","<p>I am currently implementing custom events and listeners according to the code posted below. I have been told that this is a very dirty implementation and that this needs to be changed. However, i am very new to java and android and do not see what is wrong with the current implementation. <strong>The way i have it below works and seems to be doing everything i needed it too. I was wondering if some people could please take a look at my code and make some suggestions on what i should change and what i am doing wrong.</strong> Taking my example and modifying it so that i can see what your talking about would be greatly appreciated.</p><p>Thanks in advance!</p><pre><code>/* SmartApp.java */public class SmartApp extends Activity {    private ConnectDevice cD = new ConnectDevice();    private DataRobot dR = new DataRobot();    private DataBuilder dB = new DataBuilder();    private DataSender dS = new DataSender();    public void onCreate(Bundle savedInstanceState) {       super.onCreate(savedInstanceState);       setContentView(R.layout.intro);    cD.addDataReceivedListener(new DataReceivedListener() {        @Override        public void dataReceivedReceived(DataReceivedEvent event) {            // TODO Auto-generated method stub            dR.analyzeData(event.getData());        }    });    dR.addDataAnalyzedListener(new DataAnalyzedListener() {        @Override        public void dataAnalyzedReceived(DataAnalyzedEvent event) {            // TODO Auto-generated method stub            dB.submitData(event.getData());        }    });    dB.addDataBuilderListener(new DataBuilderListener() {        @Override        public void dataBuilderReceived(DataBuilderEvent event) {            // TODO Auto-generated method stub            dS.sendData(event.getData());        }    });      }}  </code></pre><hr><pre><code>/* ConnectDevice.java * This class is implementing runnable because i have a thread running that is checking * the contents of a socket. Irrelevant to events. */public class ConnectDevice implements Runnable {    private List _listeners = new ArrayList();    private String data;    /* Constructor */    public ConnectDevice() {// does some socket stuff here, irrelevant to the events}    public void run() {// does some socket stuff here, irrelevant to the events}    public synchronized void addDataReceivedListener(DataReceivedListener listener) {        _listeners.add(listener);    }    public synchronized void removeDataReceivedListener(DataReceivedListener listener) {        _listeners.remove(listener);    }    private synchronized void fireDataReceivedEvent(String temp) {        DataReceivedEvent dRE = new DataReceivedEvent(this, temp);        Iterator listeners = _listeners.iterator();        while(listeners.hasNext()) {            ((DataReceivedListener)listeners.next()).dataReceivedReceived(dRE);        }    }    public interface DataReceivedListener {        public void dataReceivedReceived(DataReceivedEvent event);    }}  </code></pre><hr><pre><code>/* DataRobot.java */public class DataRobot {    /* This class is for analyzing the data */    private List _listeners = new ArrayList();    private String data;    public boolean analyzeData(String temp) {        /* Analyze the data         * This function analyzes the data, as explained in the OP         * This function fires the analyzed data event when finished             * analyzing the data.         */        data = temp;        fireDataAnalyzedEvent(data); // this fires the dataanalyzedevent        return true; //for now this will always return true    }    public synchronized void addDataAnalyzedListener(DataAnalyzedListener listener) {        _listeners.add(listener);    }    public synchronized void removeDataAnalyzedListener(DataAnalyzedListener listener) {        _listeners.remove(listener);    }    private synchronized void fireDataAnalyzedEvent(String temp) {        DataAnalyzedEvent dRE = new DataAnalyzedEvent(this, temp);        Iterator listeners = _listeners.iterator();        while(listeners.hasNext()) {            ((DataAnalyzedListener)listeners.next()).dataAnalyzedReceived(dRE);        }    }    public interface DataAnalyzedListener {        public void dataAnalyzedReceived(DataAnalyzedEvent event);    }}  </code></pre><hr><pre><code>/* DataBuilder.java */public class DataBuilder {    private List _listeners = new ArrayList();    private String data;    public boolean submitData(String temp) {            /* Builds the data             * This function builds the data, as explained in the OP             * This function fires the databuilder data event when finished                     * building the data.             */        data = temp;        fireDataBuilderEvent(data); //firing the databuilder event when finished        return true;    }    public synchronized void addDataBuilderListener(DataBuilderListener listener) {        _listeners.add(listener);    }    public synchronized void removeDataBuilderListener(DataBuilderListener listener) {        _listeners.remove(listener);    }    private synchronized void fireDataBuilderEvent(String temp) {        DataBuilderEvent dRE = new DataBuilderEvent(this, temp);        Iterator listeners = _listeners.iterator();        while(listeners.hasNext()) {            ((DataBuilderListener)listeners.next()).dataBuilderReceived(dRE);        }    }    public interface DataBuilderListener {        public void dataBuilderReceived(DataBuilderEvent event);    }}  </code></pre><hr><pre><code>/* DataSender.java *//* this class has no event, because it is done firing events at this point */public class DataSender {    private String data;    public boolean sendData(String temp) {        data = temp;        return true;    }}  </code></pre><hr><p>Below here are the event objects for each event. I Have each of this defined in a separate file, not sure if that is good procedure or not.</p><pre><code>/* DataReceivedEvent.java */public class DataReceivedEvent extends EventObject{    private String data;    public DataReceivedEvent(Object source, String temp) {        super(source);        // TODO Auto-generated constructor stub        data = temp;    }    public String getData() {            // this function is just an accessor function        return data;    }}  </code></pre><hr><pre><code>/* DataAnalyzedEvent.java */public class DataAnalyzedEvent extends EventObject{    private String data;    public DataAnalyzedEvent(Object source, String temp) {        super(source);        // TODO Auto-generated constructor stub        data = temp;    }    public String getData() {            // this function is just an accessor function        return data;    }}  </code></pre><hr><pre><code>/* DataBuilderEvent.java */public class DataBuilderEvent extends EventObject {    private String data;    public DataBuilderEvent(Object source, String temp) {        super(source);        // TODO Auto-generated constructor stub        data = temp;    }    public String getData() {            // this function is just an accessor function        return data;    }}</code></pre>","427763","","","","","2013-06-15 12:47:10","java events and listeners, bad implementation?","<java><android><events><event-handling><listener>","2","1","1","",""
"4909999","1","4910308","","2011-02-05 22:05:49","16","11373","<p>Im currently developing a framework for oAuth 1 and 2 access to webservices and my question is, how do i store sensitive data like an oAuth access key in a secure way? the problem with this keys is that some platforms like twitter use a permanent key and if someone would get access to this key he could do whatever he wants with the users twitter account.. </p><p>so is it possible to automatically encrypt the data before it is stored in the shared preferences? Or is there a better way/place to store very important data?</p><p>UPDATE - ALSO READ: <a href=""http://stackoverflow.com/questions/785973/what-is-the-most-appropriate-way-to-store-user-settings-in-android-application/6393502#6393502"">What is the most appropriate way to store user settings in Android application</a></p>","165106","","165106","","2013-06-14 13:40:19","2013-06-14 13:40:19","encrypt data in SharedPreferences","<android><encryption><oauth><sharedpreferences>","5","1","8","",""
"4910035","1","6448254","","2011-02-05 22:11:53","0","679","<p>I have a ListView with a custom row type that contains the following:</p><p>|Text|Spinner|</p><p>I have the row currently clickable on the spinner but not on the text. My problem is that if I used the built in keyboard D-Pad to browse the ListView then the entire row is highlighted when I only want it to highlight the Spinner. How do you handle the D-PAD in such a fashion?</p>","467569","","","","","2011-06-23 13:52:29","Android ListView Custom Row Selection","<android><listview>","1","0","","",""
"4910078","1","","","2011-02-05 22:19:14","2","1043","<p>i have problem that beetwen two subsequent invokes of startService the private data of IntentService is cleared - i assume that the service is stopped after first invoke is finished, and then recreated when handling second invoke. Is there any way to force IntentService not to be recreated or to store this private data to be the same in two subsequent calls of startService routine?</p>","604787","","604787","","2011-02-05 22:35:08","2011-02-06 00:00:39","Is there any way to force the IntentService not to be recreated?","<android><service><android-intent>","2","0","2","",""
"4910222","1","4910269","","2011-02-05 22:52:06","3","2766","<p>What formats of video file are supported in the Android emulator?</p><p>I understand that it probably won't play in real time, but what ones will play at all?</p>","253661","","","","","2012-10-23 12:43:28","What formats of video will play in emulator?","<android><video><emulator><formats>","2","0","2","",""
"4910307","1","","","2011-02-05 23:06:38","0","841","<p>I've been working away at an Android app for a while now and I'm trying to get a UI off the ground for it. I've created already created several with the standard XML + Java approach, but one screen requires a custom View (using draw to create a sort of grid) with a small TextView beneath it and two buttons beneath that. It doesn't seem that this custom View can reasonably extend existing ones (although if it can, that might make things easier), so I'm left with either using the XML + Java layout and integrating the custom View into that or using strict Java to create the layout. After digging around with both (and getting nothing but crashes or blank screens with the former), I've been mucking around with the Java layout, but can't seem to get anything to show up beneath the custom View.</p><p>I've dug through many tutorials, but I can't seem to get anything working from them and the Android developer resources aren't very detailed with this sort of thing. If someone can point me in the right direction to get this functioning, that would be great.</p>","604819","","","","","2011-02-06 02:10:20","Android custom View + standard element...how?","<android><xml><layout><view>","2","0","","",""
"4910361","1","","","2011-02-05 23:18:30","9","1061","<p>I have a AutoCompleteTextView within my activity that performs how it should. The dropdown bow is shown with correct entries etc. The problem is when the view looses focus the text is no longer visible. When focus is gained again the text is visible. </p><p>Has anyone else had this problem? Is it a bug or something I am doing wrong?</p>","597521","","","","","2013-03-29 14:22:52","AutoCompleteTextView problem on lost focus","<android><autocompletetextview>","2","3","2","",""
"4910383","1","","","2011-02-05 23:22:50","0","263","<p>i know that eclipse has a couple of glitches when it comes to updating your app and running it on the emulator, i have tried everything that i have found on the internet. Stopping the adb manually making a new emulator and starting it with ""wipe user data"" and restarting it even reinstalling all of the programs. What i have noticed is that it updates correctly until i start adding images to the drawable folder. After that it doesn't update at all. Can anybody help me its really frustrating also the pictures show up on the ""graphic layout how they are suppose to it just doesn't update.</p>","604820","","","","","2011-02-05 23:37:19","Android Apps wont update","<android>","2","1","","",""
"4910404","1","","","2011-02-05 23:26:55","1","411","<p>I have an OverlayItem on a map, the overlay is a pushpin icon.  I want to control the size of the clickable area, what I get now is an area that is much larger than my icon.</p><p>I was expecting that the system would set the clickable area to be the size of my icon.</p><p>Is there a way to set the size of the clickable area?</p><p>Thanks,Frank</p><p>I am still wrestling with this problem and would appreciate any help or clues.  I am using the tutorial from <a href=""http://developer.android.com/resources/tutorials/views/hello-mapview.html"" rel=""nofollow"">here</a></p><p>The map works fine. But the clickable area is much bigger than my Icon.  I tried smaller icons, I tried setting the bounds of the Drawable but no luck. Is there any way that I can control the size of the clickable area around my icon.  </p><p>My icon is 34 by 20 pixels but it looks as if I can click about 100 pixels away and that would trigger the onTap() callback.</p>","604831","","1887603","","2013-01-14 14:16:04","2013-01-14 14:16:04","how to set the size of the clickable area on an OverlayItem (for Android)","<android>","1","0","","",""
"4910410","1","4929339","","2011-02-05 23:28:30","2","2961","<p>I'm porting a Google Maps based project to Osmdroid in order to use OpenStreetMaps. The port is working OK apart from adding my overlay which consists of a number of straight lines and some text. In both projects I add the Overlay by means of a timer thread and handler calling redrawOverlay.</p><p>In the OSM project my overlay is just a grey square completely hiding the map. If I remove the call to redrawOveraly, the OSM tiles are shown OK. I've reduced the overlay code to the bare minimum of a single diagonal line in the code samples below. It works fine in the Google app, overlaying the map tile. The com.google.android.maps.Overlay has a draw method, the OSM has an onDraw, so I have in the OSM version:</p><pre><code>   private MapView mv;   private MapOverlay mmapOverlay = null;   private void redrawOverlay() {   gPt = mv.getMapCenter();   if (mmapOverlay == null)      mmapOverlay = new MapOverlay(getApplicationContext());      List&lt;Overlay&gt; listOfOverlays = mv.getOverlays();      listOfOverlays.clear();      listOfOverlays.add(mmapOverlay);      mv.invalidate();   }   public class MapOverlay extends org.osmdroid.views.overlay.Overlay {   public MapOverlay(Context ctx) {      super(ctx);      // TODO Auto-generated constructor stub   }      @Override      public void onDraw(Canvas canvas, MapView mapView) {      Paint lp3;      lp3 = new Paint();      lp3.setColor(Color.RED);      lp3.setAntiAlias(true);      lp3.setStyle(Style.STROKE);      lp3.setStrokeWidth(1);      lp3.setTextAlign(Paint.Align.LEFT);      lp3.setTextSize(12);      canvas.drawLine(10, 10, 150, 150, lp3);   }</code></pre><p>Whilst in the Google maps original I have the equivalent :</p><pre><code>  public 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);      Paint lp3;      lp3 = new Paint();      .....etc.</code></pre><p>redrawOverlay is the same except the instantiation of the overlay is just:</p><pre><code>mmapOverlay = new MapOverlay();</code></pre><p>All suggestions will be gratefully received</p><p><strong>UPDATE Question for kurtzmarc:</strong></p><p>Thanks for you help so far, I see that you are one of the authors of Osmdroid. I like what it's doing so far. I would like to suppress the 'jump to and zoom in' that you get on double tap. I'd like it to do nothing at all. I think it's probably hitting this bit in your source and doing the zoomInFixing:</p><pre><code>private class MapViewDoubleClickListener implements GestureDetector.OnDoubleTapListener {   @Override   public boolean onDoubleTap(final MotionEvent e) {   for (int i = mOverlays.size() - 1; i &gt;= 0; i--)      if (mOverlays.get(i).onDoubleTapUp(e, MapView.this))         return true;      final GeoPoint center = getProjection().fromPixels(e.getX(), e.getY());      return zoomInFixing(center);  }</code></pre><p>It doesn't seem that I can override it. I'm using the 3.0.1 jar and the associated javadocs. I'm wondering if the Mapview's setTouchDelegate method would help, but there is no reference to it in the javadocs. Have you any suggestions please?</p>","440010","","440010","","2011-02-08 18:57:40","2011-02-11 04:03:29","Porting a Google Maps app to Osmdroid - problem with overlay","<android>","1","0","2","",""
"4910412","1","4955891","","2011-02-05 23:29:34","3","5698","<p>Why is it so hard to find an Android example of sending email using Oauth and Google Mail?</p><p>I am new to Java and Android and am having a hard time working this out. It is possible?</p><p>I have found this <a href=""http://stackoverflow.com/questions/4636960/gmail-or-pop3-library-for-android-development"">Gmail (or POP3) library for Android development</a></p><p>Which links to this <a href=""http://code.google.com/apis/gmail/oauth/code.html"" rel=""nofollow"">http://code.google.com/apis/gmail/oauth/code.html</a></p><p>But no working Android examples to be found anywhere.</p><p>I would this this is possible. I have an app that sends email from the users Gmail account using this code</p><p><a href=""http://www.jondev.net/articles/Sending_Emails_without_User_Intervention_(no_Intents)_in_Android"" rel=""nofollow"">http://www.jondev.net/articles/Sending_Emails_without_User_Intervention_(no_Intents)_in_Android</a></p><p>But my users do not like to enter their Google password in my app. And I don't blame them. In this day and age you would think that there would be an easy solution with many examples.</p><p>So, are there examples out there and I am just missing them?</p><p>TIA</p>","6514","","","","","2013-10-03 09:27:33","looking for Android Gmail SMTP Oauth example","<android><email><oauth><smtp><gmail>","2","4","3","",""
"4910415","1","4910759","","2011-02-05 23:29:55","6","10344","<p><strong>Solved:</strong> Was missing view parameter for postData(), changed to reflect this.</p><p>I would like some help with sending GPS data to a server which will be stored in a MySQL database using PHP.</p><p>This is inside my Java file:</p><pre><code>ArrayList&lt;NameValuePair&gt; nameValuePairs = new ArrayList&lt;NameValuePair&gt;(2);public void postData(View v){    nameValuePairs.add(new BasicNameValuePair(""Lat"",""19.80""));    nameValuePairs.add(new BasicNameValuePair(""Lon"",""13.22""));    //http post    try{        HttpClient httpclient = new DefaultHttpClient();        HttpPost httppost = new              HttpPost(""http://www.xxxxxxxx.com/test.php"");        httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));        HttpResponse response = httpclient.execute(httppost);        HttpEntity entity = response.getEntity();        InputStream is = entity.getContent();        Log.i(""postData"", response.getStatusLine().toString());    }    catch(Exception e)    {        Log.e(""log_tag"", ""Error in http connection ""+e.toString());    }           }</code></pre><p>And my PHP:</p><pre><code>&lt;?phpinclude 'connect.php'; //Connect//retrieve the data$lat = $_POST['lat'];$lon = $_POST['lon'];$sql = ""INSERT INTO Coords (Lat, Lon) VALUES('$lat', '$lon')"";if (!mysql_query($sql, $sqlCon)){    die('Error: ' . mysql_error());}else{    //echo ""1 record added"";}include 'closeConnection.php';?&gt;</code></pre><p>StackTrace:    Project - Heat [Android Application]</p><pre><code> 02-06 00:37:14.265: ERROR/AndroidRuntime(1607): FATAL EXCEPTION: main 02-06 00:37:14.265: ERROR/AndroidRuntime(1607): java.lang.IllegalStateException: Could        not find a method **postData(View)** in the activity class com.nathanhunston.heat.Main for    onClick handler on view class android.widget.Button with id 'dropLocBtn'</code></pre>","533610","","1742657","","2013-04-24 03:17:14","2013-04-24 03:17:14","Android: Sending data to be stored in MySQL","<php><android><mysql>","4","5","4","",""
"4910517","1","4910596","","2011-02-05 23:49:50","2","3575","<p><strong>What I have:</strong> A custom listview with a custom adapter, with a custom ListViewItem (which extends LinearLayout)</p><p><strong>What i want to do:</strong> When the listbox item is selected, I want to change the background drawable of the selected view.</p><p><strong>What Happens:</strong> Currently nothing. The Toast does appear as it should, but the Background drawable does not change.  I tried calling View.Invalidate() but that doesn't seem to do anything either.</p><p>Here is the snippet of code that is supposed to change the drawable:</p><pre><code>public void onItemClick(AdapterView&lt;?&gt; arg0, View view, int index, long arg3) {    Card card = CardVM.GetCurrentCards().get(index);    card.setBlocked(!card.isBlocked());    if (card.isBlocked())    {        view.setBackgroundResource(R.drawable.bluegradient);        Toast.makeText(this, ""Card is now Blocked"", 1).show();    }    else    {        view.setBackgroundResource(R.drawable.greengradient);        Toast.makeText(this, ""Card is now Available"", 1).show();    }}</code></pre><p>The toggle functionality does work, if you click on it the first time, it will say ""card is now blocked"".  The second time shows ""Card is now available""... and so on.  The setBackgroundResource simply does not work.</p><p>Also, when the list view is populated, the background colors are set correctly (using the same resources and the same function). </p><p>Thanks in advance.</p><p><strong>UPDATE</strong></p><p>It appears the background DOES change, but ONLY if the screen is forced to re-draw it.  For example, when you click on the first item in the list to turn it blue, you need to scroll down (to get it off the screen) then scroll back up.  THEN it turns blue.  Can we avoid this somehow?</p>","347359","","347359","","2011-02-06 00:16:36","2011-02-06 00:33:05","Android ListView OnItemClick Change View Properties","<android><android-listview>","1","0","","",""
"4910539","1","4910565","","2011-02-05 23:54:39","1","8131","<p>When I start up my app, I get</p><pre><code>02-05 18:50:14.943: ERROR/AndroidRuntime(328): Caused by: android.database.sqlite.SQLiteException: near "")"": syntax error: CREATE TABLE table1(id INTEGER PRIMARY KEY, name TEXT));</code></pre><p>Here is my main .java: </p><pre><code>package com.shoppinglist;import android.app.Dialog;import android.app.ListActivity;import android.database.Cursor;import android.os.Bundle;import android.view.View;import android.view.View.OnClickListener;import android.widget.Button;import android.widget.EditText;import android.widget.ListAdapter;import android.widget.ListView;import android.widget.SimpleCursorAdapter;public class ShoppingList extends ListActivity {    private DataHelper DataHelper;    /** Called when the activity is first created. */    @Override    protected void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        DataHelper = new DataHelper(this);        ListView listview = (ListView) findViewById(android.R.id.list);        Cursor c = (Cursor) DataHelper.selectAll();        startManagingCursor(c);        String[] from = new String[] { DataHelper.getDatabaseName() };        int[] to = new int[] { android.R.id.list };        ListAdapter adapter = new SimpleCursorAdapter(this,                R.layout.rowlayout, c, from, to);        setListAdapter(adapter);        Button button1main = (Button) findViewById(R.id.add);        button1main.setOnClickListener(new OnClickListener()  {            @Override            public void onClick(View v)  {            final Dialog additem = new Dialog(ShoppingList.this);            additem.setContentView(R.layout.maindialog);            final EditText et = (EditText)additem.findViewById(R.id.edittext);            additem.setTitle(""Type your item"");            additem.setCancelable(true);            et.setHint(""Type the name of an item..."");            Button button = (Button) additem.findViewById(R.id.cancel);            button.setOnClickListener(new OnClickListener()  {                @Override                public void onClick(View v)  {                    additem.dismiss();                }            });            additem.show();            Button ok = (Button) additem.findViewById(R.id.ok);            ok.setOnClickListener(new OnClickListener() {                @Override                public void onClick(View v) {                    final String text = et.getText().toString();                    additem.dismiss();                    et.setText("""");                }            });       }        });    }}</code></pre><p>Here's my DataHelper class:</p><pre><code>package com.shoppinglist;import java.util.ArrayList;import java.util.List;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;public class DataHelper {       private static final String DATABASE_NAME = ""items.db"";       private static final int DATABASE_VERSION = 1;       private static final String TABLE_NAME = ""table1"";       private Context context;       private SQLiteDatabase db;       private SQLiteStatement insertStmt;       private static final String INSERT = ""insert into ""           + TABLE_NAME + ""(name) values (?)"";       public DataHelper(Context context) {          this.context = context;          OpenHelper openHelper = new OpenHelper(this.context);          this.db = openHelper.getWritableDatabase();          this.insertStmt = this.db.compileStatement(INSERT);       }       public long insert(String name) {          this.insertStmt.bindString(1, name);          return this.insertStmt.executeInsert();       }       public void deleteAll() {          this.db.delete(TABLE_NAME, null, null);       }       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[] { ""name"" },             null, null, null, null, ""name 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 static String getDatabaseName() {        return DATABASE_NAME;    }    private static class OpenHelper extends SQLiteOpenHelper {          OpenHelper(Context context) {             super(context, getDatabaseName(), null, DATABASE_VERSION);          }          @Override          public void onCreate(SQLiteDatabase db) {             db.execSQL(""CREATE TABLE "" + TABLE_NAME + ""(id INTEGER PRIMARY KEY, name TEXT));"");          }          @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 "" + TABLE_NAME);             onCreate(db);          }       }    }</code></pre><p>Thanks in advance!</p>","560096","","329637","","2011-02-05 23:57:58","2011-08-07 04:17:58","Error on startup: android.database.sqlite.SQLiteException: near "")"": syntax error: CREATE TABLE table1(id INTEGER PRIMARY KEY, name TEXT));","<android><sqlite><crash>","2","10","","",""
"4910586","1","4910643","","2011-02-06 00:06:21","0","929","<p>I have a radio group that consists of 4 radio buttons and I'm trying to align them in 2 rows with 2 buttons in each row. How should I go about nesting layouts so that I get the desired result? I have tried putting 2 LinearLayout views with horizontal alignment inside the radio group but that didn't work. Is a table my only option?</p>","165198","","","","","2011-02-06 00:47:20","android radio group layout","<android><layout><radio-group>","1","0","","",""
"4910623","1","4911546","","2011-02-06 00:12:21","1","1244","<p>I am currently developing an android app. I have an activity which calls a web view activity. When the user presses the back button once it will go to the history of the webview, when the user double taps the back button I want the webview activity to finish.</p><p>How can I go about checking for a double tap of the back button</p>","499448","","","","","2012-07-24 15:13:20","Double tap physical button on android","<android>","3","0","","",""
"4910625","1","4910730","","2011-02-06 00:13:27","1","2971","<p>Does running an Android service in a remote process mean that it's running on a different Thread? Is that a difference between a local and remote service?</p><p>Similarly, when calling a remote service via IPC, does it return immediately? Or does it wait for action to be done?</p>","312499","","","","","2011-06-10 13:24:46","Android Remote Service","<android><service>","3","0","","",""
"4910709","1","4996814","","2011-02-06 00:29:59","0","944","<p>I'm trying to display a LayerDrawable as an ImageButton image. All the layers must have different top values. such as <code>top += 10;</code>. For this I used <code>setLayerInset</code> with Drawable layer items but it stretched the images. I also tried with different parameters and it just displayed other stupid layouts.</p><p>After the setLayerInset attempt I used InsetDrawable, giving the top parameter its own constructor:</p><pre><code>new InsetDrawable(resources.getDrawable(R.drawable.soldier), 0, layerTop, 0, 0);</code></pre><p>this time, the tops look OK, but ImageButton displays a very small area of it.</p><p>Basic layout,let say this is my image,</p><pre>*---*|   ||   | ---</pre><p>the layout should be,</p><pre>*---*|   |*---*|   |*---*|   |*---*|   ||   | ---</pre>","604876","","496830","","2011-02-06 01:45:01","2011-02-14 20:16:36","Android ImageButton with LayerDrawable Image","<android><imagebutton>","1","0","","",""
"4910792","1","","","2011-02-06 00:55:38","0","920","<p>I have a Android Widget, Configuration Activities, and a heavily used Android Service full of functions.  I want to maintain global application state/status that can be referenced from any of the above locations.  The state I am referring to is application domain specific status.  For example STARTED, LEVEL1, LEVEL2 etc.  So I would like to know the following:</p><p>1) What are the advantages of Global Singleton for keeping this state/status vs. subclassing    the Android Application and using it as the Singleton?</p><p>2) I want the state to be a recoverable singleton.  So I need to save it off when the App    gets shutdown, process terminated.  Where is the right place to save off the overall application state?  the terminate method on Application can be overridden but its not really guaranteed to get called.  So I am looking also for the point at which to save off the application state.  Its not clear to me. The Activity is not the global application, neither is the widget nor the service, so where can I tell that the application is being shutdown/terminated and saveoff the application state.</p><p>3) Is their anything wrong with initializing the state in Application.onStart()?</p>","602260","","","","","2011-02-06 02:29:26","Android Widget Application State","<android><singleton><widget><state><status>","2","2","","",""
"4910929","1","4911609","","2011-02-06 01:32:38","2","1182","<p>I have a need for a very simplistic way to keep track of time.  Basically I simply need to start a timer when a method is called, and a set amount of time after that (45-90 seconds) call another method.</p><p>From what I have read, Handlers are the most efficient way to handle keeping track of time.  However, some say they require a second thread, while others say they don't.  It's certainly not a huge deal, but I would prefer to keep things as minimalistic as possible.  So, is there any way to do something like simply checking to see if System.getCurrentTimeMillis is a certain amount higher than it was when the user called the first method, without any further user interaction of course.</p><p>If not I will just read into Handlers more and work with those.  Thank you for your help.</p>","602571","","","","","2011-02-06 04:45:25","Various ways to handle timing in Android","<android><multithreading><timer><handler><countdown>","2","2","","",""
"4910966","1","4926665","","2011-02-06 01:40:55","0","806","<p>hey all,i have build a game in android. and to put in the score section i am using the score ninja adapter API. i have done all the things told on the score ninja website but every time i tries to show the score card . it tells me that ""Sorry,there was a problem loading the score card"".the method i am using isscoreNinjaAdapter.show(200); here i have put 200 as an arbitrary score and i am supposing that it should work but it never seems to work otherwise there is no error or exception.can any body help me out or show me some kind of example ..i am totally stuck here</p>","604905","","","","","2011-02-07 21:14:39","score ninja adapter API","<android>","1","0","","",""
"4911113","1","4911181","","2011-02-06 02:25:09","2","3681","<p>I am new to android/java and currently am trying to learn custom events and listeners. I currently have this code implemented below that is working successfully. I now would like to add another event to DataRobot. The event will trigger when a certain piece of data is analyzed with the analyzeData function. I was wondering if someone could show me how to implement two events in that one class? I am using this event to trigger an AlarmDialog. So, if there is a better way, let me know.</p><pre><code>/* SmartApp.java */public class SmartApp extends Activity {    private ConnectDevice cD = new ConnectDevice();    private DataRobot dR = new DataRobot();    private DataBuilder dB = new DataBuilder();    private DataSender dS = new DataSender();    public void onCreate(Bundle savedInstanceState) {       super.onCreate(savedInstanceState);       setContentView(R.layout.intro);    cD.addDataReceivedListener(new DataReceivedListener() {        @Override        public void dataReceivedReceived(DataReceivedEvent event) {            // TODO Auto-generated method stub            dR.analyzeData(event.getData());        }    });    dR.addDataAnalyzedListener(new DataAnalyzedListener() {        @Override        public void dataAnalyzedReceived(DataAnalyzedEvent event) {            // TODO Auto-generated method stub            dB.submitData(event.getData());        }    });    dB.addDataBuilderListener(new DataBuilderListener() {        @Override        public void dataBuilderReceived(DataBuilderEvent event) {            // TODO Auto-generated method stub            dS.sendData(event.getData());        }    });      }}  </code></pre><hr><pre><code>/* DataRobot.java */public class DataRobot {    /* This class is for analyzing the data */    private List _listeners = new ArrayList();    private String data;    public boolean analyzeData(String temp) {        /* Analyze the data         * This function analyzes the data, as explained in the OP         * This function fires the analyzed data event when finished             * analyzing the data.         */        data = temp;        fireDataAnalyzedEvent(data); // this fires the dataanalyzedevent        return true; //for now this will always return true    }    public synchronized void addDataAnalyzedListener(DataAnalyzedListener listener) {        _listeners.add(listener);    }    public synchronized void removeDataAnalyzedListener(DataAnalyzedListener listener) {        _listeners.remove(listener);    }    private synchronized void fireDataAnalyzedEvent(String temp) {        DataAnalyzedEvent dRE = new DataAnalyzedEvent(this, temp);        Iterator listeners = _listeners.iterator();        while(listeners.hasNext()) {            ((DataAnalyzedListener)listeners.next()).dataAnalyzedReceived(dRE);        }    }    public interface DataAnalyzedListener {        public void dataAnalyzedReceived(DataAnalyzedEvent event);    }}  </code></pre><hr><pre><code>/* DataReceivedEvent.java */public class DataReceivedEvent extends EventObject{    private String data;    public DataReceivedEvent(Object source, String temp) {        super(source);        // TODO Auto-generated constructor stub        data = temp;    }    public String getData() {            // this function is just an accessor function        return data;    }}  </code></pre><hr><pre><code>/* DataAnalyzedEvent.java */public class DataAnalyzedEvent extends EventObject{    private String data;    public DataAnalyzedEvent(Object source, String temp) {        super(source);        // TODO Auto-generated constructor stub        data = temp;    }    public String getData() {            // this function is just an accessor function        return data;    }}  </code></pre>","427763","","","","","2011-02-06 03:37:00","java events and listeners, multiple events in one class","<java><android><events><listener>","2","0","2","",""
"4911123","1","4911177","","2011-02-06 02:26:54","0","389","<p>I'm working on an Android app which has an activity and a widget.  This is currently implemented via two classes in two .java files - one for the activity (extending Activity), one for the widget (extending AppWidgetProvider).  Nothing out of the ordinary here as far as I'm aware...</p><p>However, the widget class code could be a lot simpler if it was to make use of functions and asynctasks defined in the activity class.  Duplicating these functions seems like bad design, so I'm wondering how I can structure the app to make them usable?</p><p>Can I extend both Activity and AppWidgetProvider somehow?  Can I import one in the other?</p><p>Thanks!</p>","593886","","","","","2011-02-06 03:32:36","Android: Using methods from an Activity in a Widget. Extend Activity and AppWidgetProvider?","<android><activity><widget><extend><inherit>","2","0","","",""
"4911129","1","4916428","","2011-02-06 02:27:47","12","15749","<p>I tried to use Proguard in my Android project, i setup Proguard using command line 'android update project /path/to/project' and file proguard.cfg was created in project's root directory. (In my Eclipse with Android 2.3 sdk, when create a new project, proguard.cfg file is not automatically created so i have to add it manually using command line).</p><p>When i export the project, i got the following errors</p><pre><code>    [2011-02-06 09:02:49 - TestProject] Warning: oauth.signpost.jetty.HttpRequestAdapter: can't find referenced class org.mortbay.jetty.client.HttpExchange[2011-02-06 09:02:49 - TestProject] Warning: oauth.signpost.jetty.HttpRequestAdapter: can't find referenced class org.mortbay.jetty.HttpFields[2011-02-06 09:02:49 - TestProject] Warning: oauth.signpost.jetty.HttpRequestAdapter: can't find referenced class org.mortbay.jetty.client.HttpExchange[2011-02-06 09:02:49 - TestProject] Warning: oauth.signpost.jetty.HttpRequestAdapter: can't find referenced class org.mortbay.io.Buffer[2011-02-06 09:02:49 - TestProject] Warning: oauth.signpost.jetty.HttpRequestAdapter: can't find referenced class org.mortbay.jetty.client.HttpExchange[2011-02-06 09:02:49 - TestProject] Warning: oauth.signpost.jetty.HttpRequestAdapter: can't find referenced class org.mortbay.jetty.client.HttpExchange[2011-02-06 09:02:49 - TestProject] Warning: oauth.signpost.jetty.HttpRequestAdapter: can't find referenced class org.mortbay.jetty.HttpFields[2011-02-06 09:02:49 - TestProject] Warning: oauth.signpost.jetty.HttpRequestAdapter: can't find referenced class org.mortbay.jetty.HttpFields$Field[2011-02-06 09:02:49 - TestProject] Warning: oauth.signpost.jetty.HttpRequestAdapter: can't find referenced class org.mortbay.jetty.HttpFields$Field[2011-02-06 09:02:49 - TestProject] Warning: oauth.signpost.jetty.HttpRequestAdapter: can't find referenced class org.mortbay.jetty.HttpFields$Field[2011-02-06 09:02:49 - TestProject] Warning: oauth.signpost.jetty.HttpRequestAdapter: can't find referenced class org.mortbay.jetty.client.HttpExchange[2011-02-06 09:02:49 - TestProject] Warning: oauth.signpost.jetty.HttpRequestAdapter: can't find referenced class org.mortbay.jetty.client.HttpExchange[2011-02-06 09:02:49 - TestProject] Warning: oauth.signpost.jetty.HttpRequestAdapter: can't find referenced class org.mortbay.jetty.client.Address[2011-02-06 09:02:49 - TestProject] Warning: oauth.signpost.jetty.HttpRequestAdapter: can't find referenced class org.mortbay.jetty.client.HttpExchange[2011-02-06 09:02:49 - TestProject] Warning: oauth.signpost.jetty.HttpRequestAdapter: can't find referenced class org.mortbay.jetty.client.HttpExchange[2011-02-06 09:02:49 - TestProject] Warning: oauth.signpost.jetty.HttpRequestAdapter: can't find referenced class org.mortbay.jetty.HttpFields[2011-02-06 09:02:49 - TestProject] Warning: oauth.signpost.jetty.HttpRequestAdapter: can't find referenced class org.mortbay.io.Buffer[2011-02-06 09:02:49 - TestProject] Warning: oauth.signpost.jetty.HttpRequestAdapter: can't find referenced class org.mortbay.jetty.client.Address[2011-02-06 09:02:49 - TestProject] Warning: oauth.signpost.jetty.HttpRequestAdapter: can't find referenced class org.mortbay.jetty.client.HttpExchange[2011-02-06 09:02:49 - TestProject] Warning: oauth.signpost.jetty.HttpRequestAdapter: can't find referenced class org.mortbay.jetty.client.HttpExchange[2011-02-06 09:02:49 - TestProject] Warning: oauth.signpost.jetty.HttpRequestAdapter: can't find referenced class org.mortbay.jetty.client.HttpExchange[2011-02-06 09:02:49 - TestProject] Warning: oauth.signpost.jetty.HttpRequestAdapter: can't find referenced class org.mortbay.jetty.HttpFields[2011-02-06 09:02:49 - TestProject] Warning: oauth.signpost.jetty.HttpRequestAdapter: can't find referenced class org.mortbay.jetty.HttpFields[2011-02-06 09:02:49 - TestProject] Warning: oauth.signpost.jetty.HttpRequestAdapter: can't find referenced class org.mortbay.jetty.HttpFields$Field[2011-02-06 09:02:49 - TestProject] Warning: oauth.signpost.jetty.HttpRequestAdapter: can't find referenced class org.mortbay.jetty.HttpFields[2011-02-06 09:02:49 - TestProject] Warning: twitter4j.internal.logging.CommonsLoggingLoggerFactory: can't find referenced class org.apache.commons.logging.LogFactory[2011-02-06 09:02:49 - TestProject] Warning: twitter4j.internal.logging.CommonsLoggingLoggerFactory: can't find referenced class org.apache.commons.logging.LogFactory[2011-02-06 09:02:49 - TestProject] Warning: twitter4j.internal.logging.SLF4JLoggerFactory: can't find referenced class org.slf4j.LoggerFactory[2011-02-06 09:02:49 - TestProject] Warning: twitter4j.internal.logging.SLF4JLoggerFactory: can't find referenced class org.slf4j.LoggerFactory[2011-02-06 09:02:49 - TestProject] Warning: oauth.signpost.jetty.JettyOAuthConsumer: can't find referenced class org.mortbay.jetty.client.HttpExchange[2011-02-06 09:02:49 - TestProject] Warning: twitter4j.internal.logging.Log4JLoggerFactory: can't find referenced class org.apache.log4j.Logger[2011-02-06 09:02:49 - TestProject] Warning: twitter4j.internal.logging.Log4JLoggerFactory: can't find referenced class org.apache.log4j.Logger[2011-02-06 09:02:49 - TestProject] Warning: oauth.signpost.signature.OAuthMessageSigner: can't find referenced class org.apache.commons.codec.binary.Base64[2011-02-06 09:02:49 - TestProject] Warning: oauth.signpost.signature.OAuthMessageSigner: can't find referenced class org.apache.commons.codec.binary.Base64[2011-02-06 09:02:49 - TestProject] Warning: oauth.signpost.signature.OAuthMessageSigner: can't find referenced class org.apache.commons.codec.binary.Base64[2011-02-06 09:02:49 - TestProject] Warning: oauth.signpost.signature.OAuthMessageSigner: can't find referenced class org.apache.commons.codec.binary.Base64[2011-02-06 09:02:49 - TestProject] Warning: oauth.signpost.signature.OAuthMessageSigner: can't find referenced class org.apache.commons.codec.binary.Base64[2011-02-06 09:02:49 - TestProject] Warning: twitter4j.internal.logging.SLF4JLogger: can't find referenced class org.slf4j.Logger[2011-02-06 09:02:49 - TestProject] Warning: twitter4j.internal.logging.SLF4JLogger: can't find referenced class org.slf4j.Logger[2011-02-06 09:02:49 - TestProject] Warning: twitter4j.internal.logging.SLF4JLogger: can't find referenced class org.slf4j.Logger[2011-02-06 09:02:49 - TestProject] Warning: twitter4j.internal.logging.SLF4JLogger: can't find referenced class org.slf4j.Logger[2011-02-06 09:02:49 - TestProject] Warning: twitter4j.internal.logging.SLF4JLogger: can't find referenced class org.slf4j.Logger[2011-02-06 09:02:49 - TestProject] Warning: twitter4j.internal.logging.SLF4JLogger: can't find referenced class org.slf4j.Logger[2011-02-06 09:02:49 - TestProject] Warning: twitter4j.internal.logging.SLF4JLogger: can't find referenced class org.slf4j.Logger[2011-02-06 09:02:49 - TestProject] Warning: twitter4j.internal.logging.SLF4JLogger: can't find referenced class org.slf4j.Logger[2011-02-06 09:02:49 - TestProject] Warning: twitter4j.internal.logging.SLF4JLogger: can't find referenced class org.slf4j.Logger[2011-02-06 09:02:49 - TestProject] Warning: twitter4j.internal.logging.SLF4JLogger: can't find referenced class org.slf4j.Logger[2011-02-06 09:02:49 - TestProject] Warning: twitter4j.internal.logging.Log4JLogger: can't find referenced class org.apache.log4j.Logger[2011-02-06 09:02:49 - TestProject] Warning: twitter4j.internal.logging.Log4JLogger: can't find referenced class org.apache.log4j.Logger[2011-02-06 09:02:49 - TestProject] Warning: twitter4j.internal.logging.Log4JLogger: can't find referenced class org.apache.log4j.Level[2011-02-06 09:02:49 - TestProject] Warning: twitter4j.internal.logging.Log4JLogger: can't find referenced class org.apache.log4j.Logger[2011-02-06 09:02:49 - TestProject] Warning: twitter4j.internal.logging.Log4JLogger: can't find referenced class org.apache.log4j.Logger[2011-02-06 09:02:49 - TestProject] Warning: twitter4j.internal.logging.Log4JLogger: can't find referenced class org.apache.log4j.Logger[2011-02-06 09:02:49 - TestProject] Warning: twitter4j.internal.logging.Log4JLogger: can't find referenced class org.apache.log4j.Logger[2011-02-06 09:02:49 - TestProject] Warning: twitter4j.internal.logging.Log4JLogger: can't find referenced class org.apache.log4j.Logger[2011-02-06 09:02:49 - TestProject] Warning: twitter4j.internal.logging.Log4JLogger: can't find referenced class org.apache.log4j.Level[2011-02-06 09:02:49 - TestProject] Warning: twitter4j.internal.logging.Log4JLogger: can't find referenced class org.apache.log4j.Logger[2011-02-06 09:02:49 - TestProject] Warning: twitter4j.internal.logging.Log4JLogger: can't find referenced class org.apache.log4j.Logger[2011-02-06 09:02:49 - TestProject] Warning: twitter4j.internal.logging.Log4JLogger: can't find referenced class org.apache.log4j.Logger[2011-02-06 09:02:49 - TestProject]       You should check if you need to specify additional program jars.[2011-02-06 09:02:49 - TestProject] Warning: there were 59 unresolved references to classes or interfaces.[2011-02-06 09:02:49 - TestProject]          You may need to specify additional library jars (using '-libraryjars'),[2011-02-06 09:02:49 - TestProject]          or perhaps the '-dontskipnonpubliclibraryclasses' option.[2011-02-06 09:02:49 - TestProject] java.io.IOException: Please correct the above warnings first.[2011-02-06 09:02:49 - TestProject]     at proguard.Initializer.execute(Initializer.java:308)[2011-02-06 09:02:49 - TestProject]     at proguard.ProGuard.initialize(ProGuard.java:210)[2011-02-06 09:02:49 - TestProject]     at proguard.ProGuard.execute(ProGuard.java:85)[2011-02-06 09:02:49 - TestProject]     at proguard.ProGuard.main(ProGuard.java:499)</code></pre><p>These error messages point to four external jars used in my project</p><p>(.classpath)</p><pre><code>&lt;classpathentry kind=""lib"" path=""/Users/lorensiuswlt/Android/android-sdk-mac_x86/libs/Twitter/signpost-commonshttp4-1.2.1.1.jar""/&gt;        &lt;classpathentry kind=""lib"" path=""/Users/lorensiuswlt/Android/android-sdk-mac_x86/libs/Twitter/signpost-core-1.2.1.1.jar""/&gt;        &lt;classpathentry kind=""lib"" path=""/Users/lorensiuswlt/Android/android-sdk-mac_x86/libs/Twitter/signpost-jetty6-1.2.1.1.jar""/&gt;        &lt;classpathentry kind=""lib"" path=""/Users/lorensiuswlt/Android/android-sdk-mac_x86/libs/Twitter/twitter4j-core-2.1.6.jar""/&gt;</code></pre><p>Here is my proguard.cfg file</p><pre><code>-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 * extends android.app.backup.BackupAgentHelper-keep public class * extends android.preference.Preference-keep public class com.android.vending.licensing.ILicensingService-keepclasseswithmembernames class * {    native &lt;methods&gt;;}-keepclasseswithmembernames class * {    public &lt;init&gt;(android.content.Context, android.util.AttributeSet);}-keepclasseswithmembernames class * {    public &lt;init&gt;(android.content.Context, android.util.AttributeSet, int);}-keepclassmembers enum * {    public static **[] values();    public static ** valueOf(java.lang.String);}-keep class * implements android.os.Parcelable {  public static final android.os.Parcelable$Creator *;}</code></pre><p>I've tried some solutions found on web by adding '-libraryjars' option, ex:</p><pre><code>-libraryjars /Users/lorensiuswlt/Android/android-sdk-mac_x86/libs/Twitter/twitter4j-core-2.1.6.jar</code></pre><p>but it won't help.</p><p>Any solutions?</p>","431041","","114066","","2011-06-21 12:26:03","2011-06-21 12:26:03","Android Proguard skip external jar","<android><jar><external><proguard>","1","0","8","",""
"4911240","1","","","2011-02-06 03:00:54","0","541","<p>I am starting up work on an Android game and am learning OpenGL ES.  I have used OpenGL a bit, though it was quite some time ago by now.  I have mostly used DirectX lately with C++, so I understand graphic API concepts fairly well.</p><p>When, playing with the API on my own, I was unable to get the results I anticipated, I turned to <a href=""http://blog.jayway.com/2009/12/03/opengl-es-tutorial-for-android-part-i/"" rel=""nofollow"">this</a> tutorial I found online that seemed fairly comprehensive, and though I understood it easily and followed the tutorial fairly strictly, I still can't get the screen to display a simple square (currently not using anything other than a vertex array with no colour).</p><p>Below is the code for my renderer class which I have been staring at for some time and am starting to go a little crazy with my inability to find my mistake.  I have done far more complicated things with graphics APIs (in both DirectX and OpenGL) so I find this kind of embarrassing and just need somebody to point out my probably glaringly obvious oversight.</p><p>Thank you in advance!</p><pre><code>public class GameRenderer implements Renderer {private float red, green, blue = 0.0f;private final float vertices[] = {        0.5f, -0.5f, 0.0f,  // 0, Bottom Right        0.5f,  0.5f, 0.0f,  // 1, Top Right        -0.5f,  0.5f, 0.0f, // 2, Top Left        -0.5f, -0.5f, 0.0f, // 3, Bottom Left}; private final short indices[] = {        0, 1, 2, 0, 2, 3};private final float colours[] = {        1.0f, 1.0f, 1.0f,         0.5f, 0.5f, 0.5f,         0.5f, 0.5f, 0.5f,         0.0f, 0.0f, 0.0f}; FloatBuffer vFBuff;FloatBuffer cFBuff;ShortBuffer iSBuff;public GameRenderer(){    super();}@Overridepublic void onDrawFrame(GL10 gl) {    gl.glClearColor(red, green, blue, 0.5f);    gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT);    gl.glLoadIdentity();    gl.glScalef(2.0f, 2.0f, 0.0f);    gl.glTranslatef(0.0f, 0.0f, -4f);    gl.glDrawElements(GL10.GL_TRIANGLES, indices.length, GL10.GL_UNSIGNED_SHORT, iSBuff);}@Overridepublic void onSurfaceChanged(GL10 gl, int width, int height) {    // TODO Auto-generated method stub    // set viewport    gl.glViewport(0, 0, width, height);    gl.glMatrixMode(GL10.GL_PROJECTION);    gl.glLoadIdentity();    GLU.gluPerspective(gl, 45.0f, (float)width / (float)height, 0.0f, 100.0f);    gl.glMatrixMode(GL10.GL_MODELVIEW);}@Overridepublic void onSurfaceCreated(GL10 gl, EGLConfig config) {    gl.glShadeModel(GL10.GL_SMOOTH);    gl.glClearDepthf(1.0f);    gl.glEnable(GL10.GL_DEPTH_TEST);    gl.glDepthFunc(GL10.GL_LEQUAL);    gl.glHint(GL10.GL_PERSPECTIVE_CORRECTION_HINT, GL10.GL_NICEST);    ByteBuffer vBBuff = ByteBuffer.allocateDirect(vertices.length * 4);    ByteBuffer cBBuff = ByteBuffer.allocateDirect(colours.length * 4);    ByteBuffer iBBuff = ByteBuffer.allocateDirect(indices.length * 2);    vFBuff = vBBuff.asFloatBuffer();    vFBuff.put(vertices);    vFBuff.position(0);    cFBuff = cBBuff.asFloatBuffer();    cFBuff.put(colours);    cFBuff.position(0);    iSBuff = iBBuff.asShortBuffer();    iSBuff.put(indices);    iSBuff.position(0);    gl.glEnableClientState(GL10.GL_VERTEX_ARRAY);    gl.glVertexPointer(3, GL10.GL_FLOAT, 0, vFBuff);    gl.glFrontFace(GL10.GL_CCW);    gl.glEnable(GL10.GL_CULL_FACE);    gl.glCullFace(GL10.GL_BACK);}public void setColour(float r, float g, float b) {    red = r;    blue = b;    green = g;}</code></pre>","604961","","","","","2011-02-06 06:51:42","Issue drawing triangles with basic VBO in OpenGL ES for Android 2.1","<android><opengl-es>","1","0","0","",""
"4911311","1","","","2011-02-06 03:16:35","0","149","<p>using registerReciver() by passing a null receiver can be used to get certain system properies.  In the case of my own application broadcasts will this also work. Can I use this same mechanism to get the last broadcasted Intent?</p><p>Also how do I know if this Intent was actually processed by a receiver in my application. Do I need for the receiver to issue a confirmation broadcast or is there some way of knowing that the broadcast was fully handled by my application?  Thanks</p>","602260","","","","","2011-02-06 04:12:11","Android registerReciever(null, Intent) to get lastest broadcasted values?","<android><broadcastreceiver>","1","0","","",""
"4911390","1","4911781","","2011-02-06 03:37:31","0","1279","<p>My app is using webview and loads a local html file in the assets/ folder. Now is there a way to use all the strings from res/strings.xml in that html file webview loaded ? </p><p>Tried some and google whole night but havnt gotten to any solution, is it even possible ?</p>","523221","","523221","","2011-02-07 00:15:06","2011-02-09 05:05:58","using values from strings.xml in webview","<android>","1","3","","",""
"4911451","1","4911487","","2011-02-06 03:51:33","1","714","<p>Hey everyone, I'm working on an Android App in Eclipse, and getting a wierd exception that I'm having trouble nailing down. The exception occurs in:</p><pre><code>public int getEvents(){    NodeList property_nodes;    NodeList event_nodes;    InputStream is;    parserFactory = DocumentBuilderFactory.newInstance();    try{        parser = parserFactory.newDocumentBuilder();        //check the last updated date        get = new HttpGet(""http://whatever.com/test_date.php"");        response = client.execute(get);        entity = response.getEntity();        ...</code></pre><p>at the client.execute(get) line. It's caught by,</p><pre><code>        } catch (Exception e){        String e_cause = e.getMessage();        return -1;        }</code></pre><p>and e_cause is just ""whatever.com"" and nothing else. This exact code was working earlier today, and I can't figure out how to diagnose this further! Does anyone know why the exception would return a URL from the getMessage function, or a way to get more information about the source of the error?</p><p>Thanks so much.</p>","604991","","","","","2011-02-06 19:20:43","Android Development - HttpClient Exception","<java><android><exception><url><httpclient>","2","3","1","",""
"4911511","1","","","2011-02-06 04:06:54","0","794","<p>I'm working on an app which fetches data from a webpage which is updated at 9pm (In AEDT time) each day.The data is stored using shared preferences after it is fetched.</p><p>Since it would be pointless to fetch the data if we know the page hasn't been updated since the last time it was fetched, I'm trying to implement the following:</p><p>1) when data is fetched, set a timestamp preference value of the current time<br>2) when the app would fetch data, check if the current time is ""after the next 9pm of the last fetch date""<br>3) if so, fetch data, otherwise show message saying it doesn't need updating.</p><p>I'm not sure how to store the current date as a primitive that can be stored in shared preferences... Perhaps System.currentTimeMillis() (returns a long)?  This is returned in UTC... will need to make sure that all setting and checking is done with the same timezone...</p><p>How do I then check if the current time is past the update threshold of ""the next 9pm""?</p><p>(As a failsafe, the user has a menu button to force an update - which will be mentioned if the app determines an update is not needed.)</p><p><strong>EDIT:  I think I've solved it, but would still appreciate any feedback or suggestions - see below.</strong></p>","593886","","593886","","2011-02-06 07:53:29","2011-02-06 08:03:24","Android/Java - Set and compare date with offset","<android><time><compare><sharedpreferences>","2","0","","",""
"4911523","1","4913830","","2011-02-06 04:09:41","2","4560","<p>I have a Java TCP server and an Android TCP client. The server waits for requests and then sends 50MB of data to the Android client (who reads by looping an array and overwriting the data, so the data is not saved on the phone.) Everything works fine and dandy but at random times the client crashes with this:</p><pre><code>java.net.SocketException: Connection timed out</code></pre><p>and the server gets this:</p><pre><code>java.net.SocketException: connection reset</code></pre><p>The client reads in a loop until it has received all the data (the maximum I allow it to read in one call is 1.5MB.</p><p>The server sends like this:</p><pre><code>connectionSocket.getOutputStream().write(new byte[1024*1024*10*5]);</code></pre><p>I am looping the client and trying to do this transfer 5-10 times so I can take battery life measurements but I rarely get 3 successful completions of the 50MB transfer. I am really at a loss... the setup I have is really quite simple. I am willing to post code if it will help.</p><p>Here is what adb logcat says for android at the crash:</p><pre><code>...transferingD/WifiService(  109): got ACTION_DEVICE_IDLEE/wpa_supplicant(  209): Set_key: Wrong KeyE/wpa_supplicant(  209): Set_key: Wrong KeyE/wpa_supplicant(  209): Set_key: Wrong KeyE/wpa_supplicant(  209): Set_key: Wrong KeyE/wpa_supplicant(  209): Set_key: Wrong KeyV/WifiMonitor(  109): Event [CTRL-EVENT-STATE-CHANGE id=1 state=8]V/WifiStateTracker(  109): Changing supplicant state: COMPLETED ==&gt; DORMANTD/WifiStateTracker(  109): Reset connections and stopping DHCPE/wpa_supplicant(  209): Set_key: Wrong KeyE/wpa_supplicant(  209): Set_key: Wrong KeyE/wpa_supplicant(  209): Set_key: Wrong KeyE/wpa_supplicant(  209): Set_key: Wrong KeyE/wpa_supplicant(  209): Set_key: Wrong KeyV/WifiMonitor(  109): Event [CTRL-EVENT-DISCONNECTED - Disconnect event - remove keys]V/WifiMonitor(  109): Event [CTRL-EVENT-STATE-CHANGE id=-1 state=8]D/WifiStateTracker(  109): Disabling interfaceD/NetworkStateTracker(  109): setDetailed state, old =CONNECTED and new state=IDLEV/WifiMonitor(  109): Event [CTRL-EVENT-DRIVER-STATE STOPPED]V/WifiStateTracker(  109): New network state is DISCONNECTEDV/WifiStateTracker(  109): Changing supplicant state: DORMANT ==&gt; DORMANTD/ConnectivityService(  109): ConnectivityChange for WIFI: DISCONNECTED/IDLED/ConnectivityService(  109): getMobileDataEnabled returning falseD/ConnectivityService(  109): not failing over to mobile type 0 because Mobile Data DisabledD/ConnectivityService(  109): not failing over to mobile type 2 because Mobile Data DisabledD/ConnectivityService(  109): not failing over to mobile type 3 because Mobile Data DisabledD/ConnectivityService(  109): not failing over to mobile type 4 because Mobile Data DisabledD/ConnectivityService(  109): not failing over to mobile type 5 because Mobile Data DisabledD/Tethering(  109): Tethering got CONNECTIVITY_ACTIOND/Tethering(  109): MasterInitialState.processMessage what=3E/HierarchicalStateMachine(  109): TetherMaster - unhandledMessage: msg.what=3I/ActivityManager(  109): Start proc android.process.media for broadcast com.android.providers.downloads/.DownloadReceiver: pid=793 uid=10004 gids={1015, 2001, 3003}D/NetworkLocationProvider(  109): updateNetworkState(): Updating network state to 1I/ActivityThread(  793): Publishing provider media: com.android.providers.media.MediaProviderV/MediaProvider(  793): Attached volume: internalV/MediaProvider(  793): /mnt/sdcard volume ID: 845505849V/MediaProvider(  793): Attached volume: externalI/ActivityThread(  793): Publishing provider downloads: com.android.providers.downloads.DownloadProviderI/ActivityThread(  793): Publishing provider drm: com.android.providers.drm.DrmProviderI/GTalkService(  243): [ServiceAutoStarter] --- connectivity changedI/GTalkService(  243): [ServiceAutoStarter] --- start GTalk service ---I/ActivityManager(  109): Start proc com.google.android.apps.uploader for broadcast com.google.android.apps.uploader/.ConnectivityBroadcastReceiver: pid=801 uid=10027 gids={3003}D/GTalkService(  243): [GTalkService.1] onStartCommand: found 0 connections, force audit connections...D/GoogleLoginService(  243): onBind: Intent { act=android.accounts.AccountAuthenticator cmp=com.google.android.gsf/.loginservice.GoogleLoginService }W/GoogleLoginService(  243): Device has no accounts: sending Intent { act=com.google.android.gsf.LOGIN_ACCOUNTS_MISSING }D/GTalkService(  243): [GTalkService.25] account missingI/ActivityThread(  801): Publishing provider com.google.android.apps.uploader: com.google.android.apps.uploader.UploadsContentProviderI/ActivityThread(  801): Publishing provider com.google.photos.provider.Album: com.google.android.apps.uploader.clients.picasa.AlbumProviderD/MediaUploader(  801): UploaderApplication.onCreateD/MediaUploader(  801): nonWifiLimit=20971520, default=20971520I/MediaUploader(  801): No need to wake upI/ActivityManager(  109): Process com.google.android.apps.genie.geniewidget (pid 442) has died.W/ActivityManager(  109): Scheduling restart of crashed service com.google.android.apps.genie.geniewidget/.GenieRefreshService in 5000msI/IO exception (  766): ******************** Log Msg IOE java.net.SocketException: Connection timed out**W/System.err(  766): java.net.SocketException: Connection timed outW/System.err(  766):    at org.apache.harmony.luni.platform.OSNetworkSystem.readSocketImpl(Native Method)W/System.err(  766):    at org.apache.harmony.luni.platform.OSNetworkSystem.read(OSNetworkSystem.java:358)W/System.err(  766):    at org.apache.harmony.luni.net.PlainSocketImpl.read(PlainSocketImpl.java:561)W/System.err(  766):    at org.apache.harmony.luni.net.SocketInputStream.read(SocketInputStream.java:88)W/System.err(  766):    at com.mdog.datareceive.Receive$1.onReceive(Receive.java:71)W/System.err(  766):    at android.app.ActivityThread$PackageInfo$ReceiverDispatcher$Args.run(ActivityThread.java:892)W/System.err(  766):    at android.os.Handler.handleCallback(Handler.java:587)W/System.err(  766):    at android.os.Handler.dispatchMessage(Handler.java:92)W/System.err(  766):    at android.os.Looper.loop(Looper.java:123)W/System.err(  766):    at android.app.ActivityThread.main(ActivityThread.java:4627)W/System.err(  766):    at java.lang.reflect.Method.invokeNative(Native Method)W/System.err(  766):    at java.lang.reflect.Method.invoke(Method.java:521)W/System.err(  766):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)W/System.err(  766):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)W/System.err(  766):    at dalvik.system.NativeStart.main(Native Method)**I/ActivityManager(  109): Start proc com.google.android.apps.genie.geniewidget for service com.google.android.apps.genie.geniewidget/.GenieRefreshService: pid=811 uid=10031 gids={3003, 1015}</code></pre><p>Here is the server exception:</p><pre><code>Exception in thread ""main"" java.net.SocketException: Connection reset    at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:96)    at java.net.SocketOutputStream.write(SocketOutputStream.java:124)    at com.mdog.tcpserver.ServerDriver.main(ServerDriver.java:55)</code></pre>","604996","","418183","","2011-02-06 14:24:38","2012-03-08 10:03:46","Strange SocketExceptions: connection reset and Connection timed out","<java><android><tcp><client-server><socketexception>","3","0","1","",""
"4911614","1","4911646","","2011-02-06 04:36:51","3","14253","<p>I am working on an Android project using Eclipse. I want to change the background color of a TextView using one of the colors I've defined in res/values/colors.xml. These colors are all available by using R.color.color_name.</p><p>My problem is that this simply won't work. Changing to one of my defined colors always leaves the TextView's background set to its default color, in this case, black. If I use one of Java's built-in colors, it works fine. I'm thinking it's a color definition problem, something involving how I actually define my colors in my XML, but I'm not sure.</p><pre><code>// This works:weight1.setBackgroundColor(Color.BLACK);// This does not work:weight2.setBackgroundColor(R.color.darkgrey);// Color Definition: (this is in a separate xml file, not in my Java code)&lt;color name = ""darkgrey""&gt;#A9A9A9&lt;/color&gt;</code></pre>","529554","","","","","2012-11-27 08:09:58","How to change a TextView's background color with a color defined in my values/colors.xml file?","<android><textview>","2","0","2","",""
"4911675","1","4911912","","2011-02-06 04:56:42","0","562","<p>Okay so I want to make a layout inside of a Java file and then I would like to call that Java file into my main activity. How would I go about this?</p><p>any help is greatly appreciated.</p><p>-thanksChristian </p>","424421","","","","","2013-01-03 05:33:19","layout from Java android sdk","<java><android>","3","0","","",""
"4911686","1","4912953","","2011-02-06 04:58:56","1","626","<p><strong>EDIT: Added an additional error and the revision to the code i made.</strong></p><p>I am new to java/android. I am trying to create an AlertDialog inside my SmartApp class when an event is fired in my DataRobot class. I am getting an error when doing this. The event is firing and calling the function successfully in SmartApp, but when it gets to <code>AlertDialog alert = new AlertDialog.Builder(this).create();</code> the following error is printed to logcat. Does anyone know what i am doing wrong or a better way to implement what i am wanting?</p><pre><code>Logcat error:02-05 22:39:27.081: VERBOSE/SmartApp(281): data alert event caught02-05 22:39:27.081: VERBOSE/SmartApp(281): inside sendalert02-05 22:39:27.090: WARN/System.err(281): java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare()02-05 22:39:27.122: WARN/System.err(281):     at android.os.Handler.&lt;init&gt;(Handler.java:121)02-05 22:39:27.122: WARN/System.err(281):     at android.app.Dialog.&lt;init&gt;(Dialog.java:101)02-05 22:39:27.141: WARN/System.err(281):     at android.app.AlertDialog.&lt;init&gt;(AlertDialog.java:63)02-05 22:39:27.141: WARN/System.err(281):     at android.app.AlertDialog.&lt;init&gt;(AlertDialog.java:59)02-05 22:39:27.161: WARN/System.err(281):     at android.app.AlertDialog$Builder.create(AlertDialog.java:786)02-05 22:39:27.161: WARN/System.err(281):     at cpe495.smartapp.SmartApp.sendAlert(SmartApp.java:169)02-05 22:39:27.171: WARN/System.err(281):     at cpe495.smartapp.SmartApp$3.dataAlertReceived(SmartApp.java:59)02-05 22:39:27.201: WARN/System.err(281):     at cpe495.smartapp.DataRobot.fireDataAlertEvent(DataRobot.java:96)02-05 22:39:27.201: WARN/System.err(281):     at cpe495.smartapp.DataRobot.analyzeData(DataRobot.java:32)02-05 22:39:27.211: WARN/System.err(281):     at cpe495.smartapp.SmartApp$1.dataReceivedReceived(SmartApp.java:45)02-05 22:39:27.222: WARN/System.err(281):     at cpe495.smartapp.ConnectDevice.fireDataReceivedEvent(ConnectDevice.java:71)02-05 22:39:27.222: WARN/System.err(281):     at cpe495.smartapp.ConnectDevice.run(ConnectDevice.java:42)02-05 22:39:27.242: WARN/System.err(281):     at java.lang.Thread.run(Thread.java:1096)   </code></pre><hr><pre><code>//my smartapp class main uipublic class SmartApp extends Activity implements OnSharedPreferenceChangeListener {    TextView smartConnectionStatus;    TextView testOutputView;    Thread cThread;    private ConnectDevice cD = new ConnectDevice();    private DataRobot dR = new DataRobot();    private DataBuilder dB = new DataBuilder();    private DataSender dS = new DataSender();    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.intro);        cD.addDataReceivedListener(new DataReceivedListener() {            @Override            public void dataReceivedReceived(DataReceivedEvent event) {                // TODO Auto-generated method stub                dR.analyzeData(event.getData());            }        });        dR.addDataAlertListener(new DataAlertListener() {            @Override            public void dataAlertReceived(DataAlertEvent event) {                Log.v(""SmartApp"", ""data alert event caught"");                sendAlert();            }        });    }    /* Function for sending alerts that the user has exceeded a stress index */    public void sendAlert() {        Log.v(""SmartApp"", ""inside sendalert"");        AlertDialog alert = new AlertDialog.Builder(this).create();        Log.v(""SmartApp"", ""after builder1"");        //Vibrator vibrator;        //vibrator = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE);        //vibrator.vibrate(500);        alert.setMessage(""Testing alert dialog..."");        alert.setCancelable(false);        alert.setButton(""Ok"", new DialogInterface.OnClickListener() {            @Override            public void onClick(DialogInterface dialog, int which) {                // TODO Auto-generated method stub                dialog.cancel();            }        });        Log.v(""SmartApp"", ""after builder2"");        //AlertDialog alert = builder.create();        alert.setTitle(""Title"");        Log.v(""SmartApp"", ""after builder3"");        alert.show();        Log.v(""SmartApp"", ""after builder4"");    }}   </code></pre><hr><pre><code>// datarobot classpublic class DataRobot extends Activity {/* This class is for analyzing the data */private List _listeners = new ArrayList();private List&lt;DataAlertListener&gt; _listeners2 = new ArrayList&lt;DataAlertListener&gt;();private SmartDataObject data;private int sI1;private int sI2;private float w1;private float w2;private float w3;private int hRB;private int hRVMin;private int hRVMax;public boolean analyzeData(SmartDataObject temp) {    /* Analyze the data     * Returns true if data was successfully analyzed     * Returns false if an error occurred     */    data = temp;    if(data.getHeartRate()&gt;290) {        fireDataAlertEvent();    }    fireDataAnalyzedEvent(data);    return true; //for now this will always return true}public synchronized void addDataAnalyzedListener(DataAnalyzedListener listener) {    _listeners.add(listener);}public synchronized void removeDataAnalyzedListener(DataAnalyzedListener listener) {    _listeners.remove(listener);}private synchronized void fireDataAnalyzedEvent(SmartDataObject temp) {    DataAnalyzedEvent dRE = new DataAnalyzedEvent(this, temp);    Iterator listeners = _listeners.iterator();    while(listeners.hasNext()) {        ((DataAnalyzedListener)listeners.next()).dataAnalyzedReceived(dRE);    }}public interface DataAnalyzedListener {    public void dataAnalyzedReceived(DataAnalyzedEvent event);}public synchronized void addDataAlertListener(DataAlertListener listener) {    _listeners2.add(listener);}public synchronized void removeDataAlertListener(DataAlertListener listener) {    _listeners2.remove(listener);}private synchronized void fireDataAlertEvent() {    DataAlertEvent dAE = new DataAlertEvent(this);    Iterator listeners = _listeners2.iterator();    while(listeners.hasNext()) {        ((DataAlertListener)listeners.next()).dataAlertReceived(dAE);    }}public interface DataAlertListener {    public void dataAlertReceived(DataAlertEvent event);}}  </code></pre><hr><pre><code>public class DataAlertEvent extends EventObject {    public DataAlertEvent(Object source) {        super(source);        // TODO Auto-generated constructor stub    }}   </code></pre><hr><p><strong>Below is the added code after trying to fix</strong>   </p><pre><code>02-06 10:27:30.673: VERBOSE/SmartApp(276): data alert event caught02-06 10:27:31.013: WARN/System.err(276): java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare()02-06 10:27:31.042: WARN/System.err(276):     at android.os.Handler.&lt;init&gt;(Handler.java:121)02-06 10:27:31.052: WARN/System.err(276):     at android.view.ViewRoot.&lt;init&gt;(ViewRoot.java:231)02-06 10:27:31.052: WARN/System.err(276):     at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:148)02-06 10:27:31.062: WARN/System.err(276):     at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:91)02-06 10:27:31.082: WARN/System.err(276):     at android.view.Window$LocalWindowManager.addView(Window.java:424)02-06 10:27:31.082: WARN/System.err(276):     at android.app.Dialog.show(Dialog.java:241)02-06 10:27:31.102: WARN/System.err(276):     at cpe495.smartapp.SmartApp$4.dataAlertReceived(SmartApp.java:80)02-06 10:27:31.102: WARN/System.err(276):     at cpe495.smartapp.DataRobot.fireDataAlertEvent(DataRobot.java:96)02-06 10:27:31.122: WARN/System.err(276):     at cpe495.smartapp.DataRobot.analyzeData(DataRobot.java:32)02-06 10:27:31.122: WARN/System.err(276):     at cpe495.smartapp.SmartApp$2.dataReceivedReceived(SmartApp.java:66)02-06 10:27:31.133: WARN/System.err(276):     at cpe495.smartapp.ConnectDevice.fireDataReceivedEvent(ConnectDevice.java:71)02-06 10:27:31.133: WARN/System.err(276):     at cpe495.smartapp.ConnectDevice.run(ConnectDevice.java:42)02-06 10:27:31.153: WARN/System.err(276):     at java.lang.Thread.run(Thread.java:1096)   </code></pre><hr><pre><code>public class SmartApp extends Activity implements OnSharedPreferenceChangeListener {    TextView smartConnectionStatus;    TextView testOutputView;    Thread cThread;    private ConnectDevice cD = new ConnectDevice();    private DataRobot dR = new DataRobot();    private DataBuilder dB = new DataBuilder();    private DataSender dS = new DataSender();    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.intro);    final AlertDialog alert = new AlertDialog.Builder(this).create();    Log.v(""SmartApp"", ""inside sendalert"");    //AlertDialog alert = new AlertDialog.Builder(this).create();    Log.v(""SmartApp"", ""after builder1"");    //Vibrator vibrator;    //vibrator = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE);    //vibrator.vibrate(500);    alert.setMessage(""Testing alert dialog..."");    alert.setCancelable(false);    alert.setButton(""Ok"", new DialogInterface.OnClickListener() {        @Override        public void onClick(DialogInterface dialog, int which) {            // TODO Auto-generated method stub            dialog.cancel();        }    });    Log.v(""SmartApp"", ""after builder2"");    //AlertDialog alert = builder.create();    alert.setTitle(""Title"");        cD.addDataReceivedListener(new DataReceivedListener() {            @Override            public void dataReceivedReceived(DataReceivedEvent event) {                // TODO Auto-generated method stub                dR.analyzeData(event.getData());            }        });        dR.addDataAlertListener(new DataAlertListener() {            @Override            public void dataAlertReceived(DataAlertEvent event) {                Log.v(""SmartApp"", ""data alert event caught"");                sendAlert();                            alert.show();            }        });    }}   </code></pre>","427763","","427763","","2011-02-06 16:37:42","2011-02-07 09:37:22","alertdialog error with events","<java><android><events><alertdialog>","2","0","1","",""
"4911694","1","","","2011-02-06 05:01:09","1","2749","<p>I'm trying to create a very simple custom intent example. I've searched for this error and none of the forums have answers that work for me. Here are my files:</p><pre><code>public class DemoImplicit extends Activity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);    }    public void whenButtonIsClicked(View view) {        Intent intent = new Intent(""com.example.action.NEW_ACTION""); //&lt;&lt;&lt;&lt;&lt;&lt;&lt;        intent.addCategory(""android.intent.category.DEFAULT"");       //&lt;&lt;&lt;&lt;&lt;&lt;&lt;//      Intent intent = new Intent(""android.intent.action.VIEW"");//      intent.addCategory(""com.example.MY_CATEGORY"");        startActivity(intent);                                       //&lt;&lt;&lt;&lt;&lt;&lt;&lt;    }}&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;manifest xmlns:android=""http://schemas.android.com/apk/res/android""    package=""com.example.demos"" android:versionCode=""1""    android:versionName=""1.0""&gt;    &lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;        &lt;activity android:name="".SatisfyIntent"" android:label=""@string/app_name""&gt;          &lt;intent-filter&gt;            &lt;!-- action android:name=""android.intent.action.VIEW"" / --&gt;            &lt;!-- category android:name=""com.example.MY_CATEGORY"" / --&gt;            &lt;action android:name=""com.example.action.NEW_ACTION"" /&gt;            &lt;category android:name=""android.intent.category.DEFAULT"" /&gt;          &lt;/intent-filter&gt;        &lt;/activity&gt;    &lt;/application&gt;    &lt;uses-sdk android:minSdkVersion=""9"" /&gt;&lt;/manifest&gt; </code></pre><p>These two separate files are in two different Eclipse projects, but I make sure to load the project containing the intent-filter onto the emulator before loading the file containing the startActivity call onto the emulator. In any case, I always get an ActivityNotFoundException.What am I doing wrong?</p><p>P.S. Here's the AndroidManifest.xml file for the project containing DemoImplicit.java:</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.example.demos""      android:versionCode=""1""      android:versionName=""1.0""&gt;    &lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;        &lt;activity android:name="".DemoImplicit""                  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=""9"" /&gt;&lt;/manifest&gt; </code></pre>","605019","","605019","","2011-02-06 16:50:03","2011-02-06 16:50:03","Android ActivityNotFoundException","<android><android-intent>","1","0","","",""
"4911749","1","","","2011-02-06 05:21:21","1","750","<p>I currently have a listview that is populated upon creation from a web server. I want it to either poll the database for updates routinely, or to allow a php script to update it. I would prefer that it be updated by the database, rather than polling. </p><p>As far as polling goes I know that I can implement a service or an asyncthread. I also have found the timertask class.</p><p>For AsyncThread: Can I have this be recurring continuosly? Would I call the .start method from the </p><p>For TimerTask: Is this less efficient than an asyncthread or service?</p><p>Also do I need to create the TimerTask inside of a thread? or will it create its own threads?</p>","573576","","","","","2011-02-06 10:11:35","Never Ending background thread?","<android><multithreading><android-asynctask><timertask>","1","3","","",""
"4911955","1","4911960","","2011-02-06 06:22:29","1","1919","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/2828185/interview-questions-for-an-android-developer"">Interview questions for an Android developer</a>  </p></blockquote><p>Hi allwhat are the essential things that a mid level android developer needs to know..As in things beside the basics of broadcast receiver, Content provider , intent etc.I could not find a good list of interview questions on the internet. Can you guys come up with good interview questions!! </p>","507466","","457982","","2011-02-06 13:13:39","2011-02-06 13:13:39","what are the essential things that an android developer needs to know?","<android>","2","1","2","2011-02-06 06:33:08",""
"4912020","1","","","2011-02-06 06:38:55","2","3885","<p>I am working on a TabActivity.I need to learn more detail about it.There are tutorial regarding this. But all of them are brief.</p><p>I want DETAIL. So, if you know such site, give me the address.</p><hr><p>Shaiful</p>","595543","","180538","","2011-02-06 15:57:33","2013-03-25 09:28:51","Need good tutorial for TabActivity","<android><tabactivity>","1","4","","2014-02-02 10:39:05",""
"4912031","1","4912483","","2011-02-06 06:41:33","0","564","<p>It seems that the commonly accepted approach to implement a paid ""premium key"" application is to have a the free app check if the paid one is installed to unlock features.This part is straight forward as is the implementation of the LVL but I cannot figure out how to combine both. If the paid app is never intended to be run, there is no way to call the License Verification Service. Only way I could think of was to have the free app invoke an intent from the paid one and wait for a response. The paid app could do the license verification. Problem with this approach is that when the free app calls the intent, it is paused and can be killed anytime by the OS. So nothing guarantees that the app is still running after the license check.</p><p>Any ideas or suggestions on how to implement a paid app that would only be an unlock key but also implements the LVL?</p><p>Thank you</p>","59201","","","","","2011-02-06 10:11:29","How could I use the Android LVL in my premium key app?","<android>","2","0","","",""
"4912032","1","4912200","","2011-02-06 06:41:36","0","1302","<p>This is my requirement in Android . I need to display a tiny image. When the user presses the image the image should zoom in slightly and go back to it's original position, thus giving the impression that the image has been clicked.How do I go about doing this?(I tried using 2 different images (using image selector) in imageview, but both images got scaled to the view size and hence there was no animation visible)</p><p>Please help.</p><p>Regards,Sam</p>","605040","","","","","2011-02-06 07:40:07","Android :: Image click animation","<android><imageview>","1","0","","",""
"4912059","1","4913609","","2011-02-06 06:50:31","1","352","<p>For my app, I hide the titlebar and notification bar for my activity using the themes feature in the manifest file. At the bottom of the activity, I want there to be a 48dip high ad banner and above this the rest of the space should be filled with a object from my class GameView, where this just extends SurfaceView the way seen in the Lunar Lander sample.</p><p>My current layout does this task for me:</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;GameView android:id=""@+id/game_view""        android:layout_width=""wrap_content"" android:layout_height=""wrap_content""            android:layout_weight=""1""&gt;&lt;com.admob.android.ads.AdView android:id=""@+id/ad""    android:layout_width=""fill_parent"" android:layout_height=""48dip"" /&gt;&lt;/LinearLayout&gt;</code></pre><p>However, there is a problem when I switch away from my app with the home key (which cases the notification bar to return) and then switch back to my activity. When I switch back, the screen goes black for a short time, my drawn surface view appears below the notification bar, the notification bar then animates up and disappears, my surface view then shifts to the top of the screen. The problem is that a black horizontal rectangle is now masking the top of my ad banner, where this bar looks the same height as the notification bar. Ascii art:</p><pre><code>-------------|           ||           |   &lt;- surface view the same size as expected|           ||           |#############   &lt;- black rectangle|           |   &lt;- ad banner with the top part masked by the rectangle-------------</code></pre><p>It's as if the views are laid out before the notification bar disappears and when the bar disappears the views are laid out again but something goes wrong laying out the ad bar.</p><p>Any tips on how I can fix this?</p><p>I'm on Android 2.1 if it helps. I tried an alternative RelativeLayout approach but had the same issue. Another alternative might fix it perhaps but I can't think of anything.</p><p>Edit: Relevant manifest code for setting up my activity:</p><pre><code>&lt;application android:label=""@string/app_name"" android:icon=""@drawable/app_icon""&gt;    &lt;activity android:name=""MainActivity"" android:label=""@string/app_name""        android:screenOrientation=""portrait"" android:configChanges=""keyboardHidden|orientation""        android:theme=""@android:style/Theme.NoTitleBar.Fullscreen""&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>","580100","","580100","","2011-02-06 17:36:20","2011-02-06 17:36:20","Problem placing banner at bottom of layout","<java><android><mobile>","1","2","","",""
"4912255","1","","","2011-02-06 07:58:42","0","397","<p>I am trying to have a 2D grid with a grass texture using opengl on android.</p><p>I have set up the 2 triangles for the square and added the texture I moved the camera 10 units into the screen with:</p><blockquote>  <p>gl.glTranslatef(0.0f, 0.0f, -10.0f);       </p></blockquote><p>I thought moving the square like this would orient it to the top left hand corner:</p><blockquote>  <p>gl.glTranslatef(-1.0f, 1.0f, 0);</p></blockquote><p>But it doesn't work, any advice?</p>","543117","","44729","","2011-02-06 18:08:34","2011-02-06 18:08:34","How to correctly set up the camera in android opengl?","<android><opengl-es>","0","2","","",""
"4912269","1","","","2011-02-06 08:03:53","2","2259","<p>I have made a GUI application in Android, to which I would like to sync with Google Calendar.How could this be done?</p>","531654","","2497102","","2013-12-11 04:30:27","2013-12-11 04:30:27","Synchronising Google Calendar to my application in Android","<java><android><google-calendar>","1","2","","",""
"4912283","1","4912362","","2011-02-06 08:10:55","0","180","<p>I am starting to develop Android applications. I've read several tutorials and already made a small useless (but beyond hello world) application.</p><p>I know how I should go about creating a regular application, but that's not what I want to do.</p><p>I want to build a ""notifier type"" application. Think about a ""gmail notifier"" app, only not for Gmail, but for another web service. I can handle the web service and everything.</p><p>What I don't know is how to go about building the application, because it doesn't have a UI (Well, only an options page), and it needs to be running in the background all the time checking for updates at defined intervals (changeable from the options page).</p><p>Any thoughts will be greatly appreciated.</p>","193952","","750987","","2011-05-29 06:28:43","2011-05-29 06:28:43","How to develop a notifier type Android application","<android>","1","0","","",""
"4912334","1","6445395","","2011-02-06 08:23:54","0","1622","<p>In my drawable-hdpi folder i have 4 image files (.png) to serve as the background of awidget. By default android:background=""@drawable/goldgreenbg"" is set for the LinearLayout. I created a preferences screen to let the user change the background.How to do that? I would like to use this code for it:</p><pre><code>      if (listpref.equals(""color1""))          {          Toast.makeText(EditPreferences.this,  ""Black"" + listpref, Toast.LENGTH_LONG).show();          }else if (listpref.equals(""color2""))          {              Toast.makeText(EditPreferences.this,  ""Brown"" + listpref, Toast.LENGTH_LONG).show();          }</code></pre><p>Update:Where shall i put this code to?MainActivity.java: for the activityUpdateService.java: for the widgetEditPreferences.java: for the preferencesMain.xml includes the listview and widgetlayout is id of it.</p><pre><code>  setContentView(R.layout.main);  preferences = PreferenceManager.getDefaultSharedPreferences(this);  String listpref = preferences.getString(""listPref"", ""n/a"");                LinearLayout ll = (LinearLayout) findViewById(R.id.widgetlayout);  if (listpref.equals(""color1""))  {      Toast.makeText(MainActivity.this, ""Black"" + listpref, Toast.LENGTH_LONG).show();      ll.setBackgroundDrawable(getResources().getDrawable(R.drawable.blackbg));  }  else if (listpref.equals(""color2""))  {      Toast.makeText(MainActivity.this, ""Brown"" + listpref, Toast.LENGTH_LONG).show();      ll.setBackgroundDrawable(getResources().getDrawable(R.drawable.brownbg));  }</code></pre>","571648","","571648","","2011-02-06 10:20:31","2011-06-22 19:28:41","Android set widget background","<android><background-image>","2","0","2","",""
"4912373","1","","","2011-02-06 08:35:47","0","110","<p>When i am working on android in eclipse platform i can drag and drop the elements but the ""+ and ""-"" button is not appearing in the oultine view for the designing purpose.Please can you help me out. </p>","605122","","","","","2011-02-06 08:35:47","Android query -Problem in viewing outline views compound buttons i.e. ""+"" and ""-"" buttons","<android><view><outline>","0","2","","",""
"4912398","1","4912494","","2011-02-06 08:44:10","1","9122","<p>This is a total beginner question, I've spent the past hour searching both stackoverflow and Google, but I haven't found what I'm looking for, hopefully someone here can point me in the right direction.</p><p>I'm trying to write a string to an OutputStream, which I will then use to write data to a MySQL database. I've successfully retrieved data from a MySQL (from a .php, implementing JSON and RESTful), so I have some idea of what I'm doing, I think. I'm creating a method which will take a string and return an output stream, and I'm having trouble writing to an output stream, because when I try to initialize one, it creates an anonymous inner class with the write(int oneByte) method. That's not what I want.</p><pre><code>private static OutputStream convertStringtoStream(String string) {    byte[] stringByte = string.getBytes();    OutputStream os = new OutputStream() {        @Override        public void write(int oneByte) throws IOException {            /** I'd rather this method be something like            public void write(byte[] bytes), but it requires int oneByte*/        }    };    //return os here}</code></pre><p>As you can see, I want to write to my OutputStream with the buffer, not a single byte. I'm sure this is simple question, but I've not been able to find an answer, or even sample code which does what I want. If someone could point me in the right direction I'd really appreciate it. Thanks.</p>","588758","","","","","2011-02-06 09:13:07","Writing a string to an OutputStream without using int onebyte","<java><android><mysql><outputstream>","2","0","1","",""
"4912490","1","","","2011-02-06 09:12:55","0","616","<p>I was having trouble getting my intents to work all the time from my main AppWidgetProvider, so I decided to move them to a service, but I cannot get it to work. MY intents are not firing.</p><p>My manifest have this to declare my service:</p><pre><code> &lt;service android:name="".IntentService""            android:label=""IntentService""&gt;     &lt;intent-filter&gt;         &lt;action android:name=""android.tristan.widget.digiclock.action.UPDATE_2"" /&gt;     &lt;/intent-filter&gt; &lt;/service&gt;</code></pre><p>And the code for my service is this:</p><pre><code>public class IntentService extends Service {static final String ACTION_UPDATE = ""android.tristan.widget.digiclock.action.UPDATE_2"";public final static IntentFilter sIntentFilter;public int layoutID = R.layout.clock;private static final String LOGTAG = ""tristan's DigiClock"";int appWidgetIds = 0;static {    sIntentFilter = new IntentFilter();}@Overridepublic IBinder onBind(Intent intent) {    return null;}@Overridepublic void onStart(Intent intent, int startId) {    super.onStart(intent, startId);}@Overridepublic void onCreate() {    super.onCreate();    registerReceiver(onClickTop, sIntentFilter);    registerReceiver(onClickBottom, sIntentFilter);    Log.d(LOGTAG, ""IntentService Started."");}@Overridepublic void onDestroy() {    super.onDestroy();    unregisterReceiver(onClickTop);    unregisterReceiver(onClickBottom);    Log.d(LOGTAG, ""IntentService Stopped."");}public final BroadcastReceiver onClickTop = new BroadcastReceiver() { @Override    public void onReceive(Context context, Intent intent)  {     if(intent.getAction().equals(""android.tristan.widget.digiclock.CLICK""))     {         PackageManager packageManager = context.getPackageManager();         Intent alarmClockIntent = new Intent(Intent.ACTION_MAIN).addCategory(Intent.CATEGORY_LAUNCHER);         String clockImpls[][] = {                 {""HTC Alarm Clock"", ""com.htc.android.worldclock"", ""com.htc.android.worldclock.WorldClockTabControl"" },                 {""Standar Alarm Clock"", ""com.android.deskclock"", ""com.android.deskclock.AlarmClock""},                 {""Froyo Nexus Alarm Clock"", ""com.google.android.deskclock"", ""com.android.deskclock.DeskClock""},                 {""Moto Blur Alarm Clock"", ""com.motorola.blur.alarmclock"",  ""com.motorola.blur.alarmclock.AlarmClock""}         };         boolean foundClockImpl = false;         for(int i=0; i&lt;clockImpls.length; i++) {             String vendor = clockImpls[i][0];             String packageName = clockImpls[i][1];             String className = clockImpls[i][2];             try {                 ComponentName cn = new ComponentName(packageName, className);                 ActivityInfo aInfo = packageManager.getActivityInfo(cn, PackageManager.GET_META_DATA);                 alarmClockIntent.setComponent(cn);                 foundClockImpl = true;             } catch (NameNotFoundException e) {                 Log.d(""Error, "", vendor + "" does not exist"");             }         }         if (foundClockImpl) {         Vibrator vibrator = (Vibrator) context.getSystemService(Context.VIBRATOR_SERVICE);         vibrator.vibrate(50);         final RemoteViews views = new RemoteViews(context.getPackageName(), layoutID);         views.setOnClickPendingIntent(R.id.TopRow, PendingIntent.getActivity(context, 0, new Intent(context, DigiClock.class).setFlags(Intent.FLAG_ACTIVITY_NEW_TASK), PendingIntent.FLAG_UPDATE_CURRENT));         AppWidgetManager.getInstance(context).updateAppWidget(intent.getIntArrayExtra(AppWidgetManager.EXTRA_APPWIDGET_IDS), views);         alarmClockIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);         context.startActivity(alarmClockIntent);           }     } }};     public final BroadcastReceiver onClickBottom = new BroadcastReceiver() {      @Override         public void onReceive(Context context, Intent intent)       {          if(intent.getAction().equals(""android.tristan.widget.digiclock.CLICK_2""))          {              PackageManager calendarManager = context.getPackageManager();              Intent calendarIntent = new Intent(Intent.ACTION_MAIN).addCategory(Intent.CATEGORY_LAUNCHER);                  String calendarImpls[][] = {                          {""HTC Calendar"", ""com.htc.calendar"", ""com.htc.calendar.LaunchActivity"" },                          {""Standard Calendar"", ""com.android.calendar"", ""com.android.calendar.LaunchActivity""},                          {""Moto Blur Calendar"", ""com.motorola.blur.calendar"",  ""com.motorola.blur.calendar.LaunchActivity""}                  };              boolean foundCalendarImpl = false;              for(int i=0; i&lt;calendarImpls.length; i++) {                  String vendor = calendarImpls[i][0];                  String packageName = calendarImpls[i][1];                  String className = calendarImpls[i][2];                  try {                      ComponentName cn = new ComponentName(packageName, className);                      ActivityInfo aInfo = calendarManager.getActivityInfo(cn, PackageManager.GET_META_DATA);                      calendarIntent.setComponent(cn);                      foundCalendarImpl = true;                  } catch (NameNotFoundException e) {                      Log.d(""Error, "", vendor + "" does not exist"");                  }              }              if (foundCalendarImpl) {              Vibrator vibrator = (Vibrator) context.getSystemService(Context.VIBRATOR_SERVICE);              vibrator.vibrate(50);              final RemoteViews views2 = new RemoteViews(context.getPackageName(), layoutID);              views2.setOnClickPendingIntent(R.id.BottomRow, PendingIntent.getActivity(context, 0, new Intent(context, DigiClock.class).setFlags(Intent.FLAG_ACTIVITY_NEW_TASK), PendingIntent.FLAG_UPDATE_CURRENT));              AppWidgetManager.getInstance(context).updateAppWidget(intent.getIntArrayExtra(AppWidgetManager.EXTRA_APPWIDGET_IDS), views2);              calendarIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);              context.startActivity(calendarIntent);                }          }};};}</code></pre><p>I am obviously doing something wrong, I just cannot figure out what.</p><p>EDIT: I have this in my onUpdate() in my main class, can that be some kind if issue?</p><pre><code>@Overridepublic void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {super.onUpdate(context, appWidgetManager, appWidgetIds);    context.startService(new Intent(UpdateService.ACTION_UPDATE));    context.startService(new Intent(context, ScreenUpdateService.class));    context.startService(new Intent(IntentService.ACTION_UPDATE));    final int Top = appWidgetIds.length;    final int Bottom = appWidgetIds.length;    for (int i=0; i&lt;Top; i++)    {    int appWidgetId = appWidgetIds[i];    final RemoteViews top=new RemoteViews(context.getPackageName(), layoutID);    Intent clickintent=new Intent(""android.tristan.widget.digiclock.CLICK"");    PendingIntent pendingIntentClick=PendingIntent.getBroadcast(context, 0, clickintent, 0);    top.setOnClickPendingIntent(R.id.TopRow, pendingIntentClick);    appWidgetManager.updateAppWidget(appWidgetId, top);}for (int j=0; j&lt;Bottom; j++){    int appWidgetId = appWidgetIds[j];    RemoteViews bottom=new RemoteViews(context.getPackageName(), layoutID);    Intent clickintent=new Intent(""android.tristan.widget.digiclock.CLICK_2"");    PendingIntent pendingIntentClick=PendingIntent.getBroadcast(context, 0, clickintent, 0);    bottom.setOnClickPendingIntent(R.id.BottomRow, pendingIntentClick);    appWidgetManager.updateAppWidget(appWidgetId, bottom);}}</code></pre><p>Also, do I need to declare anything else in my manifest to get it working?</p>","525720","","180538","","2011-02-06 14:22:35","2011-02-06 14:22:35","Service with intents not working. Help needed","<android><service><android-intent>","1","0","","",""
"4912527","1","4912582","","2011-02-06 09:27:45","2","1236","<p>When I tried to use &amp;, &lt;, > as text view text both in main.xml and strings.xml it returns an error. I wanna show ""&amp;"", ""&lt;"" sign anyway in my app in the text view. How to do it??</p><p>Please advice me.</p><p>Thanks in advance.</p>","348301","","","","","2011-02-06 11:26:22","Android layout file doesn't allow charactors such as &, <, >","<java><android><xml>","3","0","2","",""
"4912624","1","","","2011-02-06 09:59:39","2","1815","<p>How can I make an activity which comes as a splash screen before the app starts and waits for a specific time like 3 seconds in which the user have to draw the unlocking pattern to get in to the application?</p><p>If the user is unable to draw the right pattern, the application should open a simple web browser or another activity which is not the part of the application.</p><p>Also, after putting in the correct locking pattern, how can a user change the locking pattern so that he can use the new pattern next time he uses the application?</p>","605158","","102937","","2011-02-06 15:53:43","2012-04-23 20:58:29","lock application with a lock a pattern","<android>","2","1","","",""
"4912687","1","4913727","","2011-02-06 10:17:23","5","9973","<p>I got some text that has to be put in the textview</p><p>i did that using setText() method of the TextView</p><p>Now i got to find the number of lines or height the text occupies in the TextViewI tried using getHeight() method, but it always returns 0</p><p>Is there anyway to get the height of the text present in the textview ??</p><p>Forgive me if there are any mistakes or errors in the above problem !!!</p><p>Thanks, Siva Kumar</p>","598331","","","","","2011-02-06 14:10:44","Android : get the height of the textview","<java><android><textview>","2","2","3","",""
"4912695","1","4930538","","2011-02-06 10:18:40","46","4520","<p>I'm working on a high-performance Android application (a game), and though I try to code for readability first, I like to keep in the back of my mind a picture of what is happening under the hood. With C++, I've developed a fairly good intuition about what the compiler will and won't do for me. I'm trying to do the same for Java/Android.</p><p>Hence this question. I could find very little about this topic on the web. Will the Java compiler, Dalvik converter (dx) and/or JITter (on Android 2.2+) perform optimizations like the following?</p><ul><li><p>Method inlining. Under what conditions? <code>private</code> methods can always safely be inlined; will this be done? How about <code>public final</code> methods? Methods on objects of other classes? <code>static</code> methods? What if the runtime type of the object can easily be deduced by the compiler? Should I declare methods as <code>final</code> or <code>static</code> wherever possible?</p></li><li><p>Common subexpression elimination. For example, if I access <code>someObject.someField</code> twice, will the lookup be done only once? What if it's a call to a getter? What if I use some arithmetic expression twice; will it be evaluated only once? What if I use the result of some expression, whose value I know not to change, as the upper bound of a <code>for</code> loop?</p></li><li><p>Bounds checking on array lookups. Will the toolchain eliminate this in certain conditions, like the archetypical <code>for</code> loop?</p></li><li><p>Value inlining. Will accesses to some <code>public static final int</code> always be inlined? Even if they're in another class? Even if they're in another package?</p></li><li><p>Branch prediction. How big an issue is this even? Is branching a large performance hit on a typical Android device?</p></li><li><p>Simple arithmetic. Will <code>someInt * 2</code> be replaced by <code>someInt &lt;&lt; 1</code>?</p></li></ul><p>Etcetera...</p>","14637","","257356","","2011-02-06 13:36:49","2011-02-08 07:20:38","What optimizations can I expect from Dalvik and the Android toolchain?","<java><android><optimization><dalvik>","3","6","18","",""
"4912778","1","","","2011-02-06 10:38:49","1","1370","<p>I've been playing around with this code and I'm obviously trying to make a soundboard that will save ringtones on longclicks and etc. </p><p>Though, this is the basic code for one button. I've been duplicating the same code on top of each other, trying to make arrays, just everything.. I can't get this code to work the way I want it to.  </p><p>When they are multiple buttons and more codes. </p><p>I can get the sounds to all play for the buttons.  I can get the menu to pop up for each button. Tho, the first button is always the one that gets saved, and the rest just fall off the map. </p><p>I assume that my data flow on the following code is not getting cut off and being picked up by the other sound buttons. Either way, it doesn't work. Please help me.</p><pre><code>public class Soundboard extends Activity {    private SoundManager mSoundManager;    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        mSoundManager = new SoundManager();        mSoundManager.initSounds(getBaseContext());        mSoundManager.addSound(1, R.raw.sound1);        Button SB = (Button)findViewById(R.id.sound1);        SB.setOnClickListener(new OnClickListener() {            public void onClick(View v) {               mSoundManager.playSound(1);                                  }        });        Button btn = (Button) findViewById(R.id.sound1);        registerForContextMenu(btn);    }    @Override    public void onCreateContextMenu(ContextMenu menu, View v,ContextMenuInfo menuInfo) {        super.onCreateContextMenu(menu, v, menuInfo);        menu.setHeaderTitle(""Save as..."");        menu.add(0, v.getId(), 0, ""Ringtone"");        menu.add(0, v.getId(), 0, ""Notification"");    }    @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.sound1)) {             // 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 (savenot(R.raw.sound1)) {             // 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();         }    }    //Save into Ring tone Folder    public boolean savering(int ressound){        byte[] buffer=null;        InputStream fIn = getBaseContext().getResources().openRawResource(ressound);        int size=50;         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=""ohhh""+"".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, ""Ohhh Ringtone"");           values.put(MediaStore.MediaColumns.MIME_TYPE, ""audio/ogg"");           values.put(MediaStore.Audio.Media.ARTIST, ""weee"");           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);            //Insert it into the database        this.getContentResolver().insert(                MediaStore.Audio.Media.getContentUriForPath(k.getAbsolutePath()), values);        return true;     }    //Save in Notification Folder    public boolean savenot(int ressound){        byte[] buffer=null;        InputStream fIn = getBaseContext().getResources().openRawResource(ressound);        int size=0;         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/notifications/"";        String filename=""ohhh""+"".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, ""Ohhh Notification"");           values.put(MediaStore.MediaColumns.MIME_TYPE, ""audio/ogg"");           values.put(MediaStore.Audio.Media.ARTIST, ""weee"");           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);            //Insert it into the database        this.getContentResolver().insert(                MediaStore.Audio.Media.getContentUriForPath(k.getAbsolutePath()), values);        return true;     }}</code></pre>","604037","","13531","","2012-01-05 17:45:47","2012-01-05 17:45:47","Android Java soundboard code only setting first button as ringtone/etc","<java><android><button><ringtone>","1","0","","",""
"4912827","1","","","2011-02-06 10:51:43","0","2834","<p>I'm trying to use activity groups - since I use tabs, and want to have the tabs when loading and activity after the list item was clicked,. but I'm getting nullpointerexception                    in the following line:</p><pre><code>View view1 = S1_Group.group.getLocalActivityManager()                           .startActivity(""S1"", intent)                           .getDecorView();</code></pre><p>Code is .. .</p><pre><code>lv.setOnItemClickListener(new OnItemClickListener() {            public void onItemClick(AdapterView&lt;?&gt; parent, View view,                  int position, long id) {Intent intent = new Intent(getApplicationContext(), S1.class);                       intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);                       Log.d(""test"",""Before view"");                       try{                           View view1 = S1_Group.group.getLocalActivityManager()                           .startActivity(""S1"", intent)                           .getDecorView();                           Settings_Group.group.setContentView(view1);                             }                       catch (Exception e){                           Log.e(""test"",""view failded:""+e);                       }....</code></pre><p>Thanks for you help!!!</p><p>update: this how my group activity is: I couldn't find what was the issue., public class S1_Group extends ActivityGroup {</p><pre><code>public static S1_Group group;private ArrayList&lt;View&gt; history;@Overrideprotected void onCreate(Bundle savedInstanceState) {    // TODO Auto-generated method stub    super.onCreate(savedInstanceState);    this.history = new ArrayList&lt;View&gt;();    group = this;    View view = getLocalActivityManager().startActivity(""F1"",             new Intent(this, F1.class).addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)).getDecorView();    setContentView(view);}</code></pre><p>}</p>","605184","","605184","","2011-02-06 19:57:59","2012-04-05 13:01:08","Android ActivityGroup - NullPointerException","<android><activity><nullpointerexception><group>","3","1","1","",""
"4912853","1","4912929","","2011-02-06 10:56:35","2","3019","<p>I'm knocking together what amounts to an RSS reader in Android, and I'm having a problem with onClickListener.</p><p>The following code run fine outside of the onClickListener, but as soon as I move it inside the class it </p><pre><code>        topNewsbtn = (Button) findViewById(R.id.newsTop);    topNewsbtn.setOnClickListener(new OnClickListener(){        public void onClick(View arg0) {            // TODO Auto-generated method stub            Intent itemintent = new Intent(that,RSSReader.class);            Bundle b = new Bundle();            b.putString(""FeedURL"", ""http://english.aljazeera.net/Services/Rss/?PostingId=2007731105943979989"");            itemintent.putExtra(""android.intent.extra.INTENT"", b);            startActivity(itemintent);        }    }); </code></pre><p>N.B. that is defined in the Activity as a Context and within onCreate assigned as that = this</p><p>On execution the app crashed on start-up with the following stack trace (nothing in LogCat) </p><pre><code>Thread [&lt;1&gt; main] (Suspended (exception java.lang.RuntimeException))        &lt;VM does not provide monitor information&gt;       android.app.ActivityThread.performLaunchActivity(android.app.ActivityThread$ActivityRecord, android.content.Intent) line: 2663      android.app.ActivityThread.handleLaunchActivity(android.app.ActivityThread$ActivityRecord, android.content.Intent) line: 2679       android.app.ActivityThread.access$2300(android.app.ActivityThread, android.app.ActivityThread$ActivityRecord, android.content.Intent) line: 125     android.app.ActivityThread$H.handleMessage(android.os.Message) line: 2033       android.app.ActivityThread$H(android.os.Handler).dispatchMessage(android.os.Message) line: 99       android.os.Looper.loop() line: 123      android.app.ActivityThread.main(java.lang.String[]) line: 4627      java.lang.reflect.Method.invokeNative(java.lang.Object, java.lang.Object[], java.lang.Class, java.lang.Class[], java.lang.Class, int, boolean) line: not available [native method]      java.lang.reflect.Method.invoke(java.lang.Object, java.lang.Object...) line: 521        com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run() line: 868      com.android.internal.os.ZygoteInit.main(java.lang.String[]) line: 626       dalvik.system.NativeStart.main(java.lang.String[]) line: not available [native method]  </code></pre><p>I have another onClickListener that also crashes with the same sort of stack trace and that looks like</p><pre><code>        watchLivebtn =(Button) findViewById(R.id.Live);    watchLivebtn.setOnClickListener(new OnClickListener(){        public void onClick(View arg0) {            WebView browser = (WebView)findViewById(R.id.watchnowElement);            String HTML = ""Just some HTML I want to display"";            browser.loadData(HTML, ""text/html"", ""UTF-8"");            setContentView(R.layout.watchnow);        }    });</code></pre><p>So clearly I'm doing something that wrong with the setOnClickListener, but what?</p><p>Thanks.</p><p><strong>update</strong></p><p>I resisted puting the whole class in because it's so long, as the two people who've tryed to help me (Thanks) have pointed out stuff I've don't I'll post the whole thing to help you all help me.</p><pre><code>import android.app.Activity;import android.content.Context;import android.content.Intent;import android.os.Bundle;import android.view.View;import android.view.View.OnClickListener;import android.view.Window;import android.webkit.WebView;import android.widget.Button;import android.widget.SlidingDrawer;public class AJE extends Activity {Button news_slideHandleButton;SlidingDrawer news_slidingDrawer;Button topNewsbtn;Button watchLivebtn;Context that;/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    that = this;    super.onCreate(savedInstanceState);    requestWindowFeature(Window.FEATURE_NO_TITLE);    news_slideHandleButton = (Button) findViewById(R.id.news_slideHandleButton);    news_slidingDrawer = (SlidingDrawer) findViewById(R.id.news_SlidingDrawer);    topNewsbtn = (Button) findViewById(R.id.newsTop);    topNewsbtn.setOnClickListener(new OnClickListener(){        public void onClick(View arg0) {            // TODO Auto-generated method stub            Intent itemintent = new Intent(that,RSSReader.class);            Bundle b = new Bundle();            b.putString(""FeedURL"", ""http://english.aljazeera.net/Services/Rss/?PostingId=2007731105943979989"");            itemintent.putExtra(""android.intent.extra.INTENT"", b);            startActivity(itemintent);        }    });     watchLivebtn =(Button) findViewById(R.id.Live);    watchLivebtn.setOnClickListener(new OnClickListener(){        public void onClick(View arg0) {            WebView browser = (WebView)findViewById(R.id.watchnowElement);            String HTML = ""&lt;html&gt;&lt;body&gt;&lt;script src='http://admin.brightcove.com/js/BrightcoveExperiences.js' type='text/javascript'&gt;&lt;/script&gt;"" +                          ""&lt;script src='/custom/brightcove/aje_bc.js' type='text/javascript'&gt;&lt;/script&gt;""+                          ""&lt;div style='text-align: left; padding-bottom: 20px;'&gt;"" +                          ""&lt;div id='BCplayerArea' style='width: 680px; height: 420px;'&gt;&lt;object class='BrightcoveExperience' id='myExperience747084146001' data='http://c.brightcove.com/services/viewer/federated_f9?&amp;amp;width=680&amp;amp;height=440&amp;amp;flashID=myExperience747084146001&amp;amp;bgcolor=%23FFFFFF&amp;amp;playerID=751182905001&amp;amp;playerKey=AQ~~%2CAAAAmtVJIFk~%2CTVGOQ5ZTwJYW4Aj2VxnKEXntSbmcf9ZQ&amp;amp;isVid=true&amp;amp;isUI=true&amp;amp;dynamicStreaming=true&amp;amp;%40videoPlayer=747084146001&amp;amp;autoStart=' type='application/x-shockwave-flash' width='680' height='440'&gt;&lt;param value='always' name='allowScriptAccess'&gt;&lt;param value='true' name='allowFullScreen'&gt;&lt;param value='false' name='seamlessTabbing'&gt;&lt;param value='true' name='swliveconnect'&gt;&lt;param value='window' name='wmode'&gt;&lt;param value='high' name='quality'&gt;&lt;param value='#FFFFFF' name='bgcolor'&gt;&lt;/object&gt;&lt;/div&gt;""+                          ""&lt;script type='text/javascript'&gt;// &lt;![CDATA[""+                          ""RenderScVideo('747084146001','751182905001',680,440,'BCplayerArea');""+                           ""brightcove.createExperiences();    // ]]&gt;&lt;/script&gt;&lt;/body&gt;&lt;/html&gt;';"";            browser.loadData(HTML, ""text/html"", ""UTF-8"");            setContentView(R.layout.watchnow);        }    });    setContentView(R.layout.start);    }}</code></pre>","70568","","70568","","2011-02-06 11:27:03","2011-02-06 12:00:15","What am I forgetting about OnClickListener?","<android>","3","7","","",""
"4912858","1","4913530","","2011-02-06 10:58:12","0","1238","<p>I created a widget (HelloWidget.java), an activity for it (MainActivity.java) and a listpreference (EditPreferences.java).</p><p>XML files:</p><ul><li>Main.xml: this has the widget</li><li>Config.xml: this has the activity: buttons</li><li>preferences.xml: this has the listpreference</li></ul><p>I created the preferences to let the user change the background image of the widget. I have 4 image files for this in the drawable-hdpi folder. Default background is set like android:background=""@drawable/goldgreenbg""</p><p>In MainActivity.java i have this code to set the background image if user clicks the first or the second element of the listpreference:</p><pre><code>preferences = PreferenceManager.getDefaultSharedPreferences(this);  String listpref = preferences.getString(""listPref"", ""n/a"");                if (listpref.equals(""color1""))  {      Toast.makeText(MainActivity.this, ""Black"" + listpref, Toast.LENGTH_LONG).show();      setContentView(R.layout.main);      LinearLayout ll = (LinearLayout) findViewById(R.id.widgetlayout);      ll.setBackgroundDrawable(getResources().getDrawable(R.drawable.blackbg));  }  else if (listpref.equals(""color2""))  {      Toast.makeText(MainActivity.this, ""Brown"" + listpref, Toast.LENGTH_LONG).show();      setContentView(R.layout.main);      LinearLayout ll = (LinearLayout) findViewById(R.id.widgetlayout);      ll.setBackgroundDrawable(getResources().getDrawable(R.drawable.brownbg));  }</code></pre><p>Unfortunately this results in changing the activity, not the widget. So now i see the background image instead of the buttons in the activity while the widget is unchanged.I tried to put this in the onCreate() method of UpdateService.java but it doesn't enable setContentView() to use.Any ideas?</p><p>Update: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=""wrap_content""    android:layout_gravity=""center""    android:background=""@drawable/goldgreenbg""    android:id=""@+id/widgetlayout""&gt;&lt;TextView android:id=""@+id/widget_textview""    android:text=""@string/widget_text""    android:layout_height=""wrap_content""    android:layout_width=""wrap_content""    android:layout_gravity=""center_horizontal|center""    android:gravity=""center_horizontal""    android:layout_marginTop=""0dip""    android:padding=""0dip""    android:textColor=""#0B3B0B""    android:textSize=""11sp""/&gt;&lt;TextView android:id=""@+id/widget_textview2""    android:text=""@string/widget_text""    android:layout_height=""wrap_content""    android:layout_width=""wrap_content""    android:layout_gravity=""center_horizontal|center""    android:gravity=""center_horizontal""    android:layout_marginTop=""0dip""    android:padding=""0dip""    android:textSize=""12sp""    android:textColor=""@android:color/white""/&gt;&lt;TextView android:id=""@+id/widget_textview3""    android:text=""@string/widget_text""    android:layout_height=""wrap_content""    android:layout_width=""wrap_content""    android:layout_gravity=""center_horizontal|center""    android:layout_marginTop=""0dip""    android:padding=""0dip""    android:textSize=""9sp""    android:textColor=""#0B3B0B""/&gt;&lt;/LinearLayout&gt;</code></pre><p>Solved:The ""If"" part should be in the preferences.java file and insted of linearlayout use this code:</p><pre><code> RemoteViews updateViews = new RemoteViews(EditPreferences.this.getPackageName(), R.layout.main);              updateViews.setTextColor(R.id.widget_textview, Color.rgb(215, 215, 215));              updateViews.setTextColor(R.id.widget_textview2, Color.WHITE);              updateViews.setTextColor(R.id.widget_textview3, Color.rgb(155, 155, 155));              updateViews.setImageViewBitmap(R.id.ImageView01, ((BitmapDrawable)EditPreferences.this.getResources().getDrawable(R.drawable.blackbg)).getBitmap());              ComponentName thisWidget = new ComponentName(EditPreferences.this, HelloWidget.class);              AppWidgetManager manager = AppWidgetManager.getInstance(EditPreferences.this);              manager.updateAppWidget(thisWidget, updateViews);</code></pre>","571648","","571648","","2011-02-12 16:10:14","2011-02-12 16:10:14","Android listpreference and widget background","<android><android-preferences>","1","0","","",""
"4912928","1","5471958","","2011-02-06 11:16:28","1","860","<p>i've written an app that starts up the camera. i'd like to include face detection. i've found some code that detects faces in a given bitmap image but this image is loaded from the res/drawable directory. What i'm wanting is to scan the camera's preview for faces. can anyone shed light on which camera method should handle the detection. for example is it the surfaceChanged() where i would do the detection? i understand that i may need to use a previewcallback method. can anyone point me in the correct directionthanks</p>","532462","","","","","2011-03-29 11:44:31","how to include face-detection in my camera app lifecycle?","<android><face-detection>","1","0","","",""
"4913100","1","","","2011-02-06 11:52:19","2","393","<p>I have an app that has an IntentService that runs once in a while. If both of them run together the SQL statements that write to the database trip over each other ( datbase is locked error ) and are crashing the app.</p><p>Is there way for both the activity and the service somehow share the same database connection?</p>","450407","","","","","2011-02-07 23:52:55","How can an activty and a service write to DB at the same time?","<android><database><sqlite><locking><share>","1","2","","",""
"4913154","1","4919936","","2011-02-06 12:05:55","0","4328","<p>I have a <code>PushNotificationReceiver (extends BroadcastReceiver)</code> and <code>MainActivity</code>. The receiver sends some data (for example string value ""<code>New value</code>"") to the <code>MainActivity</code> via an <code>Intent</code>. Then <code>MainActivity</code> updates its <code>TextView</code> with this value.This works fine until I change this <code>TextView</code> value to some other value (for example reset it to ""<code>UNSPECIFIED</code>"") and move the activity to background and to foreground again. The <code>MainActivity</code> is restored and its <code>TextView</code> contains ""<code>New value</code>"", however I expected it to be ""<code>UNSPECIFIED</code>"" - <strong>this is the problem</strong>.</p><p>What is wrong with my app?</p><p>The whole proto project may be downloaded <a href=""http://www.box.net/shared/si6krushrv"" rel=""nofollow"">here</a>.</p><p>Here is my MainActivity code</p><pre><code>private TextView tvValue;private EditText etNewValue;@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    tvValue = (TextView)findViewById(R.id.value);    etNewValue = (EditText)findViewById(R.id.new_value);    findViewById(R.id.reset).setOnClickListener(new OnClickListener() {                 @Override        public void onClick(View v) {            tvValue.setText(getResources().getString(R.string.not_specified));        }    });    findViewById(R.id.send_notification).setOnClickListener(new OnClickListener() {                 @Override        public void onClick(View v) {            sendNotification(etNewValue.getText().toString());        }    });    processDataFromBroadcast(getIntent());        }@Overridepublic void onNewIntent(Intent intent) {    super.onNewIntent(intent);    processDataFromBroadcast(intent);}private void sendNotification(String value){    NotificationManager mNotificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);    String title = ""Proto App Notif"";    Notification notification = new Notification(            android.R.drawable.ic_notification_overlay,            title,            System.currentTimeMillis());    notification.flags |= Notification.FLAG_AUTO_CANCEL;    Context ctxApp = getApplicationContext();    Intent notificationIntent = new Intent()        .setAction(PushNotificationReceiver.ACTION_NOTIFICATION)        .putExtra(""value"", value);    PendingIntent contentIntent = PendingIntent.getBroadcast(            ctxApp,             0,             notificationIntent,             PendingIntent.FLAG_UPDATE_CURRENT);         notification.setLatestEventInfo(            ctxApp,            title,            value,            contentIntent);    notification.audioStreamType = AudioManager.STREAM_NOTIFICATION;    mNotificationManager.notify(1, notification);           }private void processDataFromBroadcast(Intent intent) {    if (!intent.hasExtra(""value"")){        return;    }    String val = intent.getStringExtra(""value"");    tvValue.setText(val); // Updating my activity look}</code></pre><p>PushNotificationReceiver</p><pre><code>private static final String LOG_CAT = ""PushNotificationReceiver"";static final String ACTION_NOTIFICATION = ""com.mobiwolf.proto.NOTIFICATION_RECEIVER"";@Overridepublic void onReceive(Context context, Intent intent) {    if (!intent.getAction().equals(ACTION_NOTIFICATION)) {        return;    }    String value = intent.getStringExtra(""value"");    Log.d(LOG_CAT, ""Received notification message: ""+value); // Log always contains the value sent on first time    Intent i = new Intent();    i.setClass(context, MainActivity.class);    i.putExtra(""value"", value);    i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);    context.startActivity(i);}</code></pre><p>And manifest</p><pre><code>    &lt;receiver android:name=""com.mobiwolf.proto.PushNotificationReceiver""&gt;        &lt;intent-filter&gt;            &lt;action android:name=""com.mobiwolf.proto.NOTIFICATION_RECEIVER"" /&gt;        &lt;/intent-filter&gt;    &lt;/receiver&gt;        &lt;activity android:name="".MainActivity""              android:label=""@string/app_name""              android:launchMode=""singleTask""&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>","120574","","120574","","2011-02-06 12:34:37","2012-11-27 19:13:52","Passing data from a BroadcastReceiver to MainActivity works correctly only once","<android><activity><android-intent><task><broadcastreceiver>","3","2","1","",""
"4913269","1","6317060","","2011-02-06 12:28:15","2","593","<p>I know the title is an eyebrow raiser but it's mostly a side effect problem. I'm writing an Android app that I can use with the math I've been learning in my physics class. It's a 2D bouncing ball app. I'm using the time corrected Verlet integrator with an impulse on the floor which is the bottom of the screen. I'm adding friction and bounciness so that the ball eventually reaches 0 velocity.</p><p>The problem shows up when the ball is resting on the floor and a ""significant"" time step change happens. The integrator adjusts the velocities flawlessly and ends up firing the impulse on the floor. The impulse fires when the velocity's abs value is greater than 2.5. Android's GC usually causes a time adjusted -18 velocity.</p><p>Any help is appreciated. I realize the code structure could be better but I'm just trying to visualize and apply physics for fun. Thank you.</p><pre><code>// The looppublic void run() {    if(mRenderables != null) {        final long time = SystemClock.uptimeMillis();       final long timeDelta = time - mLastTime;        if(mLastTime != 0) {            final float timeDeltaSeconds = timeDelta / 1000.0f;             if(mLastTimeDeltaSec != 0) {                                    for(short i = 0; i &lt; mRendLength; i++) {                    Ball b1 = mRenderables[i];                    // Acceleration is gauged by screen's tilt angle                    final float gravityX = -mSV.mSensorX * b1.MASS;                    final float gravityY = -mSV.mSensorY * b1.MASS;                    computeVerletMethod(b1, gravityX, gravityY, timeDeltaSeconds, mLastTimeDeltaSec);                }            }            mLastTimeDeltaSec = timeDeltaSeconds;        }        mLastTime = time;    }}/** Time-Corrected Verlet Integration* xi+1 = xi + (xi - xi-1) * (dti / dti-1) + a * dti * dti*/  public void computeVerletMethod(Renderable obj, float gravityX, float gravityY, float dt, float lDT) {    mTmp.x = obj.pos.x;    mTmp.y = obj.pos.y;    obj.vel.x = obj.pos.x - obj.oldPos.x;    obj.vel.y = obj.pos.y - obj.oldPos.y;    // Log ""1."" here            resolveScreenCollision(obj);    obj.pos.x += obj.FRICTION * (dt / lDT) * obj.vel.x + gravityX * (dt * dt);    obj.pos.y += obj.FRICTION * (dt / lDT) * obj.vel.y + gravityY * (dt * dt);    obj.oldPos.x = mTmp.x;    obj.oldPos.y = mTmp.y;    // Log ""2."" here}// Screen edge detection and resolverpublic void resolveScreenCollision(Renderable obj) {   final short xmax = (short) (mSV.mViewWidth - obj.width);   final short ymax = (short) (mSV.mViewHeight - obj.height);   final float x = obj.pos.x;   final float y = obj.pos.y;   // Only testing bottom of screen for now        if (y &gt; ymax) {    // ...    } else if (y &lt; 0.5f) {        if(Math.abs(obj.vel.y) &gt; 2.5f) {            float imp = (obj.MASS * (obj.vel.y * obj.vel.y) / 2) * obj.RESTITUTION / obj.MASS;            obj.vel.y += imp;           // Log ""bounce"" here        } else {            obj.vel.y = obj.pos.y = obj.oldPos.y = mTmp.y = 0.0f;        }    }}</code></pre><p>Output while ball is resting on the floor and sudden impulse happens(see code for ""log"" comments)</p><pre><code>1.  vel.y: -0.482587962.  pos.y: -0.42748278 /oldpos.y: 0.0 /dt: 0.016 /ldt: 0.0171.  vel.y: -0.42748278dalvikvm  GC_FOR_MALLOC freed 8536 objects / 585272 byte s in 74ms2.  pos.y: -0.48258796 /oldpos.y: 0.0 /dt: 0.017 /ldt: 0.0161.  vel.y: -0.482587962.  pos.y: -18.061148 /oldpos.y: 0.0 /dt: 0.104 /ldt: 0.0171.  vel.y: -18.061148bounce  imp: 124.356452.  pos.y: 13.805508 /oldpos.y: -18.061148 /dt: 0.015 /ldt: 0.104</code></pre>","511339","","","","","2011-06-11 16:19:48","How to avoid undesired additional velocity from time step change with Verlet integrator","<java><android><garbage-collection><physics>","2","0","0","",""
"4913313","1","","","2011-02-06 12:36:05","0","221","<p>I'm working on a GPS porting project where we need to avoid all the framework changes. This was acheived through a socket where an application (GPS Settings) talks to GPS library (Middleware) and vice versa. </p><p><strong>Issues</strong>  </p><ol><li><p>In GUI, Socket is running in onethread and not able to call methodsin the main threadactivity(securitySetting.java). Forthis we are using the Handler tocommunicate with the main thread butthe problem still persists. Theproblem here is the actual source ismodifed, securitysettings isinherited from""SettingsPreferenceFragment"" wherewhen i check the actual source it isinherited from preferenceactivity.Every time i am usingsecuritysettings.this.getactivity()to get the context.</p></li><li><p>Need to show few notifications,after completion of work in GPSlibrary. Its is not possible fromsecurity settings activity as itcan't be avaialble all the time.Please suggest if any work around toshow the notifications.</p></li></ol>","469119","","418183","","2011-02-06 12:39:26","2011-02-06 12:58:27","Problem with GPS porting","<android><multithreading><sockets><notifications>","1","0","","",""
"4913321","1","4913544","","2011-02-06 12:37:48","2","977","<p>I need a context menu to be shown when user clicks on item in listview (not long tap). How it can be implemented?</p>","497132","","","","","2011-02-06 13:23:12","ContextMenu onItemClick (ListView)","<android><listview><contextmenu>","2","0","1","",""
"4913389","1","8618653","","2011-02-06 12:49:10","6","659","<p>I have a <code>MapView</code> with some overlays and a subclass of <code>MyLocationOverlay</code> on top of them because I want the user current location to show above the other markers.</p><p>I'm handling the <code>onTap</code> event for the markers to show a panel with info of the tapped marker and if tapped outside of a marker (even in the location marker) the panel should hide.</p><p>If I click on a marker or in an empty spot everything is fine, the panel shows or hides as expected, but if I click on the location marker nothing happens (if the location marker is over another marker the info doesn't show and if it's outside and the info is showing it doesn't hide).</p><p>In my <code>MyLocationOverlay</code> I overrided <code>dispatchTap()</code> function making it return false as stated in <a href=""http://code.google.com/intl/es-ES/android/add-ons/google-apis/reference/com/google/android/maps/MyLocationOverlay.html#dispatchTap%28%29"">docs</a>:</p><blockquote>  <p>Returns: True if this tap was processed; <strong>false if it should be sent to the other overlays</strong>.</p></blockquote><p>but still doesn't work, even I tried returning true just in case, but nothing...</p><p>Anybody knows how to propagate the <code>onTap</code> event to the other overlays?</p>","177954","","","","","2011-12-23 16:57:55","MyLocationOverlay dispatchTap() doesn't propagate","<android><android-maps><android-location>","1","1","","",""
"4913590","1","","","2011-02-06 13:31:14","1","963","<p>My activity in handler <code>onCreate</code> retrieves a value from Intent and do something with it</p><pre><code>protected void onCreate(Bundle b){    ....    Intent i = getIntent();    if (i.hasExtra(""value"")){      String val = i.getStringExtra(""value"");      doSomethingWithValue(val);    }}</code></pre><p>Note that my activity has attribute <code>android:launchMode=""singleTask""</code> in manifest.After executing <code>doSomethingWithValue</code> I want to clear <code>""value""</code> extra from the intent, so when next time the activity is recovering from background the intent returned but <code>getIntent()</code> should not have <code>""value""</code> extra. How can I clear this value for the next execution of <code>onCreate</code>? <code>setIntent</code> does not work here.</p><p>In other words when I press back button and then return to my app  <code>doSomethingWithValue(val)</code> is executed again but I do not need this.</p>","120574","","","","","2011-02-06 13:43:27","How to update the intent this activity will started with after recovering from background?","<android><activity>","2","0","","",""
"4913634","1","","","2011-02-06 13:42:55","1","1254","<p>I've a custom linearlayout which calls <code>layout()</code> on each child in its <code>onLayout()</code> function. My custom child (extended from <code>MapView</code>) receives in its <code>onLayout()</code> function completely different numbers than I passed in the layout function.</p><p>What's the relation between both?</p>","503659","","119895","","2011-06-28 12:12:32","2011-06-28 12:12:32","Relationship between layout() and onLayout()","<android>","1","0","2","",""
"4913643","1","4913654","","2011-02-06 13:44:54","20","7581","<p>What is the difference between Rect and RectF in the Android SDK?</p>","594544","","881229","","2013-12-07 20:35:13","2013-12-07 20:35:13","Rect and RectF in Android SDK","<android><android-canvas><rect>","2","1","2","",""
"4913664","1","4913679","","2011-02-06 13:49:09","1","254","<p>I want to make an application in android where i want to pull the Blog of the site (http://dekora.com/blog/) which is in wordpress.But i don't have any idea how to pull the blogs from wordpress, is there any api or source code available. i have gone through wordpress website and tried to understand the api of Android but dint get it well.So i am just wondering to find some proper clue. Can any body help what approach should i taketo pull the blogs from wordpress.</p>","489762","","1471203","","2013-01-09 11:57:26","2013-10-16 15:17:09","wordpress blog in android","<android>","2","0","1","",""
"4913740","1","5347733","","2011-02-06 14:06:10","0","2298","<p>I am fairly new developer and trying to make a live wallpaper app. Among many animations, my first target is to show a rotating Bitmap which is actually a Black Hole.</p><pre><code>    public class Painting extends Thread {    /** Reference to the View and the context */    private SurfaceHolder surfaceHolder;    private Context context;    /** State */    private boolean wait;    private boolean run;    /** Dimensions */    private int width;    private int height;    /** Time tracking */    private long previousTime;    boolean first = true;    Bitmap hole;    int degree;    public Painting(Context con , SurfaceHolder surf)    {            context = con;            surfaceHolder = surf;            this.wait = true;            Log.i(""Live Test"",""UnInitialized"");            Drawable d = (con.getResources().getDrawable(R.drawable.vlack));            hole = ((BitmapDrawable)d).getBitmap();            hole.prepareToDraw();            if(hole != null)            Log.i(""Live Test"",""Initialized"");            run = true;wait = false;            degree = 0;    }    @Override    public void run()    {            while (run) {                    this.run = true;                    Canvas c = null;                    Log.i(""Live Test"",""Draw Color"");                    while (run) {                            try {                                    c = this.surfaceHolder.lockCanvas();                                    synchronized (this.surfaceHolder) {                                            doDraw(c);                                    }                            } finally {                                    if (c != null) {                                            this.surfaceHolder.unlockCanvasAndPost(c);                                            Log.i(""Live Test"",""Unlocked And Posted"");                                    }                            }                            // pause if no need to animate                            synchronized (this) {                                    if (wait) {                                            try {                                                    wait();                                            } catch (Exception e) {                                                    Log.i(""Live Test"",""Error wait"");                                            }                                    }                            }                    }            }    }    public void setSurfaceSize(int width, int height) {            this.width = width;            this.height = height;            synchronized(this) {                    this.notify();            }    }     /** * Pauses the livewallpaper animation */public void pausePainting() {    this.wait = true;    synchronized(this) {        this.notify();    }}/** * Resume the livewallpaper animation */public void resumePainting() {    this.wait = false;    synchronized(this) {        this.notify();    }}/** * Stop the livewallpaper animation */public void stopPainting() {    this.run = false;    synchronized(this) {        this.notify();    }}    private void doDraw(Canvas canvas) {            if(first)            {                    canvas.save();                    canvas.drawColor(0x60444444);                    canvas.drawBitmap(hole, 80,80,null);                    canvas.restore();                    first = false;            }            else            {            long currentTime = System.currentTimeMillis();            long elapsed = currentTime - previousTime;            if (elapsed &gt; 20) {            canvas.save();            degree+= 5;            if(degree&gt;359)degree = degree -358;            canvas.rotate((float) degree);            canvas.restore();            Log.i(""Live Test"",""rotated"");            }            previousTime = currentTime;    }  }}</code></pre><p>So I am trying to rotate the bitmap and show it again so it looks like its sucking stars and all.Also I have removed Basic onPause onResume Functions so that you guys can understand the code easily. I know there is something basic I am missing, but What?</p>","557869","","19750","","2011-03-31 15:39:37","2011-03-31 15:39:37","Animation in Live Wallpaper Android?","<android><animation><canvas><live-wallpaper>","1","1","","",""
"4913770","1","4913786","","2011-02-06 14:11:58","2","432","<p>I have an android application that gets data from the web such as an event title, location, date and time. I'd like to alert the user when it is time for the event. I've tried using the calendar API but that seems to be quite vague and unsupported by android. Are there any other ways to alert a user when there is an upcoming event based on the date and time I supply? Being able to set an alarm or something would do as well.</p>","602279","","","","","2011-02-06 14:20:15","Android - methods to alert a user?","<android>","3","0","","",""
"4913854","1","4914022","","2011-02-06 14:25:16","2","808","<p>I have bulky-multi paragraph TextView. Contents of the TextView is loaded from Strings.xml. </p><p>I would like to show show multiple paragraphs.  When I use <code>&lt;P&gt;&lt;/P&gt;</code> tag in strings.xml it is not reflected, the TextView shows all the script as one single paragraph.</p><p>Is there a way to break the text into several paragraphs?</p><p>The contents of strings.xml:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;resources&gt;    &lt;string name=""hello""&gt;Hello World, sirukathaikal!&lt;/string&gt;    &lt;string name=""app_name""&gt;Eelathu Sirukathaikal&lt;/string&gt;    &lt;string name=""main_title""&gt;®ÆòÐî º¢Ú¸¨¾¸û&lt;/string&gt;    &lt;string name=""continue_label""&gt;njhlu;f...&lt;/string&gt;    &lt;string name=""about_label""&gt;nrayp cjtp&lt;/string&gt;    &lt;string name=""about_content""&gt;,e;j md;nuhapl; nrayp %yk; ,yq;ifiar; Nru;e;j kA+Nurd; vOjpa %d;W rpWfijfis ntspapLfpd;Nwhk;. njhlu;f vd;w nghj;jhidr; nrhLf;fp fijfis thrpf;fTk;. &lt;/string&gt;    &lt;string-array name=""story_list""&gt;    &lt;item&gt;Story 1&lt;/item&gt;    &lt;item&gt;Story 2&lt;/item&gt;    &lt;item&gt;Story 3&lt;/item&gt;    &lt;/string-array&gt;    &lt;string name=""story_body""&gt;    &lt;p&gt;þ¼õ: ¦¸¡ØõÒ&lt;/p&gt;    &lt;p&gt;§¿Ãõ: ¸¡¨Ä 7.30&lt;/p&gt;    &lt;p&gt;¬ñÎ: 2019&lt;/p&gt;&lt;p&gt;Å¢ó¾¢Â¡ ¾ÉÐ ¨¸Â¢ø þÕìÌõ ¨À¨Â þÚì¸ «¨½ò¾ÀÊ ¿¼óÐ ¦¸¡ñÊÕó¾¡û. Å£¾¢ ¦ÅÈ¢î§º¡Êì ¸¢¼ó¾Ð. ¾ÉÐ ¿¨¼¨Â ¦ÁøÄ ¦ÁøÄ §Å¸ôÀÎò¾¢ì¦¸¡ñ§¼ Å£Î §¿¡ì¸¢ ¿¼ì¸ò ¦¾¡¼í¸¢É¡û.¨¸Â¢ø þÕìÌõ «ó¾ô ¨ÀÂ¢ý ¦ÀÚÁ¾¢ «ÅÙìÌò¾¡ý ¦¾Ã¢Ôõ. Å£ðÊø «¨ÉÅÕõ þó¾ô ¨ÀÂ¢ø þÕôÀ¨¾ò¾¡ý ±¾¢÷À¡÷òÐ ¸¡ò¾¢Õì¸¢ýÈ¡÷¸û. Â¡÷ ¸ñ½¢Öõ ÀðÎÅ¢¼Á¡ø ¦ºýÚÅ¢¼§ÅñÎõ ±ýÀ¾¢ø ÌÈ¢Â¡¸ þÕó¾¡û. ÀòÐ ¬ñÎ¸ÙìÌ Ó¾ø þó¾ þ¼ò¾¢ø þó§¿Ãò¾¢ø ºÉõ ÍõÁ¡ §ƒ.. §ƒ… ±ýÚ ¿¼Á¡Îõ. þô§À¡ ±øÄ¡õ ¾¨Ä¸£ú.º¢ó¾¨É¸Ç¢ø ÍÆýÈÅ¡Ú ¿¼óÐ¦¸¡ñÊÕó¾¡û Å¢ó¾¢Â¡. «ó¾ ºó¾¢¨Âì ¸¼óÐÅ¢ð¼¡ø ¾ý Å£ð¨¼ «Îò¾ 5 ¿¢Á¢¼ò¾¢ø «¨¼óÐÅ¢¼Ä¡õ ±ýÈ ¿õÀ¢ì¨¸Â¢ø ¿¨¼Â¢ý Å¢¨Ã¨Åì ÜðÊÂÅ¡Ú ºó¾¢¨Â §¿ì¸¢ ¿¼ì¸ò ¦¾¡¼í¸¢É¡û.¾¢Ë÷ ±ýÚ ±í¸¢Õó§¾¡ ´Õ «ÊÀðÎ ¦¿Ç¢ó¾ ¼¡¼¡ þýÊ¸¡ ¸¡Ã¢ø ¿¡ý¨¸óÐ þ¨Ç»÷¸û. ¸¡÷ ºò¨¾ò¨¾ Å¢¼ «Å÷¸û §À¡ð¼ ºò¾§Á «¾¢¸Á¡¸ þÕó¾Ð. ´Õò¾ý ¸¡Ð Ìò¾¢Â¢Õó¾¡ý ÁüÈÅý ¸ñþ¨ÁÂ¢ø ²§¾¡ Ìò¾¢Â¢Õó¾¡ý.“§¼ö «í¸ À¡Õ¼¡! ²ö……….. ±ýÉ ¨¸Â¢Ä?” ¸¡Ã¢ø þÕó¾ ´Õò¾ý °¨ÇÂ¢ð¼¡ý.&lt;/p&gt;&lt;p&gt;ÌÉ¢ó¾ ¾¨Ä ¿¢Á¢Ã¡Áø Å¢ó¾¢Â¡ «ó¾ þ¼ò¾¢ø þÕóÐ ¦ÁøÄ ¿¸Ãò ¦¾¡¼í¸¢É¡ø. «Å¨Ç º¢È¢Ð ¸¼óÐ ¿¢ýÚ þÕó¾ ¸¡÷ þô§À¡Ð, ¸¢Ã£î ±ýÈ ºò¾§¾¡Î «Åû ÓýÉ¡ø ÅóÐ ¿¢ýÈÐ. ¸¡Ã¢ø þÕóÐ ¿¡ýÚ þ¨Ç»÷¸Ùõ ¾¼ ¾¼¦ÅÉ þÈí¸¢É÷. ´ù¦Å¡Õò¾ý ¸ñ½¢Öõ ¦ÅÈ¢ ¾¡ñ¼ÅÁ¡ÊÂÐ.´Õ «Ê ÓýÛìÌ ±ÎòÐ ¨Åò¾ ´Õò¾ý Å¢ó¾¢Â¡ ¨¸Â¢ø þÕó¾ ¨À¨Â ÀÈ¢ò¾¡ý. ¨À¨Â ¾¢ÈóÐ ¯û§Ç À¡÷ò¾Åý, ÁüÈÅ÷¸¨Çô À¡÷òÐ ÒýÉ¨¸Ô¼ý ¾¨ÄÂ¡ðÊÉ¡ý.“§¼ö… ¾¡¼¡!!!” Å¢ó¾¢Â¡ ÀÈ¢ò¾Åý ¸ýÉò¾¢ø º¼¡÷ ±ýÚ ´Õ «¨È Å¢ð¼¡û. «¨Èó¾ ºò¾õ µöÅ¾üÌû ´Õ ºò¾õ ‘ÎÁ£ø’. Å¢ó¾¢Â¡Å¢ý ¯¼ø ¸£§Æ ºÃ¢Â «Åû ¯¼Ä¢ø þÕóÐ þÃò¾ý ÌÒ ÌÒ ±É ¦ÅÇ¢§ÂÈò ¦¾¡¼í¸¢ÂÐ.Å¢ó¾¢Â¡Å¢üÌ ÍÂ ¿¢¨É× ¦ÁøÄ ¦ÁøÄ «¸Äò ¦¾¡¼í¸¢ÂÐ. ¸ñ¸û þÕð¼ò ¦¾¡¼í¸¢ÂÐ. ¸¨¼º¢Â¡¸ ¸ñ ã¼ ÓýÉ÷, ¾ý ¨ÀÂ¢ø þÕó¾ À¡ñ Ðñ¨¼ «ó¾ì ¸ÂÅ÷¸û Å¢ÄíÌ¸¨Çô §À¡Ä À¢öòÐ ¯ñÀ¨¾ì ¸ñ¼¡û. ¦ÁøÄ ¦ÁøÄ «Åû ¯Ä¸õ þÕÇò ¦¾¡¼í¸¢ÂÐ.À¢.Ì: Ôò¾õ Å¢¨ÃÅ¢ø µÂ¡Å¢ð¼¡ø ´Õ¿¡û ŠÃ£ Äí¸¡Å¢ø þÐ ¿¼ì¸ô §À¡ÅÐ ¿¢îºÂÁ&lt;/p&gt;    &lt;/string&gt;    &lt;/resources&gt;</code></pre><p>BodyStory1.java:</p><pre><code>package com.mayuonline.com.esiru;import android.app.Activity;import android.graphics.Typeface;import android.os.Bundle;import android.widget.TextView;public class BodyStory1 extends Activity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.story_body);        Typeface tf = Typeface.createFromAsset(getAssets(),""fonts/kaviri.TTF"");          TextView tvBody = (TextView) findViewById(R.id.story_body);        tvBody.setTypeface(tf);    }}</code></pre><p>storyBody1.java after adding setText():    package com.mayuonline.com.esiru;</p><pre><code>import android.app.Activity;import android.graphics.Typeface;import android.os.Bundle;import android.text.Html;import android.widget.TextView;public class BodyStory1 extends Activity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.story_body);        setText(Html.fromHtml(getString(R.string.story_body)));        Typeface tf = Typeface.createFromAsset(getAssets(),""fonts/kaviri.TTF"");          TextView tvBody = (TextView) findViewById(R.id.story_body);        tvBody.setTypeface(tf);    }}</code></pre>","348301","","217440","","2011-10-03 00:45:42","2011-10-03 00:45:42","Formatting TextView","<android><android-layout>","1","2","1","",""
"4913875","1","5348813","","2011-02-06 14:30:16","8","2720","<p>There are several methods of unit testing in Android, what's the best one for testing a custom view I've written?</p><p>I'm currently testing it as part of my activity in an instrumentation test case, but I'd rather test just the view, isolated.</p>","606036","","","","","2011-03-23 21:13:19","Android: How to test a custom view?","<android><unit-testing><view>","2","1","4","",""
"4913878","1","4913932","","2011-02-06 14:30:24","1","2178","<p>I am launching a HttpURLConnection from my Android device that points my server i.e. <strong>http://example.com/download-app</strong>. The server receives this request and issues a redirect to <strong>market://details?id=my.package.name</strong>. The aim is to have the Android Market app on the phone open and navigate to the app download page.</p><p>However, this doesn't seem to work. I set redirects to true on the HttpURLConnection i.e.</p><pre><code>HttpURLConnection.setFollowRedirects(true);</code></pre><p>but the URL I receive back is always the same URL to my server i.e. <strong>http://example.com/download-app</strong>.</p><p>If I use a redirect link using the ""http"" protocol like <strong>http://market.android.com/details?id=my.package.name</strong>, it works but instead opens up the new web based market NOT the app on the phone.</p><p>Has anyone else experienced this?</p>","605333","","","","","2011-02-06 14:46:26","Android HttpURLConnection cannot redirect to ""market://details?id=my.package.name""","<android><google-play><httpurlconnection>","2","0","1","",""
"4913909","1","","","2011-02-06 14:36:19","0","575","<p><br>I saved the EditText value in SQLite database and I want the to view all values from the database in ListView or TextView.</p><p>How it can be done?</p><p>Please help me. </p>","555910","","457982","","2011-02-06 15:08:54","2011-05-25 16:26:04","Get the values from the database in Android","<android><sqlite><listview><edittext>","2","1","","",""
"4913982","1","","","2011-02-06 14:49:06","1","715","<p>I have just integrated services into my android app - I am also using startForeground because it's a critical app.</p><p>So, my question is - how do I get it to revert the user to the application when they have done a keyPress on the notification / service in their Notification Panel. I have looked everywhere for this and can't find it anywhere...There isn't much point in using services if they don't get directed back to the app onKeyPress so really need to get this working.</p><p>Any help is much appreciated.</p><p>Thanks</p>","605346","","","","","2011-02-06 15:12:47","Android - Monitoring for keyPress on Service","<android><service><keypress><onkeypress>","1","0","","",""
"4914039","1","4914308","","2011-02-06 14:59:46","11","8833","<p>Is it possible to set the Margins of a LinearLayout, programmatically but not with pixels, but dp?</p>","316825","","","","","2013-05-29 14:52:08","Margins of a LinearLayout, programmatically with dp","<android>","4","0","4","",""
"4914059","1","","","2011-02-06 15:03:42","0","444","<p>I have this piece of code that's really prone to errors so I wrapped it with try{}catch statement. I don't want to go back to the previous activity, I just want it to stay on the current activity so that the user can edit whatever is wrong with them. </p><p>How do I implement this? </p><pre><code>    try{        orgi.insertOrThrow(tableName, null, values);        Toast.makeText(this, ""You have successfully created a new profile!"", 2).show();        gotoProfileList();        Log.e(getClass().getSimpleName(),""Successfully added to database"");    }catch(SQLiteException se){        Log.e(getClass().getSimpleName(), ""Database connection failed!"" + se);        //Stay in this activity...    }finally{        if (orgi != null){            orgi.close();        }    }</code></pre><p>Forget it, I was able to solve my own problem by showing up an alertDialog that tells the user about the error. Thanks anyways. :)</p><pre><code>            try{                orgi.insertOrThrow(tableName, null, values);                Toast.makeText(this, ""You have successfully created a new profile!"", 2).show();                gotoProfileList();                Log.e(getClass().getSimpleName(),""Successfully added to database"");            }catch(SQLiteException se){                Log.e(getClass().getSimpleName(), ""Database connection failed!"" + se);                displayError();                //stayInThisActivity();            }finally{                if (orgi != null){                }   public void displayError(){            AlertDialog.Builder error = new AlertDialog.Builder(this);            error.setMessage(""That profile name already exists, try another one."").setCancelable(false).setPositiveButton(""Yes"",new DialogInterface.OnClickListener() {                @Override                public void onClick(DialogInterface dialog, int which) {                    dialog.cancel();                }            });            AlertDialog alert = error.create();            alert.setTitle(""Error"");            alert.show();        }</code></pre>","605354","","321731","","2014-01-31 22:07:02","2014-01-31 22:07:02","How to keep activity on Force Close?","<android><activity>","1","3","","",""
"4914079","1","","","2011-02-06 15:07:00","0","537","<p>This is my application and you can see that I make a list of data ,have 2 list each list contain 2 line and 1 imagebutton and I want to make a ContextMenu ( whan I press on each list it will show a ContextMenu)</p><p>I have coded about onCreateContextMenu like this...</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);    }@Override    public boolean onContextItemSelected(MenuItem item){        switch(item.getItemId()){        case EDIT_ID:{            Cursor cc = cursor;            Intent edit_Im_Sens = new Intent(Im_SensShow.this,Im_SensEdit.class);            Bundle bundle = new Bundle();            bundle.putLong(""THIMSENSID"", thim_sens_id);            bundle.putLong(""IMSENSID"", cc.getLong(cc.getColumnIndexOrThrow(DBAdapter.KEY_IM_SENS_ID)));            bundle.putLong(""LANGSID"", cc.getLong(cc.getColumnIndexOrThrow(DBAdapter.KEY_LANGS_ID)));            bundle.putString(""IMSENS"",cc.getString(cc.getColumnIndexOrThrow(DBAdapter.KEY_IM_SENS)));            bundle.putString(""READING"",cc.getString(cc.getColumnIndexOrThrow(DBAdapter.KEY_READING)));            edit_Im_Sens.putExtras(bundle);            startActivityForResult(edit_Im_Sens,1);            //return true;            break;            }</code></pre><p>but it doesn't work ,it doesn't show a ContextMenu please help....</p>","605358","","287954","","2011-02-06 15:12:51","2011-05-10 04:30:56","can't show contextmenu","<android><sqlite><contextmenu>","1","0","","",""
"4914130","1","4914483","","2011-02-06 15:17:29","3","28388","<p>In order to enable logging for medailytics plug in, I need to enter this into the emulator's terminal</p><pre><code>adb shellsetprop log.tag.MMT DEBUG</code></pre><p>Unfortunatly I don't have a clue how to open the terminal and the developer resource didn't seem to mention the subject.</p><p>Also I won't be surprised if anyone tells me that there are in fact 150 more steps in this task because the medialytics documentation is really very poor.</p>","562562","","","","","2011-02-06 17:53:19","How do I open the android emulator's terminal window?","<android><android-emulator><terminal><android-logcat>","2","0","1","",""
"4914141","1","4915687","","2011-02-06 15:19:33","2","6276","<p>I wrote a web service in Java and the web service is functioning correctly, but I can't figure out how to pass a list of custom objects through it. Here is my class object: </p><pre><code>public class Contacts{private int id;private String username;private String location;private Date updated_at;public void setId(int id) {    this.id = id;}public int getId() {    return id;}public void setUsername(String username) {    this.username = username;}public String getUsername() {    return username;}public void setLocation(String location) {    this.location = location;}public String getLocation() {    return location;}public void setUpdated_at(Date updated_at) {    this.updated_at = updated_at;}public Date getUpdated_at() {    return updated_at;}</code></pre><p>}</p><p>Here is my web service method to query the database and return the List of objects. Every time I try to return a object I get an axis2 error: <code>[ERROR] org.apache.axis2.AxisFault: Mapping qname not fond for the package: wtp</code></p><p>Anyway, here is my Method: </p><pre><code>    public String getUsers()  {             ResultSet mainRS = null;        String username = ""root"";        String password = ""ticket"";        String tablename = ""users"";        String fieldname = ""*"";        String query = ""SELECT "" + fieldname + "" FROM "" + ""android."" + tablename + "";"";        ArrayList&lt;Contacts&gt; lstc = new ArrayList&lt;Contacts&gt;();        /* this chnk of code can appear more or less verbatim */        /* in your database apps (including JSPs) */        String url = ""jdbc:mysql://""my IP address"":3306/android"";        String test = "" "";        try{        Class.forName(""com.mysql.jdbc.Driver"").newInstance();        Connection con = DriverManager.getConnection(url, username, password);        Statement stmt = con.createStatement();        ResultSet rs = stmt.executeQuery(query);        mainRS = rs;        while (rs.next()){            Contacts cont = new Contacts();            if (!(rs.getString(""username"") == null)){            cont.setUsername(rs.getString(""username""));            test = rs.getString(""username"");            }            if (!(rs.getString(""location"") == null)){             cont.setLocation(rs.getString(""location""));            }            if (!(rs.getString(""updated_at"") == null)){             cont.setUpdated_at(rs.getDate(""updated_at""));            }            if (!(rs.getString(""idUsers"") == null)){             cont.setId(rs.getInt(""idUsers""));            }            lstc.add(cont);        }        rs.close();        stmt.close();        con.close();        }catch(Exception e){            test = e.toString();        }        return test;                    }</code></pre><p>I am using Eclipse Galileo, Axis2 in Java. Any ideas on how to pass these objects would be much appreciated. Or maybe, even a better way to do it then to bass custom objects. I am open to any ideas. </p><p>Thanks!</p><p>EDIT: I edited the method to use:</p><pre><code>Contacts lst[] = new Contacts[""count rows here""];</code></pre><p>But, it returns Objects that are null. For example:</p><p>There are 4 rows in the database so the result is:</p><p>SoapObject: [result:null, result:null, result:null,result:null]</p><p>Any Ideas?</p>","600137","","600137","","2011-02-06 17:59:04","2011-02-06 19:51:10","How to pass custom object through Web Service","<java><android><mysql><web-services><axis2>","2","1","","",""
"4914163","1","4914206","","2011-02-06 15:23:45","0","192","<p>I need in onCreate() read some values based on a value that is stored in SharedPrefrences...So i can have the values that i want after many if elseif statements or from reading the values from the database!Which will be faster? multiple if's or search and read from the db?</p>","587377","","","","","2011-02-06 15:43:41","multiple if() or database read is faster?","<android><database><if-statement><performance>","2","0","","",""
"4914169","1","","","2011-02-06 15:24:03","1","1746","<p>I am doing a project. For my project i need to create an Android application.I will use Java and Eclipse.</p><p>The main idea of app.The application works on environment/location. Example the application needs to pick up on the users location. He should then also be able to communicate with his friends or colleagues which are in the same location. </p><p>There will be real-time communication. And the client must be able to communicate with the serve. The system will also set location by WiFi and GPS. A database will store information. Also it should be open source.</p><p>I have just started looking and reading up on XML-RPC, JSON-RPC and SOAP. This is my first Android application. </p><p>I am looking for a good alternatives to XMPP or REST for communication between servers and clients? Any recommendation would be appreciated or advice.</p><p>Kind regards</p>","605376","","605376","","2011-02-06 20:53:48","2012-11-30 09:46:57","Android - Good alternatives to XMPP or REST for communication between servers and clients?","<android>","3","3","","",""
"4914252","1","","","2011-02-06 15:38:57","0","1651","<p>Can the pc use ADB command android to make call?If it can,How to?</p><p>I have a text file containing a telephone number and a time.</p><p>How can I use JavaScript to count down from this time,and then use ADB to make an Android phone call to that number?</p><p>Thanks</p>","604190","","","","","2011-02-06 20:04:07","Using ADB to make a phone call after a time out","<javascript><android>","1","1","","",""
"4914292","1","","","2011-02-06 15:47:09","0","188","<p>I  want to update textview in my main activity view.</p><p>I have main.xml file that contains the main application ascreen,in that screen, I have textview that I need to update from time to time from another activity (class).</p><p>If I try to update those values from the main activity it work perfect, but when I'm trying to do it from deferent activity the application crashes.</p><p>Here is the method of the main activity, I need to  know how to call it from the other activity.</p><p><strong>Main Activity method:</strong></p><pre><code>    public void update_counters(){            TextView sms_textview = (TextView) findViewById(R.id.sms_textview);        sms_textview.setText(String.valueOf(sms_missed));    }</code></pre><p>Please Help</p>","552222","","50109","","2011-02-06 17:08:03","2011-02-06 17:08:03","Update main activity values from a different activity","<java><android><android-layout>","3","0","1","",""
"4914382","1","5059145","","2011-02-06 16:02:34","7","796","<p>Writing a dictionary application for android. Want to set translation direction in accord with current input language (to be more precise, language of letters displayed on soft keyboard). For example, we got language pair English-French. What I want is, when user inputs English letters (English keyboard layout displayed) translation direction is straight, and when keyboard layout changes to French, translation direction also changes to inverted.</p><p>So, question is: is there any event in an android Input Method Framework, which allows to track this layout changing. If there is not, maybe there is some standard tricks to do what I need?</p><p>Thanks in advance,Alex</p>","605384","","","","","2011-02-20 18:47:02","Android keyboard layout language","<android><keyboard-events><keyboard-layout><android-input-method>","1","0","","",""
"4914389","1","4915331","","2011-02-06 16:03:44","0","795","<p>right now I am a java programmer, and I program for the android. I was looking to expand my horizons so that I could also program for the iphone. I don't want to have to learn it from scratch (I.E. some ""for dummies"" book that is going to start me at the beginning of plain text output i.e System.out.prinltn() for objective-c, and go the whole book telling me about that) I was hoping that there was one specifically aimed at java programmers, so that I could learn it quickly.</p>","599402","","","","","2011-02-06 18:47:42","What is a good book for learning objective c for a java programmer?","<java><iphone><android><objective-c>","6","1","3","2012-11-09 09:05:11",""
"4914392","1","","","2011-02-06 16:03:59","1","798","<p>I am using Canvas for basic 2D graphics in an Android app.  I am implementing a drag and drop feature (just setting x/y coordinates of the sprite based on x/y coordinates of the touch event).  It works fine, but when testing on my Android device, there can be a slight lag if I move my finger very fast on the screen.  The bitmap just isn't keeping up with the touch/drag motion if done quickly.  </p><p>Would this be improved if I were to move to OpenGL ES?  Not wanting to rip out my code if it doesn't.  </p>","530546","","","","","2011-02-06 16:29:39","Does ""drag and drop"" become faster under OpenGL ES vs. Canvas for Android?","<android><opengl-es><canvas>","2","0","2","",""
"4914399","1","","","2011-02-06 16:05:42","1","2301","<p>I'm using a timer to schedule a notifcation</p><pre><code>        GregorianCalendar date = new GregorianCalendar(2011, 2, 6, 16, 50);    long task = date.getTimeInMillis() - System.currentTimeMillis();    Timer timer = new Timer();    TimerTask timerTask = new TimerTask()    {        @Override        public void run()        {            triggerNotification();        }    };    timer.schedule(timerTask, task);</code></pre><p>The timer will work if I manually enter a long value in the <em>schedule</em> method but does nothing it seems if I use the <em>task</em> variable. Basically I want to schedule a notification at the stated date and time in the Gregorian Calendar object. What am I doing wrong?</p>","602279","","","","","2011-11-17 09:46:27","Scheduling notification using Timer android","<java><android>","3","0","1","",""
"4914413","1","5001020","","2011-02-06 16:07:55","3","641","<p>I am having a <code>VideoView</code> in my application.</p><p>I have set blur flags in my activity</p><pre><code>getWindow().setFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND,            WindowManager.LayoutParams.FLAG_BLUR_BEHIND);</code></pre><p>The problem is even the video in the <code>VideoView</code> is blurring, which I don't want.</p><p>When <code>VideoView</code> is replaced by an <code>ImageView</code> with a specified source, its not blurry at all.</p><p>Is there any solution to avoid this blur in <code>VideoView</code>?</p>","514553","","514553","","2011-02-06 16:18:16","2011-02-15 07:45:06","Exclude view from blurring android","<android><video><blur>","1","1","1","",""
"4914460","1","5423619","","2011-02-06 16:14:50","0","766","<p>In my application I download and parse a html page. However, I want to be able to stop the download in its tracks (i.e. when the user hits cancel).</p><p>This is the code I use now, which is being called from doInBackground from ASyncTask.</p><p>How do I cancel this request from outside of the ASyncTask?</p><p>I currently use <a href=""http://htmlcleaner.sourceforge.net/"" rel=""nofollow"">htmlcleaner</a></p><pre><code>   HtmlCleaner cleaner = new HtmlCleaner();   CleanerProperties props = cleaner.getProperties();   props.setAllowHtmlInsideAttributes(true);   props.setAllowMultiWordAttributes(true);   props.setRecognizeUnicodeChars(true);   props.setOmitComments(true);   try {        URL url = new URL(urlstring);        URLConnection conn = url.openConnection();        TagNode node = cleaner.clean(new InputStreamReader(conn.getInputStream()));        return node;   } catch (Exception e) {       failed = true;       return;   }</code></pre>","602251","","602251","","2011-03-27 16:15:58","2011-03-27 16:15:58","Android stop download","<android><html><download><cancel><abort>","2","0","1","",""
"4914512","1","4914625","","2011-02-06 16:24:34","1","879","<p>I have an array ordered in alphabetical order;</p><pre><code>[0] = apple[1] = banana[2] = mango[2] = melon</code></pre><p>What I need to do now, Is split the string array into smaller string arrays with groups of the letters, so the output would be:</p><pre><code>[0] = apple[0] = banana[0] = mango[1] = melon</code></pre><p>I've tried a few methods, but all of them are hopeless, Can you give me a piece of code that will do this? I promise to give the best answer a tick and all the good answers a point!</p>","567390","","244296","","2011-02-06 16:41:48","2011-02-06 19:15:54","Android array sorting","<java><android><arrays><string>","4","1","","",""
"4914521","1","4914909","","2011-02-06 16:26:43","4","1923","<p>I am using a GLSurfaceView (sdk version 7) in RENDERMODE_WHEN_DIRTY. The documentation says I need to call onPause/onResume, but it works fine without it, so I am wondering. Is it required? What can happen if I don't?</p>","3610","","","","","2011-02-06 20:52:06","GLSurfaceView: Do I need to to call onPause/onResume?","<android><opengl-es>","1","2","1","",""
"4914549","1","4914700","","2011-02-06 16:30:41","3","890","<p>I have a view that displays all the levels of my game. These levels are read by the activity and then passed into the view. I could read them from the view, but it's not really its responsibility, and I'm a fan of separation of concerns.</p><p>Right now, I'm calling a setter for this:</p><pre><code>((GameView) findViewById(R.id.game)).setLevels(loadLevels());</code></pre><p>However, I don't like the fact that the view will be dysfunctional if I forget to call the setter. Is there a better way to pass the levels in?</p>","606036","","","","","2011-02-06 16:51:39","Android: How to best pass data to a view?","<android><dependency-injection><view>","3","0","","",""
"4914590","1","","","2011-02-06 16:35:57","4","5082","<p>I have a dynamic layout and I have a button. How can I set the property <code>layout_alignParentBottom</code> to that button so that it would appear in the bottom of my relative layout?</p><p>Or do you know another way?</p>","306833","","244296","","2011-02-06 17:17:09","2014-04-12 20:12:03","How to set the android property layout_alignParentBottom to a button dynamically","<android><dynamic><button>","1","0","3","",""
"4914663","1","4914821","","2011-02-06 16:46:25","3","9557","<p>how can I easily check in Javascript in the Android web browser if the Adobe Flash Player 10.1 (https://market.android.com/details?id=com.adobe.flashplayer) was downloaded from Android Market and installed?</p><p>--</p><p><em>Update</em>: Thanks for replies, but I need the check code for <strong>Javascript</strong>, since I am doing the web based (HTML/Javascript/CSS) solution, not native Java application. Small part of the web application is done in Flex, so .swf file is displayed in <code>&lt;div&gt;</code> element, but prior of doing that I would like to check if Flash Player is installed or not.</p>","384115","","54680","","2011-02-07 14:19:26","2011-02-08 06:43:06","How to check if the Flash players is installed on Android","<javascript><android><web-browser><flash-player>","2","1","3","",""
"4914712","1","","","2011-02-06 16:54:57","1","232","<p>I am connecting using httpPost and adding header to it.I want to get packet data after adding headers.</p><p>Please help to get the packets data.</p>","582788","","296677","","2011-02-06 17:32:20","2011-02-06 17:32:20","how to get packets data","<android><network-programming><packet>","0","2","","",""
"4914760","1","4915298","","2011-02-06 17:02:29","0","322","<p>I am not sure about this and googling is not giving me a clear answer. I hope TI developers can enlighten me.</p><blockquote>  <p>Can I use my HTML and CSS  skills in  developing Titanium Mobile  application? Or Javascript is the only  way to develop using Titanium Mobile.</p></blockquote><p>I want to use HTML and CSS in controlling my UI...</p><p>thanks!</p>","115330","","","","","2011-02-06 18:41:08","TI mobile and html/css","<android><mobile><titanium>","1","0","","",""
"4914800","1","","","2011-02-06 17:09:14","2","657","<p>Hey guys, I was just wondering about bluetooth API for Android and iOS:</p><p>Can I connect 2 devices and share things without user ""permission""? (after running app and the user accept the terms)</p><p>I mean, could it be possible in terms of programming? Because I bet that in apple store you can`t sell an application like this, unless the user be aware about it... I have no intention of steal information.</p>","420661","","","","","2011-02-08 17:47:36","iOS/Android Bluetooth sharing permission question","<android><ios><permissions><bluetooth><sharing>","0","0","","",""
"4914892","1","4915209","","2011-02-06 17:25:05","0","278","<p>In my application I start a Register activity from the Main Activity with a button</p><p><code>startActivity( new Intent(getBaseContext(),Register.class));</code></p><p>This Register activity creates records that can be viewed in a ListActivity.</p><p>If I go to the ListActivity from the Main Activity (with another button) and decide that I want to send the data of a record from the ListActivity to the Register activity in order to edit it, there are two possibilities:</p><p>1- the Register activity has never been called</p><p>2- the Register activity is opened in the background</p><p>I have two questions:</p><p>-Calling startActivity Register.class once from Main and once from ListActivity will it make two copies of Register or one?</p><p>-When I call Register activity from ListActivity and try to pass data with a handler, the handler message arrives before the activity is opened and the data do not show in the Register screen? How can I do that? Is there a way to know from the ListActivity when the view of Register is opened?</p><p>Thanks.Charles.</p>","586482","","63155","","2011-02-06 17:43:13","2011-02-06 18:23:19","Sending a message to a not yet started activity","<android><activity><handler>","1","0","1","",""
"4914921","1","4915189","","2011-02-06 17:31:12","4","3192","<p>I'm writing my first 2D app for Android using OpenGL.   I'm writing it on my Desire, so my screen coords should be 0,0 to 799,479 in landscape mode.  I'm trying to get OpenGL to use this range in world coordinates.  </p><p>The app, such as it is, is working fine so far, but I've had to tweak numbers to get stuff to appear on the screen and I'm frustrated by my inability to understand the relationship between the projection matrix, and the rendering of textures in this regard.</p><p><strong>Setting the projection matrix:</strong></p><pre><code>gl.glViewport(0, 0, width, height);float ratio = (float) width / height;float size = .01f * (float) Math.tan(Math.toRadians(45.0) / 2);             gl.glMatrixMode(GL10.GL_PROJECTION);gl.glLoadIdentity();gl.glFrustumf(-size, size, -size / ratio, size / ratio, 0.01f, 100.0f);//    GLU.gluOrtho2D(gl, 0,width, 0, height);</code></pre><p>I want to understand 0.01f and 100.0f here.   What do I use to describe a 2D world of 0,0 -> 799,479 with a z value of zero?</p><p>Also, I'm not sure what is 'best' - using glFrustumF or GLU.gluOrtho2D  The latter has simpler parameters - just the dimensions of the viewport - but I've not got anywhere with that.  (Some sites have height and 0 the other way around but that makes no difference.)  But shouldn't this be the natural choice for 2D usage of OpenGL?  Do I have to set something somewhere to say to OpenGL ""I'm doing this in 2D - please disregard the third dimension everywhere, in the interests of speed""?</p><p><strong>Drawing my textures:</strong></p><p>I'm drawing stuff using 2 textured triangles.  The relevant parts of my init (let me know if I need to edit my question with more detail) are:</p><pre><code>gl.glMatrixMode(GL10.GL_MODELVIEW);                             gl.glLoadIdentity();gl.glTranslatex(nXpos, nYpos, nZoomin);         gl.glRotatef(nRotZ, 0, 0, 1);               gl.glScalef((float)nScaleup,(float)nScaleup, 0.0f);......gl.glVertexPointer(2, GL10.GL_FIXED, 0, mVertexBuffer);gl.glTexCoordPointer(2, GL10.GL_FLOAT, 0, mTextureBuffer);gl.glDrawArrays(GL10.GL_TRIANGLE_STRIP, 0, 4);      mVertexBuffer is an IntBuffer and contains:int  vertices[] =  {    -1,   -1,    1,  -1,    -1, 1,    1,  1   };</code></pre><p>I don't intend, ultimately, to have to pass in nZoomin - I've done it this way because it was how I found the 'magic numbers' needed to actually see anything!  Currently I need to use -1000 there, with smaller numbers resulting in smaller images.  Am I right in thinking there must be some way of having a value of zero for nZoomin when the projection matrix is set correctly? </p><p>My textures are currently 128x128 (but may end up being different sizes, perhaps always square though).  I have no way of knowing when they're being displayed at actual size currently.  I'd like to be able to pass in a value of, say, 128 for nScaleup to have it plotted at actual size. Is this related to the projection matrix, or do I have two separate issues?</p>","146043","","44729","","2011-02-06 18:04:02","2012-04-04 14:30:06","Help me configure OpenGL for 2D","<android><opengl-es><2d>","2","1","2","",""
"4914946","1","4916282","","2011-02-06 17:35:33","0","2095","<p>I am ultimately trying to unit test a custom base adapter, but I am stuck at one point: I am unable to figure out how to get the UI thread to process the message I have just passed to it via <code>sendEmptyMessage(...)</code>.</p><p>In my Activity I have a ""<code>addFoo(Foo foo)</code>"" method that updates an array and then calls ""<code>sendEmptyMessage(1)</code>"", and I have a <code>handleMessage</code> method that calls the ListView's adapter to tell it the data has changed.</p><p>I've boiled the unit test down to, roughly:</p><pre><code>public void testAddFoo() {  Foo foo = new Foo();  assertTrue(mActivity.addFoo(foo));  assertTrue(mActivity.getHandler().hasMessages(1));  assertFalse(mActivity.getHandler().hasMessages(1));  assertTrue(mActivity.fooListNotEmpty());}</code></pre><p>Naturally it is failing on that <code>assertFalse()</code> (this is a contrived example, simplifying it as best as I can).</p><p>What call can I make in to mActivity or its handler or looper to get it to process all pending messages? I have tried some suggestions I've read about calling Looper.loop(), within the UI thread, but those are stabs in the dark and they failed.</p><p>FWIW, I'm pretty sure that the handleMessage code is correct because if I call it directly (inside <code>@UiThreadTest</code>) like so:</p><pre><code>@UiThreadTestpublic void testAddFoo() {  Foo foo = new Foo();  assertTrue(mActivity.addFoo(foo));  Message msg = Message.obtain();  msg.what = 1;  mActivity.handleMessage(msg);  assertTrue(mActivity.fooListNotEmpty());}</code></pre><p>the test ends up working as expected.</p>","153275","","119280","","2011-02-06 18:03:16","2012-01-19 11:26:34","Unit testing Handler","<android><unit-testing>","2","7","2","",""
"4914989","1","","","2011-02-06 17:43:38","1","537","<p>I am searching for a Camera Roll link in Adobe air! A clickable link to the Gallery for Android!</p><p>It will be great if anyone know this?</p>","605506","","19746","","2011-02-06 18:06:23","2012-11-20 03:34:51","Camera Roll Gallery link?! ADOBE AIR","<android><image><air><adobe><gallery>","1","0","1","",""
"4914991","1","4915018","","2011-02-06 17:43:45","0","162","<p>I am a new android developer. </p><p>I was trying to install eclipse in my system and after installation when I was to open a new project the column of build target is been empty.  </p><p>So i can't create or start a project... please help me in rectifying this problem.</p>","596364","","435190","","2011-02-06 18:04:29","2011-02-06 18:04:29","unable to start a new project eclipse","<java><android>","2","0","","",""
"4915120","1","","","2011-02-06 18:06:47","0","1048","<p>no key distribution, public and private keys will be known by users (random key generator will not be used). I have to encrypt hashed message with private key in order to provide signaturemessage will only 10-20 characters, so system can be as simple as it is possible</p>","605512","","","","","2011-02-08 03:27:27","how to encrypt and decrypt a message by using RSA with signature in android","<android><certificate><rsa><encryption>","2","0","","",""
"4915133","1","4915180","","2011-02-06 18:10:16","1","558","<p>I want to make application that when press the button it will make each sound and each button contain in list (like this pic : <a href=""http://plixi.com/p/75290578#"" rel=""nofollow"">enter link description here</a>) so I wrote Im_SensShow.java which extends ListActivity and have imsen_main.xml and imsen_row.xml and it doesn't work(force close) please help</p><pre><code>package com.android.proj; public class Im_SensShow extends ListActivity {/** Called when the activity is first created. */private DBAdapter db ;private Cursor cursor ;private static final int INSERT_ID = Menu.FIRST;private static final int CHANGE_ID = Menu.FIRST + 1;private static final int EDIT_ID   = Menu.FIRST + 2;private static final int DELETE_ID = Menu.FIRST + 3;//this will store situation id that is sent from mainprivate long thim_sens_id;private ImageButton menuCarBtn;TextView MyOutputText;@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.imsen_main);    MyOutputText = (TextView)findViewById(R.id.OutputText);    db = new DBAdapter(this);    setBinding();    //setOnEvent();    listData();    registerForContextMenu(getListView());}private void setBinding(){    //Binding Objects    menuCarBtn = (ImageButton)findViewById(R.id.menuCarBtn);}private void listData(){    db.open();    Bundle dataBundle = Im_SensShow.this.getIntent().getExtras();    thim_sens_id = dataBundle.getLong(""THIMSENSID"");    cursor = db.getIm_Sen_List(thim_sens_id,1);    MyOutputText.setText(thim_sens_id+""t"");    startManagingCursor(cursor);    ListAdapter list = new SimpleCursorAdapter(            this,            R.layout.imsen_row,            cursor,            new String[] {DBAdapter.KEY_IM_SENS, DBAdapter.KEY_READING},            new int[] {R.id.im_sens, R.id.reading});    setListAdapter(list);    db.close();        menuCarBtn.setOnClickListener(new OnClickListener() {            @Override            public void onClick(View arg0) {                Toast.makeText(getBaseContext(), ""hello"", Toast.LENGTH_LONG).show() ;            }        });}@Overridepublic boolean onCreateOptionsMenu(Menu menu){    super.onCreateOptionsMenu(menu);    menu.add(0, INSERT_ID,0, R.string.menu_insert);    menu.add(0, CHANGE_ID,0, R.string.menu_change_lan);    return true;}@Overridepublic boolean onOptionsItemSelected(MenuItem item) {    switch (item.getItemId()) {    case INSERT_ID:        Cursor c = cursor;        Intent create_Im_Sens = new Intent(Im_SensShow.this,Im_SensShow.class);        Bundle dataBundle = new Bundle(0);        // we want to create record in sit 2 so send a sit 1 primary key is enough        dataBundle.putLong(""THIMSENSID"", thim_sens_id);        //send 0 since we will notify create activity that this is for create : data does not exist in sit 2 table yet        dataBundle.putLong(""IMSENSID"", 0);        create_Im_Sens.putExtras(dataBundle); //        startActivity(create_Im_Sens);        break;    case CHANGE_ID:        AlertDialog.Builder builder = new AlertDialog.Builder(this);        final CharSequence[] items = { ""??????"", ""????????"", ""???????"",                ""??????"", ""????"", ""???????????"" };        builder.setTitle(""????????????????"");        builder.setItems(items, new DialogInterface.OnClickListener() {            public void onClick(DialogInterface dialog, int item) {                // Toast.makeText(getApplicationContext(), items[item],                // Toast.LENGTH_SHORT).show();            }        });        AlertDialog alert = builder.create();        alert.show();        break;    default:        break;    }    return true;}@Overridepublic void onCreateContextMenu(ContextMenu menu, View v,ContextMenuInfo menuInfo) {    super.onCreateContextMenu(menu, v, menuInfo);    menu.setHeaderTitle(""????????????"");      menu.add(0, EDIT_ID, 0, R.string.menu_edit);    menu.add(0, DELETE_ID, 0, R.string.menu_delete);}/*@Overridepublic boolean onContextItemSelected(MenuItem item){    switch(item.getItemId()){        case EDIT_ID:{            Cursor c = cursor;            Intent edit_Th_Im_Sens = new Intent(Im_SensShow.this,Th_Im_SensEdit.class);            Bundle bundle = new Bundle();            bundle.putLong(""SITUATION2ID"", sit2_id);            bundle.putLong(""THIMSENSID"", c.getLong(c.getColumnIndexOrThrow(DBAdapter.KEY_TH_IM_SENS_ID)));            bundle.putString(""THIMSENS"",c.getString(c.getColumnIndexOrThrow(DBAdapter.KEY_TH_IM_SENS)));            edit_Th_Im_Sens.putExtras(bundle);            startActivityForResult(edit_Th_Im_Sens,1);            return true;        }        case DELETE_ID:{            db.open();            db.deleteRecord(DBAdapter.TH_IM_SENS_TABLE,DBAdapter.KEY_TH_IM_SENS_ID,cursor.getLong(cursor.getColumnIndexOrThrow(DBAdapter.KEY_TH_IM_SENS_ID)));            Toast.makeText(getBaseContext(), getString(R.string.save_data), Toast.LENGTH_LONG).show() ;            listData();            return true;        }    }    return super.onContextItemSelected(item);}/*@Overrideprotected void onListItemClick(ListView l, View v, int position, long id) {    Cursor c = cursor;    c.moveToPosition(position);    Intent showTh_Im_Sens = new Intent(Th_Im_SensShow.this,Th_Im_SensShow.class);    Bundle dataBundle = new Bundle(0);    dataBundle.putLong(""SITUATIONID"", 0);    showTh_Im_Sens.putExtras(dataBundle); //    startActivity(showTh_Im_Sens);}</code></pre><p>*/   @Override    public void onResume(){        super.onResume();        listData();    }}</p><p>imsen_main.xml</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;</code></pre><p>        </p><pre><code>    &lt;TextView         android:text=""?????    ""         android:id=""@+id/TextView01""         android:layout_width=""wrap_content""         android:layout_height=""wrap_content""&gt;    &lt;/TextView&gt;    &lt;AutoCompleteTextView         android:text=""""         android:id=""@+id/AutoCompleteTextView01""         android:layout_width=""fill_parent""         android:layout_height=""wrap_content""         &gt;    &lt;/AutoCompleteTextView&gt;    &lt;/LinearLayout&gt;    &lt;LinearLayout    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:background=""#98CAF3""&gt;    &lt;TextView     android:text=""imsentences""     android:id=""@+id/TextView03""     android:layout_width=""fill_parent""     android:layout_height=""wrap_content""    android:textSize=""27dip""    android:textColor=""#FFFFFF""    android:textColorHighlight=""#98CAF3""&gt;    &lt;/TextView&gt;</code></pre><p>    </p><pre><code>    &lt;ListView         android:id=""@android:id/list""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""        android:footerDividersEnabled=""true""        android:cacheColorHint=""#00000000""/&gt;&lt;/LinearLayout&gt;&lt;LinearLayout    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:orientation=""horizontal""&gt;    &lt;TextView android:id=""@+id/im_sens""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:layout_weight=""1.""/&gt;</code></pre><p></p><p>imsen_row.xml</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;</code></pre><p></p><pre><code>    &lt;TextView android:id=""@+id/lang""               android:layout_width=""fill_parent""               android:layout_height=""wrap_content""              android:layout_weight=""1.""               android:textSize=""16dip"" /&gt;    &lt;TextView android:id=""@+id/im_sens""               android:layout_width=""fill_parent""              android:layout_height=""wrap_content""               android:layout_weight=""1.""              android:textSize=""24dip"" /&gt;    &lt;TextView android:id=""@+id/reading""               android:layout_width=""fill_parent""              android:textSize=""24dip""               android:layout_height=""wrap_content""              android:text=""reading""               android:layout_weight=""1.""/&gt;              &lt;ImageButton                android:id=""@+id/menuCarBtn""                android:layout_width=""wrap_content""                android:layout_height=""wrap_content""                android:src=""@drawable/car""                android:background=""@null""                /&gt;</code></pre><p></p>","605358","","","","","2011-02-06 18:18:14","press button in each list in ListActivity","<android><button><listactivity>","1","2","","",""
"4915312","1","4916987","","2011-02-06 18:42:55","3","28709","<p>Using the Hello, World Gridview tutorial example, I am attempting to make the image fullscreen on click instead of display the position of the image in the array.  As I am unfamilar with Android and this is my first development attempt with it, I'm at a loss.  I am familiar with Java though, and I've tried doing things like this (that don't work obviously):</p><pre><code>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) {            showImage(v, position);            Toast.makeText(HelloAndroid.this, """" + parent.getId(), Toast.LENGTH_SHORT).show();        }    });}private void showImage(View view, int position) {    ImageView imgView = (ImageView) view;     imgView.setImageResource(position);     }</code></pre><p>But the app crashes (force close).  Any ideas?</p><p><a href=""http://developer.android.com/resources/tutorials/views/hello-gridview.html"" rel=""nofollow"">Here is the tutorial app I am using</a></p>","16631","","16631","","2011-02-06 21:23:20","2014-03-20 15:09:24","Making image full screen on android tutorial app","<android><imageview>","2","2","5","",""
"4915382","1","4915425","","2011-02-06 18:56:26","0","531","<p>I use the following snippet to vibrate the phone in a specific pattern, but it throws and <strong>ArrayIndexOutOfBoundsException</strong>.</p><pre><code>vibrator.vibrate(new long[] { selectedDuration, CONSTANT_DELAY }, REPEAT); </code></pre><p>But</p><pre><code>vibrator.vibrate(VIBRATE_DURATION);</code></pre><p>works fine. Any pointers?</p>","421372","","","","","2011-02-06 19:10:48","Vibrator.vibrate() throws ArrayIndexOutOfBoundsException","<android><exception><vibrate>","1","0","0","",""
"4915432","1","","","2011-02-06 19:06:42","0","2451","<p>Hi i have a spinner that i have hidden using visibility = gone atribute. i call the spinner list using spinner.performclick() , this works fine except for that when selecting an item in the spinner list my onselect listener is never being called. please help:)  </p><p>the only catlog warning being thrown is ""window already focused, ignoring focus gain""</p><pre><code>        catagorySpinner.setOnItemSelectedListener(new OnItemSelectedListener() {        @Override        public void onItemSelected(AdapterView&lt;?&gt; parentView, View selectedItemView, int position, long id) {            CashDB cdb = new CashDB(getBaseContext());             cdb.open();            Cursor c = cdb.FetchCatagory(id);            startManagingCursor(c);            c.moveToFirst();            String newCatagoryName = c.getString(c.getColumnIndexOrThrow(CashDB.CATAGORY_NAME));            c.close();            areYouSureDialog(""Are You Sure?"", ""Are you sure you want to delete the catagory "" +'""'                     + catagoryName + '""'+ "" and move all of the transactions to "" +'""'                     + newCatagoryName + '""' + "" ?"",                    catagoryIcon, catagoryName,newCatagoryName, DELETE_CATAGORY_MOVE, catagoryId);        }        @Override        public void onNothingSelected(AdapterView&lt;?&gt; arg0) {            // TODO Auto-generated method stub        }        });</code></pre>","525726","","525726","","2011-02-06 19:15:30","2012-06-12 07:20:09","OnItemSelectedListener() not being called for my spinner","<android><selection><spinner>","1","2","","",""
"4915451","1","4915542","","2011-02-06 19:11:21","0","322","<p>I'm developing a game where, when the game is being played, the phone will be in landscape mode, but when the menu button is pressed, I want the options menu to come from the right side instead of the bottom of the screen. Is this possible, and how would I go about doing so?</p>","308115","","","","","2011-02-06 19:25:04","Is it possible to make the options menu come from the side, instead of the bottom of the screen?","<android><android-layout>","1","0","","",""
"4915509","1","4915543","","2011-02-06 19:19:02","0","597","<p>I am currently developing an android application. I want the user to select an item from a listview from and it loads the url that is assigned with the selected option in the default android browser instead of using a webview as that would mean that I would have to effectively make my own web browser.</p><p>Thanks for any help you can provide</p>","499448","","180538","","2011-02-06 19:27:30","2011-02-06 19:27:30","Load default android web browser","<android><browser><android-intent>","1","0","","",""
"4915544","1","4915608","","2011-02-06 19:25:08","1","1965","<p>In my app I have 5 String arrays that represent different fields of objects. </p><p>i.e.</p><pre><code>String_A[1],String_B[1],String_C[1],String_D[1],String_E[1],</code></pre><p>All are attributes of the same object (which is not really an object).</p><hr><p>Now I want to store those in order to be able to use them in a new activity that I am creating. Since you are not able to pass objects around I thought that i should save them in  Shared preferences. </p><p>My question is: Should I save them as separate strings or create a new class with all those fields and then serialize the objects? </p><p>Which is the best way in terms of memory usage? In fact is there any other way that you might achieve similar functionality? </p><p>Thanks in advanceMike</p>","582665","","30225","","2011-04-02 21:51:34","2011-04-02 21:51:34","Most effective way of storing Strings in Android","<android><serialization><save><memory-management><sharedpreferences>","3","0","1","",""
"4915726","1","4915805","","2011-02-06 19:58:43","1","1453","<p>I am trying to solve a start on boot related problem and I noticed many examples of the AndroidManifest.xml which has android.intent.action.BOOT_COMPLETED and some that also have the category of android.intent.category.HOME in there.  Does anyone know what the difference (if any) between the two are?</p><p>ie.</p><pre><code>       &lt;receiver android:name="".MartiniBootBroadCastReciever""        android:enabled=""true"" android:exported=""false""        android:permission=""android.permission.RECEIVE_BOOT_COMPLETED""&gt;        &lt;intent-filter&gt;            &lt;action                   android:name=""android.intent.action.BOOT_COMPLETED"" /&gt;            &lt;category android:name=""android.intent.category.HOME"" /&gt;        &lt;/intent-filter&gt;            &lt;/receiver&gt;</code></pre><p>versus</p><pre><code>        &lt;receiver android:name="".MartiniBootBroadCastReciever""        android:enabled=""true"" android:exported=""false""        android:permission=""android.permission.RECEIVE_BOOT_COMPLETED""&gt;         &lt;intent-filter&gt;            &lt;action android:name=""android.intent.action.BOOT_COMPLETED"" /&gt;        &lt;/intent-filter&gt;        &lt;/receiver&gt;</code></pre>","586907","","","","","2011-02-06 20:14:26","Difference between Android BOOT_COMPLETED & category HOME","<android><broadcastreceiver><boot>","1","2","","",""
"4915774","1","","","2011-02-06 20:07:21","1","424","<p>I have a question about services in Android. I want to know why it’s necessary for to bind the service, and doing a connection to it? I am doing an application with geolocation using a service wich implements the GPS module. And for getting the location I create a variable in the class static and public method static to be called from outside the class, and that is it.To retrieve the position from the GPS I just used in my classes:</p><pre><code>Location mLocation = ServiceGPS.getLocation();</code></pre><p>The class ServiceGPS has this method:</p><pre><code>public static Location getLocation(){    return mLocation;}</code></pre><p>Then, why I need to used the bind service?Thanks a lot for your help, and sharing your knowledge with me.</p><p>BR.David.</p>","605613","","605613","","2011-02-06 20:40:47","2011-02-06 20:40:47","Bind to a Service in Android","<android><service>","1","0","","",""
"4915985","1","4928249","","2011-02-06 20:46:34","2","2761","<p>I'm building my own C2DM application right now. I first started with a small Android application to test the push feature. And it works if I just call the curl command with the correct settings in my shell.</p><p>Now for the server part I wanted to use PHP but as it seems I'm doing something wrong as I always get a 401 error message when I try to send a message to the client. First of all the code consists of two parts. The first curl request asks for the server token. This works I get a real response from google with a working token!</p><p>The second curl request ends up with a 401 error message. Any ideas what I'm doing wrong?</p><pre><code>  $post_params = array ( ""Email"" =&gt; $MY_GOOGLE_ACC, ""Passwd"" =&gt; $MY_GOOGLE_PWD, ""accountType""=&gt;""GOOGLE"", ""source="" . $MY_GOOGLE_SRC, ""service=ac2dm"" );   $first = true;  $data_msg = """";  foreach ($post_params as $key =&gt; $value) {     if ($first)      $first = false;    else      $data_msg .= ""&amp;"";    $data_msg .= urlencode($key) .""="". urlencode($value);   }  $x = curl_init(""https://www.google.com/accounts/ClientLogin"");   curl_setopt($x, CURLOPT_HEADER, 1);   curl_setopt($x, CURLOPT_POST, 1);   curl_setopt($x, CURLOPT_POSTFIELDS, $data_msg);   curl_setopt($x, CURLOPT_RETURNTRANSFER, 1);   $data = curl_exec($x);   curl_close($x);   $response = $data;  $authKey = trim(substr($response, 4+strpos($response, ""SID="")));  echo $authKey;  $collapse_key = 'something';  $post_params = array ( ""registration_id"" =&gt; $DEVICE_TOKEN, ""collapse_key"" =&gt; $collapse_key, ""data.payload""=&gt;""cakephp"" );   $first = true;  $data_msg = """";  foreach ($post_params as $key =&gt; $value) {     if ($first)      $first = false;    else      $data_msg .= ""&amp;"";    $data_msg .= urlencode($key) .""="". urlencode($value);   }  $size=strlen($data_msg);   $x = curl_init(""https://android.apis.google.com/c2dm/send"");   curl_setopt($x, CURLOPT_HTTPHEADER, array('Content-Type: application/x-www-form-urlencoded', 'Content-Length:'. $size, 'Authorization: GoogleLogin auth=' . $authKey));   curl_setopt($x, CURLOPT_HEADER, 1);   curl_setopt($x, CURLOPT_POST, 1);   curl_setopt($x, CURLOPT_POSTFIELDS, $data_msg);   curl_setopt($x, CURLOPT_RETURNTRANSFER, 1);   $data = curl_exec($x);   curl_close($x);   $response = $data;</code></pre>","452681","","","","","2012-10-09 07:28:57","C2DM Server with PHP 401 Error","<php><android><android-c2dm>","3","2","1","",""
"4916005","1","4916376","","2011-02-06 20:49:12","0","1414","<p>I would like to know how to implement the result of the following code into an android listview.</p><p>Thanks in advance </p><pre><code>package com.androidpeople.xml.parsing;import java.net.URL;import javax.xml.parsers.DocumentBuilder;import javax.xml.parsers.DocumentBuilderFactory;import org.w3c.dom.Document;import org.w3c.dom.Element;import org.w3c.dom.Node;import org.w3c.dom.NodeList;import org.xml.sax.InputSource;import android.app.Activity;import android.os.Bundle;import android.widget.LinearLayout;import android.widget.TextView;public class XMLParsingDOMExample extends Activity {    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        /** Create a new layout to display the view */        LinearLayout layout = new LinearLayout(this);        layout.setOrientation(1);        /** Create a new textview array to display the results */        TextView name[];        TextView website[];        TextView category[];        try {            URL url = new URL(                    ""http://www.............com//example.xml"");            DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();            DocumentBuilder db = dbf.newDocumentBuilder();            Document doc = db.parse(new InputSource(url.openStream()));            doc.getDocumentElement().normalize();            NodeList nodeList = doc.getElementsByTagName(""item"");            /** Assign textview array lenght by arraylist size */            name = new TextView[nodeList.getLength()];            website = new TextView[nodeList.getLength()];            category = new TextView[nodeList.getLength()];            for (int i = 0; i &lt; nodeList.getLength(); i++) {                Node node = nodeList.item(i);                name[i] = new TextView(this);                website[i] = new TextView(this);                category[i] = new TextView(this);                Element fstElmnt = (Element) node;                NodeList nameList = fstElmnt.getElementsByTagName(""name"");                Element nameElement = (Element) nameList.item(0);                nameList = nameElement.getChildNodes();                name[i].setText(""Name = ""                        + ((Node) nameList.item(0)).getNodeValue());                NodeList websiteList = fstElmnt.getElementsByTagName(""website"");                Element websiteElement = (Element) websiteList.item(0);                websiteList = websiteElement.getChildNodes();                website[i].setText(""Website = ""                        + ((Node) websiteList.item(0)).getNodeValue());                category[i].setText(""Website Category = ""                        + websiteElement.getAttribute(""category""));                layout.addView(name[i]);                layout.addView(website[i]);                layout.addView(category[i]);            }        } catch (Exception e) {            System.out.println(""XML Pasing Excpetion = "" + e);        }        /** Set the layout view to display */        setContentView(layout);    }}</code></pre>","592344","","116938","","2011-02-06 22:34:47","2011-05-20 21:48:15","How to show Dom parser result in android list view","<android><dom><sax>","1","3","","",""
"4916015","1","","","2011-02-06 20:50:30","0","780","<p>i am new to android and ant, i created an android app that i'd like to build using ant.I did an <code>android update project --path .</code> which worked like a charm.Now i want to move the <code>~/projects/myandroidapp/build.xml</code> to <code>~/projects/build_my_app.xml</code>When i run ant on this file i receive <code>java.io.FileNotFoundException: /home/user/projects/AndroidManifest.xml (No such file or directory)</code>I manipulated every reference to AndroidManifest.xml in former build.xml and main_rules.xml i found but did not find a solution.</p><p>Maybe there is someone out there who already faced this problem.</p>","605650","","","","","2012-11-02 18:55:23","ant android change path to build.xml","<android><ant>","2","2","","",""
"4916038","1","","","2011-02-06 20:54:30","1","1512","<p>I am trying to create a kind of a metronome for Android. It shall play some audible beeps at certain intervals to give people a rhythm. Hence, timing is quite critical. Essentially it shall do the following</p><p>(start)Play beep type 1 (about 0.1s long)</p><p>Wait for x milliseconds (between 500 and 1000)</p><p>Play beep type 2 (about 0.1s long)</p><p>Wait for y milliseconds (between 500 and 1000)</p><p>Play beep type 3 (about 0.1s long)</p><p>Wait for y milliseconds (between 500 and 1000)</p><p>Go back to start</p><p>The UI activity will have some buttons to adjust the wait intervals.</p><p>From reading all the various blogs, tutorials and discussions it seems that I should be using a postdelayed() Runnable and set the delay to my desired wait time x or y. After that I should start playing the sound. This should allow me to not take the length of the wav sound file into account.</p><p>Am I roughly on the right track? I realise that the timing will not be perfect as there are other services running which might delay the execution of my timers. In order to improve that I'd be happy to use the phone in flight mode or turn of some other services as I don't need anything else when using this app. </p><p>Are there any full examples for such code out there? I am a beginner when it comes to Android. My eyperience is more with straight C embedded systems.  Putting all the classes and their functions together is quite daunting.   </p><p>Any help appreciated,Michael</p>","605653","","","","","2011-02-06 22:52:43","Short, varying interval timer in Android","<android><timer>","2","1","1","",""
"4916111","1","","","2011-02-06 21:05:15","0","1045","<p>I'm not sure if my title is clear so let me explain.</p><p>Tab A - contains a listview populated from a databaseTab B - search form</p><p>I need to update the contents of tab A after coming back from a search results screen. Using onResume() works great but this also reloads the Tab whenever I click back and forth through between tabs. Is there another method I could use here?</p><p>EDIT: I guess it's a bit more complex than this. The search form loads a new intent that displays the results in a listview. An item can be select which then loads a item info screen. From here the user can select from a few option, one being Add. This is the action that needs to reload the original listview in Tab A.</p>","579059","","579059","","2011-02-06 22:48:28","2012-01-19 10:11:11","Reloading tab activity onResume but don't want to reload on tab switch","<android>","2","0","","",""
"4916159","1","4916505","","2011-02-06 21:13:05","4","21012","<p>So i've got a Uri of an image the user chooses out of images off his SD card. And i'd like to display a thumbnail of that image, because obviously, the image could be huge and take up the whole screen. Anyone know how?</p>","515502","","","","","2013-09-28 03:52:16","Android: Get thumbnail of image on SD card, given Uri of original image","<android><image><uri><thumbnails>","4","0","7","",""
"4916209","1","","","2011-02-06 21:20:17","37","22116","<p>I'm doing a small research of mobile platforms and I would like to know which design patterns are used in Android?</p><p>e.g. in iOS Model-view-controller is very widely used together with delegation and other patterns. </p><p>What patterns and where in particular does Android use?</p><p><strong>EDIT</strong></p><p>I'm not asking for design patterns used deep in kernel, dalvik and so on, but about patterns which an application developer will meet while developing an application.</p>","386817","","683261","","2013-02-22 05:57:17","2013-12-20 06:18:43","Which design patterns are used on Android?","<android><design-patterns>","3","3","41","",""
"4916215","1","4916320","","2011-02-06 21:20:42","12","5111","<p>I'm writing a custom view that directly extends <code>android.view.View</code>. If I try to access fields <code>mScrollX</code> or <code>mScrollY</code>, I see an error that the field ""cannot be resolved or is not a field."" The <a href=""http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;f=core/java/android/view/View.java;h=65904972d39662613c67f549a26a0213b77747cc;hb=refs/heads/gingerbread-release"">source code for android.view.View</a> has mScrollX, mScrollY, and similar variables declared <code>protected</code>. How is it that my direct subclass cannot access protected fields of its parent class? (Classes like <a href=""http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;f=core/java/android/widget/ScrollView.java;h=2ad67baa4d423b227123b019e6da44101018269c;hb=refs/heads/gingerbread-release"">ScrollView</a> apparently can.)</p><p>P.S. I realize that I can call <code>getScrollX()</code>, but I want to update these fields; calling <code>setScroll()</code> has side effects that I don't want.</p>","535871","","","","","2012-02-21 22:38:07","Protected fields not visible to subclasses","<java><android><subclass><protected>","3","2","4","",""
"4916265","1","4916357","","2011-02-06 21:27:44","3","2448","<p>I started off with the notepad example on the android website. What I did was add another table to the database and make it accessible in the <code>NotePad</code> class (added another inner class called <code>Table</code> that extended <code>BaseColumns</code>). It appears the database is being read correctly, and I can launch my view directly. However, when I try to launch it the same way google launches <code>NoteEditor</code> (via the <code>ACTION_INSERT</code> intent), the application crashes. </p><p>I have an updated URI for the new table, and the intent filter for the activity I want to launch is in the manifest (with the proper mimetype). However, it seems to not be able to find and launch the activity I want.</p><p>Here's the output that is relevant:</p><pre><code>02-04 01:13:54.964: DEBUG/AndroidRuntime(342): Shutting down VM02-04 01:13:54.964: WARN/dalvikvm(342): threadid=1: thread exiting with uncaught exception (group=0x40015560)02-04 01:13:54.984: ERROR/AndroidRuntime(342): FATAL EXCEPTION: main**02-04 01:13:54.984: ERROR/AndroidRuntime(342): android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.INSERT dat=content://com.google.provider.NotePad/courses }**02-04 01:13:54.984: ERROR/AndroidRuntime(342):     at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1408)02-04 01:13:54.984: ERROR/AndroidRuntime(342):     at android.app.Instrumentation.execStartActivity(Instrumentation.java:1378)02-04 01:13:54.984: ERROR/AndroidRuntime(342):     at android.app.Activity.startActivityForResult(Activity.java:2827)02-04 01:13:54.984: ERROR/AndroidRuntime(342):     at android.app.Activity.startActivity(Activity.java:2933)02-04 01:13:54.984: ERROR/AndroidRuntime(342):     at com.example.android.notepad.CoursesList.onOptionsItemSelected(CoursesList.java:154)02-04 01:13:54.984: ERROR/AndroidRuntime(342):     at android.app.Activity.onMenuItemSelected(Activity.java:2205)02-04 01:13:54.984: ERROR/AndroidRuntime(342):     at com.android.internal.policy.impl.PhoneWindow.onMenuItemSelected(PhoneWindow.java:748)02-04 01:13:54.984: ERROR/AndroidRuntime(342):     at com.android.internal.view.menu.MenuItemImpl.invoke(MenuItemImpl.java:143)02-04 01:13:54.984: ERROR/AndroidRuntime(342):     at com.android.internal.view.menu.MenuBuilder.performItemAction(MenuBuilder.java:855)02-04 01:13:54.984: ERROR/AndroidRuntime(342):     at com.android.internal.view.menu.IconMenuView.invokeItem(IconMenuView.java:532)02-04 01:13:54.984: ERROR/AndroidRuntime(342):     at com.android.internal.view.menu.IconMenuItemView.performClick(IconMenuItemView.java:122)02-04 01:13:54.984: ERROR/AndroidRuntime(342):     at android.view.View$PerformClick.run(View.java:9080)02-04 01:13:54.984: ERROR/AndroidRuntime(342):     at android.os.Handler.handleCallback(Handler.java:587)02-04 01:13:54.984: ERROR/AndroidRuntime(342):     at android.os.Handler.dispatchMessage(Handler.java:92)02-04 01:13:54.984: ERROR/AndroidRuntime(342):     at android.os.Looper.loop(Looper.java:123)02-04 01:13:54.984: ERROR/AndroidRuntime(342):     at android.app.ActivityThread.main(ActivityThread.java:3647)02-04 01:13:54.984: ERROR/AndroidRuntime(342):     at java.lang.reflect.Method.invokeNative(Native Method)02-04 01:13:54.984: ERROR/AndroidRuntime(342):     at java.lang.reflect.Method.invoke(Method.java:507)02-04 01:13:54.984: ERROR/AndroidRuntime(342):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)02-04 01:13:54.984: ERROR/AndroidRuntime(342):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)02-04 01:13:54.984: ERROR/AndroidRuntime(342):     at dalvik.system.NativeStart.main(Native Method)02-04 01:13:55.014: WARN/ActivityManager(61):   Force finishing activity com.example.android.notepad/.CoursesList</code></pre><p>I have the intent-filter in my manifest:</p><pre><code>   &lt;activity android:name=""AddCourseView""        android:theme=""@android:style/Theme.Light""        android:label=""@string/title_note""        android:screenOrientation=""sensor""        android:configChanges=""keyboardHidden|orientation""    &gt;        &lt;!-- This filter says that we can view or edit the data of             a single note --&gt;        &lt;intent-filter android:label=""@string/resolve_course_edit""&gt;            &lt;action android:name=""android.intent.action.VIEW"" /&gt;            &lt;action android:name=""android.intent.action.EDIT"" /&gt;            &lt;action android:name=""com.android.notepad.action.EDIT_COURSE"" /&gt;            &lt;category android:name=""android.intent.category.DEFAULT"" /&gt;            &lt;data android:mimeType=""vnd.android.cursor.item/vnd.google.course"" /&gt;        &lt;/intent-filter&gt;        &lt;!-- This filter says that we can create a new note inside             of a directory of notes. --&gt;        &lt;intent-filter&gt;            &lt;action android:name=""android.intent.action.INSERT"" /&gt;            &lt;category android:name=""android.intent.category.DEFAULT"" /&gt;            &lt;data android:mimeType=""vnd.android.cursor.dir/vnd.google.course"" /&gt;        &lt;/intent-filter&gt;    &lt;/activity&gt;</code></pre><p>here is the code where the intent gets launched:</p><pre><code>        Uri intentUri = getIntent().getData();        Intent intent = new Intent(Intent.ACTION_INSERT, intentUri );        startActivity( intent );</code></pre><p>getType() method in NotePadProvider:</p><pre><code>@Overridepublic String getType(Uri uri) {    switch (sUriMatcher.match(uri)) {    case NOTES:    case LIVE_FOLDER_NOTES:        return Notes.CONTENT_TYPE;    case NOTE_ID:        return Notes.CONTENT_ITEM_TYPE;    case COURSES:        return Courses.CONTENT_TYPE;    case COURSE_ID:        return Courses.CONTENT_ITEM_TYPE;    default:        throw new IllegalArgumentException(""Unknown URI "" + uri);    }}</code></pre><p>here is where i define the types:</p><p>public final class NotePad {    public static final String AUTHORITY = ""com.google.provider.NotePad"";</p><pre><code>// This class cannot be instantiatedprivate NotePad() {}/** * Notes table */public static final class Notes implements BaseColumns {    // This class cannot be instantiated    private Notes() {}    /**     * The content:// style URL for this table     */    public static final Uri CONTENT_URI = Uri.parse(""content://"" + AUTHORITY + ""/notes"");    /**     * The MIME type of {@link #CONTENT_URI} providing a directory of notes.     */    public static final String CONTENT_TYPE = ""vnd.android.cursor.dir/vnd.google.note"";    /**     * The MIME type of a {@link #CONTENT_URI} sub-directory of a single note.     */    public static final String CONTENT_ITEM_TYPE = ""vnd.android.cursor.item/vnd.google.note"";    /**     * The default sort order for this table     */    public static final String DEFAULT_SORT_ORDER = ""modified DESC"";    /**     * The title of the note     * &lt;P&gt;Type: TEXT&lt;/P&gt;     */    public static final String TITLE = ""title"";    /**     * The note itself     * &lt;P&gt;Type: TEXT&lt;/P&gt;     */    public static final String NOTE = ""note"";    /**     * The task content     * &lt;P&gt;Type: TEXT&lt;/P&gt;     */    public static final String TASK_DESCRIPTION = ""description"";    /**     * The task location     * &lt;P&gt;Type: TEXT&lt;/P&gt;     */    public static final String TASK_LOCATION = ""location"";    /**     * The task start time     * as Unix Time, the number of seconds since 1970-01-01 00:00:00 UTC     */    public static final String TASK_START_TIME = ""starttime"";    /**     * The task end time     * as Unix Time, the number of seconds since 1970-01-01 00:00:00 UTC     */    public static final String TASK_END_TIME = ""endtime"";    /**     * The timestamp for when the note was created     * &lt;P&gt;Type: INTEGER (long from System.curentTimeMillis())&lt;/P&gt;     */    public static final String CREATED_DATE = ""created"";    /**     * The timestamp for when the note was last modified     * &lt;P&gt;Type: INTEGER (long from System.curentTimeMillis())&lt;/P&gt;     */    public static final String MODIFIED_DATE = ""modified"";    /**     * if it is an assignment/test, the weight of it is here     */    public static final String WEIGHT = ""weight"";    /**     * the course the note is assigned to     */    public static final String RELATED_COURSE = ""relatedcourse"";}/** * Courses table */public static final class Courses implements BaseColumns {    // This class cannot be instantiated    private Courses() {}    /**     * The content:// style URL for this table     */    public static final Uri CONTENT_URI = Uri.parse(""content://"" + AUTHORITY + ""/courses"");    /**     * The MIME type of {@link #CONTENT_URI} providing a directory of notes.     */    public static final String CONTENT_TYPE = ""vnd.android.cursor.dir/vnd.google.course"";    /**     * The MIME type of a {@link #CONTENT_URI} sub-directory of a single note.     */    public static final String CONTENT_ITEM_TYPE = ""vnd.android.cursor.item/vnd.google.course"";    /**     * The default sort order for this table     */    public static final String DEFAULT_SORT_ORDER = ""modified DESC"";    /**     * The title of the note     * &lt;P&gt;Type: TEXT&lt;/P&gt;     */    public static final String TITLE = ""title"";    public static final String PROFESSOR = ""professor"";    public static final String DESCRIPTION = ""description"";    /**     * The timestamp for when the note was created     * &lt;P&gt;Type: INTEGER (long from System.curentTimeMillis())&lt;/P&gt;     */    public static final String CREATED_DATE = ""created"";    /**     * The timestamp for when the note was last modified     * &lt;P&gt;Type: INTEGER (long from System.curentTimeMillis())&lt;/P&gt;     */    public static final String MODIFIED_DATE = ""modified"";}</code></pre><p>}</p><p>here is the provider part of the manifest:</p><pre><code>    &lt;provider android:name=""NotePadProvider""        android:authorities=""com.google.provider.NotePad""/&gt;</code></pre><p>ok, i changed the intent launch to this:</p><pre><code>        Intent intent = new Intent(Intent.ACTION_INSERT);        intent.setType(Courses.CONTENT_TYPE);        startActivity(intent);</code></pre><p>so there should be no confusion on the type. and now i get this error:</p><p>02-06 22:48:26.076: ERROR/AndroidRuntime(640): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.android.notepad/com.example.android.notepad.AddCourseView}: java.lang.NullPointerException</p>","602478","","602478","","2011-02-06 22:50:06","2011-12-04 16:48:05","Activity not found exception","<java><android><android-manifest>","4","4","","",""
"4916473","1","4916747","","2011-02-06 22:04:18","0","359","<p>I am currently developing an android app which uses the android web browser and notifications. </p><p>What I want to be able to do is the user clicks on an item which loads the android web browser and makes a notification in the notification bar as well. </p><p>The user should be on the browser when they go the notification, so when the user is on the browser and they click on the notification I want the notification to perform its task but not redisplay the app activity instead just return to where the user was on the browser. </p><p>I've tried setting the different flags on the activity but none of them seem to make any difference.</p><p>Thanks for any help you can provide. </p>","499448","","","","","2011-02-06 22:47:24","Notification to not reload app in android","<android>","2","2","","",""
"4916512","1","4917105","","2011-02-06 22:09:58","10","4202","<p>Can I use a LGPL library in my paid android application? I am not going to modify the LGPL lib, I just want to use it. Is it legal?</p>","508178","","321731","","2013-11-15 22:18:04","2013-11-24 21:49:15","Using LGPL library in Paid Android App","<android><lgpl>","5","5","6","",""
"4916590","1","","","2011-02-06 22:20:21","2","837","<p>I'm trying to build an android app which generates media file statistics e.g. bitrate for audio &amp; bitrate, frame rate, codec information etc for video.</p><p>I have been able to create playlist based on the files available on external storage on mobile device and play them using MediaPlayer apis.</p><p>But I haven't found any api so far which lets you extract the above mentioned information from the media files.</p><p>I checked AudioTrack class but it doesn't serves the purpose.</p><p>It will be absolutely great if some one can share some insights on this.</p>","605676","","229044","","2012-09-12 19:57:45","2012-09-12 19:57:45","Does there exist any android api that returns mediafile bitrate, framerate etc?","<android><media><codec><bitrate>","1","1","","",""
"4916629","1","4916649","","2011-02-06 22:26:12","0","101","<p>I would like to develop an Android application. In that app, I would like to get the reviews of restaurants, pubs, tourism places, etc. from a specific location.</p><p>Is there any API to get these kinds of reviews?</p>","519750","","23897","","2011-02-06 22:28:47","2011-02-06 22:30:06","Where to find reviews?","<android>","1","3","","",""
"4916654","1","4917038","","2011-02-06 22:30:43","2","8524","<p>I'm working on a little program, and I need to add a custom dialog that passes some info to the calling acitivity when it closes.I extended the dialog class, and when I try to capture the custom dialog when it closes,using an onDismiss listener, it never reaches it because I used a custom dialog.</p><p>This is part of my activity -</p><pre><code>    .    .    .       attributes customizeDialog = new attributes(con,position,pick.getLastVisiblePosition());        customizeDialog.show();</code></pre><p>(The attributes being the name of the class that extends the dialog class).</p><p>Here is the event listener I set up when the dialog finishes -</p><pre><code>    customizeDialog.setOnDismissListener(new DialogInterface.OnDismissListener() {        @Override        public void onDismiss(DialogInterface dialog) {            Log.v(""LOG_CAT"",attributes.selectedIndexes.get(0) + "" "" + attributes.selectedIndexes.get(1) + "" "" + attributes.selectedIndexes.get(2) + "" "" + attributes.selectedIndexes.get(3) + "" "" + attributes.selectedIndexes.get(5) + "" "");    }});</code></pre><p>I know i'm doing it wrong,I just don't know how to fix it.</p><p>I would really appreciate any help with this problem.</p><p>Thanks!</p>","605693","","838023","","2012-12-06 15:19:46","2013-09-01 08:05:35","Can't use onDismiss() when using custom dialogs - Android","<android><dialog><custom-controls>","4","2","1","",""
"4916680","1","4916727","","2011-02-06 22:35:02","3","1551","<p>In my project I have a AsyncTask that fetches some JSON data from the net, from which I build a    </p><pre><code>List&lt;Map&lt;String,String&gt;&gt; typesCategory = new ArrayList&lt;Map&lt;String, String&gt;&gt;();</code></pre><p>I now need to pass this List to my next intent. Looking at the API, I dont see any methods that support passing a list.  What is the best way to accomplish this?</p><pre><code>        protected void onPostExecute(List result) {            progress.dismiss();            Intent action = new Intent(this, ListTypeActivity.class);            action.putExtra(""data"", result);        }</code></pre>","553486","","","","","2011-02-07 01:05:50","How do I pass a List<Map<String,String>> using putExtra to another intent","<android><android-asynctask>","1","0","2","",""
"4916782","1","4916787","","2011-02-06 22:54:51","0","375","<p>When I start my app, I get a ClassCastException at <code>Cursor c = (Cursor) DataHelper.selectAll();</code>.</p><p>Here is my main .java:</p><pre><code>package com.gantt.shoppinglist;import android.app.Dialog;import android.app.ListActivity;import android.database.Cursor;import android.os.Bundle;import android.view.View;import android.view.View.OnClickListener;import android.widget.Button;import android.widget.EditText;import android.widget.ListAdapter;import android.widget.ListView;import android.widget.SimpleCursorAdapter;public class ShoppingList extends ListActivity {    private DataHelper DataHelper;    /** Called when the activity is first created. */    @Override    protected void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        DataHelper = new DataHelper(this);        ListView listview = (ListView) findViewById(android.R.id.list);        Cursor c = (Cursor) DataHelper.selectAll();        startManagingCursor(c);        String[] from = new String[] { com.gantt.shoppinglist.DataHelper.getDatabaseName() };        int[] to = new int[] { android.R.id.text1 };        ListAdapter adapter = new SimpleCursorAdapter(this,                R.layout.rowlayout, c, from, to);        setListAdapter(adapter);        Button button1main = (Button) findViewById(R.id.add);        button1main.setOnClickListener(new OnClickListener()  {            @Override            public void onClick(View v)  {            final Dialog additem = new Dialog(ShoppingList.this);            additem.setContentView(R.layout.maindialog);            final EditText et = (EditText)additem.findViewById(R.id.edittext);            additem.setTitle(""Type your item"");            additem.setCancelable(true);            et.setHint(""Type the name of an item..."");            Button button = (Button) additem.findViewById(R.id.cancel);            button.setOnClickListener(new OnClickListener()  {                @Override                public void onClick(View v)  {                    additem.dismiss();                }            });            additem.show();            Button ok = (Button) additem.findViewById(R.id.ok);            ok.setOnClickListener(new OnClickListener() {                @Override                public void onClick(View v) {                    final String text = et.getText().toString();                    additem.dismiss();                    et.setText("""");                }            });       }        });    }}</code></pre><p>My DataHelper class:</p><pre><code>package com.gantt.shoppinglist;import java.util.ArrayList;import java.util.List;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;public class DataHelper {       private static final String DATABASE_NAME = ""items.db"";       private static final int DATABASE_VERSION = 1;       private static final String TABLE_NAME = ""table1"";       private Context context;       private SQLiteDatabase db;       private SQLiteStatement insertStmt;       private static final String INSERT = ""insert into ""           + TABLE_NAME + ""(name) values (?)"";       public DataHelper(Context context) {          this.context = context;          OpenHelper openHelper = new OpenHelper(this.context);          this.db = openHelper.getWritableDatabase();          this.insertStmt = this.db.compileStatement(INSERT);       }       public long insert(String name) {          this.insertStmt.bindString(1, name);          return this.insertStmt.executeInsert();       }       public void deleteAll() {          this.db.delete(TABLE_NAME, null, null);       }       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[] { ""name"" },             null, null, null, null, ""name 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 static String getDatabaseName() {        return DATABASE_NAME;    }    private static class OpenHelper extends SQLiteOpenHelper {          OpenHelper(Context context) {             super(context, getDatabaseName(), null, DATABASE_VERSION);          }          @Override          public void onCreate(SQLiteDatabase db) {              db.execSQL(""CREATE TABLE "" + TABLE_NAME + ""(id INTEGER PRIMARY KEY, name TEXT);"");          }          @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 "" + TABLE_NAME);             onCreate(db);          }       }    }</code></pre>","560096","","","","","2011-02-06 22:56:53","App Crashes On Startup Due To ClassCastException","<android><sqlite><crash>","1","0","","",""
"4916883","1","","","2011-02-06 23:18:25","0","286","<p>Layout:</p><pre><code>&lt;LinearLayout android:id=""@+id/layoutLogo""    android:layout_width=""match_parent""    android:layout_height=""70.0sp""&gt;    &lt;ImageView android:layout_width=""wrap_content""        android:id=""@+id/imageLogo""        android:src=""@drawable/nglogo""        android:layout_weight=""3""        android:layout_height=""wrap_content""&gt;&lt;/ImageView&gt;    &lt;ImageView android:layout_width=""match_parent""        android:id=""@+id/imageLogoWords""        android:layout_height=""wrap_content""        android:scaleType=""fitXY""        android:src=""@drawable/audioportaltext""        android:layout_weight=""1""        android:layout_gravity=""center_horizontal""&gt;&lt;/ImageView&gt;&lt;/LinearLayout&gt;</code></pre><p>Causes my app to crash. The exact line causing it to crash:</p><pre><code>   &lt;ImageView android:layout_width=""wrap_content""       android:id=""@+id/imageLogo""       android:src=""@drawable/nglogo""       android:layout_weight=""3""       android:layout_height=""wrap_content""&gt;&lt;/ImageView&gt;</code></pre><p>It only crashes on 2.3.1, not 2.2</p>","1302338","","418183","","2011-02-06 23:29:33","2011-02-06 23:56:44","ImageView causes app to crash on 2.3.1 but not 2.2","<android><imageview>","0","2","","",""
"4916983","1","","","2011-02-06 23:37:57","15","13541","<p>I have a webpage that I'm trying to display on my Android device (loaded from the assets directory of the project) using PhoneGap (which uses a normal WebView set as the ""appview""), but the webview completely ignores the following:</p><pre><code>&lt;meta name = ""viewport"" content = ""user-scalable=no,width=device-width"" /&gt;</code></pre><p>No matter what I set in this line (I've tried explicitly setting the zoom, setting the width/height in pixels, etc.), the device completely ignores it and renders the website very small and anchored to the upper left-hand corner of the screen. I can zoom in using the pinch gesture (even if I explicitly disable zoom in the html code above), but I want the page to be zoomed-in to properly fit the device on load. </p><p>Here's the interesting bit... If I put the exact same site on my web server and navigate to it using the default browser on my test device, the page loads properly (scaled to the right size for the device). </p><p>Please help.</p><p>Thanks.</p><p><strong>EDIT1:</strong></p><p>My current settings are:</p><pre><code>&lt;meta name=""viewport"" content=""width=device-width,height=device-height,user-scalable=no,target-densitydpi=device-dpi,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0"" /&gt;</code></pre><p>That too is completely ignored.</p><p><strong>EDIT2:</strong></p><p>Here's something interesting...</p><pre><code>&lt;meta name=""viewport"" content=""width=device-width, initial-scale=2.0, maximum-scale=2.0, user-scalable=no"" /&gt;</code></pre><p>The above line scales the page to 2x in the emulator yet changes nothing on my device (Samsung Epic running 2.2.1). Still though, even at 2x, the page is not being scaled to the emulator's width... I'd have to set that to something like ""initial-scale=2.5"".</p>","272302","","272302","","2011-02-07 14:14:47","2013-03-14 14:41:23","Android-- PhoneGap/WebView ignores viewport meta tags?","<android><html><webview><phonegap>","4","3","12","",""
"4917134","1","","","2011-02-07 00:09:39","1","2672","<p>I am using TableLayout within a ListView.  The data I'm presenting is tabular in nature and the TableLayout seems like a good way to ensure that the columns line up as desired.  This approach worked well most of the time - see below.</p><p><img src=""http://i.stack.imgur.com/qRTiM.png"" alt=""desired view""></p><p>But occasionally the Views representing the columns wrapped their text content as shown below. </p><p><img src=""http://i.stack.imgur.com/DEw8Z.png"" alt=""enter image description here""></p><p>After searching around for a while, I came across the <a href=""http://code.google.com/p/android/issues/detail?id=4000"" rel=""nofollow"">following discussion on the Android Google Group</a>.  In response, I set android:stretchColumns=""*"" in the TableLayout and voila, the contained TextViews stopped mysteriously wrapping their text.  Here's a partial content of the layout's XML, with the change highlighted with a comment:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;TableLayout xmlns:android=""http://schemas.android.com/apk/res/android""              android:orientation=""horizontal""              android:layout_width=""fill_parent""              android:layout_height=""fill_parent""              android:stretchColumns=""*""&gt;  &lt;!-- stretchColumns needed to prevent              TableLayout from unilaterally deciding to shrink the column              width and thereby causing text to wrap. --&gt;</code></pre><p>While I'm now getting the desired result, I'm a bit confused as to why this ""fixed"" my problem.  The <a href=""http://developer.android.com/reference/android/widget/TableLayout.html"" rel=""nofollow"">TableLayout documentation</a> states that ""The width of a column is defined by the row with the widest cell in that column."" But if that's true, why did the columns apparently shrink in size in the first place causing the text to wrap?  Does anyone have a good explanation?</p><p>Thanks,Rich</p>","550753","","","","","2011-06-09 12:15:39","Android TableLayout in a ListView, mysterious column shrinking","<android><text><wrap><tablelayout>","1","0","1","",""
"4917176","1","4917227","","2011-02-07 00:19:25","0","540","<p>I have created a custom Button as follows. </p><p>file : buttoncontrol.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:drawable=""@drawable/greendot""          android:state_pressed=""true"" /&gt;    &lt;item android:drawable=""@drawable/reddot"" /&gt;&lt;/selector&gt;</code></pre><p>in the layout file.. I have used</p><pre><code>    &lt;Button     ...        android:background=""@drawable/buttoncontrol""&gt;&lt;/Button&gt;</code></pre><p>When I try to run the program the layout shows the button with reddot (expected result). When I press the button, it turns green until I release the keypress. How can I make this green until the next click. More a toggle behaviour. </p><p>I have tried the same xml file in a toggle button as well. Same result. </p><p>Apart from this (for testing), I have also tried adding the following code in activity as well. Still not getting the desired result. (which is saving the state)</p><pre><code>...under onClick of  Button/ToggleButtonbuttonControl.setPressed(true);</code></pre><p>Any suggestions? My preference is to avoid programatically controlling the state. i.e. I can always keep these images and use buttonContol.setBackgroundDrawable for the buttons</p><p>Thanks</p>","518219","","","","","2011-02-07 05:33:00","Custom Button in Android not saving state","<android><android-widget><android-layout>","2","0","","",""
"4917375","1","4917407","","2011-02-07 01:04:03","2","939","<p>Im writing little widget that shows time, date.. with many settings. And I want to have multiple instances of this widget with diferent settings. Is there any way to identify widget instance. I mean is it posible to set persistant id on witget instance so Ill know on update that I have to use setting for for example witget one?</p>","605816","","","","","2011-03-22 07:28:37","Android (App)Widget identification","<android>","2","0","","",""
"4917402","1","","","2011-02-07 01:12:30","1","560","<p>I need to handle multiple button presses in a gui on the screen at the same time. I have looked everywhere and tried to implement my own listeners and everything without success. Any hint? </p><p>Thank in advance!! </p>","217527","","217527","","2011-02-07 01:39:19","2011-02-07 01:39:19","Press buttons at the same time","<android>","0","6","","",""
"4917419","1","","","2011-02-07 01:16:13","3","319","<p><em><strong>Disclaimer:</strong> I'm not seeking legal advice on this subject, merely opinion; although depending on the responses, I may seek legal advice.</em></p><p>My question is a two part question, so first I'll give some background information. My company has been tasked with developing an Android application that will use some server side backend code as a data source. The server side code will have a web administration interface, and use some icons. To keep the application experience consistent, I will be using some icons in both the Android app and on the administration web interface. I have found some icons I'd like to use (Oxygen icons from KDE), however they are licensed under the GPL. <strong>It should also be noted that in both cases, the applications will be closed source.</strong></p><p><strong>Part 1:</strong> For the web interface, the images will be ""linked"" into the application (using img tag). I may need to convert them to GIF to support transparency because older versions of IE may access the web interface. If I were to do this and zipped the original ""source"" PNGs and made them available via my client's website, and distributed that zip file with the web interface, then in my eyes, all requirements of the GPL license on those images would be satisfied. I've formed this veiw based on my reading of the Drupal license FAQ below, but I would like any additional input.</p><p><strong>Part 2:</strong> For the Android app, the same icon files I mentioned would be in use in the app. The difference however, is that in this case, the image files would be compiled into the app itself. If I made an ""About"" or ""Information"" screen in the app and made it clear that the icons were GPL and provided a link to download their ""source"" PNGs on my client's website, would this satisfy the GPL license requirements?</p><p>I have tried doing additional research on this topic, however most of the links I get in searches aren't related to this topic. I've also looked at the links provided in the SO question referenced below, but found them to not contain the information I'm looking for.</p><p>Research:<br><a href=""http://stackoverflow.com/questions/2589744/gpl-lgpl-licensed-images-iphone-development"">SO question regarding GPL licensed images</a><br><a href=""http://drupal.org/licensing/faq/#q5"" rel=""nofollow"">Drupal license FAQ</a></p>","605807","","605807","","2011-02-07 01:31:14","2011-02-10 08:44:01","GPL Licensed Images in Applications","<android><image><web-applications><gpl>","1","0","0","",""
"4917449","1","4917529","","2011-02-07 01:25:23","0","599","<p>I would like to be able to draw or at least calculate an area of a map using a series of GPS coordinates, my php code currently limits the coords to an area around the GPS's current position.</p><p>My question therefore is: How would I calculate an area (e.g. a circle) from an array of GPS coords? (they are in decimal format).</p>","533610","","244296","","2011-02-07 01:35:43","2011-02-07 01:46:56","Draw a circle to the map using an array of GPS coords","<php><android><gps><overlay><android-mapview>","1","0","","",""
"4917545","1","4917675","","2011-02-07 01:52:11","12","5848","<p>just wondering if theres a way of sorting the results of a query ignoring case. Cause at the moment fields starting with an upper case letter are sorted and put on top of the list and fields starting with lower case letter are also sorted but are put after the upper case fields.</p><p>Thanks --Mike</p>","582665","","","","","2011-08-22 16:01:58","Android sort sqlite query results ignoring case","<android><sqlite><sorting><uppercase><lowercase>","3","0","3","",""
"4917591","1","4917608","","2011-02-07 02:08:03","0","1342","<p>I have developed a simple application on Emulator and would like to test/install it on Samsung Galaxy Tab. Could anybody let me know how to go about it? </p>","564844","","","","","2011-02-07 05:03:37","How to install application developed on emulator on Samsung Galaxy Tab?","<android>","2","3","","",""
"4917606","1","4917688","","2011-02-07 02:12:45","2","197","<p>I want to be able to interact with the SD card in Android device when it's connected to a computer as a disk drive. Is this possible? Most pages I've seen so far suggest it's not.</p>","243203","","118","","2011-02-07 02:47:48","2011-02-07 03:03:07","Is there any way of writing files to the SD card of an Android device when it's connected to a computer?","<android><usb>","3","7","0","",""
"4917671","1","4918045","","2011-02-07 02:30:42","0","2707","<p>I've followed the instructions given <a href=""http://www.reigndesign.com/blog/using-your-own-sqlite-database-in-android-applications/"" rel=""nofollow"">here</a> for introducing an existing SQLite database to your Android app.</p><p>When I query the table ""android_metadata"" this is fine. But when I run a similar query on my own table ""words"" (which has _id for primary integer key) I get a table does not exist exception and the app crashes.</p><p>Why is that?</p><p>Code:</p><pre><code>Cursor c = myDatabase.query(""android_metadata"", null, null, null, null, null, null, null);</code></pre><p>works but</p><pre><code>Cursor c = myDatabase.query(""words"", null, null, null, null, null, null, null);</code></pre><p>returns a table does not exist exception.</p><p>This is how I'm creating the database (the references to paths and filenames are correct):</p><pre><code>private void copyDatabase() throws IOException{    //Open local db as the input stream    InputStream myInput = mContext.getAssets().open(DB_NAME);    //Path to the just created empty db    String outFileName = DB_PATH + DB_NAME;    //Open the empty db as the output stream    OutputStream myOutput = new FileOutputStream(outFileName);    //Transfer bytes from the inputfile to the outputfile    byte[] buffer = new byte[1024];    int length = 0;    while ((length = myInput.read(buffer))&gt;0){        myOutput.write(buffer, 0, length);    }    //Close the streams    myOutput.flush();    myOutput.close();    myInput.close();}</code></pre><p>(Note: To my eyes, the table is there. I'm looking right at it in my SQLite browser.)</p>","283311","","283311","","2012-10-09 00:56:31","2012-10-09 00:56:31","SQLite table does not exist exception for existing SQLite database (and table)","<android><sqlite>","2","9","","",""
"4917689","1","","","2011-02-07 02:36:45","0","91","<p>Too many devices and variations for targeting a certain devices.I wanna have some bird-eye view of mobile development at a certain forum.</p><p>Motorola, for instance, has Motodev as Nokia has Forum Nokia, then how'bout Samsung??Samsung has already bada Developers and Samsung Mobile Innovator, but those are not supporting a holistic view of whole devices.</p>","539982","","881229","","2014-01-28 06:48:40","2014-01-28 06:48:40","Where can I get all the info on development for Samsung Devices?","<android><bada>","2","2","","",""
"4917740","1","","","2011-02-07 02:52:27","0","693","<p>From the android device i do need to select a number from the CAll Log and use it to set in my own object . I am looking at CallLog.Calls but only outgoing is provided?</p>","279560","","","","","2011-04-26 16:33:40","How to get a number from the Call log and use it to save to an Object - Android","<java><android>","1","0","","",""
"4917860","1","5100004","","2011-02-07 03:29:42","1","1933","<p>I'm in the process of translating one of my apps to Spanish, and I'm having a character encoding problem with a raw HTML file I'm sticking into a WebView. I have the spanish translation of the file in my raw-es folder, and I'm reading it in with the following function:</p><pre><code>private CharSequence getHtmlText(Activity activity) {        BufferedReader in = null;        try {            in = new BufferedReader(new InputStreamReader(getResources().openRawResource(R.raw.help), ""utf-8""));            String line;            StringBuilder buffer = new StringBuilder();            while ((line = in.readLine()) != null) buffer.append(line).append('\n');            return buffer;        } catch (IOException e) {            return """";        } finally {            closeStream(in);        }    }</code></pre><p>But everywhere there is a spanish character in the file, there is a diamond with a question mark inside of it when I run the app, and look at the activity that displays the HTML. I'm using the following to load the text into the WebView:</p><pre><code>mWebView.loadData(text, ""text/html"", ""utf-8"");</code></pre><p>I originally created the file in Microsoft Word, so I'm sure there is some sort of character encoding issue going on, but I'm not really sure how to fix it, and a Google search isn't helping. Any ideas?</p>","413414","","","","","2011-02-24 03:18:40","Android: Character encoding raw resource files","<android><html><character-encoding><webview>","1","1","","",""
"4917882","1","","","2011-02-07 03:37:45","0","988","<p>I have a base abstract class that all my asynctasks extend from. I have built in error handling for network errors where I display a dialog to the user telling them they can retry their request (after all it was a network error...).</p><p>I am having a bit of a problem ""retrying"" my asynctask since once it is executed, you cannot execute it again. How could I go by do that ? Should I use reflection to instantiate the same class and retry? </p><p>Has anyone dealt with this problem before?</p>","254638","","254638","","2012-04-06 15:32:45","2012-04-06 15:32:45","Best java practice for retrying asynctask (android)","<java><android><android-asynctask>","2","1","","",""
"4917921","1","7596057","","2011-02-07 03:51:16","2","3189","<p>I've got an annoying issue with a screen. The screen consists of a bunch of Spinners one under the other, and then underneath the spinner, an EditText.</p><p>The problem is that when the screen starts, the EditText has focus, meaning that some Spinners are off the top of the screen. Try as I might, I cannot make the top Spinner start focused, either by using <code>&lt;requestFocus/&gt;</code> in the screen XML, or by using <code>requestFocus()</code> in code. I've attempted to do what <a href=""http://stackoverflow.com/questions/4211851/requestfocus-problem"">requestFocus problem</a> suggests, and if I'm following the suggestion correctly, it doesn't work either.</p><p>To reproduce the issue, create a new Android project in Eclipse. main.xml 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:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""&gt;    &lt;Spinner         android:id=""@+id/spinner""        android:orientation=""vertical""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""&gt;           &lt;requestFocus /&gt;    &lt;/Spinner&gt;    &lt;EditText          android:id=""@+id/edittext""        android:orientation=""vertical""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content"" /&gt;&lt;/LinearLayout&gt;</code></pre><p>The activity code is </p><pre><code>package nz.co.kb.testspinner;import android.app.Activity;import android.os.Bundle;import android.view.View;public class TestSpinner extends Activity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);//        setContentView(R.layout.main);        View view = getLayoutInflater().inflate(R.layout.main, null);        final View spinner = view.findViewById(R.id.spinner);        view.post(new Runnable() {            public void run() {                spinner.requestFocus();            }        });        setContentView(view);        spinner.requestFocus();    }}</code></pre><p>Note multiple styles of requestFocus attempted.</p><p>Is this a platform bug, or am I doing something wrong?</p><p>Thanks.</p>","372926","","","","","2011-09-29 10:37:18","Can't manage to requestFocus a Spinner","<android><focus><edittext><spinner>","2","0","2","",""
"4917979","1","4918077","","2011-02-07 04:04:28","0","265","<p>I am using <code>AdapterView</code> to have Custom List. But my Xml layout not onlycontains that List. It also have some other elements like TextBox,labels, ImageButton at the top and bottom.   so when i scroll it upand animation starts it also draw elements on that Top Part(Whichcontains ImageButton and other stuff). so can some one tell me how cani remove it ? another issue is it do not have scrool bar. can some onetell me how can i add scroll bar in it ? </p>","512973","","244296","","2011-02-07 04:09:03","2011-02-07 04:31:22","overlapping problem in AdapterView","<android><android-ui>","1","0","0","",""
"4918079","1","","","2011-02-07 04:31:40","5","15775","<p>I'm new to android programming and what I'm trying to figure out is this;</p><p>In my layout i have a TextView, ImageView, and Button, all on a vertically oriented LinearLayout.</p><p>I want to be able to dynamically draw circles in the ImageView, without disturbing the rest of my layout(textview/button).  I'm trying to create a canvas, and use the drawcircle function within canvas to set the location of the circle.  And then draw that canvas to my imageview in some way.  I cannot get this to work, is there a trick to this? Or is my method fundamentally wrong?  How would i go about drawing circles to the ImageView without recreating my entire layout?  </p><p>Thanks!</p>","605933","","881229","","2014-01-31 03:51:06","2014-01-31 03:51:06","Android: Drawing a canvas to an ImageView","<android><imageview><android-canvas><draw>","3","0","","",""
"4918192","1","4941396","","2011-02-07 05:00:18","5","3310","<p>I'm writing a sports app that needs to track the elapsed time of quarter/half/period. Elapsed time needs to be accurate to the second.  The game clock needs to continue to run even if the user explicitly places the device in sleep mode by pressing the power button.</p><p>My first attempt at this involved using <strong>Handler.postDelayed()</strong> to trigger the clock ticks every 200ms and <strong>WindowManager.LayoutParms.FLAG_KEEP_SCREEN_ON</strong> to ensure that the ""clock"" wasn't stopped by a screen timeout.  But I soon learned that it was possible to circumvent this approach by pressing the power button to manually put the device to sleep.  In addition, the postDelayed() approach is experiencing some clock drift, apparently a result of the time spent in the run() method.  The actual numbers are still accurate, but instead of being aligned, for example, on 5 second boundaries which are easily understood by users - the timers involved start to drift, resulting in some understandable user confusion.</p><p>After a bit of research I found techiques for using services, <a href=""http://stackoverflow.com/questions/4597690/android-timer-how"">java timers</a>, <a href=""https://groups.google.com/forum/#!topic/android-developers/lH_T0O2HjGY"">AlarmManager</a>, and <a href=""http://developer.android.com/reference/android/os/PowerManager.html"">PartialWakeLock</a> to implement timers.  Services by themselves won't solve the problem associated with the device going to sleep.  Java timers, like services, don't solve the problem with the device going to sleep.  AlarmManager seems like a good approach, but I'm concerned that this isn't an appropriate use of AlarmManager (i.e., very short intervals between alarms).  Using PartialWakeLock also looks promising, but by itself it doesn't address the clock-drift problem I'm experiencing.</p><p>I'm going to try a combination of AlarmManager and PartialWakeLock.  The idea is that AlarmManager will help combat clock-drift and PartialWakeLock to help keep the code simple (fingers-crossed).  I'm hoping that this approach will result in a reasonable balance between power conservation, code complexity, and user expectations.  Any advice is greatly appreciated.</p><p>Thanks,</p><p>Rich</p>","550753","","","","","2011-02-09 04:47:04","Android timer that works when device is sleeping","<android><timer><clock><persistent><reliable>","1","1","3","",""
"4918235","1","4918531","","2011-02-07 05:11:05","0","1552","<p>In my application, I want to be able to send email.  I am able to send email with text.  However, I want to add attach file or photo from device memory in email. Does anybody have any ideas on how can I do this?</p>","472882","","1253219","","2012-09-27 20:35:15","2012-09-27 20:35:15","Android:Attach file with email from device memory","<android><email>","1","0","1","",""
"4918294","1","","","2011-02-07 05:23:47","0","1847","<p>I want to add more than one destination  keeping the same source and get route directions to all destinations in a single time...here is the source code i want to modify it <a href=""http://stackoverflow.com/questions/3896871/google-map-driving-direction-source-code-for-their-example/3898785#3898785"">Google map driving direction source code for their example ?</a> </p><p>please suggest me, thanks</p>","505580","","1677912","","2013-07-16 18:46:48","2013-07-25 22:44:17","Adding more than one destination on google map using googlemap javascript apiv3","<java><android><google-maps><map>","2","0","","",""
"4918306","1","4918340","","2011-02-07 05:26:26","0","242","<p>I need to develop the SMS based application. I want to read the new incoming SMS or existing inbox SMS after that I want to send the reply for that SMS. I know its not possible in j2me. But my question is which platform is support this type of functionality? Like Symbian c++, Android, blackberry or anything? </p>","488433","","488433","","2011-02-07 05:40:22","2011-02-28 15:49:02","Is it possible to send the reply after reading the new incoming SMS or inbox SMS?","<android><blackberry><java-me><mobile><symbian>","2","0","","",""
"4918370","1","","","2011-02-07 05:43:03","0","35","<p>HiIm unable to run my android application on real device ..while it was running perfectly on my emulator. showing an error ""java.net. network exception network unreahable"" while retriving details from database please help me out</p>","579515","","","","","2011-02-07 05:43:03","Im unable to run my android appln","<android>","0","3","","",""
"4918391","1","","","2011-02-07 05:46:17","0","225","<p><strong>MainActivity.java:</strong></p><pre><code>  public class MainActivity extends Activity {    @Override    protected void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        this.setTitle(R.string.app_name);                setContentView(new SampleView(this));    }  }</code></pre><p><strong>SampleView.java:</strong></p><pre><code>public class SampleView extends View {    @Override    protected void onDraw(Canvas canvas) {            if (certaincondition = true)            {                 add elements to canvas etc            }            else            {                  //How do I do the below? The layout is defined in xml.                   //I do not want to use Intent. Please help me                  create a layout from resource R.layout.idAbout and transfer control.            }         }}</code></pre>","605983","","50109","","2011-02-07 07:04:13","2011-02-07 07:04:13","creating a xml layout from a custom layout. is it possible?","<android><layout>","2","0","","",""
"4918548","1","6013922","","2011-02-07 06:16:28","1","1559","<p>I am going to place text in gallery in android app. The text is in a scrollView. Everything works fine but on draging the text towards right or left, no next page/ element shows (The screen remains still).If i have some thing outside the scrollView, it changes to the next element on dragging. </p><p>Can anyone help?</p>","298931","","290028","","2011-05-12 20:26:22","2011-05-16 06:35:45","Android: How do I place a ScrollView (with text in) into Gallery?","<android><android-layout><android-widget><scrollview><android-gallery>","3","0","","",""
"4918561","1","4918608","","2011-02-07 06:17:57","3","2320","<p>How I check the flash light available on device?also want to know how can I On/Off the flash light?  I have put the code but not working right now?  I search out this <br/>        <a href=""http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/2.2_r1.1/com/android/server/LightsService.java#LightsService"" rel=""nofollow"">http://gitorious.org/rowboat/frameworks-base/commit/eb9cbb8fdddf4c887004b20b504083035d57a15f</a><br/><a href=""http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/2.2_r1.1/com/android/server/LightsService.java#LightsService"" rel=""nofollow"">http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/2.2_r1.1/com/android/server/LightsService.java#LightsService</a></p><p>Please can tell which I should use?<br/>Thank You.</p>","256612","","","","","2012-12-22 11:46:37","Android: how to check the flash light is available on device?","<android>","2","1","","",""
"4918756","1","","","2011-02-07 06:57:04","1","1630","<p>I have implemented one basic android applicaiton.In which I want to using thread concept.</p><p>When application will open then one splash screen display for some time (3 seconds) and then open new view.</p><p>I know how to open next view but I dont know how to display splash screen for 3 seconds.</p><p>Pleas give me idea about that.</p><p>Thanks in advance.</p>","352707","","","","","2013-02-04 07:13:30","How to implement thread concept in Android application?","<android>","5","0","0","",""
"4918767","1","","","2011-02-07 06:58:24","0","2782","<p>i have this horizontal scroll view in my code. This horizontalscrollview has a series of imageviews in it. Whenever i swipe my finger and the scroll moves from one image to another, i need to find the index of the view now in focus.In short i need some way to identify which child element of the horizontalscrollview is in focus right now so that i can do stuff based on that.</p><p>thank you in advance.</p>","590849","","","","","2012-04-12 09:54:36","how to get index of the element in focus for a horizontal scrollview","<android><horizontalscrollview>","2","0","","",""
"4918780","1","4918818","","2011-02-07 07:00:26","0","118","<p>I saved the edittext value in the sqlite database and I want to view the data from the database in a textview or in a listview when clicking the button how it is possible??</p>","555910","","","","","2011-02-07 07:07:51","how to view a datas in table in android","<android><textview><edittext>","1","0","1","",""
"4918781","1","4918811","","2011-02-07 07:00:43","2","2652","<p>in my application, I have a class for UI staff, the name of which is ""SettingActivity"". </p><p>Then for doing some jobs in background, I bind this UI class(SettingActivity) to a Service. There are two predefined methods in that Service(defined in .aidl file), one is startTask(), the other one is stopTask().</p><p>Within startTask(), I made a call to an AsyncTask. But when I checked the name of the Looper of this AsyncTask. It is ""main"". In my opinion, <strong>an AsyncTask should start an another Thread other than the main Thread</strong>. </p><p>So does somebody know why this happens?  </p><p>The codes are as follows:<code></p><pre>@Override    protected void onPreExecute() {        super.onPreExecute();        Log.d(TAG, ""onPreExecute ""+Looper.myLooper().getThread().getName());    }</code></pre><p></p><p>Then I will get main as the output.</p>","453676","","453676","","2011-02-08 04:44:22","2011-02-08 04:50:06","Why does AsyncTask run in the main Thread of an application?","<android><multithreading><android-asynctask>","2","2","1","",""
"4918840","1","","","2011-02-07 07:11:55","0","2502","<p>I want to access Data/app folder, I use the following code:</p><pre><code>File fl = new File(""data/app/"");fl.list();</code></pre><p>but I get exception. May be it need some permission to read this folder list, can some one tell me which permission it need to read file in that folder.</p><p>Any help in this regar is higly appreciated, </p><p>thanks.</p>","575218","","222159","","2011-02-07 07:12:59","2013-01-11 19:46:44","How to access Data/app folder in android?","<android>","1","2","","",""
"4918844","1","4956001","","2011-02-07 07:12:42","3","498","<p>I have a relatively simple layout that contains an <code>EditText</code>. The activity itself uses the dialog theme. The dialog ends up being tiny, the edit text isn't even big enough to show the initial string.</p><p>I know that tiny dialogs are a common problem (IIRC Dianne mentioned that dialogs by default use wrap_content for the parent window), and a typical workaround is to force the dialog to be a certain size in <code>onCreate</code>. I prefer to fix this issue in the layout.</p><p>The idea was to give the EditText an <code>android:minEms</code> of 30 to give it a reasonable size (without being ridiculously huge on a tablet), but that seems to be ignored - the EditText (and dialog) is still tiny.</p><p>Side note - the dialog's height is too small too - the button at the bottom is half the size it should be.</p><p>Layout, for reference:</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/TextView01""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:text=""@string/title""        android:gravity=""center""    /&gt;    &lt;RelativeLayout        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        &gt;    &lt;ImageButton        android:id=""@+id/file_manager""        android:src=""@drawable/ic_launcher_folder_small""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:layout_alignParentRight=""true""        android:onClick=""pickFile""      /&gt;      &lt;EditText android:id=""@+id/file""            android:text=""@string/default_file""            android:inputType=""text""            android:minEms=""30""            android:layout_toLeftOf=""@+id/file_manager""            android:layout_height=""wrap_content""            android:layout_width=""fill_parent""        /&gt;    &lt;/RelativeLayout&gt;    &lt;Button        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:id=""@+id/action""        android:onClick=""performAction""        android:text=""@string/action""&gt;    &lt;/Button&gt;&lt;/LinearLayout&gt;</code></pre>","345717","","","","","2011-02-10 10:35:50","android:minEms is ignored in dialog-themed activities","<android><android-layout><android-edittext>","1","0","","",""
"4918881","1","4926370","","2011-02-07 07:17:51","10","15961","<p>I am using phonegap for build android apps.</p><p>I would like to detect user's gesture such as a user's swipe. Is there an event i can call  from javascript?</p><p>Thanks!</p>","502963","","","","","2013-09-17 10:03:12","Detect user's gesture such as swipe","<javascript><android><phonegap><gesture-recognition>","4","0","3","",""
"4919006","1","4919028","","2011-02-07 07:43:10","0","139","<p>What happend when user switch applications and go back?What events are being involved with this process?Thanks,Eyal.</p>","341497","","","","","2011-02-07 07:46:48","android what event thrown and user switch applications?","<android><events><activity>","1","0","","",""
"4919016","1","4919074","","2011-02-07 07:45:14","2","1216","<p><strong>I want to show a Javascipt ad* on top of my Android application.</strong> Please help me with sample code. No help found on internet. Similar type of question asked in <a href=""https://groups.google.com/forum/?fwc=1#!topic/android-developers/0dbOPwjQhhc"" rel=""nofollow"">here</a> too.</p><p>*Javascript Ad example:</p><pre><code>&lt;script type=""text/javascript""&gt;&lt; window.googleAfmcRequest = {   client: 'ca-mb-pub-7387556283738751',   ad_type: 'text_image',   output: 'html',   channel: '',   format: '320x50_mb',   oe: 'utf8',   color_border: '336699',   color_bg: 'FFFFFF',   color_link: '0000FF',   color_text: '000000',   color_url: '008000', }; &gt;&lt;/script&gt; &lt;script type=""text/javascript""    src=""http://pagead2.googlesyndication.com/pagead/show_afmc_ads.js (this link goes outside odesk.com)""&gt;&lt;/script&gt;</code></pre>","606075","","1131435","","2013-04-13 00:36:40","2013-04-13 00:36:40","How to add Javascript ad in my Android application","<javascript><android><webview><ads>","1","0","","",""
"4919063","1","","","2011-02-07 07:52:03","3","751","<p>Is it possible to preserve ExpandableListView's default list item press behavior when supplying a group view that contains more than just a TextView.  The behavior I'm referring to is where the item being pressed changes background color to yellow. </p><p>Every time I supply a group view that contains e.g. a TextView and a Button, I lose the behavior.</p><p>Thanks!</p>","369722","","369722","","2011-02-07 08:34:31","2011-04-06 13:45:23","How can ExpandableListView's default list item press behavior be preserved when supplying a group view that contains more than just a TextView?","<android><view><group><expandablelistview>","2","0","0","",""
"4919084","1","4919184","","2011-02-07 07:55:18","4","4543","<p>In logcat I found these messages, my application runs correctly (No error/ No exception/ and correct result), but why these messages appears in log cat. I closed all cursors. And one more thing, Application goes a little bit slow to displaying activity( Which activity is listed in my logcat message), I think it takes that time to generate these log messages. What is solution for this.</p><pre><code>I/ActivityManager(   63): Starting activity: Intent { cmp=com.pankaj.myapp/.SelectedContactActivity (has extras) }    D/dalvikvm(  251): GC freed 2584 objects / 174064 bytes in 139ms    I/dalvikvm(  251): Uncaught exception thrown by finalizer (will be discarded):    I/dalvikvm(  251): Ljava/lang/IllegalStateException;: Finalizing cursor android.database.sqlite.SQLiteCursor@43d2c688 on contacts_tags that has not been deactivated or closed    I/dalvikvm(  251):  at android.database.sqlite.SQLiteCursor.finalize(SQLiteCursor.java:596)    I/dalvikvm(  251):  at dalvik.system.NativeStart.run(Native Method)    I/dalvikvm(  251): Uncaught exception thrown by finalizer (will be discarded):    I/dalvikvm(  251): Ljava/lang/IllegalStateException;: Finalizing cursor android.database.sqlite.SQLiteCursor@43d2bf58 on contacts_tags that has not been deactivated or closed    I/dalvikvm(  251):  at android.database.sqlite.SQLiteCursor.finalize(SQLiteCursor.java:596)    I/dalvikvm(  251):  at dalvik.system.NativeStart.run(Native Method)    I/dalvikvm(  251): Uncaught exception thrown by finalizer (will be discarded):    I/dalvikvm(  251): Ljava/lang/IllegalStateException;: Finalizing cursor android.database.sqlite.SQLiteCursor@43d2b5a8 on contacts_tags that has not been deactivated or closed    I/dalvikvm(  251):  at android.database.sqlite.SQLiteCursor.finalize(SQLiteCursor.java:596)    I/dalvikvm(  251):  at dalvik.system.NativeStart.run(Native Method)    I/dalvikvm(  251): Uncaught exception thrown by finalizer (will be discarded):    I/dalvikvm(  251): Ljava/lang/IllegalStateException;: Finalizing cursor android.database.sqlite.SQLiteCursor@43d29af0 on contacts_tags that has not been deactivated or closed    I/dalvikvm(  251):  at android.database.sqlite.SQLiteCursor.finalize(SQLiteCursor.java:596)    I/dalvikvm(  251):  at dalvik.system.NativeStart.run(Native Method)    I/dalvikvm(  251): Uncaught exception thrown by finalizer (will be discarded):    I/dalvikvm(  251): Ljava/lang/IllegalStateException;: Finalizing cursor android.database.sqlite.SQLiteCursor@43d293c0 on contacts_tags that has not been deactivated or closed    I/dalvikvm(  251):  at android.database.sqlite.SQLiteCursor.finalize(SQLiteCursor.java:596)    I/dalvikvm(  251):  at dalvik.system.NativeStart.run(Native Method)    I/dalvikvm(  251): Uncaught exception thrown by finalizer (will be discarded):    I/dalvikvm(  251): Ljava/lang/IllegalStateException;: Finalizing cursor android.database.sqlite.SQLiteCursor@43d28a28 on contacts_tags that has not been deactivated or closed    I/dalvikvm(  251):  at android.database.sqlite.SQLiteCursor.finalize(SQLiteCursor.java:596)    I/dalvikvm(  251):  at dalvik.system.NativeStart.run(Native Method)    I/dalvikvm(  251): Uncaught exception thrown by finalizer (will be discarded):    I/dalvikvm(  251): Ljava/lang/IllegalStateException;: Finalizing cursor android.database.sqlite.SQLiteCursor@43d26f70 on contacts_tags that has not been deactivated or closed    I/dalvikvm(  251):  at android.database.sqlite.SQLiteCursor.finalize(SQLiteCursor.java:596)    I/dalvikvm(  251):  at dalvik.system.NativeStart.run(Native Method)    I/dalvikvm(  251): Uncaught exception thrown by finalizer (will be discarded):    I/dalvikvm(  251): Ljava/lang/IllegalStateException;: Finalizing cursor android.database.sqlite.SQLiteCursor@43d26808 on contacts_tags that has not been deactivated or closed    I/dalvikvm(  251):  at android.database.sqlite.SQLiteCursor.finalize(SQLiteCursor.java:596)    I/dalvikvm(  251):  at dalvik.system.NativeStart.run(Native Method)    I/dalvikvm(  251): Uncaught exception thrown by finalizer (will be discarded):    I/dalvikvm(  251): Ljava/lang/IllegalStateException;: Finalizing cursor android.database.sqlite.SQLiteCursor@43d25e60 on contacts_tags that has not been deactivated or closed    I/dalvikvm(  251):  at android.database.sqlite.SQLiteCursor.finalize(SQLiteCursor.java:596)    I/dalvikvm(  251):  at dalvik.system.NativeStart.run(Native Method)    I/dalvikvm(  251): Uncaught exception thrown by finalizer (will be discarded):    I/dalvikvm(  251): Ljava/lang/IllegalStateException;: Finalizing cursor android.database.sqlite.SQLiteCursor@43d24310 on contacts_tags that has not been deactivated or closed    I/dalvikvm(  251):  at android.database.sqlite.SQLiteCursor.finalize(SQLiteCursor.java:596)    I/dalvikvm(  251):  at dalvik.system.NativeStart.run(Native Method)    I/dalvikvm(  251): Uncaught exception thrown by finalizer (will be discarded):    I/dalvikvm(  251): Ljava/lang/IllegalStateException;: Finalizing cursor android.database.sqlite.SQLiteCursor@43d23be0 on contacts_tags that has not been deactivated or closed    I/dalvikvm(  251):  at android.database.sqlite.SQLiteCursor.finalize(SQLiteCursor.java:596)    I/dalvikvm(  251):  at dalvik.system.NativeStart.run(Native Method)    I/dalvikvm(  251): Uncaught exception thrown by finalizer (will be discarded):    I/dalvikvm(  251): Ljava/lang/IllegalStateException;: Finalizing cursor android.database.sqlite.SQLiteCursor@43d23238 on contacts_tags that has not been deactivated or closed    I/dalvikvm(  251):  at android.database.sqlite.SQLiteCursor.finalize(SQLiteCursor.java:596)    I/dalvikvm(  251):  at dalvik.system.NativeStart.run(Native Method)    I/dalvikvm(  251): Uncaught exception thrown by finalizer (will be discarded):    I/dalvikvm(  251): Ljava/lang/IllegalStateException;: Finalizing cursor android.database.sqlite.SQLiteCursor@43d21780 on contacts_tags that has not been deactivated or closed    I/dalvikvm(  251):  at android.database.sqlite.SQLiteCursor.finalize(SQLiteCursor.java:596)    I/dalvikvm(  251):  at dalvik.system.NativeStart.run(Native Method)    I/dalvikvm(  251): Uncaught exception thrown by finalizer (will be discarded):    I/dalvikvm(  251): Ljava/lang/IllegalStateException;: Finalizing cursor android.database.sqlite.SQLiteCursor@43d21028 on contacts_tags that has not been deactivated or closed    I/dalvikvm(  251):  at android.database.sqlite.SQLiteCursor.finalize(SQLiteCursor.java:596)    I/dalvikvm(  251):  at dalvik.system.NativeStart.run(Native Method)    I/dalvikvm(  251): Uncaught exception thrown by finalizer (will be discarded):    I/dalvikvm(  251): Ljava/lang/IllegalStateException;: Finalizing cursor android.database.sqlite.SQLiteCursor@43d20688 on contacts_tags that has not been deactivated or closed    I/dalvikvm(  251):  at android.database.sqlite.SQLiteCursor.finalize(SQLiteCursor.java:596)    I/dalvikvm(  251):  at dalvik.system.NativeStart.run(Native Method)    I/dalvikvm(  251): Uncaught exception thrown by finalizer (will be discarded):    I/dalvikvm(  251): Ljava/lang/IllegalStateException;: Finalizing cursor android.database.sqlite.SQLiteCursor@43d1ebd0 on contacts_tags that has not been deactivated or closed    I/dalvikvm(  251):  at android.database.sqlite.SQLiteCursor.finalize(SQLiteCursor.java:596)    I/dalvikvm(  251):  at dalvik.system.NativeStart.run(Native Method)    I/dalvikvm(  251): Uncaught exception thrown by finalizer (will be discarded):    I/dalvikvm(  251): Ljava/lang/IllegalStateException;: Finalizing cursor android.database.sqlite.SQLiteCursor@43d1e480 on contacts_tags that has not been deactivated or closed    I/dalvikvm(  251):  at android.database.sqlite.SQLiteCursor.finalize(SQLiteCursor.java:596)    I/dalvikvm(  251):  at dalvik.system.NativeStart.run(Native Method)    I/dalvikvm(  251): Uncaught exception thrown by finalizer (will be discarded):    I/dalvikvm(  251): Ljava/lang/IllegalStateException;: Finalizing cursor android.database.sqlite.SQLiteCursor@43d1dae0 on contacts_tags that has not been deactivated or closed    I/dalvikvm(  251):  at android.database.sqlite.SQLiteCursor.finalize(SQLiteCursor.java:596)    I/dalvikvm(  251):  at dalvik.system.NativeStart.run(Native Method)    I/dalvikvm(  251): Uncaught exception thrown by finalizer (will be discarded):    I/dalvikvm(  251): Ljava/lang/IllegalStateException;: Finalizing cursor android.database.sqlite.SQLiteCursor@43d1bfa0 on contacts_tags that has not been deactivated or closed    I/dalvikvm(  251):  at android.database.sqlite.SQLiteCursor.finalize(SQLiteCursor.java:596)    I/dalvikvm(  251):  at dalvik.system.NativeStart.run(Native Method)    I/dalvikvm(  251): Uncaught exception thrown by finalizer (will be discarded):    I/dalvikvm(  251): Ljava/lang/IllegalStateException;: Finalizing cursor android.database.sqlite.SQLiteCursor@43d1b760 on contacts_tags that has not been deactivated or closed    I/dalvikvm(  251):  at android.database.sqlite.SQLiteCursor.finalize(SQLiteCursor.java:596)    I/dalvikvm(  251):  at dalvik.system.NativeStart.run(Native Method)    I/dalvikvm(  251): Uncaught exception thrown by finalizer (will be discarded):    I/dalvikvm(  251): Ljava/lang/IllegalStateException;: Finalizing cursor android.database.sqlite.SQLiteCursor@43d1ac40 on contacts_tags that has not been deactivated or closed    I/dalvikvm(  251):  at android.database.sqlite.SQLiteCursor.finalize(SQLiteCursor.java:596)    I/dalvikvm(  251):  at dalvik.system.NativeStart.run(Native Method)    I/ActivityManager(   63): Displayed activity com.pankaj.myapp/.SelectedContactActivity: 2245 ms (total 2245 ms)</code></pre><p>Caller Activity is using List View, And after clicking of list item ""SelectedContactActivity"" activity calls.</p><p><strong>In caller Activity</strong></p><pre><code>public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.contacts_list_item);        SimpleAdapter contactAdapter = getAdapter(); // This method returns SimpleAdapter object        // Bind to our new adapter.       setListAdapter(contactAdapter);    }protected void onListItemClick(ListView l, View view, int position, long id) {        super.onListItemClick(l, view, position, id);        Intent intent = new Intent().setClass(this, AddModifyTag.class);        intent.putExtra(""_id"",contactInfo.get(""_id""));        intent.putExtra(""name"", contactInfo.get(""name""));        intent.putExtra(""number"", contactInfo.get(""number""));        intent.putExtra(""position"", position);        this.startActivityForResult(intent, EDIT_CONTACT_TAGS);    }</code></pre><p><strong>On called Activity</strong></p><pre><code>public void onCreate(Bundle savedInstanceState) {            super.onCreate(savedInstanceState);............        Cursor tags;        db.open();        tags = db.getContactTags(contactID);        startManagingCursor(tags);        .......        .......        db.close();}</code></pre>","550966","","550966","","2011-02-07 09:09:25","2011-02-07 09:09:25","Uncaught exception thrown by finalizer (will be discarded) , Android","<android><android-logcat>","1","4","1","",""
"4919169","1","","","2011-02-07 08:10:43","1","1493","<p>I have invoked the built-in Camera application in android 2.1 using intent. I've used the following code:</p><pre><code>Intent cameraintent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);File file = new File(Environment.getExternalStorageDirectory(), ""MyTestFile.jpg"");cameraintent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(file));outputFileUri = Uri.fromFile(file);startActivityForResult(cameraintent, CAMERA_PIC_REQUEST);</code></pre><p>To get the orientation of the captured image I've used the following code:</p><pre><code>Uri capturedImage = outputFileUri;Bitmap theBmp = MediaStore.Images.Media.getBitmap(getContentResolver(), capturedImage);int img_orient=0;                       String[] projection = { MediaStore.Images.Media.ORIENTATION };Cursor mImageCursor = managedQuery(capturedImage, projection, null, null, null);</code></pre><p>I am not able to get the orientation of captured photo as the cursor <code>mImageCursor</code> is always null. What is problem in my code?</p>","525004","","","","","2011-05-25 13:15:05","Orientation of captured image using built-in Camera application","<android><image><camera><orientation><android-camera-intent>","1","0","1","",""
"4919254","1","4919316","","2011-02-07 08:28:03","0","2050","<p>I have an Android application which is a tab layout and contains 3 tabs. There is a button in the first tab, which when clicked should go to the second tab. Also the second tab contains a back button which when clicked should go to the first tab. How to do this? Actually it should work like clicking on the tabs. Please help at the earliest.</p>","536091","","","","","2011-02-07 08:37:33","Click a button to go next tab in Android","<android>","2","0","2","",""
"4919320","1","","","2011-02-07 08:38:31","0","189","<p>I've seen and built many examples of GET and POST requests using REST, but I have had trouble figuring out how to get something based on what I post.</p><p>To be specific, I am creating a Android app, and for this I'm trying to create a system in which a user can recover his or her account settings and have them written back to the SharedPrefs (If you aren't familiar with this don't worry).</p><p>So yea, I'm calling a method which queries a MySQL DB and is supposed to return things such as the user's name if their username and password match one in the database.</p><pre><code>if (isset($_POST['username'])) {    $username = $_POST['username'];}if (isset($_POST['password'])) {    $password = $_POST['password'];}$password = md5(password);$connect = mysql_connect(""localhost"", ""root"", """");mysql_select_db(""TagDB"");$query = mysql_query(""SELECT * FROM tagusers WHERE username = '$username' AND password = '$password'"");while ($e = mysql_fetch_assoc($query)) {    $output[] = $e;}if (isset($output)) {    print json_encode($output);}mysql_close();</code></pre><p>As you can see, I'm attempting to recover the row if there is a username/password match. However, I don't really have means to access that print json_encode($output); line because I'm doing a POST request, not send. I tried accessing the a result string from a response handler in the Java code, but that only returns a mess of html. I've looked online but haven't found anything explaining this... whether that's me not wording what I want clearly or just a lack of info, I don't know. Anyways if anyone could point me in the right direction I'd really appreciate it, thanks!</p>","588758","","","","","2011-02-07 08:38:31","POSTing via REST and GETting something back... is this possible?","<php><android><mysql><rest>","0","6","","",""
"4919328","1","6136997","","2011-02-07 08:39:25","1","2013","<p>In my code i m trying to find the height the textview occupies..</p><pre><code>public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    t = new TextView(this);    ViewTreeObserver vto = t.getViewTreeObserver();     vto.addOnGlobalLayoutListener(this);    t.setText(""This is to test the text\n Some Text \n Another .."");    t.append(""\nafter something"");    Toast.makeText(this, "" The value at num = ""+num,Toast.LENGTH_SHORT).show();    setContentView(t);}public void onGlobalLayout() {    // TODO Auto-generated method stub    num=t.getHeight();    Toast.makeText(this, ""Hellooo !! height is ""+num, Toast.LENGTH_SHORT).show();}</code></pre><p>The value of num in onCreate() is always zero but atlast in the onGlobalLayout() , the correct height is getting stored in num but i cant use it because it is the end of the application ..Is there any possibility of getting the text length in the middle of the application ?</p><p>Forgive, if there are any mistakes in the above problem..</p><p>Thanks,Siva Kuamr</p>","598331","","","","","2011-05-26 10:19:34","Android : Problem with OnGlobalLayout","<java><android><textview>","1","1","","",""
"4919333","1","","","2011-02-07 08:40:28","0","240","<p>Can anybody help me that how to use web services to access google map for android?I am not gettng the approach to access web services.</p>","602629","","","","","2011-02-07 08:40:28","android webservices","<android><web-services>","0","2","","",""
"4919444","1","4922014","","2011-02-07 08:56:47","0","1228","<p>I am not able to get the IP address... Is it the right way to get the IP Address of all the access points by scanning through wifi ?   </p><pre><code>public void onReceive(Context context, Intent intent) {        // TODO Auto-generated method stub        List&lt;ScanResult&gt; results = wifiDemo.wifi.getScanResults();        ScanResult bestSignal = null;        for (ScanResult result : results) {        }        try {            for (Enumeration&lt;NetworkInterface&gt; en = NetworkInterface.getNetworkInterfaces(); en.hasMoreElements();){                NetworkInterface intf = en.nextElement();                for (Enumeration&lt;InetAddress&gt; enumIpAddr = intf.getInetAddresses(); enumIpAddr.hasMoreElements();){                    InetAddress inetAddress = enumIpAddr.nextElement();                    if (!inetAddress.isLoopbackAddress()) {                        Toast.makeText(wifiDemo, TAG + ""IP "" + inetAddress.getHostAddress().toString(), Toast.LENGTH_LONG).show();                    }                }            }        } catch (SocketException e) {            e.printStackTrace();        }    }</code></pre>","448005","","68805","","2011-06-02 14:00:51","2011-06-02 14:00:51","How can i get all the ip address of access points in the wifi ? Android","<android><wifi>","2","1","","",""
"4919506","1","","","2011-02-07 09:05:26","1","6274","<p>Right now I am trying to connect to Samsung Captivate. I see the device, but adb devices shows and empty list.  Debugging in Eclipse I cannot see the device.  I see it in the Windows 7 device list however.  phone says connected.  But adb devices does not list anything. What else do I need to do?</p>","602260","","","","","2013-04-25 06:40:34","Android USB to Samsung Eclipse Cannot Connect","<android><eclipse><usb><connect>","3","0","","",""
"4919532","1","","","2011-02-07 09:09:04","4","1339","<p>I want to save the state (ie. content) of spinner tied to an Adapter when chnaging the orientation. I am using onSaveInstanceState(Bundle savedInstanceState) and onRestoreInstanceState(Bundle savedInstanceState) method . Will u give the step by step process how to save the content?</p><p>Thanx</p>","524017","","","","","2011-03-03 00:25:26","How to save the state of Spinner in onSaveInstanceState when changing the orientation in android","<android>","1","0","3","",""
"4919577","1","4919978","","2011-02-07 09:14:18","1","469","<p>Currently i am having listview with multiple items (First time, i fetch data with the use of AsyncTask), now i want to implement the below functionalities:</p><p>I am showing Option Dialog(With options Edit, Delete, Read) whenever user do long-click  on any item, now if user select ""Delete"" option, at that time i want to remove item from the listview, listview should be displayed without that item meanwhile the data should also be fetched(in background) from the web.</p><p>Anybody knows, how do i implement such?</p>","379693","","","","","2011-02-07 10:03:27","Listview - list items updated with fetched data in background","<android>","3","0","1","",""
"4919578","1","4922600","","2011-02-07 09:14:23","1","1135","<p>I am trying to not to propagate an sms upon receiving like this</p><pre><code>public class SMSReceiver extends BroadcastReceiver {@Override    public void onReceive(Context context, Intent intent) {        abortBroadcast();        setResultData(null);    }}</code></pre><p>AndroidManifest.xml</p><pre><code>&lt;receiver android:name="".SMSReceiver"" android:enabled=""true"" android:priority = ""100"" &gt;          &lt;intent-filter&gt;            &lt;action android:name=""android.provider.Telephony.SMS_RECEIVED"" /&gt;          &lt;/intent-filter&gt;        &lt;/receiver&gt;</code></pre><p>but this is not working. I have been looking for a fix for days now. any help is highly appreciated.</p><p>Thanks</p>","192901","","192901","","2011-02-07 09:45:30","2012-09-28 09:24:45","stop SMS propagation","<android>","1","2","0","",""
"4919669","1","","","2011-02-07 09:25:02","1","3805","<p>I have this piece of code in onCreate():</p><pre><code>try{    Log.i(""onCreate"",""Trying to open database..."");    orgi = this.openOrCreateDatabase(""orgi"", MODE_PRIVATE, null);    Log.i(""onCreate"",""database opened."");    cursor = orgi.rawQuery(""SELECT name from profile;"",null);    Log.i(""onCreate"",""successfully done with query.."");    adapter = new SimpleCursorAdapter(this,R.layout.profilelistrow,cursor,             new String[]{""name""},new int[] {R.id.profileListRowTV1});    Log.i(""onCreate"",""Adapter done"");    ll.setAdapter(adapter);}catch (SQLException e){    displayError(e.toString());}</code></pre><p>I'm supposed to populate the customlistview with data from the SQLite database. But then it gives me a force close right at this line:</p><pre><code>adapter = new SimpleCursorAdapter(this,R.layout.profilelistrow,cursor,             new String[]{""name""},new int[] {R.id.profileListRowTV1});</code></pre><p>Can somebody tell me what is wrong? I'm pretty ignorant with the simple cursor adapter (due to my noobness in android)... R.layout.profilelistrow is my layout for the entire screen, while profileListRowTV1 is the textview where the ""name"" will be inserted. Please educate me on this... What am I doing wrong?</p>","606178","","","","","2013-03-07 05:15:48","populating custom listview from SQLite database","<android><sqlite><listview>","2","1","","",""
"4919676","1","","","2011-02-07 09:25:59","0","4091","<p>I have a little problem; I hope you can help me.While progressDialog is running, the user presses the BACK Button.  The current Activity progressDialog goes to Background, but progressDialog is running.</p><p>My problem is that when the user clicks on the BACK button, progressDialog should be foreground Activity, stop current progress and ask ""Do you want to continue or exit?""</p><p>If the user presses Continue, progressDialog should continue the remaining work.</p><p>Otherwise, close the current activity.</p><p>CODE HERE:</p><pre><code>public class SampleExample extends Activity {    static final int PROGRESS_DIALOG = 0;    Button button;    TextView download;    ProgressThread progressThread;    ProgressDialog progressDialog;public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    download = (TextView) findViewById(R.id.download);    button = (Button) findViewById(R.id.progressDialog);    button.setOnClickListener(new OnClickListener() {        public void onClick(View v) {            showDialog(PROGRESS_DIALOG);        }    });}@Overridepublic boolean onKeyDown(int keyCode, KeyEvent event) {    // Handle the back button    if (keyCode == KeyEvent.KEYCODE_BACK) {        // Ask the user if they want to quit        new AlertDialog.Builder(this).setIcon(                android.R.drawable.ic_dialog_alert).setTitle(""Exit"")                .setMessage(""Are you sure you want to leave?"")                .setNegativeButton(android.R.string.cancel, null)                .setPositiveButton(android.R.string.ok,                        new DialogInterface.OnClickListener() {                            public void onClick(DialogInterface dialog,                                    int which) {                                // Exit the activity                                SampleExample.this.finish();                            }                        }).show();        // Say that we've consumed the event        return true;    }    return super.onKeyDown(keyCode, event);}protected Dialog onCreateDialog(int id) {    switch (id) {    case PROGRESS_DIALOG:        progressDialog = new ProgressDialog(SampleExample.this);        progressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);        progressDialog.setMessage(""Loading..."");        download.setText(""Now downloading......."");        progressThread = new ProgressThread(handler);        progressThread.start();        progressDialog.setCancelable(true);        return progressDialog;    default:        return null;    }}// Define the Handler that receives messages from the thread and update the// progressfinal Handler handler = new Handler() {    public void handleMessage(Message msg) {        int total = msg.getData().getInt(""total"");        progressDialog.setProgress(total);        if (total &gt;= 100) {            download.setText("" download is completed."");            dismissDialog(PROGRESS_DIALOG);            progressThread.setState(ProgressThread.STATE_DONE);        }    }};/** Nested class that performs progress calculations (counting) */private class ProgressThread extends Thread {    Handler mHandler;    final static int STATE_DONE = 0;    final static int STATE_RUNNING = 1;    int mState;    int total;    ProgressThread(Handler h) {        mHandler = h;    }    public void run() {        mState = STATE_RUNNING;        total = 0;        while (mState == STATE_RUNNING) {            try {                Thread.sleep(100);            } catch (InterruptedException e) {                Log.e(""ERROR"", ""Thread Interrupted"");            }            Message msg = mHandler.obtainMessage();            Bundle b = new Bundle();            b.putInt(""total"", total);            msg.setData(b);            mHandler.sendMessage(msg);            total++;        }        Log.d(""SampleExample"", ""6666 run () 6666 End"");    }    /*     * sets the current state for the thread, used to stop the thread     */    public void setState(int state) {        mState = state;    }}</code></pre><p>}</p>","606052","","429108","","2012-10-05 17:55:27","2013-03-24 16:46:32","BACK Button is not working ,while progressDialog is running","<android><android-emulator><android-layout>","4","1","1","",""
"4919685","1","4920186","","2011-02-07 09:27:16","1","1499","<p>I need to make a <code>ListView</code> with this specific attributes:</p><p>1) Every row has a <code>CheckBox</code> on the left and a <code>Spinner</code> on the right;</p><p>2) The <code>Spinner</code> is active and selectable of and only if the correlated <code>CheckBox</code> is checked.</p><p>I've managed to achieve (1) using a <code>SimpleAdapter</code> and a <code>ViewBinder</code>.</p><p>I'm also able to put a <code>onClickListener</code> to every <code>CheckBox</code> using the <code>ViewBinder</code>, like this:</p><pre><code>myCheckBox.setOnClickListener(new View.OnClickListener() {    @Override        public void onClick(View v) {        if (myCheckBox.isChecked()) //call the ""enable spinner"" function;    }});</code></pre><p>The problem is that I don't know how to find the right <code>Spinner</code> from the ""enable spinner"" function. What is the best way to achieve this?</p>","396133","","493939","","2012-06-02 16:14:25","2012-06-02 16:14:25","Custom ListView with a Checkbox and a Spinner","<android><checkbox><android-listview><android-spinner>","1","2","","",""
"4919696","1","4919707","","2011-02-07 09:29:01","2","221","<p>I am very new to android development.... i have created an app and want to store it in my android mobile. But normally all apps gets stored in mobile memory and it now shows no space so i want to store it in my SD card. Pls get me a solution for this issue....</p>","596364","","","","","2011-02-07 10:39:02","How to store App in SDcard","<java><android><mobile>","1","0","2","",""
"4919703","1","4919836","","2011-02-07 09:29:41","28","16855","<p>How to set property ""<code>android:drawableTop</code>"" of a button at runtime</p>","301549","","213269","","2011-02-07 09:33:33","2014-01-02 08:04:05","How to set property ""android:drawableTop"" of a button at runtime","<android><layout>","6","0","6","",""
"4919714","1","4920827","","2011-02-07 09:31:12","2","876","<p>I have a CSV file which contains around 1200 rows. I was trying to insert it into sqlite db. Around 300 rows only got inserted. Rest didnt...Is there any max limit on no:of rows in a table while using sqlite?</p>","504162","","","","","2012-07-12 06:13:58","is there any max limit for no:of rows while using sqlite?","<android>","3","2","","",""
"4919740","1","","","2011-02-07 09:33:43","5","4259","<p>I'm trying to store objects of Android.graphics.Path in internal device memory. Does anyone know how to serialize a android.graphics.Path object? And also, is there any other way of storing a Path object? Thanks. </p>","556555","","","","","2011-12-02 11:54:43","how to serialize an object of android.graphics.Path","<android><serialization><memory><path><internal>","3","0","2","",""
"4919988","1","4920065","","2011-02-07 10:05:34","2","561","<p>I would like to know if it is possible to listen out for key presses on the android keyboard. So when a letter is pressed then I can update a TextView when the key is released in realtime. I want to be able to show the word in reverse so to store each character in an array the append this back in reverse for the textView. </p><p>So can it be done, to set and onKeyListener maybe for the keyboard? or another way?</p>","400406","","372239","","2014-01-04 15:40:12","2014-01-04 15:40:12","Realtime text input parsing android keyboard","<java><android><text><keyboard>","1","0","","",""
"4919996","1","4922859","","2011-02-07 10:06:37","0","2681","<p>I have a package which just includes and xsd file to generate (via JAXB) shared classes which are relevant for our server and client applications. So these classes contain XML annotations.</p><p>One client is an Android App. I also want to use these classes here for JSON deserialization because I communicate with a REST service which delivers JSON (with Jersey/<a href=""http://jackson.codehaus.org/"" rel=""nofollow"">Jackson</a>).</p><p>I try to use <a href=""http://jackson.codehaus.org/"" rel=""nofollow"">Jackson</a> (version 1.7.2) on the Android like this:</p><pre><code>ObjectMapper mapper = new ObjectMapper();mapper = mapper.configure(DeserializationConfig.Feature.USE_ANNOTATIONS,                false);mapper = mapper.configure(SerializationConfig.Feature.USE_ANNOTATIONS,                false);FooBar someObject = (FooBar) mapper.readValue(jsonString, FooBar.class);</code></pre><p>I though configure the MAPPER should avoid using annotations but I still get </p><pre><code>02-07 09:30:18.631: ERROR/AndroidRuntime(447): java.lang.NoClassDefFoundError: javax.xml.bind.annotation.XmlAccessorType02-07 09:30:18.631: ERROR/AndroidRuntime(447):     at java.lang.Class.getDeclaredAnnotations(Native Method)02-07 09:30:18.631: ERROR/AndroidRuntime(447):     at org.codehaus.jackson.map.introspect.AnnotatedClass.resolveClassAnnotations(AnnotatedClass.java:292)02-07 09:30:18.631: ERROR/AndroidRuntime(447):     at org.codehaus.jackson.map.introspect.AnnotatedClass.construct(AnnotatedClass.java:139)</code></pre><p>Who knows the trick to stop Jackson from resolving annotations.</p><p>Thanks  Klaus</p>","367285","","","","","2011-08-10 15:36:24","Use Jackson JSON processor without using annotations","<android><json><jackson>","2","2","1","",""
"4920066","1","4920992","","2011-02-07 10:13:55","11","6917","<p>i want to use c/cpp functions/library in android application using jni.   any suggestion / links / tutorials /example ?</p><p>my problem with pointer/stucture return in c/cpp. how to use pointer/stucture in android ?</p><p>actually i am trying to developed remote desktop application  through that i am able to access my pc in android.</p>","489902","","","","","2011-02-07 11:52:16","how to use c/cpp library/functions in android","<c++><android><c><jni>","2","1","5","",""
"4920119","1","4920330","","2011-02-07 10:20:21","0","335","<p>I wanna create an application where when i open a PDF to a particular page and a zoom position. i should be able to share the same to another client. </p><p>It will be Android Tablet with a Webserver to support it. </p><p>Can someone guide me how to do it ?</p>","155196","","","","","2011-02-07 10:43:27","PDF Sharing on a Android Client","<android><web-services><pdf>","1","0","","",""
"4920192","1","6111318","","2011-02-07 10:28:35","2","1458","<p>I am new in Android Programming and I am  trying to include GTalk application inside my application. I am trying to use XMPP server but it is not working. How can I add GTalk to my app?</p>","606238","","623518","","2012-07-03 12:37:53","2012-07-03 12:39:46","Embed Google talk inside Android application","<android>","1","0","","",""
"4920228","1","4920303","","2011-02-07 10:31:54","1","1063","<p>I have a product number which I would like to format using a mask.</p><p>Example:</p><pre><code>String productNumber = ""0913014316"";String mask = ""XX.XXX.XXX.XXX"";</code></pre><p>How do I get this following output: <code>09.13.014.316</code>?</p><p>Can I use <code>String.format()</code>? Or maybe something else on the Android?</p><p>Thank you</p>","574243","","372239","","2014-01-04 15:43:22","2014-01-04 15:43:22","Android - Format string with mask","<java><android><string><text><format>","1","0","","",""
"4920260","1","4920352","","2011-02-07 10:35:35","0","263","<p>Tts.java</p><pre><code>public void onInit(int arg0) {    Bundle dataBundle = Tts.this.getIntent().getExtras();    speech = dataBundle.getString(""IMSENS"");    tts.setLanguage(Locale.ENGLISH);    tts.speak(speech, TextToSpeech.QUEUE_FLUSH, null); }</code></pre><p>Im_SensShow.java</p><pre><code>public class Im_SensShow extends ListActivity {    public void buttonGetClicked(View v){    Cursor cc = cursor;    Intent showSound = new Intent(Im_SensShow.this,Tts.class);    Bundle dataBundle = new Bundle();    dataBundle.putString(""IMSENS"",cc.getString(cc.getColumnIndexOrThrow(DBAdapter.KEY_IM_SENS)));    showSound.putExtras(dataBundle);    startActivityForResult(showSound,1);}</code></pre><p>I set tts to read a sentece from Im_SensShow.java and when I press the button in Im_SensShow.java page this progarm change to tts page and make sound </p><p>but actually I want it to send only sentence and doesn't change page (stay in Im_SensShow.java page)</p><p>I try to not declare .Tts in Manufest but it force close What should I do?</p>","605358","","168868","","2012-01-01 20:52:24","2012-01-01 20:52:24","How to send text from database to TTS without chang page","<android><text-to-speech>","1","0","","",""
"4920322","1","","","2011-02-07 10:42:30","1","732","<p>How to share a image in email through android. The image should display in the message body.</p><p>Thanks, </p><p>Yuvaraj.K</p>","598487","","","","","2011-02-07 15:18:39","How to embed images in an email","<android><email>","1","2","1","",""
"4920428","1","4920476","","2011-02-07 10:54:04","1","2832","<p>How to Change the  default Application image in android??we want to distinguish our application to other android application.so we i want to change the default android application image to sepate image.</p><p>how this can be done?anyone pls help me? </p>","555910","","","","","2011-02-07 10:58:49","How to Change the default Application image in android?","<android><image><icons>","1","1","3","",""
"4920430","1","","","2011-02-07 10:54:18","0","245","<p>I am developing an Android Game application Bingo.I have implemented the sound part.While selecting 5 images A bingo image appears. I have also implemented tapping functionality.Now main problem is when i click on 5 images,It should play Bingo sound.. I am wondering why sound is not played on android emulator</p><p>Thanks in advanceRegardsTushar</p>","475349","","","","","2011-07-16 05:39:22","application not playing sound while clicking of images in android","<android>","0","2","1","",""
"4920446","1","","","2011-02-07 10:55:55","3","226","<p>How can I know that current screen is Full-screen mode in Android?</p><p>I'm making a service that notifies some message through status bar.</p><p>But It has a problem when status bar is hide. </p><p>So I want to know that whether status bar is on the screen or not.</p><p>I tried to find out the way. But I don't know how to know that.</p><p>Please help me from this problem ;)</p><p>Thanks.</p>","606298","","","","","2011-02-07 12:54:21","How to know that current screen is Full-screen mode in Android","<android><activity><window><screen><foreground>","1","0","","",""
"4920528","1","4920643","","2011-02-07 11:04:08","25","26506","<p>I have a table layout that I want to populate with the result from a database query. I use a select all and the query returns four rows of data. </p><p>I use this code to populate the textviews inside the table rows. </p><pre><code>Cursor c = null;        c = dh.getAlternative2();        startManagingCursor(c);        // the desired columns to be bound        String[] columns = new String[] {DataHelper.KEY_ALT};        // the XML defined views which the data will be bound to        int[] to = new int[] { R.id.name_entry};         SimpleCursorAdapter mAdapter = new SimpleCursorAdapter(this,                  R.layout.list_example_entry, c, columns, to);         this.setListAdapter(mAdapter);</code></pre><p>I want to be able to separate the four different values of KEY_ALT, and choose where they go. I want them to populate four different textviews instead of one in my example above. How can I iterate through the resulting cursor?</p><p>Regards, AK</p>","455479","","","","","2014-01-28 12:47:39","Iterate through rows from Sqlite-query","<android><sqlite><cursor>","6","0","7","",""
"4920535","1","","","2011-02-07 11:04:55","2","2629","<p>My Android application needs to look into the default Camera directory and get the names of JPEG files created within a time range. I currently do this with the below code snippet.The idea is to filter out files not only by the ""jpg"" extension but also to use the fact that the file names have date/time in them.</p><p>I run the below getImages() function within a Thread so the UI itself isn't affected.I notice that it takes a while if there are lot of files in the directory even after all this. Is there a faster algorithm or Android specific functions that I can use to optimize it further?</p><pre><code>private boolean getImages()    {        boolean status=true;        File dir = new File(picPath);        //Optimize file search by setting the common file prefix as a filter        //get the date format used by camera to store files.        String startStr=startTime.format3339(false);        String endStr=endTime.format3339(false);        //Loop through each character of start time         //and compare with end time till a mismatch is found        int len=startStr.length();        int idx=0;        for ( idx=0;id &lt; len;idx++ )        {                   if (startStr.charAt(idx) != endStr.charAt(idx))            {                Log.d(TAG,""breaking at idx ""+ idx);                break;            }        }        filterString=endStr.substring(0,idx).replace(""T"", "" "").replace("":"",""."");        Log.d(TAG,""Filter String"" + filterString);        String[] children = dir.list(new JpegFilter());        List matchedFiles = new ArrayList();        Log.d(TAG,dir.getAbsolutePath()+"" has ""+ children.length+ "" files"");        int numfiles = children.length;        for(int i=0;i &lt; numfiles;i++)        {            //Get file modify time            File file = new File(picPath+File.separator+children[i]);            // Get the last modification information.            long lastModified = file.lastModified();            if (lastModified &gt; =startTime.toMillis(false)) //If file modified date greater than equals start time            {                Log.d(TAG,""Match! "" + children[i]);                if (lastModified &lt; =endTime.toMillis(false))//If file modified date less than equals end time                {                    matchedFiles.add(picPath+File.separator+children[i]);                }                else //We are now over the time range, quit loop to save time                 {                    break; //TODO break out of for loop                }            }        }        if (!matchedFiles.isEmpty()) //If there are images to be processed        {            status=convertToPDF(matchedFiles,pdfFile);            Log.d(TAG,""convertToPDF() returned "" + status);         }        return status;    }</code></pre><p>This is the Filter class I use</p><pre><code>class JpegFilter implements FilenameFilter {    public boolean accept(File dir, String name) {        return (name.startsWith(captureJPEG.filterString) && name.endsWith("".jpg""));    }}</code></pre>","511716","","511716","","2011-02-08 09:59:03","2011-02-08 09:59:03","Most efficient way to read all files into a list in Android","<android><file>","2","0","4","",""
"4920547","1","","","2011-02-07 11:06:41","0","1722","<p>I have tried installing the Samsung Captivate Drivers, but ADB does not see them.  I have got the google adb drivers in sdk directory but everytime i try to install this driver it says that Windows think I have the best driver for the device.  It keeps the MTB driver.  I have tried uninstalling but MTB driver keeps coming back.  I am trying to get the debug bridge to work to a Samsung Captivate.  adb devices shows nothing.  </p>","602260","","1228","","2011-02-07 15:50:45","2011-02-09 05:50:04","Android Debug Bridge and Samsung Captivate","<android><eclipse><usb><adb>","3","12","","",""
"4920605","1","","","2011-02-07 11:13:01","0","2327","<p>which codecs are supported for audio in android? G711 is supported. But is there any other like G729,...etc?</p>","606328","","606328","","2011-02-07 11:27:20","2012-02-07 11:52:29","supported codecs in android","<android><codec>","2","2","","",""
"4920676","1","","","2011-02-07 11:21:09","4","984","<p>I have a need to get the signal strength as part of an inline piece of work. My app has no activities, no services and a broadcast receiver. So in lifetime terms my code only runs when the broadcast intent (for phone call state) runs.</p><p>My question is what can I hang a PhoneStateListener off that will allow me to receive an event  about signal strength when (or shortly after) I ask for it.</p><p>Is the GSM signal strength not delivered as a broadcastable event?</p><p>(I am trying to avoid having to put this listener in a service)</p><p>Thanks.</p>","606339","","","","","2011-02-07 14:01:36","Getting signal strength without an activity","<android>","2","1","","",""
"4920687","1","","","2011-02-07 11:22:15","0","316","<p>I have an application in J2ME ,I want to convert that application to Android, using J2AB (J2Android Bridge), kindly give me a method for that? Also give another method if exit?</p>","605934","","72746","","2011-02-07 11:25:31","2011-02-08 10:13:07","How to use J2AB?","<android><java-me><j2ab>","1","0","","",""
"4920707","1","4920737","","2011-02-07 11:23:50","1","350","<p>I am working on one application which basically is an auto start application and runs in background.</p><p>The Problem is i need to access shared preference before auto start. But if device is not properly booted up how can i access the shared preference.</p><p><strong>I want that either if device is completely booted then start my service or i can set any wait to my service to start..</strong>.</p><p>Pls help me in this case..</p><p>Thanks in advance.</p>","383597","","","","","2011-02-07 11:27:25","Android autostart functionality","<android>","1","0","","",""
"4920770","1","4944953","","2011-02-07 11:30:44","7","9344","<p>Hi  I implement the many things using the webViewClient like onUnhandledKeyEvent,shouldOverrideUrlLoading and more.If want to add the support for alertbox then need to switch to WebChromeClient then i can not do other things.Any one know how mix the both future?<br/>   I have check the code for javasript alert box at <a href=""http://lexandera.com/2009/01/adding-alert-support-to-a-webview/"">http://lexandera.com/2009/01/adding-alert-support-to-a-webview/</a></p><p><br/>Thank you</p>","256612","","","","","2013-03-11 09:15:18","Android:How to add support the javascript alert box in WebViewClient?","<android>","3","2","2","",""
"4920810","1","4920942","","2011-02-07 11:34:06","3","1931","<p>in portrait i have 5 icons. 4 icons in the first row,and 1 icon in the second row. but in landscape the 5th icon has to fit in the first row.   how to solve this?</p><p><img src=""http://i.stack.imgur.com/YF5NH.jpg"" alt=""enter image description here""></p>","226157","","535857","","2011-02-07 11:41:43","2012-12-22 07:25:09","How to change screen layout according to the orientation?","<android><android-layout>","4","1","2","",""
"4920855","1","","","2011-02-07 11:38:12","1","1650","<p>I have service running in background and notification is shown in GUI. When i do force close from application=>manage application, my service, application and icon in notification bar goes off. </p><p>But when i kill my application via TaskKiller application, my service stopped and then Android OS restarts service(i can see from logcat) and icon in my notification area remains. while my background work (of downloading image) is closed. </p><p>I return START_STICKY (also tried with STArT_NOT_STICKY flag) from OnStartCommand(), but no luck. My GUI activity, binds to service via Context.BIND_AUTO_CREATE, is it because of that flag? </p><p>What should i do if i want my application,service and notification area icon to go off, when application is killed by task killer. </p><p><strong>Solution</strong></p><p>resolved this issue by using flag in intent passed to Service when started from activity. When OS restarts service after crash/task killer, Service receives null intent</p>","465751","","465751","","2011-02-26 06:13:59","2011-06-28 11:03:52","Android:: What to do to allow forceful kill of service","<android><service>","1","0","0","",""
"4920912","1","","","2011-02-07 11:44:10","0","1102","<p>When I upload image from android device (v 2.2) to a server (apache with php)basically, have same problem as here: <a href=""http://stackoverflow.com/questions/3154224/android-development-image-upload-corrupted"">Android Development Image Upload Corrupted</a></p><p>At first, the upload method was based on apache httpcomponent 4.1 and i thought the problem was in it. Then I have written my own upload library based on HttpURLConnection.</p><p>I tried to use different servers, but it is still the same.</p><p>Example:<br><a href=""http://pixelbirthcloud.com/corrupted_images/1_orig.jpg"" rel=""nofollow"">http://pixelbirthcloud.com/corrupted_images/1_orig.jpg</a> - the original image<br><a href=""http://pixelbirthcloud.com/corrupted_images/1_corrupted.jpg"" rel=""nofollow"">http://pixelbirthcloud.com/corrupted_images/1_corrupted.jpg</a> - what we get on server.</p><p>File size is the same, but the content in the content there is a corrupted block of bytes:  </p><pre><code>00051330 |       49 69 11 4B 9D E6 | 00051330 |       DA BB 10 70 DC 77 |  00051338 | 2D B9 1B B9 E4 81 5A E6 | 00051338 | AC 20 C7 90 7E B4 33 80 |  00051340 | D4 14 B0 F4 EA 3D D1 E9 | 00051340 | 31 9A B8 C2 29 83 66 9C |  00051348 | 61 9D E3 38 F7 36 DE 63 | 00051348 | 9A 84 8E 73 9A 8D B5 29 |  00051350 | 25 9D 9D C4 64 C3 23 AA | 00051350 | 18 60 1C 0F 7A CF 33 01 |  00051358 | 4A EB 08 C3 97 7C 8C 36 | 00051358 | D4 F0 7A D3 24 BA 85 71 |  00051360 | 73 F5 E3 15 14 5B BC C1 | 00051360 | F3 0A 76 8A D6 C4 36 5E |  00051368 | B9 A4 49 06 71 1B 11 87 | 00051368 | 7B B9 5F 20 E3 A5 46 F2 |  00051370 | 39 E7 76 7B 8F 5F       | 00051370 | B8 1D 4E 6B 36 6D       |</code></pre><p>I don't know what it depends on, but on my clients' devices the images get much more corrupted. Sometimes it uploads fine, but most of the time the uploaded images are corrupted.</p><p>So I guess it's not about the http transfer. it is something about getting stream from sd card to memory and then saving that stream to http...</p><p>The code is below.</p><p>Do you guys have any ideas? Tried everything and still it doesn't' work.</p><pre><code>public String execute() throws IOException {    String lineEnd = ""\r\n"";    String twoHyphens = ""--"";    String boundary = ""*****MultipartBoundary"";    try {        URL url = new URL(mUri);        HttpURLConnection conn = (HttpURLConnection) url.openConnection();        conn.setDoInput(true);        conn.setDoOutput(true);        conn.setUseCaches(false);        conn.setRequestMethod(""POST"");        conn.setRequestProperty(""Connection"", ""Keep-Alive"");        conn.setRequestProperty(""Content-Type"",                ""multipart/form-data; boundary="" + boundary);        // timeouts        conn.setConnectTimeout(CONNECT_TIMEOUT);        conn.setReadTimeout(READ_TIMEOUT);        Log.d(TAG, ""Opening connectionStream"");        DataOutputStream dos = new DataOutputStream(conn.getOutputStream());        Log.d(TAG, ""Adding params"");        for (NameValuePair param : mParams) {            dos.writeBytes(twoHyphens + boundary + lineEnd);            dos.writeBytes(""Content-Disposition: post-data; name=""                    + param.getName() + lineEnd);            dos.writeBytes(lineEnd);            dos.writeBytes(param.getValue());            dos.writeBytes(lineEnd);        }        File file;        Log.d(TAG, ""Adding files"");        for (NameValuePair param : mFiles) {            file = new File(param.getValue());            if (file.exists()) {                dos.writeBytes(twoHyphens + boundary + lineEnd);                dos.writeBytes(""Content-Disposition: post-data; name=""                        + param.getName() + ""; filename="" + file.getName()                        + lineEnd);                dos.writeBytes(""Content-Type: application/octet-stream"" + lineEnd);                dos.writeBytes(""Content-Transfer-Encoding: binary"" + lineEnd);                dos.writeBytes(lineEnd);                Log.d(TAG, ""Opening fileInputStream"");                FileInputStream fileStream = new FileInputStream(file);                try {                    int bytesAvailable;                    while((bytesAvailable = fileStream.available()) &gt; 0)                    {                        int bufferSize = Math.min(bytesAvailable, 4096);                        byte[] buffer = new byte[bufferSize];                        int bytesRead = fileStream.read(buffer, 0, bufferSize);                        dos.write(buffer, 0, bytesRead);                    }                    dos.writeBytes(lineEnd);                } finally {                    fileStream.close();                }                Log.d(TAG, ""Closing fileINputStream"");            }        }        // very important - we specify the end of the multipart block        dos.writeBytes(twoHyphens + boundary + twoHyphens + lineEnd);        dos.flush();        dos.close();        // getting response        if (conn.getResponseCode() == HttpStatus.SC_OK) {            BufferedInputStream bis = new BufferedInputStream(conn.getInputStream());            try {                 ByteArrayBuffer baf = new ByteArrayBuffer(50);                 int read = 0;                 int bufSize = 512;                 byte[] buffer = new byte[bufSize];                 while(true){                      read = bis.read(buffer);                      if(read==-1){                           break;                      }                      baf.append(buffer, 0, read);                 }                 Log.d(TAG, ""Connection successful - returning result"");                 return new String(baf.toByteArray(), ""UTF-8"");            } finally {                bis.close();            }        } else {            Log.d(TAG, ""Return code is "" + Integer.toString(conn.getResponseCode()));            throw new IOException(""Return code is "" + Integer.toString(conn.getResponseCode()));        }    } catch (MalformedURLException e) {        Log.e(TAG, ""Exception: "" + e.getMessage(), e);        throw new IOException(""aaa"");    } catch (IOException e) {        Log.e(TAG, ""Exception: "" + e.getMessage(), e);        throw new IOException();    }}</code></pre><p><strong>UPDATES:</strong><br>thought about data corruption when creating streams.. so i changed a code a bit to save the file from the source stream:</p><pre><code>                FileOutputStream fileOutStream = new FileOutputStream(AndorraApplication.getPhotosPath() + ""/orig_"" +file.getName() );                DataOutputStream dataOutStream = new DataOutputStream(fileOutStream);                try {                    int bytesAvailable;                    while((bytesAvailable = fileStream.available()) &gt; 0)                    {                        int bufferSize = Math.min(bytesAvailable, 4096);                        byte[] buffer = new byte[bufferSize];                        int bytesRead = fileStream.read(buffer, 0, bufferSize);                        dos.write(buffer, 0, bytesRead);                        dataOutStream.write(buffer, 0, bytesRead);                    }                    dos.writeBytes(lineEnd);                } finally {                    fileStream.close();                    dataOutStream.close();                }</code></pre><p>And it comes that while the uploaded image is corrupted, the image stored using dataOutStream is good... completely lost now.</p><p>is there a bug in HTTPUrlConnection on Froyo or something?</p>","602945","","759866","","2013-11-10 18:56:36","2013-11-10 18:56:36","Android image corruption when uploading via http","<android><http><upload><stream><corrupt>","1","0","","",""
"4920930","1","5448587","","2011-02-07 11:45:37","34","5086","<p>I'm trying to figure out how to use <code>Loaders</code> in Android 3.0 but can't seem to get it to work. The docs only describe using CursorLoader but I'm using AsyncTaskLoader.</p><p>From the docs it seems that you should only need to implement AsyncTaskLoader.loadInBackground() but it never gets called after getLoaderManager().initLoader() and then creating the loader in the callback.</p><p>I can see debug messages saying <code>Created new loader LoaderInfo{4040a828 #0 : ArticleDataLoader{4036b350}}</code> so it seems like it is created successfully.</p><p>Is it possible that loaders are currently broken in the SDK or is there some method you need to call after creating the loader? (they don't do that in the CursorLoader example).</p><p>EDIT: Seems like calling forceLoad() on the Loader returned from initLoader() starts the loading at least but this means you can't handle rotations correctly :(</p>","253583","","750987","","2011-05-29 06:46:58","2012-06-23 02:48:51","Loaders in Android Honeycomb","<java><android><android-3.0-honeycomb>","3","4","14","",""
"4920989","1","","","2011-02-07 11:51:30","0","1864","<p>In my application I want to display a list of stuff and provide the user with the ability to filter the list by using the soft keyboard. To that end I added a button that should trigger (hide/show) the soft keyboard for filtering. I don't want to have a visible edit text control, cause it would take up unnecessary space. Rather than that, I would like to display a toast showing the filter query as the user types, much as the 'android:textFilterEnabled' attribute for ListView does. To my understanding there is no obvious way of doing this with available Android components. So I tried the following approach:</p><p>1) creating a layout containing invisible edit text and the list view:</p><p>    </p><pre><code>&lt;ListView android:id=""@+id/main_list""          android:drawSelectorOnTop=""false""          android:layout_height=""0px""          android:layout_width=""fill_parent""          android:layout_weight=""5""          /&gt;</code></pre><p></p><p>2) adding button as a popup and invoking InputMethodManager on click to toggle the soft input (called in onCreate):</p><pre><code>private void initButton() {    Button buttonView = (Button) getLayoutInflater().inflate(R.layout.keyboard_button, null);    buttonView.setOnClickListener(new View.OnClickListener() {        public void onClick(View v) {            final View target = findViewById(R.id.filterbox);            InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);            // this does not work...            // imm.toggleSoftInputFromWindow(target.getWindowToken(), InputMethodManager.SHOW_FORCED, 0);            // ... so need to track this in an instance variable - which sucks            if (imeShowing) {                imm.hideSoftInputFromWindow(target.getWindowToken(), 0);                imeShowing = false;            } else {                // check that the filterbox got focus                Preconditions.checkState(target.requestFocusFromTouch());                Preconditions.checkState(target.hasWindowFocus());                Preconditions.checkState(target.hasFocus());                imm.showSoftInput(target, 0);                imeShowing = true;            }        }    });    buttonPopup = new PopupWindow(buttonView);    // ... code to display the button as a small popup}</code></pre><p>As mentioned in the code sample, the 'obvious' approach (calling toggleSoftInput) does not work, so I had to revert to this ugly if-else. This is however, a secondary problem. The primary problem is that when I run this in the emulator, the soft keyboard is displayed correctly, but as soon as I start typing in it, the systems starts an intent to the google search activity! And the typed characters appear in the Google search box displayed as a result. What is even more weird, this only happens the first time I type after deploying and running the app. I.e. if I go back to my app from the Google search box, everything works as expected (no redirects to the search box). Before showing the display I make sure that the invisible edittext gets focus, so it <em>should</em> be the target of the soft keyboard, right??</p><p>Does anyone have any idea what is happening here?</p>","578559","","","","","2011-02-15 12:48:28","android: problems with programmatic invoking of soft keyboard","<android><android-input-method>","1","2","","",""
"4921011","1","4921121","","2011-02-07 11:55:33","9","18056","<p>I'm developing an android app. Now I'm parsing bbcode to html and display it inside a textview, the textview is inside a custom listview. I use Html.ImageGetter() to display the images downloaded from AsyncTask. </p><p>It works great for a low number of pictures. But if the app is asked to download 40-50 pictures, 40-50 tasks are created and it becomes a mess. Each task opens a stream to download the images. After that it decodes the bytes into bitmaps, resize them, save them to the sdcard and recycles the bitmaps. </p><p>Now if the app is loading all this images at the same time it uses a huge amount of ram. I managed to make it pass 48 mb. There is a big gap between 16 and 48 :(. I searched on how to solve this. I downloaded AsyncTask code from google: </p><p><a href=""http://google.com/codesearch/p?hl=en&amp;sa=N&amp;cd=2&amp;ct=rc#uX1GffpyOZk/core/java/android/os/AsyncTask.java&amp;q=lang:java%20AsyncTask"" rel=""nofollow"">http://google.com/codesearch/p?hl=en&amp;sa=N&amp;cd=2&amp;ct=rc#uX1GffpyOZk/core/java/android/os/AsyncTask.java&amp;q=lang:java%20AsyncTask</a></p><p>And set the pool size to 3. But this didn't helped. I really can't figure out where I'm loosing ram. As soon as I put a big task queue my ram goes crazy. After a few images are received it gets worst. I don't think it is the images since I can get to 30 mb before any image is displayed. The app itself including the view, information and its service uses 13 mb, all the rest is leaked here.</p><p>Does the queue itself make big ram allocations? Or is the Html.ImageGetter() leaking a huge amount of memory somehow? Is there a better way to do this? </p><p>Here I load the images:</p><pre><code>public void LoadImages(String source) {    myurl = null;    try {        myurl = new URL(source);    } catch (MalformedURLException e) {        e.printStackTrace();    }    new DownloadImageFromPost().execute(myurl);}private class DownloadImageFromPost extends AsyncTask&lt;URL, Integer, Bitmap&gt; {    @Override    protected Bitmap doInBackground(URL... params) {        URL url;        Log.d(TAG, ""Starting new image download"");        try {            url = params[0];            HttpURLConnection connection = (HttpURLConnection) url            .openConnection();            int length = connection.getContentLength();            InputStream is = (InputStream) url.getContent();            byte[] imageData = new byte[length];            int buffersize = (int) Math.ceil(length / (double) 100);            int downloaded = 0;            int read;            while (downloaded &lt; length) {                if (length &lt; buffersize) {                    read = is.read(imageData, downloaded, length);                } else if ((length - downloaded) &lt;= buffersize) {                    read = is.read(imageData, downloaded, length                            - downloaded);                } else {                    read = is.read(imageData, downloaded, buffersize);                }                downloaded += read;                publishProgress((downloaded * 100) / length);            }            Bitmap bitmap = BitmapFactory.decodeByteArray(imageData, 0,                    length);            if (bitmap != null) {                Log.i(TAG, ""Bitmap created"");            } else {                Log.i(TAG, ""Bitmap not created"");            }            is.close();            return bitmap;        } catch (MalformedURLException e) {            Log.e(TAG, ""Malformed exception: "" + e.toString());        } catch (IOException e) {            Log.e(TAG, ""IOException: "" + e.toString());        } catch (Exception e) {        }    return null;}protected void onPostExecute(Bitmap result) {        String name = Environment.getExternalStorageDirectory() + ""/tempthumbs/"" + myurl.toString().hashCode() +"".jpg"";        String rname = Environment.getExternalStorageDirectory() + ""/tempthumbs/"" + myurl.toString().hashCode() +""-t.jpg"";        try {            if (result != null) {                    hasExternalStoragePublicPicture(name);                     ImageManager manager = new ImageManager(context);                    Bitmap rezised = manager.resizeBitmap(result, 300, 300);                    saveToSDCard(result, name,  myurl.toString().hashCode() +"".jpg"");                    saveToSDCard(rezised, rname, myurl.toString().hashCode() +""-t.jpg"");                    result.recycle();                    rezised.recycle();            } else {            }        } catch(NullPointerException e) {        }    Log.d(TAG, ""Sending images loaded announcement"");    Intent i = new Intent(IMAGE_LOADED);    i.putExtra(""image"",  name);    i.putExtra(""source"", myurl.toString());    i.putExtra(""class"", true);    context.sendBroadcast(i);}}    private boolean hasExternalStoragePublicPicture(String name) {    File file = new File(name);    if (file != null) {        file.delete();    }        try {            file.createNewFile();        } catch (IOException e) {        e.printStackTrace();        }    return file.exists();}public void saveToSDCard(Bitmap bitmap, String name, String nam) {    boolean mExternalStorageAvailable = false;    boolean mExternalStorageWriteable = false;    String state = Environment.getExternalStorageState();    if (Environment.MEDIA_MOUNTED.equals(state)) {        mExternalStorageAvailable = mExternalStorageWriteable = true;        Log.v(TAG, ""SD Card is available for read and write ""                + mExternalStorageAvailable + mExternalStorageWriteable);        saveFile(bitmap, name, nam);    } else if (Environment.MEDIA_MOUNTED_READ_ONLY.equals(state)) {        mExternalStorageAvailable = true;        mExternalStorageWriteable = false;        Log.v(TAG, ""SD Card is available for read ""                + mExternalStorageAvailable);    } else {        mExternalStorageAvailable = mExternalStorageWriteable = false;        Log.v(TAG, ""Please insert a SD Card to save your Video ""                + mExternalStorageAvailable + mExternalStorageWriteable);    }}private void saveFile(Bitmap bitmap, String fullname, String nam) {    ContentValues values = new ContentValues();    File outputFile = new File(fullname);    values.put(MediaStore.MediaColumns.DATA, outputFile.toString());    values.put(MediaStore.MediaColumns.TITLE, nam);    values.put(MediaStore.MediaColumns.DATE_ADDED, System            .currentTimeMillis());    values.put(MediaStore.MediaColumns.MIME_TYPE, ""image/jpg"");    Uri uri = context.getContentResolver().insert(            android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI,            values);;    try {        OutputStream outStream = context.getContentResolver()                .openOutputStream(uri);        bitmap.compress(Bitmap.CompressFormat.JPEG, 95, outStream);        outStream.flush();        outStream.close();    } catch (FileNotFoundException e) {        e.printStackTrace();    } catch (IOException e) {        e.printStackTrace();    }    bitmap.recycle();}</code></pre><p>And here i call Html.ImageGetter(), this is inside a list getView:</p><pre><code>holder.content.setText(Html.fromHtml(   processor.preparePostText(posts.get(position).post_content),   new Html.ImageGetter() {      @Override public Drawable getDrawable(String source) {         Log.d(""Forum Service"", ""image source: "" + source);         if (imageSources.contains(source)) {            for (int x = 0; x &lt; imageSources.size(); x++) {               if (source.equals(imageSources.get(x))) {                  String tmp = oImages.get(x);                  tmp = tmp.substring(0, tmp.length() - 4);                  tmp = tmp + ""-t.jpg"";                  Drawable d = Drawable.createFromPath(tmp);                  try {                     d.setBounds(0, 0, d.getIntrinsicWidth(),                        d.getIntrinsicHeight());                  } catch (NullPointerException e) {                  }                  Log.d(""Forum Service"", ""Loaded image froms sdcard"");                  return d;               }            }         } else if (notLoadedImages.contains(source)) {            Log.d(""Forum Service"", ""Waiting for image"");            return null;         } else {            notLoadedImages.add(source);            LoadAllIcons loader = new LoadAllIcons(context);            loader.LoadImages(source);            Log.d(""Forum Service"", ""Asked for image"");            return null;         }         return null;      }   }, null));</code></pre><p>Thanks!</p><p>Finally the problem was that all Tasks loaded at the same time. Therefor 40 images where allocated in ram while downloading. I managed to limit the amount of running tasks by doing this modifications on AsyncTask:</p><pre><code>private static final int CORE_POOL_SIZE = 2;private static final int MAXIMUM_POOL_SIZE = 2;private static final int KEEP_ALIVE = 1;private static final BlockingQueue&lt;Runnable&gt; sWorkQueue =        new LinkedBlockingQueue&lt;Runnable&gt;(100);</code></pre>","567646","","403455","","2012-07-30 12:49:02","2012-07-30 12:49:02","Managing multiple asynctask to download multiple images from html code, leaking ram, any ideas?","<android><html><android-listview><android-asynctask><drawable>","1","1","7","",""
"4921067","1","4921140","","2011-02-07 12:03:17","0","322","<p>I want to redirect a site .how it can be done using http ??pls any one explain me?I am new to android</p>","555910","","","","","2011-02-07 12:13:17","how to redirect a site in android","<android><http>","2","0","","2011-02-07 12:15:58",""
"4921183","1","4921902","","2011-02-07 12:18:51","3","8565","<p>I am looking for someone to assist in the code i require in my application to copya image from where they get stored on the HTC desire as standard(the gallery) to a another folder on the SD card. I want the user to be able to click on a button and a certain file is copied from the SD card gallery folder to the another folder on the SD card? Thanks</p>","569654","","569654","","2011-02-07 13:27:01","2014-02-01 11:11:14","Android copy image from gallery folder onto SD Card alternative folder","<android><image><copy><sd-card>","2","0","3","",""
"4921222","1","","","2011-02-07 12:22:56","1","9323","<p>I started android application development and followed this tutorial:</p><p><a href=""http://mindtherobot.com/blog/452/android-beginners-ndk-setup-step-by-step/"" rel=""nofollow"">http://mindtherobot.com/blog/452/android-beginners-ndk-setup-step-by-step/</a> but the application didn't work.I debug it and the log cat show this message:JNI_Onload not found..how can I solve this problem?</p><p>Thanks</p>","499858","","21234","","2011-02-07 13:51:02","2012-08-26 03:54:47","JNI_OnLoad not found","<android><android-ndk><android-ndk-r5>","2","0","","",""
"4921244","1","4921747","","2011-02-07 12:25:52","6","11621","<p>I want to kill all tasks that run in android like task killer...What I have done until now is:</p><pre><code>ActivityManager manager =  (ActivityManager) this.getSystemService(ACTIVITY_SERVICE);    List&lt;RunningAppProcessInfo&gt; activityes = ((ActivityManager) manager).getRunningAppProcesses();    for (int i = 0; i &lt; activityes.size(); i++){        Log.e(""APP: ""+i, activityes.get(0).processName);        if (!activityes.get(0).processName.equals(""app.android.myapp"")){            Process.killProcess(activityes.get(0).pid);        }    }</code></pre><p>The problem with the code is that it returns in the activityes list only my app for 12 times. And no task is being killed...</p><p>Can somebody help me please?Thank you!</p>","449310","","","","","2013-08-20 02:23:06","android task kill","<android><task><kill><taskkill>","5","1","1","",""
"4921257","1","4921298","","2011-02-07 12:27:29","0","1342","<p>I am doing client server process. I dont know how to connect with Servlet . In servlet i have JDBC that collects data from oracle. I want to connect servlet and to show all the details from oracle database in android.  </p>","599841","","157882","","2011-02-07 12:33:52","2011-02-07 13:06:57","How to connect servlet","<java><android>","2","0","","",""
"4921269","1","4921313","","2011-02-07 12:28:41","1","3019","<p>I am need stop watch like widget in android.Currently I am using Android chronometer,it is not fulfilling my requirements as when I am stopping the chronometer its stops in UI but but it continues to tick in background.</p>","388088","","","","","2011-02-07 12:32:20","How can I make stop watch in Android?","<android>","1","1","","",""
"4921286","1","4921363","","2011-02-07 12:30:04","1","1589","<p>I made a simple timer example but it work as it have to be.Here is the code</p><pre><code>public class TimerExample extends Activity {private Timer timer;/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    timer=new Timer();    timer.schedule(new TimerTask(){        @Override        public void run() {            // TODO Auto-generated method stub            TimerMethod();        }    }, 0, 10000);}public void TimerMethod(){    Toast.makeText(getApplicationContext(), ""Hi this is piyush"", Toast.LENGTH_LONG).show();}}</code></pre><p>a toast have to be appeared after 10 sec but it wont happen. please suggest the correct way.</p>","510617","","244296","","2011-02-07 12:39:59","2011-02-07 13:09:35","Simple Timer Example but it wont work fine","<java><android>","1","0","","",""
"4921290","1","4921544","","2011-02-07 12:30:24","2","321","<p>I am new to Java and I started to learn it on Android platform, I know its not good to start learning language on emulation of mobile platform, but anyway....</p><p>What I woud like to ask about java, is ""external"" calling of some methods. I mean, often in program, or tutorials, you just ovveride some method, and it gets run autmatically based on some action. </p><p>This is very nice actually, I really like it, but I would like to know how this this implemented. Does JVM has to implement those, or are they user-defineable somehow?</p><p>For axample on Android are methods <code>surfaceCreated(),surfaceDestroyed()</code> which are called on respective event, and you than can handle it. The similiar are button click handling, and many more events.</p><p>I would just like to know how this is implemented, becouse, for example in C you have to manually check wheather some action happened or not. And you are limited by data provided by OS. So, does JVM has predefined actions it can call, or can you manually somehow tell it to do somthing based on somthing? I know this is strange question, but in fact its so strange to me I cannot explain it better. Maybe you can understand my not-knowing if you knew I programmed mainly for MCU in C, so this behavior is strange to me. But I like it.</p>","307797","","","","","2011-02-07 13:06:16","Java ""external on event call""","<java><android>","2","0","","",""
"4921365","1","","","2011-02-07 12:38:02","1","1205","<p>I am trying to pass a string from current activity to previous activity. I tried with intent, but it got failed. how can i pass it? Can anyone help me to find a solution for this?....i struck with this from 4 days... please help me as soon as possible.</p><p>Thanks in advance..</p>","607568","","844882","","2012-03-22 20:20:27","2012-03-22 20:20:27","Passing a string from one activity to previous activity","<android>","1","2","1","",""
"4921377","1","","","2011-02-07 12:39:27","0","244","<p>Im long time c++ developer . and I like to start to develop 3d applications and games for the android , now I do know I wil be limit with java VM So I like to start to develop with c++ with the NDK API , before I start , what version should I start to develop ? 2.3 ? can I do complete application just With c++ ? what problems should I expect ? can you please point me to articles on the subject. </p>","63898","","","","","2011-02-11 15:55:15","Developing 3d application with NDK beginner question","<android><android-ndk>","1","0","","",""
"4921384","1","","","2011-02-07 12:39:58","1","7739","<p>I need to send file to a computer instead of another android application. I have looked at the bluetooth api, but it only allow connection as client-server. In my case I dont know what UUId would be on the computer. Do I need to look at obex. I haven't used it before. So any help would be benficial.</p>","606433","","","","","2013-03-04 08:58:26","How to send file using bluetooth on android programatically?","<android><sockets><bluetooth><obex>","2","2","2","",""
"4921427","1","6041648","","2011-02-07 12:45:03","0","196","<p>Hey, im trying to use mediaRecorder but on emulator i can't normal tested it. In emulators ddms and app sayd me about ""prepare failed"" but when i try to run it on phone - all ok ( problem only when video recorded - than i can see bug with video (bloky/lines on screen)I run my app on 2 device : 1 device recorded video and sound - but have on screen bloky/lines with random colors ( sound are ok), on other device - when click on start record : i have error...(and app crashed) i think there error is  ""prepare failed"" .Anyone know what is that  and how to fix it ?</p><p>Regards,Peter.p.s. sorry for my bad english, hope u understand me</p>","562592","","","","","2011-05-18 08:09:41","Recorded video is bugged . Good sound but video with green or purple line/bloky","<java><android><video-encoding>","1","1","","",""
"4921454","1","5037476","","2011-02-07 12:47:42","0","846","<p>I am trying to create template/BaseActivity class for other developers to use, as a part of framework.</p><p>I extended my class with TabActivity, and my xml looks like this/</p><pre><code>&lt;TabHost xmlns:android=""http://schemas.android.com/apk/res/android""    android:id=""@android:id/tabhost"" android:layout_width=""match_parent""    android:layout_height=""match_parent""&gt;    &lt;LinearLayout android:orientation=""vertical""        android:layout_width=""fill_parent"" android:layout_height=""fill_parent""&gt;        &lt;View android:layout_width=""fill_parent"" android:layout_height=""0dip""            android:background=""#000"" /&gt;        &lt;TabWidget android:id=""@android:id/tabs""            android:layout_width=""fill_parent"" android:layout_height=""wrap_content""            android:layout_marginLeft=""0dip"" android:layout_marginRight=""0dip"" /&gt;        &lt;View android:layout_width=""fill_parent"" android:layout_height=""2dip""            android:background=""#696969"" /&gt;        &lt;View android:layout_width=""fill_parent"" android:layout_height=""1dip""            android:background=""#fff"" /&gt;        &lt;FrameLayout android:id=""@android:id/tabcontent""            android:layout_width=""fill_parent"" android:layout_height=""fill_parent"" /&gt;    &lt;/LinearLayout&gt;&lt;/TabHost&gt;</code></pre><p>when I use this activity by extending in other project, I get an error stating, it is not able to get android.R.id.tabhost and this is necessary.</p><p>This happens, even if i call getTabHost() or findViewById() both scenarios.</p><p>Please note : I tried this without extending the TabActivity, for the use of views in tab. It works fine. But I want to use activities as my tab content.</p><p>I think this is the issue when we make it a library project and include it.</p><p>Please let me know if you need more explanation or if you know some workarounds, please suggest.</p>","606432","","750987","","2011-05-29 06:28:36","2012-09-29 06:12:31","TabActivity in library project, android.R.id.tabhost not found error","<android><android-layout><android-tabhost><android-library>","1","0","","",""
"4921507","1","","","2011-02-07 12:51:18","9","1749","<p>I have an Activity, where I want the software keyboard to be alaways opened. How to close the Activity after BACK press, when keyboard is opened? Now I have to click BACK twice, first to close the keyboard and then to finish the Activity.</p>","243225","","","","","2013-03-14 23:44:53","How to close Activity with software keyboard after BACK press?","<android>","5","2","2","",""
"4921550","1","4921720","","2011-02-07 12:56:00","2","2332","<p>I need to know where to call the db.close() in my code. I've added it on onCreate() method, but when I need to use some methods it says database not open, and then I've removed from onCreate() and it says close() was not explicity called. so where should I close, could it be inside each method of the class??</p><p>here is the code:</p><pre><code>public class HoursPerDayDataHelper {private static final String DATABASE_NAME = ""database.db"";private static final int DATABASE_VERSION = 1;protected static final String TABLE_NAME = ""table"";protected String TAG = ""HoursPerDayDataHelper"";private Context context;private SQLiteDatabase db;OpenHelper openHelper = null;public HoursPerDayDataHelper(Context context) {    this.context = context;    openHelper = new OpenHelper(this.context);    this.db = openHelper.getWritableDatabase();    openHelper.onCreate(db);}public void close() {    if (openHelper != null) {        openHelper.close();    }}public void deleteAll() {    this.db.delete(TABLE_NAME, null, null);}public String selectDuration(String date) {    String duration = """";    Integer value = 0;    String returnment = """";    Log.i(TAG, ""date do select: "" + date);                  Cursor cursor = this.db.query(TABLE_NAME, new String[] { ""duration"" },            ""date = ? "", new String[]{ date }, null, null, null);    Log.i(TAG, ""cursor string "" + cursor);    if (cursor.moveToFirst()) {        do {            Log.i(TAG, ""dentro do if cursor"");            duration = cursor.getString(0);            value += Integer.parseInt(duration);        } while (cursor.moveToNext());        returnment = Integer.toString(value);    }else{        Log.i(TAG, ""bla bla bla"");    }    if (cursor != null &amp;&amp; !cursor.isClosed()) {        cursor.close();    }    return returnment;}public ArrayList&lt;String[]&gt; selectTopContacts() {    ArrayList&lt;String[]&gt; list1 = new ArrayList&lt;String[]&gt;();    Cursor cursor = this.db.query(TABLE_NAME, null, null, null, null, null,            ""duration desc"");    if (cursor.moveToFirst()) {        do {            if (cursor.getString(2) != """") {                String[] data = new String[4];                data[0] = cursor.getString(2);                data[1] = cursor.getString(4);                data[2] = cursor.getString(5);                data[3] = cursor.getString(7);                list1.add(data);            } else {                String[] data = new String[3];                data[1] = cursor.getString(4);                data[2] = cursor.getString(5);                data[3] = cursor.getString(7);                list1.add(data);            }        } while (cursor.moveToNext());    }    if (cursor != null &amp;&amp; !cursor.isClosed()) {        cursor.close();    }    return list1;}public 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 IF NOT EXISTS ""                + TABLE_NAME                + ""(id INTEGER PRIMARY KEY AUTOINCREMENT, duration TIME, date DATE, current_time TIME)"");    }    @Override    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {        Log.w(""HoursPerDay Database"",                ""Upgrading database, this will drop tables and recreate."");        db.execSQL(""DROP TABLE IF EXISTS "" + TABLE_NAME);        onCreate(db);    }}}</code></pre><p><strong>And this is my Activity:</strong></p><pre><code>public class HoursPerDay extends Activity{private String LOG_TAG = ""HoursPerDay"";private TextView mDateDisplay;public String date;private int mYear;private int mMonth;private int mDay;private int newDay;private String hpdData; private HoursPerDayDataHelper hpd;OpenHelper openHelper = new OpenHelper(HoursPerDay.this);static final int DATE_DIALOG_ID = 0;protected void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.hours_per_day);    hpd = new HoursPerDayDataHelper(this);    // capture our View elements    mDateDisplay = (TextView) findViewById(R.id.dateDisplay);       // 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)}@Overrideprotected void onDestroy() {    super.onDestroy();    if (openHelper != null) {        openHelper.close();    }    if (hpd != null) {        hpd.close();    }}// the callback received when the user ""sets"" the date in the dialogprivate DatePickerDialog.OnDateSetListener mDateSetListener = new DatePickerDialog.OnDateSetListener() {    public void onDateSet(DatePicker view, int year, int monthOfYear,            int dayOfMonth) {        mYear = year;        mMonth = monthOfYear;        mDay = dayOfMonth;                          setBasicContent();        hpd.close();    }};protected Dialog onCreateDialog(int id) {    switch (id) {    case DATE_DIALOG_ID:        return new DatePickerDialog(this,                    mDateSetListener,                    mYear, mMonth, mDay);    }    return null;}@Overridepublic boolean onCreateOptionsMenu(Menu menu){    MenuInflater inflater = getMenuInflater();    inflater.inflate(R.layout.hoursperdaymenu, menu);    return true;}@Overridepublic boolean onOptionsItemSelected(MenuItem item){    switch(item.getItemId()){    case R.id.filter_by_day:                        showDialog(DATE_DIALOG_ID);            return true;    case R.id.filter_by_user:        showDialog(DATE_DIALOG_ID);        return true;    default:        return super.onOptionsItemSelected(item);    }}   public void setBasicContent() {    date = (mMonth + 1) + ""/"" + newDay + ""/"" + mYear;           hpdData = this.hpd.selectDuration(date);    mDateDisplay.setText(hpdData);    hpd.close();}}</code></pre>","399459","","135152","","2011-07-05 17:47:56","2011-07-05 17:47:56","close() was not explicity called on database","<java><android><sqlite>","2","0","","",""
"4921585","1","4921754","","2011-02-07 12:59:24","0","1349","<p>I have 3 webviews displaying query result for a search string from 3 search engines.. if google is displayed, i have yahoo and ask buttons at the bottom....when I click either of them, I get results for the entered query...</p><pre><code>                    if(btn2.getText()==""Yahoo"")        {            wv2.loadUrl(""http://search.yahoo.com/bin/search?p=""+value);            vf.setDisplayedChild(1);            System.out.println(""Yahoo is working"");            btn1.setText(""Ask"");            btn2.setText(""Google"");        }        else if(btn2.getText()==""Ask"")        {            wv3.loadUrl(""http://www.ask.com/web?q=""+value);            vf.setDisplayedChild(2);            System.out.println(""Ask is working"");            btn1.setText(""Google"");            btn2.setText(""Yahoo"");        }        else if(btn2.getText()==""Google"")        {               wv1.loadUrl(""http://www.google.com/search?q=""+value);            vf.setDisplayedChild(0);            System.out.println(""Google is working"");            btn1.setText(""Yahoo"");            btn2.setText(""Ask"");        }   </code></pre><p>With the above code, each time i press the buttons at the bottom, I am getting query results regenerated,,,,I want to display the result if i select any....For ex: Google results displayed the search string ""FACEBOOK"" and i selected first result in that....Suppose I select Yahoo button at the bottom, then yahoo is displayed and I have a google button formed at the bottom....when I click that google button, I want the first result that I selected previously...Kindly suggest what changes to make in the above code</p>","466590","","463721","","2011-02-07 13:22:23","2011-07-21 17:46:30","how to display current webview in android","<android><webview><viewflipper>","4","0","","",""
"4921674","1","","","2011-02-07 13:10:13","1","709","<p>I am working on application for Android 1.5 . Currently, I need to parse XML file. As Android does not support XPath natively in API Level 3, I decided to use dom4j and jaxen libraries to read a file.</p><p>I have simple XML file (test1.xml):</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8"" ?&gt;&lt;tests&gt;    &lt;resources base_lang=""en""&gt;            &lt;string base=""example""&gt;                    &lt;localization lang=""pl""&gt;Przyklad&lt;/localization&gt;            &lt;/string&gt;    &lt;/resources&gt;    &lt;test name=""main name""&gt;            &lt;title&gt;Main Title&lt;/title&gt;            &lt;description&gt;Long description&lt;/description&gt;    &lt;/test&gt;&lt;/tests&gt;</code></pre><p>And simple code:</p><pre><code>SAXReader reader = new SAXReader();Document doc = reader.read(""file:///sdcard/tests/test1.xml"");Node node = doc.selectSingleNode(""/tests/test"");Element elem = (Element)node;for(int j=0;j&lt;elem.attributeCount();++j) {    Attribute attr = elem.attribute(j);    Logger.getLogger(AutoTesterMain.class.getName()).log(Level.SEVERE, ""ATTR: ""+attr.getName()+""=""+attr.getValue());}</code></pre><p>It reads test1.xml file, finds ""/tests/test"" node and enumerates it's attributes. When I run this code as part of ""desktop"" java application (I'm not deep in the java terminology), it displays what I expect (OpenJDK 1.8.3 under Fedora Linux):</p><pre><code>SEVERE: ATTR: name=main name</code></pre><p>Unfortunately, in Android 1.5 (emulator ofc), the exact same code shows:</p><pre><code>E/AutoTesterMain(  823): ATTR: base_lang=main name</code></pre><p>As you can see, attribute's value is OK, but there's problem with name. I have completely no idea, why in this place appears name of attribute from completely other DOM element (""/tests/resources""). It seems to parse my file incorrectly, so I probably set something wrong ...</p><p>Of course both versions uses the exact same .jars with dom4j and jaxen libraries, so this is probably ok.</p><p>This problem has more effects than only incorrect attributes listing. It also disallows me to read attributes properly using XPath - selection ""/tests/test/@name"" gives nothing, while ""/tests/test/@base_lang"" gives me ""main name"" string. This is obviously caused by the same error as in listing attributes above.</p><p>Does anyone encountered this? How could I fix it?</p><p>Moving to newer Android with native XPath support is unfortunately not an option for me.</p><p>I was trying to find anything on web and here, but had no luck.</p>","172835","","172835","","2011-02-07 19:10:46","2011-03-18 14:16:59","Android 1.5 and dom4j - attributes names parsed incorrectly","<java><android><dom><attributes><dom4j>","1","0","","",""
"4921678","1","","","2011-02-07 13:10:56","0","55","<p>I am making an android app which reminds people via notifications of events they have to do over the course of a day. The way I currently do this is have each event on a seperate timer using the Timer class. However, I don't think this is great way of doing things. Is there any way maybe to have just one timer which will trigger an event at each time interval I pass in? Or is there any other way of scheduling a notification?</p>","606471","","","","","2011-02-07 13:17:19","Timer with multiple things to do","<java><android>","1","0","","",""
"4921803","1","","","2011-02-07 13:24:15","7","22165","<p>I just installed the latest version of Eclipse and the Android SDK. In the Android SDK Manager I installed everything, and in Eclipse I installed the ADT Plugin. </p><p>If I choose new Android project, I can't choose any Build Target. How can i select different build targets? Thanks for your help!</p>","606483","","1673709","","2013-05-28 09:36:40","2014-03-12 18:43:56","Eclipse Android Project no Target available","<android><eclipse>","6","0","","",""
"4921811","1","4921856","","2011-02-07 13:24:55","0","701","<p>I am working on customize (inflated) list view. In which I have used the text and background image for text (as per the condition). Now I am facing problem in scrolling the list view that background of text view is overlapping to the other text views.Here is the sample code:</p><pre><code>@Overridepublic View getView(int position, View convertView, ViewGroup parent) { View icontextlayout=convertView;     icontextlayout= inflater.inflate(R.layout.layout_complex_list, null);     TextView Txt1=(TextView)icontextlayout.findViewById(R.id.txt1);if(disp1==true){Txt1.setBackgroundResource(R.drawable.pic)}    elseTxt1.setText(""Text1 ""+strUser);//    TextView Txt2=(TextView)icontextlayout.findViewById(R.id.txt2);if(disp2==true){Txt2.setBackgroundResource(R.drawable.pic);}    else Txt2.setText(""Text2: ""+strIndus);return icontextlayout;      </code></pre><p>}</p><p>Could you please help me out that background image pic do not overlap the others background.</p><p>Thanking you...</p>","579936","","","","","2011-02-07 13:30:06","Trouble in inflated listview","<android><image><listview>","1","0","1","",""
"4921825","1","9488160","","2011-02-07 13:26:46","5","2588","<p>I am using PreferenceActivity, how can I set a custom title bar? Not only text but background color, size - the whole layout.</p>","243225","","243225","","2011-02-07 23:41:42","2013-08-12 15:56:09","Set custom title bar in PreferenceAcivity","<android>","6","0","3","",""
"4921826","1","4921892","","2011-02-07 13:26:47","0","2343","<p>I have tried downloading the Samsung specific drivers.  It installs the modem, not sure if the adb bridge got installed.  I don't see it in the device manager.  I have installed kies 2.0, I have tried connecting USB via MASS storage, via Kies, and under no circumstances so far will ADB detect the device when running adb devices command.  I got lots of suggestions to use Kies, I tried this. Don't see any real relationship between Kies and ADB which is a debug bridge.   I simply have no clue what ADB is doing when I type adb devices.  How does it look for devices, where does it check, where can i register my device with ADB?  </p>","602260","","","","","2011-02-07 13:51:51","Android ADB Cannot Find Samsung Captivate","<android><usb><adb>","2","0","","",""
"4921844","1","4921998","","2011-02-07 13:28:45","1","2772","<p>I'm just looking to setup a simple TextView wrapped in a ScrollView which will automatically scroll down displaying the contents of the TextView in the same way as movies have their credits displayed. I do not want the user to have to interact with scroll bars. There are no buttons or other layouts I am working with on the screen so the credits fills the whole screen.</p><p>I have in my app a horizontally scrolling TextView which I setup in XML using marquee which was pretty easy but I am unsure of the easiest approach to have my text scroll vertically. This is the XML code I am working with will I need to have some code on the Java side to get this to work? Thanks in advance!</p><pre><code>&lt;ScrollView xmlns:android=""http://schemas.android.com/apk/res/android""     android:id=""@+id/sv""     android:layout_width=""fill_parent""     android:layout_height=""fill_parent""    android:fillViewport=""true"" &gt;&lt;TextViewandroid:id=""@+id/tv""android:layout_width=""wrap_content""android:layout_height=""wrap_content""android:text=""@string/credits_text""android:layout_alignParentTop=""true""       android:focusable=""true""     android:focusableInTouchMode=""true""/&gt; &lt;/ScrollView&gt; </code></pre>","606446","","","","","2011-02-07 13:47:20","Vertically AutoScrolling Textview","<android><xml><textview><scrollview>","1","1","1","",""
"4921888","1","4921920","","2011-02-07 13:33:13","1","177","<p>I'm having a little trouble switching views and wondering anyone can help. Basically the initial view is a ListActivity. On this view the user can press the menu button which triggers a database call and when the result comes back (either a number or a null) I require the view to be altered to one of two views (a numberview and a nullview so to speak).</p><p>I've had some success by doing -</p><pre><code>Intent myIntent = new Intent(this, numberview.class);this.startActivity(myIntent);</code></pre><p>Now this works however I can't see a way to pass the number retrieved from the database into the new view.</p><p>I also tried to use the PopUpWindow class but to no avail, all the examples I found only had examples for the Activity (not ListActivity) and some of the mentioned methods don't exist. Can I get some help/advice at all please? </p>","606495","","473070","","2011-02-07 13:35:33","2011-02-07 13:36:38","Switching Views/Popup Window","<android><view><listactivity>","1","0","","",""
"4921906","1","4922454","","2011-02-07 13:35:01","2","664","<p>I'm trying to implement a DialogPreference in the preferences layout. Unfortunatly, the code below always causes a force close. EditTextPreferences work well but I need a simple dialog.Any suggestions what's wrong here?</p><pre><code>&lt;DialogPreference        android:id=""@+id/reset_languages""        android:negativeButtonText=""@string/no""        android:positiveButtonText=""@string/yes""        android:dialogTitle=""@string/reset_languages""        android:dialogMessage=""@string/reset_languages_confirmation""        android:title=""@string/reset_languages""        android:summary=""@string/reset_languages_summ"" /&gt;</code></pre>","564256","","","","","2011-07-29 02:02:03","DialogPreference causes FC","<android><xml><preferences>","1","4","","",""
"4921916","1","","","2011-02-07 13:36:18","1","1632","<p>I am developing an application and I am using a service that tracks location via GPS every 10 minutes. But when I put the location listener in a timer task, it throws an exception:</p><blockquote>  <p>Cannot put code inside thread that has not called <code>looper.prepare()</code>.</p></blockquote><p>Does anyone have any insight on this problem?</p>","461503","","483349","","2012-06-24 16:37:16","2012-06-24 16:37:16","Track Gps At every 10 minutes using timer in android","<android>","2","0","","",""
"4921941","1","4923780","","2011-02-07 13:40:15","5","5855","<p>i want to show the progress dialog before playing video. i tried below link example for playing video.</p><p><a href=""http://davanum.wordpress.com/2009/12/04/android-%E2%80%93-videomusic-player-sample-take-2/"">http://davanum.wordpress.com/2009/12/04/android-%E2%80%93-videomusic-player-sample-take-2/</a></p><p>it works but it takes more time to take for playing video so i want to show a progress dialog before start the video. so please tel me how to show the progress dialog before playing the video.</p><p>Thank you.</p><p>Best Regards.</p>","745367","","","","","2012-06-21 10:14:56","how to show the progress bar before playing the video","<android><video-streaming><progressdialog>","3","1","4","",""
"4921983","1","","","2011-02-07 13:45:22","0","280","<p>In my program I have a list like  <a href=""http://plixi.com/p/75290578#"" rel=""nofollow"">this picture</a></p><p>so you can see that each list have 2 lines and 1 button so I call each button from each list like this</p><pre><code>public void buttonGetClicked(View v){    db.open();    LinearLayout linearLayout = (LinearLayout)v.getParent();    TextView idRow = (TextView) linearLayout.getChildAt(4);    Toast.makeText(Im_SensShow.this, idRow.getText(), Toast.LENGTH_SHORT).show();</code></pre><p>and result is if I click button in list one , it will display ""1""and if I click button in list two, it will display ""2"" </p><p>but the thing that I need is get text from database to read  in TTS function</p><p>(for example in <a href=""http://plixi.com/p/75290578#"" rel=""nofollow"">this picture</a> : if press button in list one ,TTS will make sound like ""Do you have a room"" and if I press button in list two, TTS will make sound like ""Do you"")</p><p>and I've coded database already like this</p><pre><code>public Cursor getSound(String rowId) {    return db.query(IM_SENS_TABLE, new String[] {             KEY_IM_SENS_ID,            KEY_IM_SENS},            KEY_IM_SENS_ID + ""=""+ rowId,             null, null, null, null, null);}</code></pre><p>I try to write like this </p><pre><code>public void buttonGetClicked(View v){    db.open();    LinearLayout linearLayout = (LinearLayout)v.getParent();    TextView idRow = (TextView) linearLayout.getChildAt(4);    Cursor cc = cursor;    cc = db.getSound(idRow.getText().toString());    startManagingCursor(cc);    String sp=cc.getString(cc.getColumnIndexOrThrow(DBAdapter.KEY_IM_SENS));    onInit(sp); }    public void onInit(String speech) {    tts.setLanguage(Locale.ENGLISH);    tts.speak(speech, TextToSpeech.QUEUE_FLUSH, null);   }</code></pre><p>but It force close </p><p>please help</p>","605358","","135152","","2011-05-25 02:57:32","2011-05-25 02:57:32","how to make sound from database when press button from list","<android><sqlite><button><text-to-speech>","1","2","","",""
"4921992","1","4922928","","2011-02-07 13:46:41","3","2423","<p>do you know how to create a folder in which photos will be saved and os and other apps should see that folder as photo album? I need to save photos in a certain album and if album does not exists, I need to create it. </p><p>Thanks</p>","517558","","","","","2012-12-17 04:02:42","android create photo album","<android><photo><albumart>","1","0","1","",""
"4922026","1","4922200","","2011-02-07 13:49:33","2","3551","<p>I'm developing an Android 2.2 application.</p><p>I want to show a text with an Ok butto but I want to add my custom style.</p><p>What is the better choice an <a href=""http://developer.android.com/reference/android/app/AlertDialog.Builder.html"" rel=""nofollow"">AlertDialog</a> with a custom layout or a <a href=""http://developer.android.com/reference/android/app/Dialog.html"" rel=""nofollow"">Dialog</a>?</p>","68571","","68571","","2011-02-07 14:41:16","2011-02-07 15:06:44","AlertDialog or Custom Dialog","<android><dialog><alertdialog><android-2.2-froyo>","1","0","0","",""
"4922037","1","","","2011-02-07 13:50:56","3","1351","<p>Is it possible to to start Gallery in such a way so both pictures and videos are shown?</p><p>Thanks</p>","367677","","","","","2014-04-08 23:35:19","Android: Let user pick image or video from Gallery","<android><android-intent><mime-types>","5","0","1","",""
"4922126","1","4922821","","2011-02-07 14:00:46","0","5609","<p>I am creating a appwidget which needs to update when some changing in app's database.What I do:1. Create working widget2. Override onReceive method: </p><pre><code>public static final String DATABASE_CHANGED = "" utimetable.DATABASE_CHANGED"";@Overridepublic void onReceive(Context context, Intent intent) {    String action = intent.getAction();    if (action.equals(DATABASE_CHANGED) || action.equals(Intent.ACTION_DATE_CHANGED))     {        AppWidgetManager gm = AppWidgetManager.getInstance(context);        int[] ids = gm.getAppWidgetIds(new ComponentName(context, widget_provider.class));        this.onUpdate(context, gm, ids);                }    else     {        super.onReceive(context, intent);    }}</code></pre><ol><li><p>In AndroidManifest:</p><pre><code>    &lt;receiver android:name="".widget_provider"" android:label=""@string/widget_today_name""&gt;    &lt;intent-filter&gt;        &lt;action android:name=""android.appwidget.action.APPWIDGET_UPDATE"" /&gt;        &lt;action android:name=""utimetable.DATABASE_CHANGED"" /&gt;        &lt;action android:name=""android.intent.action.DATE_CHANGED"" /&gt;    &lt;/intent-filter&gt;    &lt;meta-data android:name=""android.appwidget.provider"" android:resource=""@xml/widget_row"" /&gt;&lt;/receiver&gt;</code></pre></li><li><p>Add Broadcast sending into all DB changing functions:</p><pre><code>public static void sendUpdateIntent(Context context) {    Intent i = new Intent(context, widget_provider.class);    i.setAction(widget_provider.DATABASE_CHANGED);    context.sendBroadcast(i);}</code></pre></li></ol><hr><p>But widget still not updated when I make changes in DB.What should I do?</p>","499393","","","","","2011-02-07 15:09:29","Using sendBroadcast for update android widgets","<android><android-widget><android-intent>","1","0","1","",""
"4922185","1","4922293","","2011-02-07 14:05:58","4","1599","<p>I've run into issues with banding of my PNG files. Digging into the problem has yielded two solutions. Both make sense individually, but together they don't. The solutions I've discovered:</p><p>1) Move the PNG file into the ""raw"" folder. This prevents AAPT from ""optimizing"" the image which results in banding.</p><p>2) Change the pixel format of your Activity's window to RGBA_8888 (i.e. in onCreate add this line ""getWindow().setFormat(PixelFormat.RGBA_8888)""). On Android 2.2 and lower the default pixel format is 16-bit (565). </p><p>I have tried both of these and they correct the banding effect in my images, however now I am even more confused as to what Android is doing. </p><p>On the one hand, if I leave my PNG in the drawable folder it is ""optimized"" which results in a banding effect in the image. It magically goes away when I change the pixel format to 32-bit. If the image was ""optimized"" though, I would have expected the banding to remain.</p><p>On the other hand, if I move the PNG to the raw folder it will retain the nice gradient and display nicely even though the pixelFormat is supposedly 16-bit.</p><p>If anyone has any insight into what is going on I would appreciate it.</p><p>Thanks,</p><p>-Dan</p>","212389","","","","","2011-02-16 12:53:33","Confusing PNG banding solutions","<android><png>","1","0","3","",""
"4922195","1","","","2011-02-07 14:06:31","0","730","<p>I'm faced with another dilemma, with regards to synchronizing (or updating?) data across to the server, from a mobile device (using Android).</p><p>I've looked into SyncML as the standard for doing this, but my big concern is that we plan on <code>syncing</code> a large amount of data across (not just 1 record), and probably only doing it once, twice or at most 3 times a day, or maybe not even once a day - all dependant on certain circumstances.</p><p>The other thing - the device or server will still be able to function properly without having to sync across. The sync would just be an <code>update</code>, essentially.</p><p>From reading up on the SyncML specs, it applies more to syncing across small pieces of data, and at a very fast interval (ie. every 5-15 minutes, but I guess can be regulated by the user). At any rate, the synchronization process is more involved, and important for both the device and the server (more so the device, I guess).</p><p>Here's a quote from the documentation that got me thinking:</p><blockquote>  <p>2.2.3 Data synchronization SyncML is oriented towards synchronization of  small independent records, as the  modied records are transmitted  entirely. This is adequate for address  entries, short messages and similar  data. On the primary target of SyncML,  mobile devices, most data is of this  type. The devices must be able to keep  track which of their records have been  changed. Each record is identied by a  unique ID, so con icts can be detected  quite simple. As the record ID's may  not be arbitrarily chosen but  automatically created, mapping between  server and client ID's is dened in  the protocol. Mapping is always  managed by the server. When the client  receives a new item from the server,  he can send a map update command to  tell the server what ID he assigned to  the item. Now the server uses the  client ID in all his messages.</p></blockquote><p>So, I guess my question is whether we should continue to look into SyncML for this, or built an in-house solution - maybe something more tailored to delivering large pieces of data across, which can define it as well?</p>","380579","","","","","2012-01-02 14:57:07","SyncML (sync or update?)","<android><web-services><synchronization><syncml>","1","3","","",""
"4922329","1","4922396","","2011-02-07 14:20:30","1","968","<p>I am wondering what way I can log (sniff) all HTTP requests that are outgoing and incoming in whole Android and is it possible to modify them during that process or block ?</p><p>What libraries should I use ?</p>","223386","","","","","2011-02-07 14:28:19","Android log and modify all HTTP requests","<android><http><httpwebrequest>","1","2","0","",""
"4922352","1","","","2011-02-07 14:23:14","6","2051","<p>I have customize the <strong>SeekBar</strong> using a <strong>LayeredDrawable</strong>, The drawable works fine, but the drawable used as a background becomes rounded at the corners (Both the corner, here only the right end is shown. When the thumb is moved to the extreme left, the left corner is also rounded. Note: The original image is rectangular). How do I make it rectangular?</p><p><img src=""http://i.stack.imgur.com/fLNGN.png"" alt=""enter image description here""></p><p>Here is my LayerdDrawable xml:</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:id=""@android:id/background""&gt;    &lt;bitmap android:src=""@drawable/progress_bg"" /&gt;&lt;/item&gt;&lt;item android:id=""@android:id/progress""&gt;    &lt;clip&gt;        &lt;bitmap android:src=""@drawable/progress"" /&gt;    &lt;/clip&gt;&lt;/item&gt;&lt;/layer-list&gt;</code></pre>","421372","","421372","","2011-02-07 14:47:23","2013-04-04 11:13:52","Rectangular edges for custom SeekBar","<android><customization><seekbar>","1","1","1","2013-04-05 06:38:39",""
"4922381","1","","","2011-02-07 14:26:32","3","1017","<p>In two different activities I want to use same gradient drawable but with different colors.I think to refer gradient colors to activity theme in follow way:</p><p>I've added follow rows in attrs.xml</p><pre><code>&lt;attr name=""backgroundTopColor"" format=""color"" /&gt;&lt;attr name=""backgroundBottomColor"" format=""color"" /&gt;</code></pre><p>in bg_gradient.xml I typed</p><pre><code>&lt;shape xmlns:android=""http://schemas.android.com/apk/res/android""&gt;    &lt;gradient         android:startColor=""?backgroundTopColor""         android:endColor=""?backgroundBottomColor""         android:angle=""270"" /&gt;    &lt;corners android:radius=""0dp"" /&gt;&lt;/shape&gt;</code></pre><p>In activity theme, I've added</p><pre><code>&lt;item name=""backgroundTopColor""&gt;#FFFFFFFF&lt;/item&gt;&lt;item name=""backgroundBottomColor""&gt;#FFFFFF00&lt;/item&gt;</code></pre><p>After application start in logcat</p><blockquote>  <p>02-07 14:03:59.479: ERROR/AndroidRuntime(2096): Caused by: java.lang.UnsupportedOperationException: Can't convert to color: type=0x2<br>  02-07 14:03:59.479: ERROR/AndroidRuntime(2096):     at android.content.res.TypedArray.getColor(TypedArray.java:326)<br>  02-07 14:03:59.479: ERROR/AndroidRuntime(2096):     at android.graphics.drawable.GradientDrawable.inflate(GradientDrawable.java:647)<br>  02-07 14:03:59.479: ERROR/AndroidRuntime(2096):     at android.graphics.drawable.Drawable.createFromXmlInner(Drawable.java:788)<br>  02-07 14:03:59.479: ERROR/AndroidRuntime(2096):     at android.graphics.drawable.Drawable.createFromXml(Drawable.java:729)<br>  02-07 14:03:59.479: ERROR/AndroidRuntime(2096):     at android.content.res.Resources.loadDrawable(Resources.java:1694)<br>  02-07 14:03:59.479: ERROR/AndroidRuntime(2096):     ... 29 more</p></blockquote><p>How I can solve this?</p><p>Thank you</p><p>NB: API level = 8</p>","251434","","436938","","2012-02-29 15:27:39","2012-02-29 15:27:39","Re use gradient drawable with theme-dipendent colors","<android><colors><gradient><drawable><attr>","1","0","2","",""
"4922403","1","4923669","","2011-02-07 14:28:53","2","1665","<p>I am trying to displaying a ProgressDialog before a video with the following code:</p><pre><code>package com.Boodang;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 android.app.Activity;import android.app.ProgressDialog;import android.content.Context;import android.os.Bundle;import android.os.Handler;import android.os.Message;import android.util.Log;import android.view.View;import android.view.View.OnClickListener;import android.webkit.URLUtil;import android.widget.EditText;import android.widget.ImageButton;import android.widget.ImageView;import android.widget.Toast;import android.widget.VideoView;public class VideoLoading extends Activity implements Runnable {    private static final String TAG = ""VideoViewDemo"";    private VideoView mVideoView;    private EditText mPath;    private ImageView mPlay;    private ImageView mPause;    private ImageButton mReset;    private ImageView mStop;    private String current;    private ProgressDialog dialog;    private Context mContext;    String s=null;    @Override    public void onCreate(Bundle state){    super.onCreate(state);    dialog=ProgressDialog.show(this,"""",""Loding.PleaseWait"",true);    Thread t=new Thread(this);    t.start();       Log.e(""VideoPlay1 page"",""OnStart"");        setContentView(R.layout.videoplay);        mPlay = (ImageView) findViewById(R.id.play);        mPause = (ImageView) findViewById(R.id.pause);        mStop = (ImageView) findViewById(R.id.stop);        mPlay.setOnClickListener(new OnClickListener() {            public void onClick(View view) {            }        });        mPause.setOnClickListener(new OnClickListener() {            public void onClick(View view) {                if (mVideoView != null) {                    mVideoView.pause();                }            }        });        mStop.setOnClickListener(new OnClickListener() {            public void onClick(View view) {                if (mVideoView != null) {                    current = null;                    mVideoView.stopPlayback();                }            }        });    runOnUiThread(new Runnable(){        public void run() {              dialog.dismiss();            }        });    }    public void run(){        Message msg;        handler.sendEmptyMessage(0);    } Handler handler=new Handler(){@Override public void handleMessage(Message msg) {        try {            mVideoView = (VideoView) findViewById(R.id.video);            s=getIntent().getStringExtra(""id"");            final String path = s;            Log.v(TAG, ""path: "" + path);            if (path == null || path.length() == 0) {            Toast.makeText(VideoLoading.this, ""File URL/path is empty"",                        Toast.LENGTH_LONG).show();            } else {                // If the path has not changed, just start the media player                if (path.equals(current) &amp;&amp; mVideoView != null) {                    mVideoView.start();                    mVideoView.requestFocus();                return;            }            current = path;                mVideoView.setVideoPath(getDataSource(path));                mVideoView.start();                mVideoView.requestFocus();            }        } catch (Exception e) {            Log.e(TAG, ""error123: "" + e.getMessage(), e);            if (mVideoView != null) {                mVideoView.stopPlayback();            }        }    } };    private String getDataSource(String path) throws IOException {        if (!URLUtil.isNetworkUrl(path)) {            return path;        } else {            URL url = new URL(path);            URLConnection cn = url.openConnection();            cn.connect();            InputStream stream = cn.getInputStream();            if (stream == null)                throw new RuntimeException(""stream is null"");            File temp = File.createTempFile(""mediaplayertmp"", ""dat"");            temp.deleteOnExit();            String tempPath = temp.getAbsolutePath();            FileOutputStream out = new FileOutputStream(temp);        byte buf[] = new byte[128];            do {            int numread = stream.read(buf);                if (numread &lt;= 0)                    break;                out.write(buf, 0, numread);            } while (true);            try {                stream.close();            } catch (IOException ex) {               Log.e(TAG, ""error: "" + ex.getMessage(), ex);            }            return tempPath;        }    }}</code></pre><p>but I do not get the progress bar here. all I get is the the video directly.</p><p>All help is appreciated.</p>","606559","","222159","","2011-02-07 14:31:44","2011-02-07 16:25:29","displaying a progressdialog before a video","<android><video><progressdialog>","3","0","1","",""
"4922442","1","4923068","","2011-02-07 14:32:34","3","5329","<p>Is there a way to detect long presses on links and images inside a WebView?</p>","64475","","","","","2011-02-08 08:21:24","android webview: detect long press on <a> and <img>","<android><webview><image>","1","0","3","",""
"4922527","1","","","2011-02-07 14:40:20","0","188","<p>I want 7 togglebuttons to be organized in a pyramid, like this:</p><pre><code>---b-----b-b---b---b- b-----b</code></pre><p>where b represents a togglebuton and - represents an empty space. I also wnat the whole pyramide to fill the width of it's parent. How can I achieve this? Any help is appreciated.</p>","162003","","","","","2011-02-07 14:46:41","Android Togglebuttons organized as a pyramid?","<android><layout><togglebutton>","1","0","","",""
"4922641","1","4922740","","2011-02-07 14:51:12","4","5538","<p>I am developing an application that contains many activities and i created my own menu (i don't want to use the built in menu button) with the Sliding Drawer as the sliding drawer is at the bottom of the screen and contains my menu buttons </p><p>what i need is to make that sliding drawer to appear in all my activities </p><p>i tried to create an activity and set it's content view to the xml file that includes the drawer and then extends that activity in all other activities but this solution doesn't work </p><p>so any suggestions ?</p>","575630","","","","","2014-01-09 06:49:50","sliding drawer appear in all activities","<android><menu><slidingdrawer>","3","0","4","",""
"4922649","1","4923088","","2011-02-07 14:52:07","0","1664","<p>The default screen of my app shows a ListView. When the user selects an entry a new Activity is displayed with a Title (TextView), some information gained from xml (WebView).</p><p>I want to place an Ad aligned to the bottom of this second Activity.</p><p>My layout currently is this:</p><pre><code>&lt;LinearLayout android:id=""@+id/info"" android:layout_width=""fill_parent"" android:layout_height=""wrap_content"" android:orientation=""vertical"" style=""@style/info""&gt;        &lt;TextView android:id=""@+id/title"" style=""@style/title"" /&gt;    &lt;WebView android:id=""@+id/info"" style=""@style/info"" /&gt;&lt;/LinearLayout&gt;</code></pre><p>This works perfectly, but I can't get the Ad to always be at the bottom.</p><p>I've tried RelativeLayout, but no matter what, I always get the same results!</p><p>If the HTML shown in the WebView is short enough for the AdView to be displayed (but not at bottom, underneath WebView) or its too long and the AdView is not shown at all!</p><p>I want the AdView always visible always, even if the WebView scrolls!</p><p>Hope this makes sense!</p><p>Neil</p><p>PS: I'll continue to look for answers and update if I find one....</p>","67419","","67419","","2011-02-07 15:08:24","2011-02-07 15:31:30","Align AdView (AdMob) to bottom of screen with WebView on Android Layout","<android><android-layout>","1","1","","",""
"4922699","1","4923121","","2011-02-07 14:57:57","0","244","<p>I m working on an auto start application. In my application when app starts i need to get the sim number. When i have not applied any sim lock my app is working fine but when i apply sim lock and again reboot the device it asks for the sim password and as soon as screen comes my auto start app gets crashed with null pointer exception.</p><p>How can i overcome this issue..</p>","383597","","","","","2011-02-07 15:34:09","Android app crashes when sim is locked","<android>","1","0","","",""
"4922764","1","6227541","","2011-02-07 15:03:12","3","1414","<p>I'm writing a UI test case (using ActivityUnitTestCase) and would like to check if at a given time a View subclass is visible to the user. I've found the <strong>View#isShown()</strong> method, which claims to do exactly this - checking the visibility field of this element and all its parents - but somehow it always returns ""false"" for all the elements. I'll be grateful for some help. If it makes it easier, I can paste some code.</p><p>Also, I found <strong>ViewAsserts#assertOnScreen(View origin, View view)</strong> but it doesn't seem to do the right thing either - always returns true. Am I perhaps calling it wrong: assertOnScreen(viewImTesting.getRootView(), viewImTesting)?</p><p>Thanks,Jan</p>","128734","","","","","2011-11-04 16:45:30","In an Android test, how to check that a View is shown?","<android><unit-testing><gui>","3","1","2","",""
"4922896","1","4922972","","2011-02-07 15:15:26","0","909","<p>This sounds like a issue a beginner like me would only have...this is my code...</p><pre><code>    private void saveAvatar(Bitmap avatar) {    String strAvatarFilename =  Id + "".jpg"";     try {        avatar.compress(CompressFormat.JPEG, 100, openFileOutput(strAvatarFilename, MODE_PRIVATE));    } catch (Exception e) {        Log.e(DEBUG_TAG, ""Avatar compression and save failed."", e);    }    Uri imageUriToSaveCameraImageTo = Uri.fromFile(new File(PhotoActivity.this.getFilesDir(), strAvatarFilename));    Editor editor = Preferences.edit();    editor.putString(PREFERENCES_AVATAR, imageUriToSaveCameraImageTo.getPath());    editor.commit();    ImageButton avatarButton = (ImageButton) findViewById(R.id.ImageButton_Avatar);    String strAvatarUri = Preferences.getString(PREFERENCES_AVATAR, """");    Uri imageUri = Uri.parse(strAvatarUri);    avatarButton.setImageURI(null);     avatarButton.setImageURI(imageUri);}</code></pre><p>This does save the image but when i go to look at the image on the sd card ti is called imag001 etc not the ID i am labelling it. How do i save the image with a name i want to call it? regards</p><p><strong>EDIT</strong></p><p>I found out something interesting...I believe on the SD card in the DCIM/100MEDIA the image taken by the application is stored using the name the phone has set as default. However, under data/data/com.andorid.packagename/files/   the image mayalso is being stored with the name i give to it.</p>","569654","","569654","","2011-02-08 12:05:09","2011-02-09 03:04:30","Android How do you save an image with your own unique Image Name?","<android><image>","2","0","1","",""
"4922908","1","","","2011-02-07 15:16:29","0","381","<p>I want to send the JavaVM object from one process to another process in Android.Is it possible?</p><p>Please suggest me how to do it. </p><p>regardsSatyajit</p>","606647","","510491","","2012-12-19 11:40:00","2012-12-19 11:40:00","Sharing JavaVM object between two process in Android","<java><android><process>","1","2","","",""
"4922983","1","4930355","","2011-02-07 15:22:15","2","368","<p>In my app, I show a menu screen immediately to the user and then use an AsyncTask to load some  data from disk. Loading takes about 3 seconds if that's all the app had to do. When the user hits a menu option and the data hasn't loaded yet, a ""Please wait, loading"" screen appears.</p><p>I have two problems:</p><ul><li><p>I recently added ads to my app and have found this is making my app hang sometimes because the AsyncTask never finishes loading. What seems to be happening is that the ad banner (I'm using admob and this happens when adsense ads are shown which admob do occasionally) is using resources by playing a simple animation and the AsyncTask never gets a chance to finish. </p></li><li><p>I want to play a simple looping animation (e.g. making a view rotate) on my menu screen and this makes the AsyncTask take about 5 times longer to finish which renders the background loading pointless.</p></li></ul><p><b>How can I avoid situations where my background data never finishes loading or has such a low priority it takes a long time?</b></p><p>I can't seem to find a way to increase the priority of an AsyncTask.</p>","580100","","","","","2011-03-07 11:05:59","AsyncTask never finishes when other tasks are running","<java><android><mobile>","2","0","","",""
"4923073","1","","","2011-02-07 15:29:51","1","1725","<p>I'm using an image with transparency as a ImageButton in my Android app - but when it appears on the android screen - it still has a whitish surrounding border. </p><p>I even changed the image to one of the template ones supplied and that still is not transparent (although it is in photoshop).Am a missing some declaration or something ?</p><p>I tried in both the emulator and also running on my phone and its still shows as white on the black background.</p><p>Cheers</p><p>ScottyB</p>","606646","","","","","2011-07-26 09:52:40","Android Transparent png doesn't show as transparent","<android><png><transparency>","1","1","","",""
"4923079","1","12814799","","2011-02-07 15:30:24","1","908","<p>I need to create a custom toggle-silder widget, like in the iphone, things like on-off items etc...For the task i chose to inherit from LinearLayout, define it as Vertical and grab some xml attributes like the drawables that will be using for the buttons (one for on, one for off) and i just place two Views with the drawables as their backgrounds.Now the issues i'm facing are:</p><ol><li>i can catch onKeyDown andonTouchEvent to discover swipe andright-left-fire events so i'llswitch states for the button, but ido wonder if there is a swipe eventread in the android system onSwipeor should i try messing with theGestureDetector ?</li><li>i want the sliding to be animated, i have no idea how to do that, any ideas where to start looking ?</li></ol>","312288","","","","","2012-10-10 08:09:13","Android widget slide animation","<android><animation><slider><toggle><swipe>","1","0","","",""
"4923090","1","4928569","","2011-02-07 15:31:50","1","994","<p>I am using a ListActivity to display an iconified list (using a custom implementation of BaseAdapter). It does not reload data properly. When I change the contents of the adapter and notify the list, it appears that the old data draws on top of the new data, until a scroll event happens. The old rows draw on top of the new rows, but the old rows disappear when I start scrolling.</p><p>However if I set the ListActivity style to Theme.Dialog, it refreshes fine. (presumably because when in dialog, the activity resizes each time the list contents changes, which forces a redraw of the whole view hiearchy?)</p><p>Any ideas how to make this work in my fullscreen activity?</p><p>Thanks.</p>","426493","","","","","2011-02-08 01:04:07","ListActivity list does not refresh properly when in full screen?","<android><listview>","2","0","1","",""
"4923185","1","5131160","","2011-02-07 15:39:23","2","1932","<p>We currently have an application that sends out SMS to users, it acts like a SMS gateway sitting on an Android phone.</p><p>I have come across a lot of questions on how to reads SMS, SMS threads etc, i was wondering if it is possible to figure out which thread and incoming SMS belongs to.</p><p>We are looking at automating where we send an SMS to user with an ORDER ID, when user replies back we would like to figure out which thread the SMS belongs to and try to extract the ORDER ID from that SMS that initiated the conversation. </p>","160108","","580556","","2011-02-07 16:00:38","2011-02-27 03:17:47","Android SMS history","<android>","1","0","1","",""
"4923205","1","","","2011-02-07 15:40:40","7","625","<p>I have implemented Augmented Reality application for android using Adobe Air for Android, FLARManager, Away3DLite.The program works fine on flash, However when i publish it on my mobile phone (HTC Nexus One) or run it on the emulator my camera doesn’t activate and all i can see is the colour of my background and the framerate display.</p><p>I think that the problem is the Camera3D that i have used which is the FLARCamera_Away3DLite from FLARManager.</p><p>This is how I set my camera</p><pre><code>import com.transmote.flar.camera.FLARCamera_Away3DLite;private var camera3D:FLARCamera_Away3DLite;this.camera3D = new FLARCamera_Away3DLite(this.flarManager, new Rectangle(0, 0, this.stage.stageWidth, this.stage.stageHeight));</code></pre><p>I will really appreciate any advice i can get from you.</p><p>Thank you George</p>","495296","","495296","","2011-03-03 18:40:58","2011-03-10 11:34:36","Problem with getting the Camera to work on Away3DLite","<android><air><away3d><flartoolkit>","1","6","2","",""
"4923282","1","","","2011-02-07 15:47:51","0","305","<p>I am trying to emulate point sprites in Android using OpenGL, specifically the characteristic of the size staying the same if the view is zoomed.</p><p>I do not want to use point sprites themselves as they pop out of the frustum when the ""point"" reaches the edge, regardless of size. I do not want to go down the route of Orthographic projection either.</p><p>Say I have a billboard square with a size of 1, when the use zooms in, I would need to decrease the size of the square so it looks the same size, if the user zooms out, I increase it. I have the projection and model matrices to hand if these are required as well as the FOV. My head just goes blank every time I sit down and think about it! Any ideas on the necessary algorithm?</p>","606707","","44729","","2011-02-07 16:10:55","2011-05-02 17:43:12","Emulating constant size of point sprites using OpenGL ES","<android><opengl-es>","1","0","","",""
"4923287","1","","","2011-02-07 15:48:34","2","1116","<p>I have an Activity with a viewFlipper and a slidingDrawer.The SlidingDrawer's Handler contains an extra button wich is clickable.</p><p>The problem is, the extra button on the handler only registers onClick when the slidingDrawer is locked, and when the slidingDrawer is locked, the viewFlipper (the rest of the layout) does not respond to the gestureListener anymore and therefore I cannot flip between views.</p><p>Does anyone have any suggestions on how to make an extra button on a slidingDrawer's handler clickable and at the same time have a working gesturelistener on the viewFlipper?</p><p>Maybe someone knows why slidingDrawer.lock() would block the touch input for the rest of the layout?</p><p>Thanks!</p>","536938","","","","","2012-05-04 02:41:42","Android: Slidingdrawer.lock() blocking touch input for the rest of the layout","<android><locking><onclick><slidingdrawer><gesturedetector>","2","0","","",""
"4923300","1","","","2011-02-07 15:50:13","0","351","<p>Quick question. i have an activity that when the user clicks on a particular item, an image gallery gets displayed. now my question is, i am trying to implement an action/code that when that same item is clicked, it brings up an option for the user to choose to display the images stored in either the internal or external storage unit? hope this now makes sense. Thanks</p>","447570","","447570","","2011-02-07 16:46:54","2011-02-07 16:46:54","Action to choose between External or Internal storage in Android","<android>","0","2","","",""
"4923310","1","","","2011-02-07 15:51:11","10","25019","<p>This is driving me nuts since it's something I've done before but can't figure out why it isn't working now...</p><p>I've got a menu button, implemented in the usual way via a <code>menu.xml</code> file and the <code>onOptionsItemSelected</code> method with a switch in it, that creates and displays a spinner.</p><p>I've added the <code>setOnItemSelectedListener</code>, but it never seems to trigger. The spinner appears, I pick an option or back out, neither <code>onItemSelected</code> or <code>onNothingSelected</code> are called.</p><p>Here is all the code between the ""case"" and ""return true"" of the menu-button-handling switch statement. (<code>topThis</code> is a variable referring to the context of the activity - works fine for all other toasts in the app)</p><pre><code>String[] widgetModes = {""Mode 1"", ""Mode2""};ArrayAdapter&lt;String&gt; widgetModeAdapter = new ArrayAdapter&lt;String&gt; (this, android.R.layout.simple_spinner_item, widgetModes);widgetModeAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);Spinner widgetModeSpinner = new Spinner(this);widgetModeSpinner.setAdapter(widgetModeAdapter);widgetModeSpinner.setPrompt(""Choose Widget Mode"");widgetModeSpinner.setOnItemSelectedListener(new OnItemSelectedListener() {    @Override    public void onItemSelected(AdapterView&lt;?&gt; parentView, View selectedItemView, int position, long id)     {        Toast.makeText(topThis, ""derp"", Toast.LENGTH_LONG).show();    }    @Override    public void onNothingSelected(AdapterView&lt;?&gt; parentView)     {        Toast.makeText(topThis, ""herf"", Toast.LENGTH_LONG).show();    }});widgetModeSpinner.performClick();</code></pre><p>Any ideas? I vaguely suspect that the fact I'm creating the <code>Spinner</code> programmatically is the problem...</p>","593886","","810368","","2012-10-03 14:51:00","2013-09-15 19:50:31","Android Spinner - onItemSelected / setOnItemSelectedListener not triggering","<android><android-layout><triggers><spinner><listener>","3","7","3","",""
"4923422","1","4923444","","2011-02-07 16:00:48","7","8047","<p>Ive been trying to acheive the same, this is exactly what i want :-<img src=""http://i.stack.imgur.com/ZxMcC.jpg"" alt=""Google Maps Image""></p><p>i have implemented googleMapView with overlays, i have one issue i want to show a popup when clicked on each overlay, and when i click on another overlay the previous popus should disappear and new one should appear at the clicked location(ie projection points). And popup shouldnt appear when i click anywhere else on screen.Im using onTap event to record onclick. (map_overlay) is the layout that i want to show when someone click a projection point on the map. The code is below and map_overlay.xml could be any file. </p><p><strong>Class: ItemizedOverlay</strong></p><pre><code>public boolean onTap(GeoPoint p, MapView mapView) {LayoutInflater inflater = (LayoutInflater)cContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);LayoutParams lp = new MapView.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.FILL_PARENT, p, LayoutParams.WRAP_CONTENT);LinearLayout view = (LinearLayout)inflater.inflate(R.layout.map_overlay, null);mapView.removeView(view);    mapView.invalidate();    mapView.addView(view,lp);mapView.invalidate();return true;}</code></pre><p>Below is the Main class in which im displaying projection points which is working fine and im calling I have implemented the onTap event in another class as shown above:</p><pre><code>public **class MapView** extends MapActivity{    private ArrayList&lt;MyClass&gt; overlayItem ;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.large_mapview);        mapView = (MapView) findViewById(R.id.mapview);       // mapView.setBuiltInZoomControls(true);        List&lt;Overlay&gt; mapOverlays = mapView.getOverlays();        Drawable drawable = this.getResources().getDrawable(R.drawable.mappointer2);        ItemizedOverlay itemizedoverlay = new ItemizedOverlay(drawable,this);        OverlayItem overlayitem;        GeoPoint point;        double lat;        double lng;                for (int i = 0; i &lt; overlayItem.size(); i++) {            lat = Double.parseDouble(overlayItem.get(i).getLatitude());            lng = Double.parseDouble(overlayItem.get(i).getLongitude());            point = new GeoPoint((int) (lat * 1E6),(int) (lng * 1E6));            overlayitem = new OverlayItem(point, i+"""".toString(), overlayItem.get(i).getDetails().toString());            itemizedoverlay.addOverlay(overlayitem);            mapOverlays.add(itemizedoverlay);        }        mapView.invalidate();    }}</code></pre>","606669","","492624","","2012-02-26 08:58:44","2012-02-26 08:58:44","mapView show overlay details when clicked","<android>","1","0","","",""
"4923458","1","","","2011-02-07 16:04:19","0","322","<p>Greetings.I am trying to draw a graph in Android. I want the graph to scale to current screen size, so instead of setting them explicitly in the constants, I get the size of an LinearLayout which is intented to contain the graph. However, there is a problem that it's not possible to get sizes in activity's onCreate(), so I use a custom LinearLayout with overridden onSizeChanged(). I include it into layout with:</p><pre><code>view class=""com.nnevod.loggraph.graph$GraphDisplayLayout""    android:layout_height=""fill_parent""    android:id=""@+id/linearLayout1""    android:layout_width=""fill_parent""    android:layout_weight=""1""    android:background=""@color/White""</code></pre><p>I've omitted angular brackets. </p><p>In the overridden onSizeChanged(), dimensions of the view are read, then everything is done as described in many graphing examples: a Bitmap is created, passed to a graph-drawing class, an ImageView is created, is set with the Bitmap, and then added to the custom LinearLayout.</p><p>Problem is, the graph's image is not visible. However, if I try to inspect it with HierarchyViewer, the image becomes visible. If I cut-paste the code from onSizeChanged() to activity's onCreate(), sans using preset dimensions instead of measured ones, everything is displayed nicely.</p><p>So, my question is what I'm doing wrong? I've had assumptions that either I'm using a wrong context in custom onSizeChanged(), or it is not possible to update the view from there, and I should somehow pass the measured dimensions to the activity and do the attachment of the Bitmap in some of activity's methods. Though on the context part, I've tried using all availible contexts, including using activity's context, to no avail.</p><p>Thanks in advance. If needed, I'll provide more code.</p>","412710","","","","","2011-02-07 17:09:03","Drawing a graph, can not see the resulting image","<android><graph><canvas><context><draw>","1","0","","",""
"4923487","1","4923558","","2011-02-07 16:07:33","0","3042","<p>my app has three buttons that each create a new intent like this:</p><pre><code> Button button3 = (Button) findViewById(R.id.Button03);    button3.setOnClickListener(new View.OnClickListener() {        public void onClick(View view) {            Intent myIntent = new Intent(view.getContext(), Shout.class);            startActivityForResult(myIntent, 0);        }    });</code></pre><p>so basically my other classes in the project start when I click a button. When I want to go back to the first screen I just press the back key.this works well but after I've pressed the buttons and the back key about 5 times the app crashes. Why? I've noticed that even after I go back from the class, the sensorlistener continues to run at full speed like here:</p><pre><code>02-07 16:51:13.034: DEBUG/sensor(5354): onSensorChanged: 202-07 16:51:13.094: DEBUG/sensor(5354): onSensorChanged: 202-07 16:51:13.154: DEBUG/sensor(5354): onSensorChanged: 202-07 16:51:13.214: DEBUG/sensor(5354): onSensorChanged: 202-07 16:51:13.274: DEBUG/sensor(5354): onSensorChanged: 202-07 16:51:13.334: DEBUG/sensor(5354): onSensorChanged: 202-07 16:51:13.394: DEBUG/sensor(5354): onSensorChanged: 202-07 16:51:13.444: INFO/ActivityManager(156): Starting: Intent { cmp=com.bengaard/.Shout } from pid 535402-07 16:51:13.504: DEBUG/sensor(5354): onSensorChanged: 202-07 16:51:13.564: DEBUG/dalvikvm(5354): GC_EXTERNAL_ALLOC freed 394K, 60% free 3179K/7943K, external 24861K/26873K, paused 34ms02-07 16:51:13.574: ERROR/dalvikvm-heap(5354): 32980-byte external allocation too large for this process.02-07 16:51:13.604: ERROR/GraphicsJNI(5354): VM won't let us allocate 32980 bytes02-07 16:51:13.604: DEBUG/dalvikvm(5354): GC_FOR_MALLOC freed &lt;1K, 60% free 3179K/7943K, external 24861K/26873K, paused 21ms02-07 16:51:13.614: DEBUG/skia(5354): --- decoder-&gt;decode returned false02-07 16:51:13.614: DEBUG/AndroidRuntime(5354): Shutting down VM02-07 16:51:13.614: WARN/dalvikvm(5354): threadid=1: thread exiting with uncaught exception (group=0x40169560)02-07 16:51:13.614: DEBUG/webviewglue(5354): nativeDestroy view: 0x4dc7e002-07 16:51:13.614: DEBUG/webviewglue(5354): nativeDestroy view: 0x47a31002-07 16:51:13.614: DEBUG/webviewglue(5354): nativeDestroy view: 0x4339e802-07 16:51:13.644: ERROR/AndroidRuntime(5354): FATAL EXCEPTION: main02-07 16:51:13.644: ERROR/AndroidRuntime(5354): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.bengaard/com.bengaard.Shout}: android.view.InflateException: Binary XML file line #21: Error inflating class &lt;unknown&gt;02-07 16:51:13.644: ERROR/AndroidRuntime(5354):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1622)02-07 16:51:13.644: ERROR/AndroidRuntime(5354):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1638)02-07 16:51:13.644: ERROR/AndroidRuntime(5354):     at android.app.ActivityThread.access$1500(ActivityThread.java:117)02-07 16:51:13.644: ERROR/AndroidRuntime(5354):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:928)02-07 16:51:13.644: ERROR/AndroidRuntime(5354):     at android.os.Handler.dispatchMessage(Handler.java:99)02-07 16:51:13.644: ERROR/AndroidRuntime(5354):     at android.os.Looper.loop(Looper.java:123)02-07 16:51:13.644: ERROR/AndroidRuntime(5354):     at android.app.ActivityThread.main(ActivityThread.java:3647)02-07 16:51:13.644: ERROR/AndroidRuntime(5354):     at java.lang.reflect.Method.invokeNative(Native Method)02-07 16:51:13.644: ERROR/AndroidRuntime(5354):     at java.lang.reflect.Method.invoke(Method.java:507)02-07 16:51:13.644: ERROR/AndroidRuntime(5354):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)02-07 16:51:13.644: ERROR/AndroidRuntime(5354):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)02-07 16:51:13.644: ERROR/AndroidRuntime(5354):     at dalvik.system.NativeStart.main(Native Method)02-07 16:51:13.644: ERROR/AndroidRuntime(5354): Caused by: android.view.InflateException: Binary XML file line #21: Error inflating class &lt;unknown&gt;02-07 16:51:13.644: ERROR/AndroidRuntime(5354):     at android.view.LayoutInflater.createView(LayoutInflater.java:518)02-07 16:51:13.644: ERROR/AndroidRuntime(5354):     at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)02-07 16:51:13.644: ERROR/AndroidRuntime(5354):     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:568)02-07 16:51:13.644: ERROR/AndroidRuntime(5354):     at android.view.LayoutInflater.inflate(LayoutInflater.java:386)02-07 16:51:13.644: ERROR/AndroidRuntime(5354):     at android.view.LayoutInflater.inflate(LayoutInflater.java:320)02-07 16:51:13.644: ERROR/AndroidRuntime(5354):     at android.view.LayoutInflater.inflate(LayoutInflater.java:276)02-07 16:51:13.644: ERROR/AndroidRuntime(5354):     at android.widget.Toast.makeText(Toast.java:235)02-07 16:51:13.644: ERROR/AndroidRuntime(5354):     at com.bengaard.Shout.onCreate(Shout.java:57)02-07 16:51:13.644: ERROR/AndroidRuntime(5354):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)02-07 16:51:13.644: ERROR/AndroidRuntime(5354):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1586)02-07 16:51:13.644: ERROR/AndroidRuntime(5354):     ... 11 more02-07 16:51:13.644: ERROR/AndroidRuntime(5354): Caused by: java.lang.reflect.InvocationTargetException02-07 16:51:13.644: ERROR/AndroidRuntime(5354):     at java.lang.reflect.Constructor.constructNative(Native Method)02-07 16:51:13.644: ERROR/AndroidRuntime(5354):     at java.lang.reflect.Constructor.newInstance(Constructor.java:415)02-07 16:51:13.644: ERROR/AndroidRuntime(5354):     at android.view.LayoutInflater.createView(LayoutInflater.java:505)02-07 16:51:13.644: ERROR/AndroidRuntime(5354):     ... 20 more02-07 16:51:13.644: ERROR/AndroidRuntime(5354): Caused by: java.lang.OutOfMemoryError: bitmap size exceeds VM budget02-07 16:51:13.644: ERROR/AndroidRuntime(5354):     at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method)02-07 16:51:13.644: ERROR/AndroidRuntime(5354):     at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:450)02-07 16:51:13.644: ERROR/AndroidRuntime(5354):     at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:326)02-07 16:51:13.644: ERROR/AndroidRuntime(5354):     at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:697)02-07 16:51:13.644: ERROR/AndroidRuntime(5354):     at android.content.res.Resources.loadDrawable(Resources.java:1740)02-07 16:51:13.644: ERROR/AndroidRuntime(5354):     at android.content.res.TypedArray.getDrawable(TypedArray.java:601)02-07 16:51:13.644: ERROR/AndroidRuntime(5354):     at android.view.View.&lt;init&gt;(View.java:1951)02-07 16:51:13.644: ERROR/AndroidRuntime(5354):     at android.view.View.&lt;init&gt;(View.java:1899)02-07 16:51:13.644: ERROR/AndroidRuntime(5354):     at android.view.ViewGroup.&lt;init&gt;(ViewGroup.java:286)02-07 16:51:13.644: ERROR/AndroidRuntime(5354):     at android.widget.LinearLayout.&lt;init&gt;(LinearLayout.java:120)02-07 16:51:13.644: ERROR/AndroidRuntime(5354):     ... 23 more02-07 16:51:13.674: WARN/ActivityManager(156):   Force finishing activity com.bengaard/.Shout02-07 16:51:13.674: WARN/ActivityManager(156):   Force finishing activity com.bengaard/.OB02-07 16:51:14.174: WARN/ActivityManager(156): Activity pause timeout for HistoryRecord{40a5f000 com.bengaard/.Shout}02-07 16:51:14.224: ERROR/AK8973(135): Compass driver encountered fatal error2. </code></pre><p>it looks like an out-of-memory issue, but how can I close down the activities when I click the back button so I won't get this problem, or is there another answer to the problem? Why doesn't the sensorlistener stop after I click the back key? Excuse me for being so noob :o)</p>","586483","","","","","2011-02-07 17:36:11","My android app stops unexpectedly","<android>","2","1","","",""
"4923495","1","4923533","","2011-02-07 16:08:31","4","4146","<p>I've got a 3 column <code>GridView</code> and 4 items.</p><p>So it happens that three of them appear on the first row, and the last one in the second row, but this one aligned to the left. I just wanted to know if there is possible to make it appear centered in the <code>GridView</code>. Like a 'T', I don't know if I explain... xD</p><p>Thank you :-)</p><p>Edit:</p><p>This is the layout that contains the <code>GridView</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:id=""@+id/section_title_root""    android:layout_width=""fill_parent""     android:layout_height=""fill_parent""    android:background=""@drawable/bg_gd_home_grid""&gt;    &lt;ImageView    android:src=""@drawable/home_grid_txori""    android:layout_width=""wrap_content""     android:layout_height=""wrap_content""    android:layout_marginTop=""40dip""    android:layout_centerHorizontal=""true""/&gt;    &lt;GridView        android:id=""@+id/home_grid""        android:layout_width=""wrap_content""         android:layout_height=""wrap_content""        android:layout_alignParentBottom=""true""        android:numColumns=""3""        android:drawSelectorOnTop=""true""        android:layout_marginBottom=""30dip""        android:layout_marginLeft=""30dip""        android:layout_marginRight=""30dip""        android:padding=""5dip""        android:listSelector=""@android:color/transparent""        android:background=""@drawable/bg_home_grid_item""/&gt;&lt;/RelativeLayout&gt;</code></pre><p>By the way, <code>android:layout_centerHorizontal=""true""</code> doesn't work in GridView</p>","453981","","453981","","2011-02-08 08:31:27","2012-03-30 23:02:18","Center children in a GridView","<android><gridview>","2","0","1","",""
"4923514","1","","","2011-02-07 16:10:30","1","272","<p>I have 2 projects: first is a library project which contains many activities/layouts/etc, second is a regular android project which will use this library project's stuff.</p><p>the library project contains a <code>WebView</code>, and I wish to show the activity's view containing this web view in my regular Android project.</p><p>The library project has the potential to be included in many different android projects.</p><p><strong>My question:Do I have to change the WebView's API Key in the Library Project every time I export the Android project to an APK, or can I use a constant API Key for all projects including the Library?</strong></p><p>Extra thoughts:Ideally I would not like to be changing things in the library project that relate to a specific android project.  If I have to make a change to the Library project, I'd have to create and put in place a new WebView API Key for every project containing this library(if I wanted to update the app in the market), and that could potentially be a pain in the butt.</p>","416412","","","","","2011-02-07 16:10:30","Android WebView contained in a Library Project - API Key use?","<android>","0","0","","",""
"4923538","1","5230645","","2011-02-07 16:12:32","-1","6999","<p>I've been trying for ages to get AdMob Ads to appear in my app. I followed the AdMob PDF instructions and am stuck at this point: Eclipse, when displaying my main layout XML file in ""Graphical Layout"" mode, tells me: ""The following classes could not be found: - com.admob.android.ads.AdView"".</p><p>I presumed it had to to with the build path, but from what I can tell the admob...jar file is correctly added as JAR file to the build path for the project and appears under ""Referenced Libraries"" in the Package Explorer tree of Eclipse.</p><p>in the bin folder, however, these classes are not included (should they be?).</p><p>Any ideas on how to get eclipse, and the application for that matter, to find these classes?</p><p>EDIT: It turns out I get this message on and off for no apparent reason. Playing around with the main XML layout file (the code related to the admob ad) and saving it seems to make the message appear or disappear. However, I don't think it was responsible for the ad not showing. Just make sure the emulator has internet access (not obvious if using WiFi under Linux) and that the layout/positioning is correct.</p>","349169","","349169","","2011-02-09 08:12:46","2011-07-17 14:34:07","AdMob for Android in Eclipse: ""The following classes could not be found: - com.admob.android.ads.AdView""","<android><eclipse><admob>","3","1","","",""
"4923550","1","","","2011-02-07 16:13:37","5","9013","<p>I would like to make call via ADB command on android's command line.</p><p>How should I use ADB command in order to make a call via PC?</p><p>please provide source code.</p>","604190","","907921","","2011-12-10 13:21:23","2013-12-11 18:35:17","How to make a call via pc by ADB command on android?","<android><command-line><adb>","2","2","5","",""
"4923555","1","4923739","","2011-02-07 16:14:23","11","6731","<p>I develop an Android App using eclipse, the <a href=""http://developer.android.com/guide/developing/eclipse-adt.html"">Android Development Tools (ADT) plugin</a> and the <a href=""http://code.google.com/p/maven-android-plugin/"">maven-android-plugin</a>.</p><p>Building and installing the application on the commandline (<code>mvn install</code> / <code>adb install</code>) works fine - especially it includes all dependencies specified in the pom.xml.</p><p>Deploying the application to Android via eclipse (Run as -> Android Application) does not automatically put the dependencies in the apk file - although specified in the pom.xml. I haven to explicit declare them in the eclipse project <code>Build Path -> Libraries</code> dialog.</p><p>Is there a way to make eclipse include the dependencies defined in the <em>pom.xml</em> without definig them twice in the project <em>Build-Path -> Libraries</em>?</p><p><strong>EDIT:</strong> To clarify - the eclipse project includes a ""Maven Dependencies"" entry with all dependencies specified in the pom.xml. But these dependencies will not be included in the apk during install via ""Run As -> Android Application"". To include them, each one has to be extra added in the ""Java Build Path -> Libraries"" dialog. That's the pain!</p>","367285","","367285","","2011-02-07 16:45:29","2013-03-09 23:48:45","Include maven dependencies in eclipse ""Run As -> Android Application"" build","<android><eclipse><maven>","2","4","5","",""
"4923668","1","4923775","","2011-02-07 16:25:25","1","236","<p>I asked in a <a href=""http://stackoverflow.com/questions/4889376/android-hardware-and-adobe-air"">previous post</a> if it was possible to access native API from AIR. <a href=""http://stackoverflow.com/users/533552/ladaraider"">LadaRaider</a> answered that it was not, but linked me to a site with a hack around it. Today I noticed a default AIR application in Flash that uses the accelerometer on an Android device to move a ball around. Can anyone explain this?</p><pre><code>import flash.events.Event;var accelX:Number;var accelY:Number;var fl_Accelerometer:Accelerometer = new Accelerometer();fl_Accelerometer.addEventListener(AccelerometerEvent.UPDATE, fl_AccelerometerUpdateHandler);function fl_AccelerometerUpdateHandler(event:AccelerometerEvent):void{    accelX = event.accelerationX;    accelY = event.accelerationY;}ball.addEventListener(Event.ENTER_FRAME, moveBall);function moveBall(evt:Event){    ball.x -= accelX*30;    ball.y += accelY*30;    if(ball.x &gt; (480-ball.width/2))    {        ball.x = 480-ball.width/2;    }    if(ball.x &lt; (0+ball.width/2))    {        ball.x = 0+ball.width/2;    }    if(ball.y &gt; (800-ball.width/2))    {        ball.y = 800-ball.width/2;    }    if(ball.y &lt; (0+ball.width/2))    {        ball.y = 0+ball.width/2;    }}</code></pre><p>Where is this <code>AccelerometerEvent.UPDATE</code> coming from?</p><p>Thanks,</p>","450780","","","","","2011-06-21 13:17:24","Android hardware and Adobe AIR cont","<android><flash><actionscript><air><flash-cs5>","2","0","","",""
"4923730","1","","","2011-02-07 16:31:26","0","412","<p>This is the last piece of my Android App that needs to function before it can go public.</p><p>The app uses webview/webkit to view an online database and I need to create a sql database to cache files that can be available for offline use in the case of no cell service. I've created a sql database but I'm unable to find any information about actually saving the file. </p><p>Any help would be appreciated!</p><p>This project got abandoned for a few months, but in the last few days I've added code to make the app save the html files after they are loaded.</p><pre><code>public void processHttp(String saveAs) throws Exception    {        HttpClient httpClient = new DefaultHttpClient();        httpGet = new HttpGet(saveAs);        ResponseHandler&lt;String&gt; responseHandler = new BasicResponseHandler();        String response = httpClient.execute(httpGet, responseHandler);        File dir = getFilesDir();        File f = new File(dir, saveAs);        if (!f.exists()) f.mkdir();        String fileName = saveAs;        FileWriter fw = new FileWriter(fileName);        fw.write(response);        fw.flush();        fw.close();    }</code></pre><p>It generally <a href=""http://sadtrombone.com/"" rel=""nofollow"">fails </a> around the f.exists() statement. Any ideas?</p>","564259","","564259","","2011-07-08 19:34:21","2011-07-08 19:34:21","cache webpage files","<android><caching><webkit>","0","3","","",""
"4923771","1","4923823","","2011-02-07 16:35:03","0","42","<p>I am developing a app in android ....which need a code snippet to be executed in a loop...i thought of using threads and handler..i need some assistance on that...</p><p>and is there any other optimistic way of doing it...</p><p>consider it like an alarm clock, where the program continually checks for the alarm time with the mobile time ... i need to implement a concept similar to this ...</p><p>pls help me out guys ... Thanks :) :) </p>","601142","","139010","","2011-02-07 16:40:34","2011-02-07 16:43:10","looped execution of code snippet even when the application is in background?","<java><android>","2","1","","",""
"4923903","1","4923964","","2011-02-07 16:46:01","0","190","<p>I am currently working on an Android project in which I need to extract an image from a database. The image is saved in Base 64 code, and the datatype in the table is BLOB. </p><p>I have read about decoding Base 64, and now I am uncertain if I need an external package (for example, org.apache.commons.codec.binary) or is it now included since api 8 (from link: <a href=""http://stackoverflow.com/questions/4836760/how-to-use-base64-included-in-android-since-api-8-2-2-in-a-android-project-ap"">How to use Base64 (included in android since api 8 (2.2)) in a android project api 3 (android 1.5) ??</a>)?</p><p>What is the best way to do this? THanks!</p>","455479","","","","","2011-02-07 16:52:49","Do I need an external package for decoding Base 64 in Android?","<android><database><base64>","2","0","","",""
"4923931","1","","","2011-02-07 16:48:36","1","4674","<p>I'm trying to get a vertical LinearLayout to display an imageview with a second imageview below it. I want the lower imageview to be the width of the top image view.</p><p>I'm trying the current layout xml:</p><pre><code>            &lt;LinearLayout            android:orientation=""vertical""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:layout_gravity=""center""&gt;                   &lt;ImageView                android:id=""@+id/image_view""                android:layout_width=""wrap_content""                android:layout_height=""wrap_content""                android:scaleType=""centerInside""                android:adjustViewBounds=""true""                android:layout_weight=""1""                /&gt;                &lt;LinearLayout                android:orientation=""vertical""                android:layout_width=""fill_parent""                android:layout_height=""wrap_content""&gt;                     &lt;ImageView                    android:id=""@+id/spacer""                    android:layout_width=""fill_parent""                    android:layout_height=""wrap_content""                    android:background=""@drawable/spacer""                    /&gt;                &lt;/LinearLayout&gt;            &lt;/LinearLayout&gt;</code></pre><p>The images will be displayed with a 'spacer' which is the full width of the screen, rather than the width of the image. The spacer is a fading edge graphic and I want it to be the same width as the image above it.</p><p>Note: the image for the top imageview is set programatically and could be a landscape or portrait image.</p><p>Anyone any thoughts on how to achieve this?</p><p>Thanks in advance!</p>","421636","","","","","2014-03-26 08:08:44","Android: Vertical LinearLayout - Two image views, I want the bottom one to scale to be the width of the top one","<android><layout><android-layout><android-linearlayout>","3","2","0","",""
"4923941","1","4925074","","2011-02-07 16:49:56","0","384","<p>I am trying to intercept the window.location changes to do some native work in Android app. To ve more specific, I overwrite the call in WebViewClient:</p><pre><code>public boolean shouldOverrideUrlLoading(WebView view, String url) </code></pre><p>to look for anything start with ""native://"". The JavaScript code is like this. </p><pre><code>function callNative() {   window.location = ""native://doSomeNativeWork()"";}function callNativeManyTimes(count) {   for(i = 0 ; i &lt; count ; i ++) {       callNative();   }}&lt;a href=""javascript:callNativeManyTimes(40);"" class=""btn large""&gt;DoSomeNativeWork&lt;/a&gt;&lt;br/&gt;</code></pre><p>The problem I am seeing is that if I call ""window.location = something"" many time very quickly (like in the code above) , I will only get one call inside the WebViewClient on the native code side. If I make the call 50ms apart, I will get everyone of them. I am thinking that the browser is doing some optimization around this. </p><p>I think I can solve this problem like this: do not use window.location, change to embed a native object to javascript, and call methods on that object in javascript. I am just wondering why this is happening. Can someone more familiar wit JS to share some insight?</p><p>Thanks</p>","428024","","428024","","2011-02-07 17:23:56","2012-10-23 17:59:43","window.location called too often?","<javascript><android>","2","3","","",""
"4923942","1","4923961","","2011-02-07 16:50:22","2","1563","<p><em>Tagged with <code>[android]</code> so that someone will actually read this, but applies equally to other application platforms.</em></p><p>We have a number of Android and iPhone applications which have user-feedback functionality incorporated into their user interfaces. These allow the user to leave comments, report bugs, rate the application, request support, etc. </p><p>Currently, the applications make a web service call to our backend, which converts them into email and sends them to us.</p><p>We would like to replace this with an API call to a remote backend service hosted by someone else, a service that specialises in this sort of thing, and provides us with a web interface for viewing and collating the feedback.  The API would need to support arbitrary fields that we can set up as we see fit.</p><p>I was hoping to somehow integrate this with the Google Analytics APIs for Android and iPhone, but it's not flexible enough. The likes of FogBugz would seem to do the job, but it's too heavyweight a solution - we don't need anything that fancy.</p><p><a href=""http://stackoverflow.com/questions/1764739/simple-user-feedback-collection-service"">This question</a> touches on the same issue, but concentrates on self-hosted software. I'm looking for a service provided by someone else.</p><p>Free services preferred, for obvious reasons, but commercial options considered also.</p>","21234","","918414","","2013-03-16 03:01:22","2013-03-16 03:01:22","User feedback collection API service","<android><mobile><user-feedback>","3","0","1","",""
"4924038","1","4924524","","2011-02-07 16:59:05","1","3352","<p>i'm trying to drag and drop a button the problem is that when i use getX() at motion event it works but the button starts to tremble . When i call the method getRawX() it does not tremble but it jumps at least 80px right before i start the drag and drop .</p><p>how can i managed that , i'll post my code here:</p><pre><code>    public class MyButton extends Button {private final static int START_DRAGGING = 0;private final static int STOP_DRAGGING = 1;private int status;private LinearLayout parentLayout;public MyButton(Context context) {    super(context);}public MyButton(Context context, AttributeSet attrs) {    super(context, attrs);}public MyButton(Context context, AttributeSet attrs, int defStyle) {    super(context, attrs, defStyle);}@Overridepublic boolean onTouchEvent(MotionEvent event) {    // Log.i(""teste"", ""Button width: "" + btWidth + "", Height : ""+ btHeight);    switch (event.getAction()) {    case MotionEvent.ACTION_DOWN:        status = START_DRAGGING;        Log.i(""teste"", ""Coordenada on ACTION_DOWN: "" + (int) event.getRawX());        break;    case MotionEvent.ACTION_UP:        status = STOP_DRAGGING;        Log.i(""teste"", ""Coordenada on ACTION_UP: "" + (int) event.getRawX());        break;    case MotionEvent.ACTION_MOVE:        if(status == START_DRAGGING){            parentLayout.setPadding((int)event.getRawX(), 0,0,0);            parentLayout.invalidate();            Log.i(""teste"", ""Coordenada on ACTION_MOVE: "" + (int) event.getRawX());        }                                   break;    }    return true;}</code></pre><p>}</p>","569873","","","","","2011-02-12 16:20:32","Drag an drop a button on android .. help","<java><android><drag-and-drop><touch-event>","2","0","1","",""
"4924071","1","4924116","","2011-02-07 17:01:36","20","17095","<p>I'm calling <code>finish()</code> but my activity keeps on going.</p><p>I have an activity which is invoked by a menu from the main activity screen.  In my activity's <code>onCreate()</code> method I have the following code fragment:</p><pre><code>    // Make sure there are some events in the list.    if (theEventArrayList.isEmpty()){        Toast.makeText(this, ""Event List is empty"", Toast.LENGTH_LONG).show();        finish();    }    SummarizeCurrentEvent();    graphEvents();</code></pre><p>If the list is empty it puts up the Toast, and I can set breakpoint on the call to <code>finish()</code>. If I step from that in the debugger it goes to straight to <code>SummarizeCurrentEvent()</code>.   I thought <code>finish()</code> would exit the activity. Is this not the case? Where can I find out more information about this method?</p>","424690","","322","","2011-02-07 17:07:27","2014-01-17 09:41:32","Calling finish() on an Android activity doesn't actually finish","<android>","6","0","2","",""
"4924131","1","","","2011-02-07 17:07:42","3","862","<p>I am developing an Android application and can't quite figure out the best way of implementing a 2-level image cache that can be shared among multiple activities w/in a single application.</p><p>Example:</p><p>Application has 3 activities (A, B, and C) and for the sake of argument lets say that A calls B and B calls C and C calls A. Each activity displays an image downloaded from the web and I'm using asynctask to download and display images w/in each activity - easy enough. Now I'd like to add an image cache to avoid multiple downloads of the same image. </p><p>Right now each activity starts a new instance of a simple asynctask that downloads the image and updates the view appropriately. Obviously its easy enough to update the basic asynctask to check the image cache before proceeding to download and to update the cache once the download is complete but I'm stuck on how/where to create and initialize the cache. Any thoughts would be appreciated.</p>","606785","","","","","2011-02-07 19:02:15","Android: sharing an image cache among activities","<android><image><caching><android-asynctask>","1","1","","",""
"4924239","1","4924297","","2011-02-07 17:15:14","0","1160","<p>I don't understand why I'm receiving a ClassCastException when I use this line:</p><pre><code>Activity a=(Activity)photoToLoad.imageView.getContext();</code></pre><p>That is taken from the <a href=""http://stackoverflow.com/questions/541966/android-how-do-i-do-a-lazy-load-of-images-in-listview"">LazyList example</a> (the second answer) and in that project it works, but when I use the class in mine, it doesn't work. It is necessary to obtain an Activity to use the runOnUIThread method to set the downloaded Bitmap to the ImageView and avoid handlers. What am I doing wrong?</p>","383628","","244296","","2011-02-07 18:11:21","2011-02-07 18:11:21","ClassCastException when casting an ImageView context to an Activity","<android><casting><activity><context><classcastexception>","1","1","","",""
"4924296","1","4931493","","2011-02-07 17:19:26","0","925","<p>In my Android application I am using GLSurfaceView to draw 3d object like a box object. I animate this object by translating it using OpenGL ES apis. At some point during animation, the object would have gone out of the visible viewport window. At this point I must remove this object from the collection of other objects that are being drawn. How can I detect that the object has gone out of the view? Short code sample would be appreciated.</p>","574122","","","","","2011-02-08 09:44:17","How to detect if an object has moved out of the visible window in OpenGL ES?","<android><opengl-es>","2","0","1","",""
"4924308","1","","","2011-02-07 17:20:46","-1","5134","<p>Where can I get Android application source?I want to find a sample application project source code that I can use for teaching and present a sample android project. The application I want is the application that get the feed from twitter, facebookThank you</p>","480716","","480716","","2011-02-07 17:27:56","2011-04-08 05:44:45","Where I can get the application source code?","<android><open-source>","3","3","","2012-09-10 01:46:49",""
"4924385","1","","","2011-02-07 17:28:32","0","387","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/4552831/how-to-attach-multiple-files-to-email-client-in-android"">how to attach multiple files to email client in android.</a>  </p></blockquote><p>Hi all,<br>Hey there thanks for your help. I want to attach multiple images say 1 to 5 in my Android application. Please guide me for getting this done. Thanks.</p><p>Regards,<br>Panache. </p>","541776","","","","","2011-03-09 11:59:35","How to attach multiple images to email intent in Android?","<android>","0","2","","2011-04-30 06:16:52",""
"4924480","1","4924513","","2011-02-07 17:34:10","0","394","<p>How to scroll to middle of the Horizontalscrollview dynamically.</p><p>Please let me know</p><p>thanks</p>","341443","","","","","2011-02-07 17:37:33","how to scroll to middle of horizontal scrollview","<android><android-layout>","1","0","","",""
"4924488","1","4925732","","2011-02-07 17:34:58","0","571","<p>I am retrieving a list of items from a URL and displaying them in a ListView using a customized ArrayAdapter. I display at most 25 results, but retrieve up to 26 from the URL because I want to display a ""next"" link if there are more than 25. I am trying to figure out a way to make the last item in the view just display the next link instead of the image and two TextViews that the other items display. Scrolling down, all the items show up the way they are supposed to, but the last item continues to look like the rest. When scrolling back up, every fifth item is blank (can tell it is still there because of the separating lines).</p><p>Inside getView:</p><pre><code>if (position + 1 == limit) { // Limit = 26, corresponding position is 25    Log.e(""Last Item"", String.valueOf(position));    // Gone    image.setVisibility(8);    text.setVisibility(8);    // Visible    next.setVisibility(0);} else {    if (item != null) {        Log.e(""Other item"", String.valueOf(position));        if (top_text != null) {            top_text.setText(item.getItemTitle(), BufferType.SPANNABLE);        }        if(bottom_text != null){            bottom_text.setText(item.getItemDescription());        }    }}return view;</code></pre><p>In ddms, it is printing the ""Last Item"" tag only for the last item, and the ""Other Item"" tag for the rest, but the items aren't being changed based off the if-else. In the XML, next is set to gone so it doesn't need changed in the else. When I remove the if-else and leave only the code within the else, the list functions properly but I need the next link. Any ideas for the cause of the odd behavior? Please let me know if you need to see any additional code or need clarification on what is happening.</p>","536986","","","","","2011-02-07 19:44:43","How to create a different view for the last item of an ArrayAdapter?","<android><listview><android-arrayadapter>","1","0","","",""
"4924505","1","4924656","","2011-02-07 17:36:16","0","752","<p>I would like to display a .png file from the R.drawable to the screen.  Eventually I would like this image to be dynamic, meaning that it's position can move based on specified x,y coordinates. </p><p>I have looked into it but I am confused by the many options.  Here are most of my questions:</p><p>What is the best data type/object to use for the situation?What is the best way to instatiate the image?Does it need to be a Drawable?Does the Drawable then need its own View?To display it, do I just add the new View to the main view?</p><p>I have experience with numerical method algorithms, but this is my first venture into graphics and I'm a bit overwhelmed, so any advice is greatly appreciated.</p><p>Edit - For the movement of the image, it will be moving around a lot, eventually as a user controlled movement.</p>","606853","","606853","","2011-02-07 18:08:32","2011-02-07 19:27:36","Dynamic Image in Android? (Beginner Question)","<android><graphics>","2","0","","",""
"4924581","1","","","2011-02-07 17:43:39","1","1115","<p>Does anyone know how to change the online status for a user by invoking it from another application? Ideally I'd like to invoke Talk to change the users status to ""Away"" during some periods when using my application. Would be nice not having to use xmpp and access the internet from my app but rather ""do it locally"" and let Talk distribute the status change. </p><p>Maybe Im blind and/or stupid but I cant find any info on this.</p>","606861","","","","","2011-07-22 01:43:28","Change Google Talk online status programmatically from Android","<android><xmpp><status><android-intent><google-talk>","1","1","3","",""
"4924589","1","","","2011-02-07 17:44:36","2","6792","<p>hi everyone i am new to android application development.i am developing an android application using c2dm.can anyone tell me of how to receive the registration id for the application from c2dm.please tell me with a detailed example and explanation</p>","606862","","469983","","2011-10-27 09:04:18","2012-08-29 18:53:54","android c2dm programming example","<android><android-c2dm>","2","0","1","",""
"4924591","1","4924617","","2011-02-07 17:44:55","1","5408","<p>This is killing me!!!</p><p>I seem to have done all I need to do but it just wont work!</p><p>here is what i did:</p><p>-created a keystore using keytool:</p><p><code>$ keytool -genkey -v -keystore PADReleaseKey.keystore -alias pocket_aces_release -keyalg RSA -keysize 2048 -validity 10000</code></p><p>-got the MD5 fingerpring from it and used:</p><p><code>$ keytool -list -alias pocket_aces_release PADReleaseKey.keystore</p><p></code></p><p>-used it to get the mapAPI key and embedded it inside my application:</p><p><code></p><pre><code>&lt;com.google.android.maps.MapView    android:layout_weight=""1"" android:id=""@+id/mapview""    android:layout_width=""fill_parent"" android:layout_height=""fill_parent""    android:apiKey=""0qLwM2TNe70Ho-Y1wZiN2MqF_jFIXLc-0gwLRsw""            android:clickable=""true""/&gt;</code></pre><p></code></p><ul><li><p>exported a signed application package using eclipse and the keystore and alias I have created before.</p></li><li><p>installed it on my android machine using adb install.</p></li></ul><p>but still no map is showing!!!! I have done this several times, but it does not work...</p><p>can anyone point me to what am i doing wrong?</p><p>Thanks.</p>","62898","","","","","2011-02-07 17:47:54","android mapview not working","<android><google-maps><google-maps-api-3><android-mapview><self-signed>","1","4","3","",""
"4924597","1","4924741","","2011-02-07 17:45:55","0","274","<p>i'm trying to access an EditText from an onClick() method within an onClickListener implementation for a button.  here's the code:</p><pre><code>transmit.setOnClickListener(new View.OnClickListener() {    public void onClick(View v) {        //data validation        ///////////////////////        boolean valid = true;        if(((EditText)findViewById(R.id.drv_in)).getText().toString() == """") {            TX_FAIL_TEXT = ""Missing Driver ID!"";            showDialog(DIALOG_FAIL);            TX_FAIL_TEXT = ""Transmission Failed!""; //reset the dialog fail text to default            valid = false;        }        Log.e(""smsDRVERR"",((EditText)findViewById(R.id.drv_in)).getText().toString());        //begin transmission        ///////////////////////        if(valid) {            showDialog(DIALOG_TX_PROGRESS);            Thread t = new Thread(txRunnable);            t.start();        } else {            //do things if needed        }    }});</code></pre><p>the Log.e is never called (does not show up in logcat).  and the program executes as if the conditional statement doesn't exist.  how do i reference layout items properly in an onClick implementation?  i've also tried the following line:</p><pre><code>Log.e(""smsDRVERR"",((EditText)smsActivity.this.findViewById(R.id.drv_in)).getText().toString());</code></pre><p>which was alluded to in this question i found on SO:</p><p><a href=""http://stackoverflow.com/questions/2076037/inside-onclicklistener-i-cannot-access-a-lot-of-things-how-to-approach"">Inside OnClickListener I cannot access a lot of things - how to approach?</a></p><p>but it does not solve the problem.  i'm missing something that i need to reference these items within this inner class, or maybe i have my syntax a bit jarbled.  any help is appreciated.</p>","329993","","","","","2011-02-07 18:02:22","Accessing program data from within onClick() inner class","<java><android><events><onclick>","2","4","","",""
"4924600","1","4955915","","2011-02-07 17:46:18","2","7872","<p>I need to get the full path to a file somewhere on the phone (any location) and play it with MediaPlayer. </p><p>ive heard of using a file chooser for Android (by launching an intent).</p><p>In the test code, I just copied a resource to a another file, got the path and passed it to AudioVideoEntry (as i show later, a very simple and thin wrapper around MediaPlayer)</p><p>Here's the test code I've written:</p><pre><code>private String ave_path;    private String ave_file_name = ""my_media_content"";    private InputStream ave_fis;    private OutputStream ave_fos;    public void testAudioVideoEntry()    {        //get the Activity        Module_JournalEntry journalentryactivity = getActivity();        //open an InputStream to a resource file (in this case strokes.mp3)        ave_fis = journalentryactivity.getResources().openRawResource(module.jakway.JournalEntry.R.raw.strokes);        //open an OutputStream to a new file        try {            ave_fos = journalentryactivity.openFileOutput(ave_file_name,                                                 Context.MODE_PRIVATE);        } catch (FileNotFoundException e1) {            // TODO Auto-generated catch block            e1.printStackTrace();            assertTrue(false);        }        catch(Exception e)        {            assertTrue(false);        }        //copy the data from the resource into        //the OutputStream        int data;        try {        while((data = ave_fis.read()) != -1)        {            ave_fos.write(data);        }            assertTrue(true);        }        catch(Exception e)        {            assertTrue(false);        }        //get the full path of the file we wrote to        ave_path = journalentryactivity.getFileStreamPath(ave_file_name).toString();        //and construct a new object of AudioVideoEntry with that path        AudioVideoEntry ave = new AudioVideoEntry(ave_path);        //register an error listener via MediaPlayer's setOnErrorListener        ave.setOnErrorListener(new OnErrorListener()                                {                                    @Override                                    public boolean onError(MediaPlayer mp,                                            int what, int extra) {                                        Log.e(""MEDIAPLAYER ERRORS"",                                        ""what: "" + what + ""  extra: ""   + extra);                                        assertTrue(false);                                        // TODO Auto-generated method stub                                        return false;                                    }                                });        ave.prepareMedia();        ave.playMedia();        try {        ave_fis.close();        ave_fos.close();        }        catch(Exception e)        {            assertTrue(false);            e.printStackTrace();        }</code></pre><p>AudioVideoEntry is basically a thin wrapper around MediaPlayer that can hold its own path:</p><pre><code>public class AudioVideoEntry{    private String path_to_audio_file;    private MediaPlayer mediaplayer;    /**     * Initialize the internal MediaPlayer     * from the String parameter     * @param set_path_to_audio_file     */    public AudioVideoEntry(String set_path_to_audio_file)    {        path_to_audio_file = set_path_to_audio_file;        mediaplayer = new MediaPlayer();        try {            mediaplayer.setDataSource(path_to_audio_file);            mediaplayer.prepare();        } catch (IllegalArgumentException e) {            // TODO Auto-generated catch block            e.printStackTrace();        } catch (IllegalStateException e) {            // TODO Auto-generated catch block            e.printStackTrace();        } catch (IOException e) {            // TODO Auto-generated catch block            e.printStackTrace();        }    }    public AudioVideoEntry(FileDescriptor fd)    {        mediaplayer = new MediaPlayer();        try {            mediaplayer.setDataSource(fd);            mediaplayer.prepare();        } catch (IllegalArgumentException e) {            // TODO Auto-generated catch block            e.printStackTrace();        } catch (IllegalStateException e) {            // TODO Auto-generated catch block            e.printStackTrace();        } catch (IOException e) {            // TODO Auto-generated catch block            e.printStackTrace();        }    }    /**     * Begin playing media     */    public void prepareMedia()    {        try {            mediaplayer.prepare();        } catch (IllegalStateException e) {            // TODO Auto-generated catch block            e.printStackTrace();        } catch (IOException e) {            // TODO Auto-generated catch block            e.printStackTrace();        }    }    /**     * play media     * don't forget to prepare() if necessary     */    public void playMedia()    {        mediaplayer.start();    }    /**     * pause the media     * can be played later     */    public void pauseMedia()    {        mediaplayer.pause();    }    /**     * stop media     */    public void stopMedia()    {        mediaplayer.stop();    }    public void setOnErrorListener(OnErrorListener listener)    {        mediaplayer.setOnErrorListener(listener);    }}</code></pre><p>here's the logcat output from the JUnit test (the tests were successful, the actual results - as the logat shows - were not)</p><pre><code>02-07 09:40:23.129: ERROR/MediaPlayer(1209): error (1, -2147483648)02-07 09:40:23.139: WARN/System.err(1209): java.io.IOException: Prepare failed.: status=0x102-07 09:40:23.149: WARN/System.err(1209):     at android.media.MediaPlayer.prepare(Native Method)02-07 09:40:23.149: WARN/System.err(1209):     at module.jakway.JournalEntry.AudioVideoEntry.&lt;init&gt;(AudioVideoEntry.java:39)02-07 09:40:23.149: WARN/System.err(1209):     at module.jakway.JournalEntry.test.Module_JournalEntryTest.testAudioVideoEntry(Module_JournalEntryTest.java:182)02-07 09:40:23.149: WARN/System.err(1209):     at java.lang.reflect.Method.invokeNative(Native Method)02-07 09:40:23.149: WARN/System.err(1209):     at java.lang.reflect.Method.invoke(Method.java:507)02-07 09:40:23.159: WARN/System.err(1209):     at android.test.InstrumentationTestCase.runMethod(InstrumentationTestCase.java:204)02-07 09:40:23.159: WARN/System.err(1209):     at android.test.InstrumentationTestCase.runTest(InstrumentationTestCase.java:194)02-07 09:40:23.159: WARN/System.err(1209):     at android.test.ActivityInstrumentationTestCase2.runTest(ActivityInstrumentationTestCase2.java:186)02-07 09:40:23.159: WARN/System.err(1209):     at junit.framework.TestCase.runBare(TestCase.java:127)02-07 09:40:23.169: WARN/System.err(1209):     at junit.framework.TestResult$1.protect(TestResult.java:106)02-07 09:40:23.169: WARN/System.err(1209):     at junit.framework.TestResult.runProtected(TestResult.java:124)02-07 09:40:23.169: WARN/System.err(1209):     at junit.framework.TestResult.run(TestResult.java:109)02-07 09:40:23.179: WARN/System.err(1209):     at junit.framework.TestCase.run(TestCase.java:118)02-07 09:40:23.179: WARN/System.err(1209):     at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:169)02-07 09:40:23.179: WARN/System.err(1209):     at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:154)02-07 09:40:23.179: WARN/System.err(1209):     at android.test.InstrumentationTestRunner.onStart(InstrumentationTestRunner.java:529)02-07 09:40:23.189: WARN/System.err(1209):     at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1447)02-07 09:40:23.189: ERROR/MediaPlayer(1209): prepareAsync called in state 002-07 09:40:23.189: WARN/System.err(1209): java.lang.IllegalStateException02-07 09:40:23.189: WARN/System.err(1209):     at android.media.MediaPlayer.prepare(Native Method)02-07 09:40:23.189: WARN/System.err(1209):     at module.jakway.JournalEntry.AudioVideoEntry.prepareMedia(AudioVideoEntry.java:79)02-07 09:40:23.199: WARN/System.err(1209):     at module.jakway.JournalEntry.test.Module_JournalEntryTest.testAudioVideoEntry(Module_JournalEntryTest.java:197)02-07 09:40:23.199: WARN/System.err(1209):     at java.lang.reflect.Method.invokeNative(Native Method)02-07 09:40:23.199: WARN/System.err(1209):     at java.lang.reflect.Method.invoke(Method.java:507)02-07 09:40:23.199: WARN/System.err(1209):     at android.test.InstrumentationTestCase.runMethod(InstrumentationTestCase.java:204)02-07 09:40:23.199: WARN/System.err(1209):     at android.test.InstrumentationTestCase.runTest(InstrumentationTestCase.java:194)02-07 09:40:23.199: WARN/System.err(1209):     at android.test.ActivityInstrumentationTestCase2.runTest(ActivityInstrumentationTestCase2.java:186)02-07 09:40:23.199: WARN/System.err(1209):     at junit.framework.TestCase.runBare(TestCase.java:127)02-07 09:40:23.199: WARN/System.err(1209):     at junit.framework.TestResult$1.protect(TestResult.java:106)02-07 09:40:23.199: WARN/System.err(1209):     at junit.framework.TestResult.runProtected(TestResult.java:124)02-07 09:40:23.199: WARN/System.err(1209):     at junit.framework.TestResult.run(TestResult.java:109)02-07 09:40:23.199: WARN/System.err(1209):     at junit.framework.TestCase.run(TestCase.java:118)02-07 09:40:23.199: WARN/System.err(1209):     at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:169)02-07 09:40:23.199: WARN/System.err(1209):     at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:154)02-07 09:40:23.199: WARN/System.err(1209):     at android.test.InstrumentationTestRunner.onStart(InstrumentationTestRunner.java:529)02-07 09:40:23.199: WARN/System.err(1209):     at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1447)02-07 09:40:23.199: ERROR/MediaPlayer(1209): start called in state 002-07 09:40:23.199: ERROR/MediaPlayer(1209): error (-38, 0)</code></pre><p>Edit:  why is MediaPlayer failing?</p><p>thanks!dragonwrenn</p>","450153","","450153","","2011-02-07 19:02:51","2011-02-12 06:14:15","Android MediaPlayer full path to file","<android><path><media-player>","3","2","5","",""
"4924604","1","4924755","","2011-02-07 17:46:27","4","10127","<p>I have an android xml layout, main.xml. I would like to add controls to this layout at runtime (I would like to add a series of additional linear layouts that contain buttons controls). Can I do that and if yes, how?</p><p>Thanks</p>","501223","","","","","2012-07-16 19:08:47","How to add a button control to an android xml view at runtime?","<android><layout>","5","0","0","",""
"4924758","1","4924790","","2011-02-07 18:05:04","0","1655","<p>I want to create a text file of the data received from bluetooth and then save it to a location from where it can be used by another application.</p><p>How can I solve this using code?</p>","560365","","330204","","2011-02-07 18:10:19","2011-02-07 18:13:27","Creating a textfile and saving it to a particular location in android phone","<android><file><copying>","2","1","","",""
"4924800","1","4926619","","2011-02-07 18:09:49","1","1230","<p>I have a tree structure of Renderers. If I load them up <strong>before rendering</strong> everything works fine, but if I load them <strong>while rendering</strong> I get a memory dump.</p><pre><code>02-07 17:50:00.721: INFO/DEBUG(2355): signal 11 (SIGSEGV), fault addr 0000000002-07 17:50:00.721: INFO/DEBUG(2355):  r0 00000000  r1 4bf22eb0  r2 00000010  r3 0000000402-07 17:50:00.721: INFO/DEBUG(2355):  r4 0023d2e8  r5 0023e154  r6 00000000  r7 0000000402-07 17:50:00.721: INFO/DEBUG(2355):  r8 00000010  r9 00000010  10 00000000  fp 0000000102-07 17:50:00.721: INFO/DEBUG(2355):  ip 00000001  sp 4b7bdaa8  lr 81b06b70  pc 81b30dc0  cpsr 8000001002-07 17:50:00.721: INFO/DEBUG(2355):  d0  6472656767756265  d1  000000000000000002-07 17:50:00.721: INFO/DEBUG(2355):  d2  000000640024c100  d3  000000004493680002-07 17:50:00.721: INFO/DEBUG(2355):  d4  0000000000000000  d5  000000000000000002-07 17:50:00.721: INFO/DEBUG(2355):  d6  000000000012eca8  d7  000000000000000002-07 17:50:00.721: INFO/DEBUG(2355):  d8  0000000000000000  d9  000000000000000002-07 17:50:00.721: INFO/DEBUG(2355):  d10 0000000000000000  d11 000000000000000002-07 17:50:00.721: INFO/DEBUG(2355):  d12 0000000000000000  d13 000000000000000002-07 17:50:00.721: INFO/DEBUG(2355):  d14 0000000000000000  d15 000000000000000002-07 17:50:00.721: INFO/DEBUG(2355):  d16 c1d0a059b6bb9581  d17 3f50624dd2f1a9fc02-07 17:50:00.721: INFO/DEBUG(2355):  d18 41c9bc2c66800000  d19 3fe000000025a36b02-07 17:50:00.721: INFO/DEBUG(2355):  d20 4008000000000000  d21 3fd99a27ad32ddf502-07 17:50:00.721: INFO/DEBUG(2355):  d22 3fd24998d6307188  d23 3fcc7288e957b53b02-07 17:50:00.721: INFO/DEBUG(2355):  d24 3fc74721cad6b0ed  d25 3fc39a09d078c69f02-07 17:50:00.721: INFO/DEBUG(2355):  d26 0000000000000000  d27 000000000000000002-07 17:50:00.721: INFO/DEBUG(2355):  d28 0000000000000000  d29 000000000000000002-07 17:50:00.721: INFO/DEBUG(2355):  d30 0000000000000000  d31 000000000000000002-07 17:50:00.721: INFO/DEBUG(2355):  scr 2000001202-07 17:50:00.815: INFO/DEBUG(2355):          #00  pc 00030dc0  /system/lib/egl/libGLESv1_CM_POWERVR_SGX540_120.so02-07 17:50:00.823: INFO/DEBUG(2355):          #01  lr 81b06b70  /system/lib/egl/libGLESv1_CM_POWERVR_SGX540_120.so02-07 17:50:00.823: INFO/DEBUG(2355): code around pc:02-07 17:50:00.823: INFO/DEBUG(2355): 81b30da0 e781410c e28cc001 e15c0003 3afffffa 02-07 17:50:00.823: INFO/DEBUG(2355): 81b30db0 e8bd8010 e92d4010 e3a0c000 ea000004 02-07 17:50:00.823: INFO/DEBUG(2355): 81b30dc0 e5904000 e5014008 e5904004 e0800002 02-07 17:50:00.827: INFO/DEBUG(2355): 81b30dd0 e5014004 e15c0003 e2811008 e28cc001 02-07 17:50:00.831: INFO/DEBUG(2355): 81b30de0 3afffff6 e8bd8010 e92d4010 e3a0c000 02-07 17:50:00.831: INFO/DEBUG(2355): code around lr:02-07 17:50:00.835: INFO/DEBUG(2355): 81b06b50 e3530000 1a000005 e59c0028 e1a03007 02-07 17:50:00.835: INFO/DEBUG(2355): 81b06b60 e59c102c e59c2024 e1a0e00f e59cf034 02-07 17:50:00.838: INFO/DEBUG(2355): 81b06b70 e2866001 e2855004 e5942ec0 e3a03001 02-07 17:50:00.838: INFO/DEBUG(2355): 81b06b80 e1560002 3affffeb e088800a e2840d77 02-07 17:50:00.838: INFO/DEBUG(2355): 81b06b90 e2888003 e280000c e1a02003 e0278799 02-07 17:50:00.838: INFO/DEBUG(2355): stack:02-07 17:50:00.838: INFO/DEBUG(2355):     4b7bda68  00000004  02-07 17:50:00.842: INFO/DEBUG(2355):     4b7bda6c  afd0bfc9  /system/lib/libc.so02-07 17:50:00.842: INFO/DEBUG(2355):     4b7bda70  00000000  02-07 17:50:00.846: INFO/DEBUG(2355):     4b7bda74  00000001  02-07 17:50:00.846: INFO/DEBUG(2355):     4b7bda78  00000003  02-07 17:50:00.846: INFO/DEBUG(2355):     4b7bda7c  00000001  02-07 17:50:00.850: INFO/DEBUG(2355):     4b7bda80  00000000  02-07 17:50:00.854: INFO/DEBUG(2355):     4b7bda84  00000000  02-07 17:50:00.854: INFO/DEBUG(2355):     4b7bda88  000e44f0  [heap]02-07 17:50:00.858: INFO/DEBUG(2355):     4b7bda8c  0023d2e8  [heap]02-07 17:50:00.858: INFO/DEBUG(2355):     4b7bda90  0023e154  [heap]02-07 17:50:00.858: INFO/DEBUG(2355):     4b7bda94  00000000  02-07 17:50:00.862: INFO/DEBUG(2355):     4b7bda98  00000004  02-07 17:50:00.862: INFO/DEBUG(2355):     4b7bda9c  00000010  02-07 17:50:00.862: INFO/DEBUG(2355):     4b7bdaa0  df002777  02-07 17:50:00.866: INFO/DEBUG(2355):     4b7bdaa4  e3a070ad  02-07 17:50:00.866: INFO/DEBUG(2355): #00 4b7bdaa8  0023d2e8  [heap]02-07 17:50:00.866: INFO/DEBUG(2355):     4b7bdaac  81b06b70  /system/lib/egl/libGLESv1_CM_POWERVR_SGX540_120.so02-07 17:50:00.866: INFO/DEBUG(2355):     4b7bdab0  0023d2e8  [heap]02-07 17:50:00.866: INFO/DEBUG(2355):     4b7bdab4  00000004  02-07 17:50:00.870: INFO/DEBUG(2355):     4b7bdab8  00000004  02-07 17:50:00.870: INFO/DEBUG(2355):     4b7bdabc  00000000  02-07 17:50:00.874: INFO/DEBUG(2355):     4b7bdac0  00000005  02-07 17:50:00.874: INFO/DEBUG(2355):     4b7bdac4  00000001  02-07 17:50:00.874: INFO/DEBUG(2355):     4b7bdac8  00000004  02-07 17:50:00.874: INFO/DEBUG(2355):     4b7bdacc  81b08510  /system/lib/egl/libGLESv1_CM_POWERVR_SGX540_120.so02-07 17:50:00.874: INFO/DEBUG(2355):     4b7bdad0  0023d2e8  [heap]02-07 17:50:00.874: INFO/DEBUG(2355):     4b7bdad4  81b6a5fc  /system/lib/egl/libGLESv1_CM_POWERVR_SGX540_120.so02-07 17:50:00.878: INFO/DEBUG(2355):     4b7bdad8  00000004  02-07 17:50:00.878: INFO/DEBUG(2355):     4b7bdadc  00000000  02-07 17:50:00.878: INFO/DEBUG(2355):     4b7bdae0  00000005  02-07 17:50:00.878: INFO/DEBUG(2355):     4b7bdae4  81b09954  /system/lib/egl/libGLESv1_CM_POWERVR_SGX540_120.so02-07 17:50:00.878: INFO/DEBUG(2355):     4b7bdae8  00000004  02-07 17:50:00.881: INFO/DEBUG(2355):     4b7bdaec  00000000  </code></pre><p>All the renderer does is:</p><pre><code>glEnableClientState(GL_VERTEX_ARRAY);glEnableClientState(GL_TEXTURE_COORD_ARRAY);glBindBuffer(GL_ARRAY_BUFFER, mArraybuffer);glVertexPointer(2, GL_FLOAT, sizeof(TextureMap), NULL);glTexCoordPointer(2, GL_FLOAT, sizeof(TextureMap), (void *)offsetof(TextureMap, coord));glBindBuffer(GL_ARRAY_BUFFER, 0);glDrawArrays(GL_TRIANGLE_STRIP, 0, mSize);glDisableClientState(GL_VERTEX_ARRAY);glDisableClientState(GL_TEXTURE_COORD_ARRAY);</code></pre><p>and I know it crashes on <code>glEnableClientState(GL_VERTEX_ARRAY)</code>. What I want to know is why is it crashing, or at least a reason why I shouldn't be doing what I'm doing?</p><p><strong>EDIT:</strong> I have designed it to load the renderer with the code above when the screen is tapped. It generates an array buffer and assigns the array accordingly. I then add the renderer to the renderer tree, but when it first renders it crashes and get the above memory dump.</p><pre><code>        GLuint arraybuffer;        glGenBuffers(1, &amp;arraybuffer);        TextureMap data[] = {                {{-69.573, 39.74}, {325.0/512.0, 279.75/512.0}},                {{-69.573, 83.24}, {325.0/512.0, 323.25/512.0}},                {{71.571, 39.74}, {466.45/512.0, 279.75/512.0}},                {{71.571, 83.24}, {466.45/512.0, 323.25/512.0}},        };        glBindBuffer(GL_ARRAY_BUFFER, arraybuffer);        glBufferData(GL_ARRAY_BUFFER, sizeof(TextureMap) * 4, data, GL_STATIC_DRAW);        TextureMapBufferRenderer *renderer = new TextureMapBufferRenderer(arraybuffer); //generates a renderer for array buffer        renderer-&gt;load();        glBindBuffer(GL_ARRAY_BUFFER, 0);        mManager-&gt;renderer()-&gt;addChildRenderer(renderer);</code></pre><p>The above code is when it executed on tap. If I put the same code at the beginning it will work.</p>","398640","","398640","","2011-02-07 19:27:30","2011-03-07 13:28:43","OpenGL ES is crashing when rendering code is loaded while rendering","<android><opengl-es><android-ndk>","1","1","","",""
"4924879","1","4925761","","2011-02-07 18:18:49","1","1504","<p>I'm currently trying to code an app to send mass SMS to 300+ numbers I have in my database.</p><p>I'm facing issues with sending them all at one go my app will force close and I only managed to send like 27/308.</p><p>I'm using a for loop to send my SMSes.</p><p>Is this any fix for this where I can delay my for loop for like 1-2 seconds before going to the next step?</p><p>Currently I've tried this code but it only sleep for 20seconds then it'll do all the steps at one go instead of 20sec per step. Commented out my sendSms method and tested with println();</p><p>Any help would be greatly appreciated.</p><pre><code>for (i = 0; i &lt; phoneNumbers.length; i++){                txtCommand = customIDs[i] + "";"" + command + "";&amp;W&lt;"";                if (phoneNumbers[i].length()&gt;0 &amp;&amp; txtCommand.length()&gt;0)  {                    final String Messages = ""Phone Number:"" + phoneNumbers[i] + "" "" + ""Message:"" + txtCommand;                    myHandler.postDelayed(new Runnable() {                         public void run() {                             System.out.println(Messages);                            //sendSMS(phoneNumbers[i], txtCommand);                       }            }, 20000);                    }                else                    Toast.makeText(getBaseContext(),                         ""Please enter both phone number and message."",                         Toast.LENGTH_SHORT).show();            }</code></pre>","606903","","606903","","2011-02-08 08:31:08","2011-02-08 08:31:08","Delay SMS sending ANDROID","<android><timer><sms><delay><postdelayed>","1","1","2","",""
"4924914","1","4925581","","2011-02-07 18:21:54","2","536","<p>I must be doing something obvious, but I can't figure out what it is. I'm simply trying to insert a character into an Editable:</p><pre><code>@Overridepublic void afterTextChanged(Editable s) {    Log.d(TAG, ""inserting space at "" + location);    s.insert(location, "" "");    Log.d(TAG, ""new word: '"" + s + ""'"");}</code></pre><p>But s never changes. The string 's' is long enough, because I print it and it looks good. If I call Editable.clear(), it is cleared, and I can replace multiple characters with Editable.replace(). Ideas?</p>","355039","","355039","","2011-02-07 18:41:28","2011-02-07 19:29:23","Can't insert into Editable","<android><editable><textwatcher>","2","0","1","",""
"4925024","1","4925260","","2011-02-07 18:33:01","2","284","<p>Is it possible to get notification whenever a call get terminated?Is there any Intent I can register a broadcast receiver for?</p>","286802","","244296","","2011-03-15 18:24:07","2011-03-15 18:24:07","Is there a way to get notification whenever a call get terminated","<android>","1","0","","",""
"4925035","1","","","2011-02-07 18:34:37","1","55","<p>From Android documentation:</p><pre><code>// Find out whether the caps lock is on.// 0 is no, 1 is yes, 2 is caps lock on.int active = MultiTapInputMethod.getCapsActive(txtView.getText());</code></pre><p>I'm using the Android emulator, not an actual phone.  Do real Android phones have a 3-state Caps Lock key? If not, then what is returned when Cap Lock is on?</p>","606924","","244296","","2011-02-07 18:38:27","2011-02-07 18:38:27","Android: getCapsActive return value","<android>","0","0","","",""
"4925065","1","4925174","","2011-02-07 18:37:39","1","1013","<p>How do i detect when my textures are destroyed on android?My Renderer class for my GLSurfaceView currently looks like this:</p><pre><code>public void onDrawFrame(GL10 gl){    nativeLibrary.drawFrame();}public void onSurfaceChanged(GL10 gl, int width, int height) {    if (reload)    {        library.glRecreate(); //this method reloads destroyed textures    }    else    {        nativeLibrary.init(width, height)); //this method initializes my game        reload = true;    }}public void onSurfaceCreated(GL10 gl, EGLConfig config) {}</code></pre><p>The problem is that doesn't always work. When i press the home button from my game and then start it again, it works like a charm. But when i lock the device, and then unlock it again, all textures are just black. Everything seems to reset when I lock it too (my game always comes back in the main menu). When I quit the game using the home button, and do a lock/unlock after that, the game doesn't reset.</p>","69587","","","","","2011-02-07 18:51:11","How to detect when textures are destroyed","<java><android><opengl-es-2.0>","1","3","2","",""
"4925076","1","4925112","","2011-02-07 18:38:56","2","727","<p>The documentation shows the orientation of the Axes:<a href=""http://developer.android.com/reference/android/hardware/SensorEvent.html"" rel=""nofollow"">http://developer.android.com/reference/android/hardware/SensorEvent.html</a></p><p>But it doesn't specify where exactly the origin is located. Is it in the lower left corner or in the middle of the screen?</p><p>The same question also applies to getRotationMatrix:http://developer.android.com/reference/android/hardware/SensorManager.html#getRotationMatrix(float[], float[], float[], float[])</p><p>Since it is a rotation matrix it is implied that the worlds coordinate system has the origin at the same location.</p>","480894","","","","","2011-02-07 18:43:59","Where is the origin of the sensor coordinate system?","<android>","1","0","","",""
"4925194","1","4925451","","2011-02-07 18:53:14","16","4720","<p>I fully appreciate dumping lots of data into the preferences is totally inappropriate, but my requirement is not that great, but large enough (potentially 500-5000 bytes) where I've no idea whether it's appropriate or not. The docs do not help.<a href=""http://developer.android.com/reference/android/content/SharedPreferences.Editor.html"">http://developer.android.com/reference/android/content/SharedPreferences.Editor.html</a></p><p>I've searched the net and Stackoverflow and can't find a definitive answer on:a) what the actual limit is, based on the underlying architectureb) what the practical limit is, based on performance (I find writing even short pref values can take a few seconds, but I suspect that's just a flash write delay)</p><p>Would appreciate clarification.</p>","477415","","","","","2012-05-25 22:57:00","What's the maximum size for an Android shared preference value?","<android><android-preferences>","2","2","2","",""
"4925309","1","","","2011-02-07 19:03:20","1","369","<p>QoS -- as opposed to Best Effort.  If Android does, how can I access those elements of the API?</p>","606956","","21234","","2011-02-07 19:25:35","2011-02-07 19:25:35","Does Android support QoS flows over EVDO?","<android><qos>","0","0","","",""
"4925384","1","","","2011-02-07 19:09:58","1","795","<p>I've developed an android application which uses the Google MapView.during the development phase (with the debug key), the application worked fine both on the emulator and on my device.</p><p>Now, prior to releasing my application I've done the following steps:</p><ol><li>Opened a new Google account (for the company)</li><li>Created a new key store usingkeytool for my release builds</li><li>Generated an MD5 for my releasekey (using keytool -list)</li><li>Registered the MD5 with theGoogle Maps API(http://code.google.com/android/maps-api-signup.html)while I was signed in using my newGoogle account.</li><li>Changed all the apikey elementsof my MapViews to the newly generatedone.</li><li>Exported my application fromEclipse using the ADT add-in(Project->Export->Export AndroidApplication)</li><li>In the wizard, I signed myapplication using my release key.</li><li>Installed the application on mydevice using (adb install)</li></ol><p>For some reason, the MapView is not loading any tiles, as if the key I entered is incorrect.I've repeated the above steps more then 3 times, for the same results.</p><p>Please Note,</p><ol><li>My android manifest contains theINTERNET permissions</li><li>Nothing was changed other thansigning the application.</li></ol><p>Launching the application from Eclipse using the emulator, the MapView works great. even though the apikey element contains the key generated for my release keystore.</p><p>Any suggestions??</p>","165355","","165355","","2011-02-07 19:22:22","2011-02-07 19:22:22","Why is Google MapView in my release signed android application works only on the emulator but not on my device","<android><google-maps><google-maps-api-3><android-mapview>","0","13","","",""
"4925411","1","","","2011-02-07 19:12:33","0","748","<p>I am making a quiz application in which i am planning to use the SlidingDrawer control for displaying different question numbers. Clicking on a number will allow the user to jump to a specific question. </p><p>I have implemented the sliding drawer control but it is able to display only 6-7 buttons inside it depending on the screen size. Trying to add more buttons to it gives an exception. I tried using a GridView inside the SlidingDrawer but i keep getting an error.</p><p>Is there anyway i can have around 20-30 buttons inside the SlidingDrawer control arranged in a grid like manner ?</p><p>Please give suggestions on any other way i can implement similar functionality in a way that doesn't take up much screen space ?</p>","282826","","","","","2011-02-08 04:12:53","How to Have multiple buttons inside Android SlidingDrawer Control","<android><slidingdrawer>","1","5","","",""
"4925525","1","","","2011-02-07 19:23:32","1","1608","<p>I am building on my media player app, and am now in the alpha testing stage.  I have noticed that battery drain is increased while running my app.  When checking battery usage I see that the MediaServer process is the culprit.  </p><p>I used OSMonitor to investigate and found mediaserver using 15-35%, with the following error message repeating constantly:</p><p>MP3Extractor(109)</p><p>Unable to resync. Signalling end of stream.</p><p>Incidentally, the stock android player usage of this process is similar, and has the same error.  Should I write this off as expected result when using the SDK mediaplayer , or should I attempt to troubleshoot this error?</p><p>Any opinions are appreciated.</p><p>Thank You,Josh McKinney</p>","453305","","","","","2011-04-07 17:36:26","Android mediaserver process using processor / battery","<android><media-player>","1","0","","",""
"4925555","1","","","2011-02-07 19:27:05","1","318","<p>When I add contacts with ACCOUNT_NAME, ACCOUNT_TYPE set to my custom values, the contacts are not saved after the Samsunc Epic is powered off.  I add contacts using the ArrayList ops and applyBatch(ContactsContract.AUTHORITY, ops) technique.</p><p>The same code works fine on the emulator and HTC EVO phones running 2.1 or 2.2. I am not currently using any sync provider logic.  Do I need to be a sync provider to use custom account fields?</p><p>If I use null values for ACCOUNT_NAME and ACCOUNT_TYPE the contacts are saved fine on both the Epic and HTC EVO, but I want an option to hide the contacts from typical ""My Contacts"" views. </p><p>Given that I'd like to be able to hide/unhide contacts dynamically, is using a custom account/type the best way to hide contacts or is there a better way?</p>","606894","","","","","2011-02-18 11:17:19","contacts added to an account are not saved across power off/on on Samsung Epic","<android>","1","0","1","",""
"4925588","1","4926427","","2011-02-07 19:29:53","1","2359","<p>I'm following steps at this website, <a href=""http://bootloader.wikidot.com/android:kgdb"" rel=""nofollow"">http://bootloader.wikidot.com/android:kgdb</a>, and one of the steps requires me to configure the kernel when I make it. I was wondering how to do this? What files do I need to edit, or what commands do I need to input?</p>","548852","","648313","","2011-07-19 17:07:36","2011-07-19 17:07:36","Android: How to configure kernel?","<android><kernel><android-source>","1","2","","",""
"4925609","1","","","2011-02-07 19:31:44","1","978","<p>I made a little live wallpaper. I wanted to upload it to the market and got the info that I need to specify the api level. But when I set</p><pre><code>&lt;uses-sdk android:minSdkVersion=""7"" /&gt;</code></pre><p>in the Manifest right after closing the  tag, the wallpaper just crashes on loading. I did not change anything else between the two compiles and it runs fine without the tag. The error occurs somewhere deep in the opengl thread running the wallpaper, so the exception message is not really helpful. At least I don't know what could possibly crash there.</p><pre><code>W/dalvikvm( 3838): threadid=9: thread exiting with uncaught exception (group=0x40201560)E/AndroidRuntime( 3838): FATAL EXCEPTION: GLThread 10E/AndroidRuntime( 3838): java.lang.IllegalArgumentException: Must use a native order direct BufferE/AndroidRuntime( 3838):    at com.google.android.gles_jni.GLImpl.glVertexPointerBounds(Native Method)E/AndroidRuntime( 3838):    at com.google.android.gles_jni.GLImpl.glVertexPointer(GLImpl.java:1121)E/AndroidRuntime( 3838):    at com.mblaster.LaserShowLWP.MyRenderer.drawLaserRays(MyRenderer.java:406)E/AndroidRuntime( 3838):    at com.mblaster.LaserShowLWP.MyRenderer.onDrawFrame(MyRenderer.java:109)E/AndroidRuntime( 3838):    at net.rbgrn.android.glwallpaperservice.GLThread.guardedRun(GLWallpaperService.java:675)E/AndroidRuntime( 3838):    at net.rbgrn.android.glwallpaperservice.GLThread.run(GLWallpaperService.java:540)I/installd(  134): unlink /data/dalvik-cache/data@app@com.mblaster.LaserShowLWP-1.apk@classes.dex</code></pre><p>If you want to read the code of the GLThread, it's here: <a href=""https://github.com/markfguerra/GLWallpaperService/blob/master/GLWallpaperService/src/net/rbgrn/android/glwallpaperservice/GLWallpaperService.java"" rel=""nofollow"">https://github.com/markfguerra/GLWallpaperService/blob/master/GLWallpaperService/src/net/rbgrn/android/glwallpaperservice/GLWallpaperService.java</a></p><p>I hope someone can help me with this.</p><p>mblaster</p>","606984","","","","","2011-02-08 19:33:59","uses-sdk tag crashes live wallpaper","<android><versioning><android-manifest><wallpaper>","1","0","","",""
"4925681","1","","","2011-02-07 19:39:10","2","773","<p>Within an AsyncTask, I am making a REST call to retrieve data. Within that AsyncTask, I may encounter an exception which I would like to package up (the HTTP code) and inform the Activity, which based on the HTTP response code (Timeout, Unauthorized, etc), would display different messages to the user. </p><p>What would be the best way to bubble that information up to the Activity for processing? </p><p>I have looked at a number of different Android mechanisms such as Notification, Handler, etc but I can't seem to determine a good architectural pattern for this situation. </p>","541999","","","","","2011-02-07 19:46:48","Notification of Activity from AsyncTask","<android><android-asynctask>","1","0","","",""
"4925834","1","4926161","","2011-02-07 19:55:27","1","1419","<p>i'm trying to trigger a conditional by checking the user input in an EditText field.  when i print the String from the EditText to logcat, i can see the data change, but the String functions that check against the values always return false.</p><pre><code>if(((EditText)findViewById(R.id.drv_in)).getText().toString().equals("""")) {    TX_FAIL_TEXT = ""Missing Driver ID!"";}Log.e(""SMSDRVERR"", ((EditText)findViewById(R.id.drv_in)).getText().toString());</code></pre><p>this code always displays ""Missing Driver ID!"".  i have tried these other conditionals, with no success:</p><pre><code>(((EditText)findViewById(R.id.drv_in)).getText().toString().isEmpty())  //does not compile, says cannot find symbol, but the function is in the Android documentation(((EditText)findViewById(R.id.drv_in)).getText().toString().length() &lt; 1) //returns false, even for strings of length &gt; 1</code></pre><p>i can confirm that the data is, indeed, no null by looking at logcat and seeing my data show up in the logs.  what's wrong with the conditional?</p><p>it doesn't fail if you insert no data in the first transmit. if the first transmit fails, all subsequent transmissions fail, regardless of whether you change the data or not. furthermore, if it passes the first transmission, it will pass all subsequent transmissions.</p><p>additionally, there are other conditionals, posted in the full code below, which also evaluate only on the first click of the button.</p><pre><code>transmit.setOnClickListener(new View.OnClickListener() {    public void onClick(View v) {        //data validation        ///////////////////////        boolean valid = true;        if(((EditText)findViewById(R.id.drv_in)).getText().toString().equals("""")) {            TX_FAIL_TEXT = ""Missing Driver ID!"";            showDialog(DIALOG_FAIL);            TX_FAIL_TEXT = ""Transmission Failed!""; //reset the dialog fail text to default            valid = false;        }        Log.e(""SMSDRVERR"", ((EditText)findViewById(R.id.drv_in)).getText().toString());        if(custSpn.getSelectedItemPosition() == 0) {            TX_FAIL_TEXT = ""Missing Customer Selection!"";            showDialog(DIALOG_FAIL);            TX_FAIL_TEXT = ""Transmission Failed!""; //reset the dialog fail text to default            valid = false;        }        if(prdSpn.getSelectedItemPosition() == 0) {            TX_FAIL_TEXT = ""Missing Product Selection!"";            showDialog(DIALOG_FAIL);            TX_FAIL_TEXT = ""Transmission Failed!""; //reset the dialog fail text to default            valid = false;        }        if(((Cursor)prdSpn.getItemAtPosition(prdSpn.getSelectedItemPosition())).getString(prdSpn.getSelectedItemPosition()).contains(""CAR"") ||                 ((Cursor)prdSpn.getItemAtPosition(prdSpn.getSelectedItemPosition())).getString(prdSpn.getSelectedItemPosition()).contains(""AUTO"") ||                ((Cursor)prdSpn.getItemAtPosition(prdSpn.getSelectedItemPosition())).getString(prdSpn.getSelectedItemPosition()).contains(""TRUCK"")            ) {            //must have make, license# and 1vin            if(((EditText)findViewById(R.id.make_in)).getText().toString().equals("""")) {                TX_FAIL_TEXT = ""Vehicle Entry:\n Missing Make/Model!"";                showDialog(DIALOG_FAIL);                TX_FAIL_TEXT = ""Transmission Failed!""; //reset the dialog fail text to default                valid = false;            }            if(((EditText)findViewById(R.id.tag_in)).getText().toString().equals("""")) {                TX_FAIL_TEXT = ""Vehicle Entry:\n Missing Tag Number!"";                showDialog(DIALOG_FAIL);                TX_FAIL_TEXT = ""Transmission Failed!""; //reset the dialog fail text to default                valid = false;            }            if(((EditText)findViewById(R.id.vin1_in)).getText().toString().equals("""") ||                    ((EditText)findViewById(R.id.vin2_in)).getText().toString().equals("""") ||                    ((EditText)findViewById(R.id.vin3_in)).getText().toString().equals("""") ||                    ((EditText)findViewById(R.id.vin4_in)).getText().toString().equals("""") ||                    ((EditText)findViewById(R.id.vin5_in)).getText().toString().equals("""") ||                    ((EditText)findViewById(R.id.vin6_in)).getText().toString().equals("""") ||                    ((EditText)findViewById(R.id.vin7_in)).getText().toString().equals("""") ||                    ((EditText)findViewById(R.id.vin8_in)).getText().toString().equals("""")                ) {                TX_FAIL_TEXT = ""Vehicle Entry:\n Missing VIN Number!"";                showDialog(DIALOG_FAIL);                TX_FAIL_TEXT = ""Transmission Failed!""; //reset the dialog fail text to default                valid = false;            }        }        //Log.e(""smsDRVERR"",((EditText)smsActivity.this.findViewById(R.id.drv_in)).getText().toString());        //begin transmission        ///////////////////////        if(valid) {            showDialog(DIALOG_TX_PROGRESS);            Thread t = new Thread(txRunnable);            t.start();        } else {            //do things if needed        }    }</code></pre>","329993","","329993","","2011-02-07 20:04:21","2011-02-07 20:55:16","String and EditText function issues in Android","<java><android><string><conditional><edittext>","2","5","","",""
"4925899","1","4926001","","2011-02-07 20:01:34","0","378","<p>Im trying to launch an application from another one. Ive used the fingerpaint api demo and added a save and some different brushes and Id like the user to be prompted on saving the picture to select something like photoshop to do color correction of photomanipulation to the photo and once they are done with the photo and its saved in photoshop have the fingerpaint app reopen with the photo they just manipulated in the screen and ready for them to add more to if they chose to do so.</p><p>Will I have to set a background activity to read the photoshops state and when it saves? Thats what Im thinking I will have to do but Im not sure at this point.</p><p>Im not asking for some one to code it out for me but if any one has an idea of how or where I can see an example of an app opening another that would be awesome. </p><p>( and please do not be so vague as to say look at the android.com dev section as there is WAY to much info to look through on there. I spend half my day on there already :p )</p>","607013","","","","","2011-02-07 20:09:48","android- How to launch an app from your app in android","<android>","1","3","","",""
"4925915","1","4928814","","2011-02-07 20:03:12","4","9663","<p>I have a drawing app that allows the user to draw to a blank canvas.  I am attempting to draw a scaled 'thumbnail' of the current bitmap so that when the user has scaled in the View, they can reference the thumbnail to get a sense as to where they are in the overall draw canvas.  I have the scaling working, and am displaying the thumbnail in the correct location, but it appears that the thumbnail is not being updated on subsequent onDraws when new lines/shapes are added.</p><p>So that I have access to the underlying bitmap for this view (to show the thumbnail, be able to easily save the bitmap to a file, etc) I do the following in onSizeChanged() for the View:</p><pre><code>@Overrideprotected void onSizeChanged(int w, int h, int oldw, int oldh) {    super.onSizeChanged(w, h, oldw, oldh);    // set the canvas height, panning, etc, based on the now inflated View    mWidth      = getWidth();    mHeight     = getHeight();    mAspectRatio    = mWidth / mHeight;    mPanX       = 0;    mPanY       = 0;    // create the Bitmap, set it to the canvasmBitmap = Bitmap.createBitmap(mWidth, mHeight, Bitmap.Config.ARGB_8888);mCanvas.setBitmap(mBitmap);draw(mCanvas);}</code></pre><p>Then, when the user draws and invalidate() is called, I do the following in onDraw() to generate the thumbnail:</p><pre><code>@Overrideprotected void onDraw(Canvas canvas) {    &lt;snipped code that draws paths, shapes to canvas&gt;    if (mScaled) {        Bitmap out = Bitmap.createScaledBitmap(mBitmap, (int) thumbWidth, (int) thumbHeight, false);        canvas.drawBitmap(out, null, thumbnailRectF, thumbCanvasPaint);    }}</code></pre><p>The thumbnail gets displayed in the space defined by thumbnailRectF using the thumbCanvasPaint, but in subsequent onDraw() calls, the scaled bitmap has not changed from it's original state, even though the full-sized active canvas shows all of the drawings, etc.  Based on some testing, it seems to me that while I am setting the Bitmap with the initial call to draw(mCanvas);, subsequent onDraws are writing to the underlying Bitmap rather than the one specified in onSizeChanged().</p><p>So, I guess I am trying to figure out how I tie the onDraw canvas to a Bitmap that I can readliy access to perform re-sizes, save, etc.  Looking at <a href=""http://stackoverflow.com/questions/2174875/android-canvas-to-jpg"">this question</a>, I thought that the draw(mCanvas); call would tie the onDraw to the bitmap specified in the mCanvas (in my case, mBitmap), but in practice, it doesn't seem to be working, in so far as updats to the canvas are concerned.</p><p>Thanks,</p><p>Paul</p>","357801","","641020","","2011-09-22 10:58:34","2013-02-20 21:11:03","Android Scaling Canvas Bitmap","<android><bitmap><android-canvas>","1","0","1","",""
"4925948","1","4983982","","2011-02-07 20:06:22","0","96","<p>I have 2 android apps both are signe with the same certificate, both are using the same google mapapi key created for the certificate. how come only one of the application is showing maps???</p>","62898","","","","","2011-02-13 11:59:31","google mapapi key works on one android application but not on another","<android><google-maps><google-maps-api-3><android-mapview>","1","3","","",""
"4925965","1","4926249","","2011-02-07 20:07:09","7","5496","<p>I've come to the point where I'm a few steps away from going bald...</p><p>I'm trying to run a service that will check if the servers at my work are running. It's supposed to do this every 5 minutes.</p><p>I've been through TimerTask, ScheduledExecutorService and finally Handler.They all work ""fine"" for a few hours, except for some inaccuracy, 1-5 mins off, and then suddenly the ""timer"" just stops firing.</p><p>Now, I've read that the Scheduler will stop if it encounters an uncaught Exception, and I'm sure that's the case as well with the TimerTask - But checking the log files, there aren't any exceptions at all...</p><p>When I got home from work today I decided to do an experiment with Handler.</p><p>I created 2 handlers, one would run the code for checking the servers and increment an int one at a time. The other would just Log the value of said int, so as to not stop should it encountered an exception (I can't see how it would though).</p><p>It runs great, with the usual 1-5 mins inaccuracy, for a few hours and then stops, below is the last lines from the log:</p><pre><code>02-07 20:03:25.892 D/dalvikvm(  992): GC_EXPLICIT freed 192K, 53% free 4295K/9031K, external 3755K/4825K, paused 114ms02-07 20:03:35.572 D/dalvikvm( 5472): GC_EXPLICIT freed &lt;1K, 54% free 2895K/6279K, external 2002K/2137K, paused 61ms02-07 20:04:42.212 V/ServerChecker(12568): Timer triggered02-07 20:04:42.212 V/ServerChecker(12568): Checking: linux1502-07 20:04:44.152 V/ServerChecker(12568): Checked: linux1502-07 20:04:44.152 V/ServerChecker(12568): Checking: linux102-07 20:04:44.462 V/ServerChecker(12568): Checked: linux102-07 20:04:44.462 V/ServerChecker(12568): Checking: linux1202-07 20:04:44.762 V/ServerChecker(12568): Checked: linux1202-07 20:04:44.762 V/ServerChecker(12568): Checking: linux902-07 20:04:45.072 V/ServerChecker(12568): Checked: linux902-07 20:04:45.072 V/ServerChecker(12568): Checking: linux1402-07 20:04:45.382 V/ServerChecker(12568): Checked: linux1402-07 20:04:45.382 V/ServerChecker(12568): Test timer triggered: 1302-07 20:05:01.002 E/InputDispatcher(  223): channel '406cefc8 com.n04dev.serverchecker/com.n04dev.serverchecker.ServerChecker (server)' ~ Consumer closed input channel or an error occurred.  events=0x802-07 20:05:01.002 E/InputDispatcher(  223): channel '406cefc8 com.n04dev.serverchecker/com.n04dev.serverchecker.ServerChecker (server)' ~ Channel is unrecoverably broken and will be disposed!02-07 20:05:08.932 D/dalvikvm(12842): GC_EXPLICIT freed 73K, 51% free 2641K/5379K, external 2002K/2137K, paused 37ms02-07 20:05:09.132 D/dalvikvm(  185): GC_EXPLICIT freed 11K, 53% free 2554K/5379K, external 2002K/2137K, paused 96ms02-07 20:05:12.022 D/dalvikvm(  185): GC_EXPLICIT freed &lt;1K, 53% free 2554K/5379K, external 2002K/2137K, paused 164ms02-07 20:05:12.062 D/dalvikvm(  185): GC_EXPLICIT freed &lt;1K, 53% free 2554K/5379K, external 2002K/2137K, paused 36ms02-07 20:05:18.612 D/dalvikvm(12852): GC_EXPLICIT freed 59K, 52% free 2596K/5379K, external 2002K/2137K, paused 72ms</code></pre><p>I've looked up the last two messages concerning my app and found <a href=""http://stackoverflow.com/questions/4484444/what-does-this-error-mean-android"">this thread</a> - But I can't see how that would apply in my case.</p><p>I really hope you guys have some idea about what I'm doing wrong. I've been at it for weeks.. Trying different timers, having a timer try to catch the ""main"" timer stopping and then restarting it, but with no luck, and as my last experiment shows, it doesn't seem to be a problem with the timer.. I think..</p>","605211","","496830","","2011-02-07 20:22:29","2011-02-07 20:35:30","Android service stops","<java><android><service><timer>","1","0","4","",""
"4925983","1","4926328","","2011-02-07 20:08:37","2","362","<p>I am using a debugging key for my API. I have generated it about 10 times now out of desperation.</p><p>Here's my Java code:</p><pre><code>public class MyMap extends MapActivity {private MapView mapView;private MapController mc;@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.my_map);    mapView = (MapView) findViewById(R.id.mapView);    mapView.setBuiltInZoomControls(true);    }}</code></pre><p>Here's the XML layout file:</p><p></p><pre><code>&lt;com.google.android.maps.MapView    android:layout_width=""fill_parent"" android:layout_height=""fill_parent""    android:apiKey=""0UsP9tzCZAIzw2b76-QktRuiZKaDt59u6ySX09w"" android:id=""@+id/mapView""    android:clickable=""true"" android:enabled=""true"" /&gt;&lt;/LinearLayout&gt;</code></pre><p>And here's my manifest file:</p><p></p><pre><code>&lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name"" android:debuggable=""true""&gt;    &lt;activity android:name="".MyMap"" android:label=""@string/app_name""        android:theme=""@android:style/Theme.NoTitleBar""        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;uses-library android:name=""com.google.android.maps"" /&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=""1"" /&gt;</code></pre><p></p><p>I just keep getting the grid. I haven't got a clue why. I have been at this for hours now. Also, I have done this with a release key, made an APK and still the same problem.</p><p>Can anyone help?</p><p><strong>SOLVED</strong>:</p><p>I had my MapActivity inside an ActivityGroup and for some reason the maps won't load like that. I simply took the map out of the ActivityGroup, loaded it as it's own Intent and it worked fine. Weird problem. Google should get on sorting that out.</p>","348261","","348261","","2011-02-09 10:10:06","2011-02-09 10:10:06","Does anyone know why my Maps aren't showing up in my app?","<android><grid><maps>","1","0","","",""
"4926004","1","4926162","","2011-02-07 20:10:17","6","2324","<p>How can I sync my strings.xml in Android if I'm using localisation and a new string needs also to be translated in values-de/strings.xml, values-ru/strings.xml ... <br>Do I really have to copy paste it in everey file - or is there a tool for managing translations?</p>","570168","","","","","2013-04-30 04:29:45","Android sync strings.xml","<android><internationalization><translation><sync>","3","0","3","",""
"4926027","1","4926204","","2011-02-07 20:13:09","19","17064","<p>I can't understand why the answer to this isn't in the Android developer docs; I find them consistently frustrating.</p><p>Re the openFileOutput() method on the Context class to open a file for writing, what internal storage file path does it write to?</p><p><a href=""http://developer.android.com/reference/android/content/Context.html"">http://developer.android.com/reference/android/content/Context.html</a></p><p><a href=""http://developer.android.com/guide/topics/data/data-storage.html#filesInternal"">http://developer.android.com/guide/topics/data/data-storage.html#filesInternal</a></p>","477415","","","","","2013-05-31 03:54:11","What file system path is used by Android's Context.openFileOutput()?","<android>","3","1","1","",""
"4926126","1","4926325","","2011-02-07 20:22:29","10","4081","<p><strong>The Situation</strong></p><p>I'm working with RSA encryption in Java. I'm trying to encrypt data on an HTC Saphire (32B) developer phone equipped with Cyanogenmod's Android 2.2 and then decrypt said data on a 64 bit server running Mandriva Linux 2010. I am using the same public key, private key pair on both machines, can correctly encrypt/decrypt data on the Android phone, can correctly encrypt/decrypt data on the Linux server, but I am unable to encrypt data on the phone and then decrypt it on the server. I get bad padding exceptions. I have confirmed that the data is being sent correctly by the phone and is being parsed correctly by the server. As such, I cannot figure out why decryption fails. Can anyone help me with this? Perhaps the RSA algorithm in Java has some underlying assumption about word size?</p><p><strong>Further information:</strong></p><ul><li>My encryption/decryption library is based on the guide found <a href=""http://www.javamex.com/tutorials/cryptography/rsa_encryption.shtml"" rel=""nofollow"">here.</a></li><li>My encryption key is 2048 bits in length, but I see similar behaviour with different key sizes.</li><li>I have packaged my RSA encryption/decryption code into a jar file. It was compiled through Eclipse on the server's machine.</li><li>The program using the encryption library on the Android phone uses the above library. It too was built using Eclipse.</li><li>The server program was built using Netbeans (as it was easier at the time to do so).</li></ul><p><strong>Other Questions</strong></p><ul><li>Are there other free public-key encryption algorithms / libraries available for Java? Do they work cross-platform? What performance would one expect from them? Etc., etc. I've looked into this and haven't found much; perhaps I'm looking with the wrong keywords.</li></ul><p>Phew! I think that's it. Thanks for your help in  advance!</p>","341654","","","","","2012-01-17 04:07:56","RSA Encryption in Java: Cross Platform Issues?","<java><android><cross-platform><encryption-asymmetric><public-key-encryption>","2","6","3","",""
"4926280","1","","","2011-02-07 20:38:24","0","550","<p>Can I add data 2 from different tables of the same database into each row of a ListView in Android?</p><p>I have a vendor app and I want to add data from one standard items list table and one daily table to the list view.</p>","599044","","","","","2011-02-07 21:22:10","Can I add data 2 from different tables of the same database into each row of a ListView in Android?","<android><sqlite><table><listview>","2","2","","",""
"4926293","1","","","2011-02-07 20:39:25","1","1670","<p>I got an android phone day before yesterday, and I am utterly disappointed to find that there is no WiFi proxy support on unrooted android phones. I was desperately looking for solutions for the last two days. I am thinking of this solution, but since I don't have much knowledge of Networking, I am not sure how to implement it:</p><ol><li>It is an open issue in android:<a href=""http://code.google.com/p/android/issues/detail?id=1273"" rel=""nofollow"">http://code.google.com/p/android/issues/detail?id=1273</a> . Here,comment by 910 (allanco)-<a href=""http://code.google.com/p/android/issues/detail?id=1273#c910"" rel=""nofollow"">http://code.google.com/p/android/issues/detail?id=1273#c910</a> says hecan access internet by entering proxy in default gateway.</li><li>Since allanco had the proxy server address and gateway address asthe same IP, he was able to enter proxy server information ingateway address.</li><li>At my university, there is no other way to connect to internet(other than a proxy server), so what I am doing is, I have created aproxy server on my laptop. That proxy server is actually atransparent proxy of the institute proxy server.</li><li>I am now thinking of entering this proxy server (i.e. my laptop'sIP) into Default Gateway in my android phone. I am hoping that thiswill work, since the default gateway, and proxy address are same.</li></ol><p>But, while creating the proxy server, I am not sure which port to enter, because in Default Gateway, you don't enter any port number. Please look into this issue, and confirm if this can be a possible solution to WiFi proxy issue on android. Since allanco was able to connect to internet with this kind of configuration, I think there is hope.</p><p>Any ideas, Networking geniuses?</p><p>Warm Regards,Ujjwal</p>","607085","","427763","","2012-07-20 18:54:23","2013-04-07 14:38:36","Looking for a solution for WiFi proxy issue with Android","<android><proxy><wifi><gateway>","1","1","","",""
"4926388","1","","","2011-02-07 20:48:35","1","907","<p>I am trying to make my buttons change the color of their text when it is pressed but i ran into a problem that i cant solve. I get an error saying ""unable to resolve color value"" then it gives me the path to the file. here are my files im using</p><p>This one is in a new folder named color under resources and its called button</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;item android:state_focused=""true"" android:color=""#ff0000ff"" /&gt;&lt;item android:color=""#ff000000"" /&gt;&lt;/selector&gt;</code></pre><p>And </p><pre><code>&lt;Button android:text=""Main Menu"" android:textColor=""@color/button""    android:layout_width=""200px"" android:id=""@+id/mainmenu""    android:layout_height=""55px"" android:layout_x=""5dip""      android:layout_y=""174dip""    android:textSize=""18px""&gt; &lt;/Button&gt;</code></pre><p>its driving me crazy if anybody could help me.</p>","604820","","119895","","2011-02-07 21:38:10","2011-02-07 22:19:42","Unable to resolve color value","<android>","2","1","1","",""
"4926447","1","5021169","","2011-02-07 20:54:31","4","4259","<p>i need to run a program that classifies certain dataset values. on the computer i am using weka to classify the same and provide it to me but i need to implement the same on android. eclipse shuts down when i run the program(weka) by giving an error such as PermGen heap space. i read several forums and found the option of changing the value in the <code>--launcher.XXMaxPermSize</code> in the eclipse.ini file but i have not found any success. i just need to use the j48 classifier from weka, is there anything else existing that would do the work for me? or is there a workaround to fix the PermGen error in eclipse?</p><p>please guide.</p>","377337","","377337","","2011-02-09 15:33:59","2014-01-28 08:40:17","weka in android?","<android><machine-learning><weka><classifier>","3","1","1","",""
"4926469","1","4926774","","2011-02-07 20:56:18","2","1134","<p>I am trying to find the battery level after running an android app. When the phone starts the app completely charged the code always returns 100% battery level (even though it has drained a lot). If I start the app at 75% battery or whatever then it returns the actual battery level at the end of the test. I start my test with the phone plugged into my computer keeping its charge up then right before executing the app I unplug it. Ideally I'd like tobe able to get starting% and ending% but that read 100% on both as well. So here is what I am doing... I call this from my activity:</p><pre><code>this.registerReceiver(this.mBatInfoReceiver, new IntentFilter(Intent.ACTION_BATTERY_CHANGED));</code></pre><p>Then in BroadcastReceiver I do a bunch of stuff (that takes over an hour so battery level changes). Then at the end of BoradcastReceiver I call this</p><pre><code>int level2 = intent.getIntExtra(""level"", 0);    /* Ending battery level */String end = ""Ending battery level: "" + String.valueOf(level2) + ""%"";</code></pre><p>And then send the String end to the server. </p><p>Here is what my code looks like:</p><pre><code>package com.mdog.datareceive;import java.io.IOException;import java.io.PrintWriter;import java.net.Socket;import java.net.UnknownHostException;import android.app.Activity;import android.content.BroadcastReceiver;import android.content.Context;import android.content.Intent;import android.content.IntentFilter;import android.os.Bundle;import android.os.PowerManager;import android.util.Log;import android.widget.TextView;public class Receive extends Activity {    /* Test parameters */    static int BYTES_TO_READ = 1024*1024*50;    /* The size of the data for each transfer */    static int TIMES_TO_READ = 20;              /* The number of times the client will request the data */    static int PLAYER_BUFFER_SIZE = 1638400;    /* Clients buffer size 1638400 = 1.57MB */    static int SLEEP_TIME_MS = 5000;    /* Display Info */    String start = ""empty"";                 /* String holder for the starting battery life */    String end = ""empty2"";                  /* String holder for the ending battery life */    int allMBytes = 0;                      /* Integer holder for the total number of megabytes received during the test */    TextView tv;                            /* The view the phone displays after completion of test */    /* Server Info */    String serverIP = ""192.168.0.104"";      /* Server IP */    int serverPort = 11313;                 /* Server port number */    private BroadcastReceiver mBatInfoReceiver = new BroadcastReceiver(){        @Override        public void onReceive(Context arg0, Intent intent) {            //int level = intent.getIntExtra(""level"", 0);            Socket connectionSocket = null;                         /* Socket to communicate with server */            byte[] inputHolderByteArray = new byte[PLAYER_BUFFER_SIZE]; /* Used to read from the socket */            int bufferBytes = 0;        /* filling the second buffer */            int totalBytesRead = 0;     /* The total number of bytes read for this transfer round */            int read=0;                 /* reading from stream, will contain the number of bytes read or -1 if the end has been hit */            /* Acquire a wake lock for the phone so it does not go to sleep */            PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE);            PowerManager.WakeLock wl = pm.newWakeLock(PowerManager.SCREEN_BRIGHT_WAKE_LOCK, getClass().getName());            /* Connect to Server */            try {                connectionSocket = new Socket(serverIP, serverPort);                connectionSocket.setReceiveBufferSize(PLAYER_BUFFER_SIZE); //1.5ish MB                connectionSocket.setKeepAlive(true);                PrintWriter out = new PrintWriter(connectionSocket.getOutputStream(), true);                out.print(""Client Info: Bytes expected per transfer:"" + BYTES_TO_READ + "", Number of transfer to request:"" + TIMES_TO_READ+ "", Buffer size:"" +PLAYER_BUFFER_SIZE+ "", Sleep time(ms):"" + SLEEP_TIME_MS + ""\n"");                out.flush();                wl.acquire();                for(int i=0; i&lt;TIMES_TO_READ; i++){                    out.print(""Start\n"");                    out.flush();                    while(totalBytesRead &lt; BYTES_TO_READ){                        /* Read at most PLAYER_BUFFER_SIZE bytes */                        read = connectionSocket.getInputStream().read(inputHolderByteArray, 0, PLAYER_BUFFER_SIZE);                        if(read != -1){                            bufferBytes += read;                            totalBytesRead  += read;                            if(bufferBytes &gt;= PLAYER_BUFFER_SIZE){                                    try {                                        Thread.sleep(SLEEP_TIME_MS);                                    } catch (InterruptedException e) {                                        e.printStackTrace();                                    }                                bufferBytes = 0;                            }                        }                        else{                            /* End of stream reached */                            break;                        }                         }                    allMBytes += ((totalBytesRead/1024)/1024);                    totalBytesRead = 0;                    try {                        Thread.sleep(1000);                    } catch (InterruptedException e) {                        e.printStackTrace();                    }                }                int level2 = intent.getIntExtra(""level"", 0);    /* Ending battery level */                /* Put data on screen */                start = ""Starting battery level: 100%"";                end = ""Ending battery level: "" + String.valueOf(level2) + ""%"";                out.print(""Test Completed: "" + start + "", "" + end + "", Megabytes Read: "" + allMBytes + ""\n"");                out.flush();                wl.release();                tv.setText(start + ""    \n"" + end + ""    \n Total MB transferred:"" + allMBytes);                setContentView(tv);            } catch (UnknownHostException e) {                Log.i(""UnknownHost exception "", "" ******************** Log Msg UHE "" + e.getLocalizedMessage());                e.printStackTrace();            } catch (IOException e2) {                Log.i(""IO exception "", ""******************** Log Msg IOE "" + e2.toString());                e2.printStackTrace();            }        }    };    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        tv = new TextView(this);                /* The view to post text to */        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        this.registerReceiver(this.mBatInfoReceiver, new IntentFilter(Intent.ACTION_BATTERY_CHANGED));    }}</code></pre>","604996","","","","","2011-02-07 21:23:59","Weird behaviour when using intent and BroadcastReceiver to get android battery level","<android><activity><android-intent><broadcastreceiver><battery>","2","1","","",""
"4926478","1","","","2011-02-07 20:56:57","3","604","<p>i just want it to show only one activity on the main menu and hide the remaining ones.</p><p>My manifest file looks something like this.</p><p>    </p><pre><code>&lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""    android:debuggable=""true""&gt;    &lt;activity android:name="".MainAct"" 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="".StartGame"" 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="".Instructions"" 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="".About"" 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;</code></pre><p></p>","605983","","605983","","2011-02-08 01:49:48","2011-02-08 01:49:48","why does the menu button in the emulator show all the activities of my app?","<android><menu><activity><emulator>","2","1","1","",""
"4926737","1","4927433","","2011-02-07 21:20:28","0","107","<p>I am trying to use the built in android search for my app. The problem is There are 7 different fields the user can search, and only one search bar. I am not sure this is possible, but I have seen Searches in android that were like this:</p><p><img src=""http://i.stack.imgur.com/eaOsW.png"" alt=""Multiple Searches Example""></p><p>Can anyone point me to any good resources that might help? Currently I using the returned query from the search bar on each index. This would require the user query remote resources 7 times for the same search string. It would be nice to only search the fields out of the 7 they want to search, without reinventing the wheel (making my own search activity and figure out how to override the default search page). Thank You.</p>","457577","","","","","2011-02-07 22:31:40","Adapt Default Android Search To My Liking","<android><gui><search><listactivity>","2","0","","",""
"4926807","1","4926991","","2011-02-07 21:27:44","1","565","<p>I'm <em>just</em> starting to develop on Android so this may be a very basic thing, but. . .</p><p>I'm having a really hard time setting up a <code>ListView</code> within a <code>LinearLayout</code>. Maybe it's a problem in my XML layout, or maybe it's a problem with my databinding code. </p><p>I'm confused by the many tutorials that say that my <code>Activity</code> should extend <code>ListActivity</code>. Why would this one widget require that my entire UI be changed?</p><p>The thing is, I only want the scrolling box of items to occupy a part of this one screen. Is <code>ListView</code> the wrong widget to use? Should I be using a <code>ScrollView</code> instead?</p><p>Thanks -- here's 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:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:background=""#FFF""    &gt;    &lt;TextView          android:layout_width=""fill_parent""         android:layout_height=""wrap_content""         android:text=""@string/enter_text""        /&gt;     &lt;LinearLayout      android:orientation=""horizontal""      android:layout_width=""fill_parent""      android:layout_height=""wrap_content""      android:layout_weight=""1""&gt;        &lt;EditText             android:id=""@+id/txtTo""              android:layout_width=""wrap_content""             android:layout_height=""wrap_content""            android:gravity=""left""            android:layout_weight=""1""            android:width=""200px""/&gt;       &lt;/LinearLayout&gt;       &lt;ListView android:id=""@+id/listRecent""        android:layout_width=""fill_parent""         android:layout_height=""wrap_content"" /&gt;  &lt;/LinearLayout&gt;</code></pre><p>And here's my code:</p><pre><code>public class MyApp extends Activity {private String TAG = ""MyApp"";//UI ELEMENTSEditText txtTo;ListView listRecent;/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    //GET REFERENCES TO UI ELEMENTS    listRecent = (ListView) this.findViewById(R.id.listRecent);    try {        //----------------------------------------        // create the grid item mapping        String[] from = new String[] {""zero"", ""one"", ""two"", ""three""};        int[] to = new int[] {0, 1, 2, 3};        // prepare the list of all records        List&lt;HashMap&lt;String, String&gt;&gt; fillMaps = new ArrayList&lt;HashMap&lt;String, String&gt;&gt;();        for(int i = 0; i &lt; 10; i++){            HashMap&lt;String, String&gt; map = new HashMap&lt;String, String&gt;();            map.put(""rowid"", """" + i);            map.put(""col_1"", ""col_1_item_"" + i);            map.put(""col_2"", ""col_2_item_"" + i);            map.put(""col_3"", ""col_3_item_"" + i);            fillMaps.add(map);        }        // fill in the grid_item layout        SimpleAdapter adapter = new SimpleAdapter(this, fillMaps, R.layout.recently_dingdonged, from, to);        listRecent.setAdapter(adapter);        //----------------------------------------    }    catch(Exception e) {        Log.e(TAG, ""Error here (3116019)"", e);    }}</code></pre>","28118","","119895","","2011-02-07 21:39:37","2011-02-07 21:45:04","How can I set up an inline ListView?","<android><android-listview>","2","0","","",""
"4926810","1","4933861","","2011-02-07 21:27:58","0","702","<p>I am looking for a way to communicate between a Android application built using Adobe AIR and a native application. I know it is possible between two native applications using Intents or Remote methods. But is it possible to send a message to a native service from an Adobe AIR built application that doesn't have access to the native API?</p><p>Thanks</p>","450780","","","","","2011-05-27 06:58:56","Android Native and AIR Application Communication","<android><actionscript><air><flash-cs5>","2","0","","",""
"4926847","1","","","2011-02-07 21:30:35","0","334","<p>I'm working on an app which displays various images. I want to optimize this for the various screen resolutions. The MultiResolution (1) tutorial uses many resource qualifiers in the res folder to display the appropriate images for the various device resolutions, but how do you package this? I don't want to ship the images for all devices (or do I?). I want to keep the download size as small as possible, so I only want to package the ones for that particular screen resolution. Or, should I forget packaging images and put the images on-line somewhere? </p><p>Any opinions on this subject would be appreciated</p><p>(1) <a href=""http://developer.android.com/resources/samples/MultiResolution/index"" rel=""nofollow"">http://developer.android.com/resources/samples/MultiResolution/index</a>....</p>","9707","","","","","2011-02-07 21:45:46","Optimal packaging of Android image app","<android><optimization><packaging><aapt>","1","0","","",""
"4926863","1","","","2011-02-07 21:33:01","2","266","<p>I have created an AVD which is shown to be a valid one as denoted by the green check mark.</p><p>When I have to select a build target however, it doesn't show my AVD in the list for Build Target.</p><p>How do I get Eclipse to 'see' my AVD?</p><p>Thanks!</p>","607167","","","","","2011-02-07 21:37:14","How do I get Eclipse to 'see' my AVD?","<android>","2","0","","",""
"4926921","1","4926997","","2011-02-07 21:38:42","0","931","<p>First of all, thanks to everybody here that I can get answers to almost all my questions after 39 days into Java/Android/Eclipse development life. But now I seem to get stuck at a very unexpected problem!</p><p>I need to format dates into only year+month and month+day formats. These are not standard formats, so I need to construct my own format patterns and use DateFormat.format() to get the string. I know I can use DateFormat.getDateFormatOrder() to determine the ordering of year, month, day. But I also need to know the date separator, like ""/"", ""-"", or ""."". This is where I get stuck, I can't find a way to do it!</p><p>From Eclipse debugger, I can get to see that there is a ""pattern"" field inside a DateFormat object, but it's not exposed. And the name of the method SimpleDateFormat.getDateFormatSymbols() sounds like what I want, but it's not. So....</p><p>Please help, thank you.</p>","593407","","","","","2011-02-07 21:56:32","How to obtain date separators in Android?","<java><android>","3","0","","",""
"4926923","1","","","2011-02-07 21:38:46","0","104","<p>On iPhone, apps can invoke each other using urls like:</p><pre><code>myapp://some/action</code></pre><p>I'm wondering if we can use the same on android? (would like to standardize my apps across platforms for third party app access).</p><p>Right now my android app can pick up on certain urls using the  tag in the manifest:</p><pre><code>&lt;data  android:scheme=""http""  android:host=""m.myapp.com""  android:pathPrefix=""/action"" /&gt;</code></pre><p>So, functionality is the same as iphone, can we use the same url scheme though? Not sure how that would translate with the above?</p><p>Thanks</p>","291701","","","","","2011-02-07 21:38:46","Using iphone style urls with intents for third party apps?","<android>","0","2","","",""
"4926963","1","","","2011-02-07 21:41:59","2","1646","<p>Is there any real battery power consumption benefit if Network Location Provider (vs. GPS) is used?</p><p>I believe there should be some benefit, but since I develop on emulator I can not prove my assumption. Does anyone have the evidence that Network Location Provider consumes less battery power than GPS Location Provider? If yes, could you tell how significant it is?</p><p>Thanks!</p>","247013","","418613","","2012-06-07 02:51:26","2012-06-07 02:51:26","Is there any battery power consumption benefit if Network Location Provider (vs. GPS) is used?","<android><networking><gps><power-management><location-provider>","2","6","1","",""
"4927122","1","","","2011-02-07 21:59:14","1","674","<p>I need to deliver an app on sd card, and need to make it start automatically after insertion of the card.</p><p>What I want to ask is, is this possible to achieve this for the operating systems android, symbian, blackberry and j2me supported phones?</p><p>I know that symbian supports pre-installment but how to do auto-start? And on android before version 2.2 non-sd card apps don't supported as i know.</p>","73292","","","","","2011-02-07 22:36:12","Pre-install and deliver app on sd card","<android><blackberry><java-me><mobile><symbian>","2","1","","",""
"4927125","1","5045818","","2011-02-07 21:59:30","2","651","<p>In my program, I have a section that displays the various currencies using the java NumberFormat.  As an example, the following three lines will give you the currency format for Algeria.</p><pre><code>chosenlocale = new Locale(""ar"",""DZ"");NumberFormat currencyformatter = NumberFormat.getCurrencyInstance(chosenlocale);String currencyexample = currencyformatter.format(Double.parseDouble(""0000.00000""));</code></pre><p>When I run this in the Android emulator, I get the cool and funky characters, but I do not when I run it on my device.  I assume that if the device was native to Algeria, the characters would display as they do in the emulator.  Is my assumption a good one?</p><p>Many thanks for your input!</p>","607173","","118587","","2011-02-18 19:50:12","2011-02-18 19:50:12","Android Currency Display: Device vs. Emulator","<java><android><android-emulator><currency>","1","0","1","",""
"4927158","1","","","2011-02-07 22:03:10","1","634","<p>My app is an asp .net vb app.  The link appears to work in any browser...except Android.</p><p>Here is the dynamic link:  <a href=""http://rentonlive.com/TandL.aspx?xid=106&amp;xtitle=RED%LIGHT%CAMERAS%READER%SURVEY"" rel=""nofollow"">http://rentonlive.com/TandL.aspx?xid=106&amp;xtitle=RED%LIGHT%CAMERAS%READER%SURVEY</a></p><p>What is Android looking for?  If this is a basic question that I could have figured out elsewhere please guide me after you help me with this issue.  </p><p>Thank you!</p>","607212","","76337","","2011-03-29 19:39:46","2011-03-29 19:39:46","Android Link Error Web page not available asp .net","<.net><asp.net><android><hyperlink>","1","6","","",""
"4927182","1","4927282","","2011-02-07 22:06:01","0","963","<p>I have this property in a visual basic class. NET 2008, the property in addition to the get and set has a parameter called ""pParam. ""</p><pre><code>Public Property UpdateField(ByVal pParam As String) As String        Get            Return Me.idField        End Get        Set(ByVal value As String)            Me.idField = value            If pParam = ""NEW"" Then        // some code here            End If        End SetEnd Property</code></pre><p>which is the equivalent of this in java code?</p><p>to use I do the following:</p><pre><code>oClass.UpdateField(""NEW"") = 1850</code></pre><p>I have this code in java</p><pre><code>public void setUpdateField(String idField) {    this.idField = idField;}public String getUpdateField() {    return idField;}</code></pre><p>but I need to put the parameter ""pParam""</p><p>Thanks in advance.</p>","518657","","","","","2011-02-07 22:15:28","Passing parameter to class property in Java","<java><android><class><parameters><getter-setter>","1","1","","",""
"4927208","1","","","2011-02-07 22:08:04","6","6427","<p>It seems like the EditText in the image below is too wide.  I assume that I have misused the SDK in some way and until convinced otherwise I am not looking for a way to specify some number of margin/padding pixels on the sides of the <code>EditText</code>.</p><p><img src=""http://i.stack.imgur.com/qTjlm.png"" alt=""enter image description here""></p><p>This one looks more appropriate.</p><p><img src=""http://i.stack.imgur.com/33Shn.png"" alt=""enter image description here""></p><p>Here's my code (that creates the first, 'Create Tag', dialog):</p><pre><code>final Dao&lt;Tag, Integer&gt; tagDao = getHelper().getTagDao();final EditText input = new EditText(this);input.setSingleLine(true);input.setHint(R.string.create_tag_dialog_hint);AlertDialog.Builder builder = new AlertDialog.Builder(this);builder.setView(input);builder.setTitle(getString(R.string.create_tag_dialog_title));builder.setPositiveButton(    getString(R.string.create_tag_dialog_positive),    new DialogInterface.OnClickListener() {        public void onClick(DialogInterface dialog, int whichButton) {            String value = input.getText().toString().trim();            Toast.makeText(getApplicationContext(), value, Toast.LENGTH_SHORT).show();            Tag tag = new Tag(value);            try {                    tagDao.create(tag);            } catch (SQLException e) {                    // TODO Auto-generated catch block                    e.printStackTrace();            }        }    });builder.setNegativeButton(    getString(R.string.create_tag_dialog_negative), null);builder.show();</code></pre><p>Sorry for the length of the post and thanks for any helpful comments.</p>","228539","","228539","","2011-02-07 23:19:36","2011-10-09 18:34:08","Android EditText in AlertDialog seems too wide","<android><width><edittext><alertdialog>","4","0","2","",""
"4927237","1","","","2011-02-07 22:10:32","1","387","<pre><code>Intent i = new Intent(Intent.ACTION_PICK,                        android.provider.MediaStore.Images.Media.INTERNAL_CONTENT_URI);                        startActivityForResult(i,0); </code></pre><p>but this always displays the picker in portrait mode. Is there a way to make that landscape?thanks!</p>","607218","","","","","2011-02-08 07:19:27","Android Pick Image Always in Portrait mode?","<android>","1","1","","",""
"4927303","1","4927550","","2011-02-07 22:17:52","1","2374","<p>Hi I retrieve data and one Float value from sqlite and return in arraylist:</p><pre><code>if (!cursor.isAfterLast())        {            do            {                ....                rowArray.add(cursor.getFloat(2));                ....            }            while (cursor.moveToNext());        }</code></pre><p>Problem occurred in float cast, when I try to set float variable from the list:</p><pre><code>ArrayList&lt;Object&gt; row;        row = db.getNameAsArray(name);        mCurrentPrice=((Float)row.get(2)).floatValue();</code></pre><p>There is no error but app FC in this line. Simple float cast doesnt work neither.Thx for any answer.</p><p>Logcat:</p><pre><code>02-07 22:34:19.537: ERROR/Retrieve Error(632): java.lang.ClassCastException: java.lang.String</code></pre><p>02-07 22:34:21.217: WARN/System.err(632): java.lang.ClassCastException: java.lang.String02-07 22:34:21.267: WARN/System.err(632):     at com.testing.retrieveDrinkName(DatabaseActivity.java:222)02-07 22:34:21.527: WARN/System.err(632):     at android.os.Handler.handleCallback(Handler.java:587)02-07 22:34:21.547: WARN/System.err(632):     at android.os.Handler.dispatchMessage(Handler.java:92)02-07 22:34:21.596: WARN/System.err(632):     at android.os.Looper.loop(Looper.java:123)02-07 22:34:21.657: WARN/System.err(632):     at android.app.ActivityThread.main(ActivityThread.java:4363)02-07 22:34:21.667: WARN/System.err(632):     at java.lang.reflect.Method.invokeNative(Native Method)02-07 22:34:21.737: WARN/System.err(632):     at java.lang.reflect.Method.invoke(Method.java:521)02-07 22:34:21.769: WARN/System.err(632):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)02-07 22:34:21.797: WARN/System.err(632):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)02-07 22:34:21.817: WARN/System.err(632):     at dalvik.system.NativeStart.main(Native Method)</p>","581567","","581567","","2011-02-07 22:45:55","2011-02-07 22:45:55","How cast from Float in object array to float variable?","<java><android>","1","8","","",""
"4927333","1","","","2011-02-07 22:20:24","1","110","<p>I have tried to find the answer to something I am sure is really simple.  I just want to be able to stack one image ontop of another.  Intent is put a cropped picture of the user's face onto a wacky body. </p>","607231","","","","","2011-02-07 22:26:31","Stack to images in an Android application","<android><image><layer>","1","0","","",""
"4927356","1","","","2011-02-07 22:23:49","4","7978","<p>I'm having some troubles with the Android NDK.</p><p>My project requires software components written in C that can receive data over TCP to be executed on the Android OS.</p><p>To that end, I've made a simple server and client in C using BSD sockets and can send messages back and forth successfully across the connection on PCs. Now I've moved the clientside code into the NDK, and can't connect to my server from the emulator or from an actual android device. NDK compiles without warnings or errors, the emulator/phone are on wifi and have internet permissions enabled in the manifest. What gives? </p><p>All it does is make a socket, fill in host/port info and attempt to connect: If it does connect, send a message, else return an error. Android always returns a negative value for connect </p><hr><h2>This client code, compiled/executed on Mac/Windows/Linux, works:</h2><p>PC Client code:</p><pre><code>int tcp_socket = socket(AF_INET, SOCK_STREAM,0); if(tcp_socket&lt; 0 ) {    cerr &lt;&lt; ""Failed to create TCP socket."" &lt;&lt; endl;    return 2;}sockaddr_in server_tcp_add;server_tcp_add.sin_family = AF_INET;server_tcp_add.sin_port = htons(tcp_port); //set via command line: Yes, they are the same for the androidhostent *hostp = gethostbyname(server_host);memcpy(&amp;server_tcp_add.sin_addr, hostp-&gt;h_addr, hostp-&gt;h_length); socklen_t slen = sizeof(server_tcp_add);if(connect(tcp_socket,(sockaddr*)&amp;server_tcp_add, slen) &lt;0 ){    cerr&lt;&lt; ""Failed to connect to server with TCP. "" &lt;&lt; endl;    close(tcp_socket);    return 3;}char* myString = ""This is my message"";send(tcp_socket, myString, strlen(myString), 0);close(tcp_socket);</code></pre><hr><h2>This code, executed on the Android NDK, does not</h2><p>Code: NDK Client</p><pre><code>jstring Java_networking_client_activate_initiateTcpConnection(JNIEnv* env, jobject javaThis){    int tcp_socket = socket(AF_INET, SOCK_STREAM,0);    if(tcp_socket &lt; 0){        return (*env)-&gt;NewStringUTF(env, ""ERROR CREATING SOCKET"");    }    const char* server_host = ""some.numbers.that.work""; //It's a valid IP I don't feel like sharing    unsigned short server_port = 43000;    struct sockaddr_in server_tcp_addr;    server_tcp_addr.sin_family = AF_INET;    server_tcp_addr.sin_port = htons(server_port);    struct hostent *hostp = gethostbyname(server_host);    memcpy(&amp;server_tcp_addr, hostp-&gt;h_addr, hostp-&gt;h_length);    socklen_t slen = sizeof(server_tcp_addr);    if(connect(tcp_socket,(struct sockaddr*)&amp;server_tcp_addr, slen) &lt; 0){ //fails here        close(tcp_socket);        return (*env)-&gt;NewStringUTF(env, ""ERROR CONNECTING TO SERVER"");    }    char* message = ""hello from android!"";    send(tcp_socket, &amp;message, sizeof(message),0);    return (*env)-&gt;NewStringUTF(env, ""TCP message sent!"");}</code></pre><p>Largely identical; required to put struct in front of everything for NDK to compile. Any insights or input would be greatly appreciated. Thank you in advance for your time</p><p>--edit--I should also mention, I have been able to send data over sockets in Java with this app. Just the C sockets that's really screwing stuff up. Even a sample of someone else that has C sockets working via NDK would be tremendously appreciated.</p>","607152","","607152","","2011-03-04 04:52:20","2011-12-25 13:07:53","Android NDK Networking problems: TCP Connection fails","<android><sockets><networking><tcp><android-ndk>","1","3","7","",""
"4927365","1","4929659","","2011-02-07 22:24:28","6","603","<p>Are there any tools for displaying the current task's Activity stack? I'd like to do some debugging, e.g.: check to see if a specific Activity always starts in a new task, and things like that. But i couldn't find any tooling for this.</p><p>Thanks</p>","446529","","","","","2011-02-08 04:47:13","Is there a way to show Android Acivity stacks?","<android><activity><stack>","1","0","1","",""
"4927435","1","4927621","","2011-02-07 22:31:53","5","2226","<p>my code here is horribly wrong, and i'm not sure how you would properly do this.  i have a Spinner which is populated from a SQLite database query through a CursorAdapter.  i need to get the text (value) of the currently selected item.  i tried this garbage:</p><pre><code>((Cursor)prdSpn.getItemAtPosition(prdSpn.getSelectedItemPosition())).getString(prdSpn.getSelectedItemPosition())</code></pre><p>to get the text, but it crashes every time.  what's the proper way to do this?  here's some additional code that may be relevant:</p><pre><code>/// qc defined above as a SimpleCursorAdapter/////////setup product selection spinner from dbprdSpn = (Spinner)findViewById(R.id.prd_spn);Cursor prdCur = null;try {    prdCur = mDb.query(smsDbSchema.ProductSchema.TABLE_NAME, null, null, null, null, null, null);} catch(Exception e) {    Log.e(""smsdb"", e.toString());}prdCur.moveToFirst();startManagingCursor(prdCur);qc = new SimpleCursorAdapter(    this,    android.R.layout.simple_spinner_item,    prdCur,    new String[] {smsDbSchema.ProductSchema.COLUMN_NAME},    new int[] {android.R.id.text1});qc.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);prdSpn.setAdapter(qc);</code></pre>","329993","","","","","2011-02-08 14:13:01","getting String value from a Spinner backed by CursorAdapter from SQL query in Android","<java><android><spinner><simplecursoradapter>","2","0","1","",""
"4927455","1","4927714","","2011-02-07 22:34:51","6","3356","<p>I am developing an app where I want to allow the user to be able to set up that if they fail the login after a couple of attempts into the app, it will automatically delete all the data including the preferences and databases. </p><p>Is there a simple way to do this or do I have to write code to manually reset everything the app uses. </p><p>Thanks for any help with this</p>","499448","","","","","2013-03-04 08:39:46","Clear my own apps data programatically","<android>","3","0","","",""
"4927456","1","4927633","","2011-02-07 22:35:16","2","1072","<p>I need to show a EULA like dialog when a user starts up my app, but my app also has a splash screen of sorts that needs to be displayed before the dialog. I coded this up like so:</p><pre><code>Activity A.onCreate(...) {...1. startActivity(Activity B) [this activity calls .finish() after x seconds]2. dialog.show()...}</code></pre><p>Logically, it seems like this should work. However, after I return to activity A from activity B, the entire screen is dimmed as if the dialog is showing, but without the dialog window.</p><p>I was able to work around this by reversing the calls as such and the dialog shows after activity B is done and no weird issues occur:</p><pre><code>Activity A.onCreate(...) {...1. dialog.show()2. startActivity(Activity B) [this activity calls .finish() after x seconds]...}</code></pre><p>Anyone know why the order of calls is so important? To me they should work the same.</p>","501754","","","","","2011-02-07 22:54:55","Android Activity.startActivity() and Dialog.show() order","<android><activity><dialog><order>","1","0","","",""
"4927482","1","","","2011-02-07 22:37:57","1","390","<p>On Android 2.1+ I am calling a number that is not in the contacts database using the activity started by startActivity(new Intent(Intent.ACTION_CALL, Uri.parse(""tel:"" + ptn)))  Since the number is not in the contacts database there is no name associated with the call.  I want to display a name with the called number so the user can verify the number the application is calling.</p><p>I tried using a LabeledIntent, but couldn't get it to work with ACTION_CALL.  Is there a way to make a call using the ACTION_CALL intent or through some other means where I can pass a name that will be displayed during the call?</p>","606894","","","","","2011-10-20 19:07:52","custom text passed to ACTION_CALL activity","<android>","1","0","","",""
"4927647","1","4927772","","2011-02-07 22:56:05","3","5369","<p>Is there any documentation regarding the WebView JavaScript Bridge? I am looking for documentation that describes the capabilities and supported data types for methods defined within the ""JavascriptInterface"".</p><p>For example if I define the following:</p><pre><code>public class JavaScriptInterface {    public int incrementNumber(int num) {       return num + 1;}</code></pre><p>If I call this method from within JavaScript and run it in the emulator, everything seems to work fine. If I run this on my NexusOne, the passed in ""num"" argument is always ""0"". </p><p>If I change the above to:</p><pre><code> public class JavaScriptInterface {    public int incrementNumber(String num) {       // Leaving out try/catch       int tempNum = newRadius = Integer.parseInt(num);       return tempNum + 1;}</code></pre><p>... everything seems to work. So I am wondering if JavaScriptInterface method arguments should/can only be of type String?</p><p>Relevant resources:<a href=""http://developer.android.com/reference/android/webkit/WebView.html"" rel=""nofollow"">http://developer.android.com/reference/android/webkit/WebView.html</a>http://developer.android.com/reference/android/webkit/WebView.html#addJavascriptInterface(java.lang.Object, java.lang.String)<a href=""http://code.google.com/apis/maps/articles/android_v3.html"" rel=""nofollow"">http://code.google.com/apis/maps/articles/android_v3.html</a></p>","440222","","","","","2012-03-19 14:33:37","WebView JavaScript Bridge Documentation","<android><android-webview>","2","0","","",""
"4927685","1","4927800","","2011-02-07 22:59:13","2","1079","<p>I have a problem with updating my table-layout from my async class.MY async class is fetching XML data so I don't block the main thread. My logs show the XML data is coming through but I don't know how to update my view with the data.</p><p>So I am attempting to put the data in tablerows and add the rows to the TableLayout but the logs show errors suggesting the Async class is not allowed to update my TableLayout view.</p><p>My code is as follows:</p><pre><code>public class RemotePrimary extends Activity {private static String SERVER_PATH   =   ""http://test2.icerge.com/"";private static String XML_FILE1     =   ""samplexml"";//private static String SERVER_PATH =   ""http://tqs.mamlambo.com/"";//private static String XML_FILE1       =   ""scores.jsp"";private String[] data               =   new String[10];/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    TableLayout datatable           =   (TableLayout)findViewById(R.id.TableLayout_data);    Downloader downloader   =   new Downloader();    downloader.execute(SERVER_PATH + XML_FILE1, datatable);}private class Downloader extends AsyncTask&lt;Object, String, Boolean&gt;{    TableLayout table;    @Override    protected Boolean doInBackground(Object... params) {        // TODO Auto-generated method stub        String path             =   (String)params[0];        table                   =   (TableLayout)params[1];        XmlPullParser xmldata   =   null;        try {            URL serverPath      =   new URL(path);            xmldata             =   XmlPullParserFactory.newInstance().newPullParser();            xmldata.setInput(serverPath.openStream(), null);            addRecord(xmldata, table);        } catch (Exception e) {            // TODO Auto-generated catch block            e.printStackTrace();        }        return true;    }    @Override    protected void onProgressUpdate(String... values) {        // TODO Auto-generated method stub        //super.onProgressUpdate(values);    }    private boolean addRecord(XmlPullParser data, TableLayout table){        int eventType                   =   -1;        boolean bFoundScores            =   false;        //find some records from xml        while(eventType != XmlResourceParser.END_DOCUMENT){            if( eventType == XmlResourceParser.START_TAG ){                //get the name of the tag(eg scores or score)                String strName  =   data.getName();                if( strName.equals(""node"") ){                    bFoundScores            =   true;                    String scoreValue       =   data.getAttributeValue(null, ""Title"");                    String scoreRank        =   data.getAttributeValue(null, ""Type"");                    String scoreUserName    =   data.getAttributeValue(null, ""Nid"");                    Log.e(""ADDING: "", scoreValue);                    //Log.e(""RETRIEVED"", ""collected : ""+scoreValue+"", ""+scoreRank+"", ""+scoreUserName);                    //publishProgress(scoreValue, scoreRank, scoreUserName);                    TableRow newRow     =   new TableRow(RemotePrimary.this);                    TextView rowText    =   new TextView(RemotePrimary.this);                    rowText.setText(scoreValue);                    newRow.addView(rowText);                    table.addView(newRow);                }            }            try {                eventType   =   data.next();            } catch (XmlPullParserException e) {                // TODO Auto-generated catch block                e.printStackTrace();            } catch (IOException e) {                // TODO Auto-generated catch block                e.printStackTrace();            }        }        return true;    }    @Override    protected void onPreExecute() {        // TODO Auto-generated method stub        super.onPreExecute();    }    @Override    protected void onPostExecute(Boolean result) {        // TODO Auto-generated method stub        super.onPostExecute(result);    }}//close Downloader class</code></pre><p>}//close RemotePrimary class</p><p>It's a bit much I know but I'll appreciate any help.</p><p>Thanks a great deal :-)</p>","504612","","","","","2011-02-07 23:12:25","Updating main thread tablelayout from async thread","<android>","1","0","","",""
"4927693","1","","","2011-02-07 23:00:15","0","588","<p>How can I have my textview detect if a circle is drawn on it's surface?  And help would be great.</p><p>Thanks so much.-Mitchell</p>","445342","","","","","2013-08-21 10:36:51","Gestures on a textview in Android","<android><textview><circle><gestures>","1","0","","",""
"4927828","1","5003945","","2011-02-07 23:16:15","0","1095","<p>I'm trying to chose the ARM development board for education purpose.The goal is to learn how to run and play around with systems like Android (version 2.0 or higher),Linux, Windows CE. It must support touch-screen, Ethernet, USB host and device. </p><p>I've found many boards, the most interesting is <a href=""http://armdesigner.com/Android6410.html"" rel=""nofollow"">Android6410</a>. I've search Google and it seems that it is not very popular. Has anyone used it? Is it well documented? What about the support? How about the performance under Android? </p><p>I've also found some other development boards:</p><ul><li><a href=""http://www.friendlyarm.net/products/mini2440?lang=en"" rel=""nofollow"">http://www.friendlyarm.net/products/mini2440?lang=en</a> - the most popular one but probably it is too slow for android 2.0. </li><li><a href=""http://www.friendlyarm.net/products/mini6410?lang=en"" rel=""nofollow"">http://www.friendlyarm.net/products/mini6410?lang=en</a> - the same CPU like Android6410 but it seems to be a new product so the support may be pretty bad</li><li><a href=""http://beagleboard.org/"" rel=""nofollow"">http://beagleboard.org/</a> - quite interesting and popular but no touch-screen in standard version. The external ones are very expensive (twice as expensive as the board itself)</li><li><a href=""http://pandaboard.org/"" rel=""nofollow"">http://pandaboard.org/</a> - very fast but also doesn't have standard touch-screen connector, no Windows CE support</li></ul><p>Any hints will be appreciated.</p>","291427","","","","","2013-04-16 01:50:53","Has anyone used Android6410 board for Android/Linux/WinCE development? Or recommend any other?","<android><embedded><hardware><arm><android-hardware>","2","0","","",""
"4927857","1","","","2011-02-07 23:19:58","0","173","<p>all, We know on Andorid, for a EditText, by default, whenever the EditText is clicked, the soft keyboard pops up to let you enter text. When you click DONE, it closes out and put the text directly to the EditText. Now, what I am trying to do is, instead of an EditText, I have an ImageView which is to let user enter some comment.(So the ImageView actually is an comment icon). I wish whenever the icon is clicked, it pops up the text editor with user previous entered text, again once the DONE is hit, it closes out and I can save whatever text there back to a string member of the Activity. Is that possible? So far, all I've seen about InputMethodManager is on EditText control, If it is too complicated, I probably just put an EditText into a sperate Activity. </p><p>Thanks.</p>","518138","","","","","2011-05-25 12:07:03","Can I show up the textbox editor on an image icon in Android?","<java><android><imageview><edittext>","1","0","","",""
"4927919","1","4928746","","2011-02-07 23:28:28","1","2581","<p>First I should prolly ask if it is indeed possible to do what I'm trying to do.</p><p>I have a custom RelativeView and it contains 4 TextViews and a button defines in an xml layout.</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;view class=""com.android.appionresourcemanager.Widgets.Digital""    xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:background=""@drawable/digitalface""&gt;      &lt;TextView android:id=""@+id/digi_reading""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:layout_alignParentBottom=""true""        android:layout_alignParentLeft=""true""/&gt;      &lt;TextView android:id=""@+id/digi_header""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:layout_alignParentTop=""true""        android:layout_alignParentLeft=""true""/&gt;       &lt;Button android:id=""@+id/digi_grouping""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:layout_alignParentTop=""true""        android:layout_alignParentRight=""true""/&gt;      &lt;TextView android:id=""@+id/digi_measurement""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:layout_alignParentBottom=""true""        android:layout_alignParentRight=""true""/&gt;      &lt;!-- If a gauge has more than one input types, this is how they would       toggle them. --&gt;      &lt;TextView android:id=""@+id/digi_type""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:layout_toRightOf=""@+id/digi_reading""        android:layout_above=""@+id/digi_measurement""/&gt;&lt;/view&gt;</code></pre><p>This I inflated the views into the RelativeLayout class.</p><pre><code>public void init() {        LayoutInflater inflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);        mReadDisplay = (TextView)inflater.inflate(R.id.digi_reading, this, true);            mReadDisplay.setTypeface(Typeface.createFromAsset(context.getAssets(),                    ""font/DIGITALDREAM.ttf""));            mReadDisplay.setTextSize(18f);        mHeadDisplay = (TextView)inflater.inflate(R.id.digi_header, this, true);            mHeadDisplay.setTextSize(14f);        mMeasureDisplay = (TextView)inflater.inflate(R.id.digi_measurement, this, true);            mMeasureDisplay.setTextSize(10f);        mTypeDisplay = (TextView)inflater.inflate(R.id.digi_type, this, true);            mTypeDisplay.setTextSize(10f);        mGrouping = (Button)inflater.inflate(R.id.digi_grouping, this, true);            mGrouping.setBackgroundColor(0x00000000);    }</code></pre><p>Everything looks good so far, so I run it and get a massive xml crash saying that it can't find my resource. Is it because I embedded it in the custom RelativeLayout?</p><pre><code>02-07 16:23:57.332: ERROR/AndroidRuntime(28002): android.view.InflateException: Binary XML file line #2: Error inflating class com.android.appionresourcemanager.Widgets.DigitalGauge02-07 16:23:57.332: ERROR/AndroidRuntime(28002):     at android.view.LayoutInflater.createView(LayoutInflater.java:513)02-07 16:23:57.332: ERROR/AndroidRuntime(28002):     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:565)02-07 16:23:57.332: ERROR/AndroidRuntime(28002):     at android.view.LayoutInflater.inflate(LayoutInflater.java:385)02-07 16:23:57.332: ERROR/AndroidRuntime(28002):     at android.view.LayoutInflater.inflate(LayoutInflater.java:320)02-07 16:23:57.332: ERROR/AndroidRuntime(28002):     at android.view.LayoutInflater.inflate(LayoutInflater.java:276)02-07 16:23:57.332: ERROR/AndroidRuntime(28002):     at android.view.View.inflate(View.java:8666)02-07 16:23:57.332: ERROR/AndroidRuntime(28002):     at com.android.appionresourcemanager.Widgets.WorkBench$2$1.onClick(WorkBench.java:64)02-07 16:23:57.332: ERROR/AndroidRuntime(28002):     at com.android.internal.app.AlertController$AlertParams$3.onItemClick(AlertController.java:876)02-07 16:23:57.332: ERROR/AndroidRuntime(28002):     at android.widget.AdapterView.performItemClick(AdapterView.java:284)02-07 16:23:57.332: ERROR/AndroidRuntime(28002):     at android.widget.ListView.performItemClick(ListView.java:3382)02-07 16:23:57.332: ERROR/AndroidRuntime(28002):     at android.widget.AbsListView$PerformClick.run(AbsListView.java:1696)02-07 16:23:57.332: ERROR/AndroidRuntime(28002):     at android.os.Handler.handleCallback(Handler.java:587)02-07 16:23:57.332: ERROR/AndroidRuntime(28002):     at android.os.Handler.dispatchMessage(Handler.java:92)02-07 16:23:57.332: ERROR/AndroidRuntime(28002):     at android.os.Looper.loop(Looper.java:144)02-07 16:23:57.332: ERROR/AndroidRuntime(28002):     at android.app.ActivityThread.main(ActivityThread.java:4937)02-07 16:23:57.332: ERROR/AndroidRuntime(28002):     at java.lang.reflect.Method.invokeNative(Native Method)02-07 16:23:57.332: ERROR/AndroidRuntime(28002):     at java.lang.reflect.Method.invoke(Method.java:521)02-07 16:23:57.332: ERROR/AndroidRuntime(28002):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)02-07 16:23:57.332: ERROR/AndroidRuntime(28002):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)02-07 16:23:57.332: ERROR/AndroidRuntime(28002):     at dalvik.system.NativeStart.main(Native Method)02-07 16:23:57.332: ERROR/AndroidRuntime(28002): Caused by: java.lang.reflect.InvocationTargetException02-07 16:23:57.332: ERROR/AndroidRuntime(28002):     at com.android.appionresourcemanager.Widgets.DigitalGauge.&lt;init&gt;(DigitalGauge.java:41)02-07 16:23:57.332: ERROR/AndroidRuntime(28002):     at java.lang.reflect.Constructor.constructNative(Native Method)02-07 16:23:57.332: ERROR/AndroidRuntime(28002):     at java.lang.reflect.Constructor.newInstance(Constructor.java:446)02-07 16:23:57.332: ERROR/AndroidRuntime(28002):     at android.view.LayoutInflater.createView(LayoutInflater.java:500)02-07 16:23:57.332: ERROR/AndroidRuntime(28002):     ... 19 more02-07 16:23:57.332: ERROR/AndroidRuntime(28002): Caused by: android.content.res.Resources$NotFoundException: Resource ID #0x7f050000 type #0x12 is not valid02-07 16:23:57.332: ERROR/AndroidRuntime(28002):     at android.content.res.Resources.loadXmlResourceParser(Resources.java:1874)02-07 16:23:57.332: ERROR/AndroidRuntime(28002):     at android.content.res.Resources.getLayout(Resources.java:731)02-07 16:23:57.332: ERROR/AndroidRuntime(28002):     at android.view.LayoutInflater.inflate(LayoutInflater.java:318)02-07 16:23:57.332: ERROR/AndroidRuntime(28002):     at com.android.appionresourcemanager.Widgets.DigitalGauge.init(DigitalGauge.java:47)02-07 16:23:57.332: ERROR/AndroidRuntime(28002):     at com.android.appionresourcemanager.Widgets.AppionWidget.&lt;init&gt;(AppionWidget.java:30)02-07 16:23:57.332: ERROR/AndroidRuntime(28002):     at com.android.appionresourcemanager.Widgets.Gauge.&lt;init&gt;(Gauge.java:13)02-07 16:23:57.332: ERROR/AndroidRuntime(28002):     ... 23 more</code></pre><p>Thanks for any help~Aedon</p><p>EDIT @ DAN BRESLAU The stack trace:</p><pre><code>02-08 08:52:21.904: ERROR/AndroidRuntime(1393): android.view.InflateException: Binary XML file line #2: Error inflating class com.android.appionresourcemanager.Widgets.DigitalGauge02-08 08:52:21.904: ERROR/AndroidRuntime(1393):     at android.view.LayoutInflater.createView(LayoutInflater.java:513)02-08 08:52:21.904: ERROR/AndroidRuntime(1393):     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:565)02-08 08:52:21.904: ERROR/AndroidRuntime(1393):     at android.view.LayoutInflater.inflate(LayoutInflater.java:385)02-08 08:52:21.904: ERROR/AndroidRuntime(1393):     at android.view.LayoutInflater.inflate(LayoutInflater.java:320)02-08 08:52:21.904: ERROR/AndroidRuntime(1393):     at android.view.LayoutInflater.inflate(LayoutInflater.java:276)02-08 08:52:21.904: ERROR/AndroidRuntime(1393):     at android.view.View.inflate(View.java:8666)02-08 08:52:21.904: ERROR/AndroidRuntime(1393):     at com.android.appionresourcemanager.Widgets.WorkBench$3$1.onClick(WorkBench.java:106)02-08 08:52:21.904: ERROR/AndroidRuntime(1393):     at com.android.internal.app.AlertController$AlertParams$3.onItemClick(AlertController.java:876)02-08 08:52:21.904: ERROR/AndroidRuntime(1393):     at android.widget.AdapterView.performItemClick(AdapterView.java:284)02-08 08:52:21.904: ERROR/AndroidRuntime(1393):     at android.widget.ListView.performItemClick(ListView.java:3382)02-08 08:52:21.904: ERROR/AndroidRuntime(1393):     at android.widget.AbsListView$PerformClick.run(AbsListView.java:1696)02-08 08:52:21.904: ERROR/AndroidRuntime(1393):     at android.os.Handler.handleCallback(Handler.java:587)02-08 08:52:21.904: ERROR/AndroidRuntime(1393):     at android.os.Handler.dispatchMessage(Handler.java:92)02-08 08:52:21.904: ERROR/AndroidRuntime(1393):     at android.os.Looper.loop(Looper.java:144)02-08 08:52:21.904: ERROR/AndroidRuntime(1393):     at android.app.ActivityThread.main(ActivityThread.java:4937)02-08 08:52:21.904: ERROR/AndroidRuntime(1393):     at java.lang.reflect.Method.invokeNative(Native Method)02-08 08:52:21.904: ERROR/AndroidRuntime(1393):     at java.lang.reflect.Method.invoke(Method.java:521)02-08 08:52:21.904: ERROR/AndroidRuntime(1393):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)02-08 08:52:21.904: ERROR/AndroidRuntime(1393):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)02-08 08:52:21.904: ERROR/AndroidRuntime(1393):     at dalvik.system.NativeStart.main(Native Method)02-08 08:52:21.904: ERROR/AndroidRuntime(1393): Caused by: java.lang.reflect.InvocationTargetException02-08 08:52:21.904: ERROR/AndroidRuntime(1393):     at com.android.appionresourcemanager.Widgets.DigitalGauge.&lt;init&gt;(DigitalGauge.java:41)02-08 08:52:21.904: ERROR/AndroidRuntime(1393):     at java.lang.reflect.Constructor.constructNative(Native Method)02-08 08:52:21.904: ERROR/AndroidRuntime(1393):     at java.lang.reflect.Constructor.newInstance(Constructor.java:446)02-08 08:52:21.904: ERROR/AndroidRuntime(1393):     at android.view.LayoutInflater.createView(LayoutInflater.java:500)02-08 08:52:21.904: ERROR/AndroidRuntime(1393):     ... 19 more02-08 08:52:21.904: ERROR/AndroidRuntime(1393): Caused by: android.view.InflateException: Binary XML file line #2: Error inflating class &lt;unknown&gt;02-08 08:52:21.904: ERROR/AndroidRuntime(1393):     at android.view.LayoutInflater.createView(LayoutInflater.java:513)02-08 08:52:21.904: ERROR/AndroidRuntime(1393):     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:565)02-08 08:52:21.904: ERROR/AndroidRuntime(1393):     at android.view.LayoutInflater.inflate(LayoutInflater.java:385)02-08 08:52:21.904: ERROR/AndroidRuntime(1393):     at android.view.LayoutInflater.inflate(LayoutInflater.java:320)02-08 08:52:21.904: ERROR/AndroidRuntime(1393):     at android.view.LayoutInflater.inflate(LayoutInflater.java:276)02-08 08:52:21.904: ERROR/AndroidRuntime(1393):     at android.view.View.inflate(View.java:8666)02-08 08:52:21.904: ERROR/AndroidRuntime(1393):     at com.android.appionresourcemanager.Widgets.DigitalGauge.init(DigitalGauge.java:45)02-08 08:52:21.904: ERROR/AndroidRuntime(1393):     at com.android.appionresourcemanager.Widgets.AppionWidget.&lt;init&gt;(AppionWidget.java:30)02-08 08:52:21.904: ERROR/AndroidRuntime(1393):     at com.android.appionresourcemanager.Widgets.Gauge.&lt;init&gt;(Gauge.java:13)02-08 08:52:21.904: ERROR/AndroidRuntime(1393):     ... 23 more02-08 08:52:21.904: ERROR/AndroidRuntime(1393): Caused by: java.lang.reflect.InvocationTargetException02-08 08:52:21.904: ERROR/AndroidRuntime(1393):     at com.android.appionresourcemanager.Widgets.DigitalGauge.&lt;init&gt;(DigitalGauge.java:41)02-08 08:52:21.904: ERROR/AndroidRuntime(1393):     at java.lang.reflect.Constructor.constructNative(Native Method)02-08 08:52:21.904: ERROR/AndroidRuntime(1393):     at java.lang.reflect.Constructor.newInstance(Constructor.java:446)02-08 08:52:21.904: ERROR/AndroidRuntime(1393):     at android.view.LayoutInflater.createView(LayoutInflater.java:500)02-08 08:52:21.904: ERROR/AndroidRuntime(1393):     ... 31 more02-08 08:52:21.904: ERROR/AndroidRuntime(1393): Caused by: android.view.InflateException: Binary XML file line #2: Error inflating class &lt;unknown&gt;02-08 08:52:21.904: ERROR/AndroidRuntime(1393):     at android.view.LayoutInflater.createView(LayoutInflater.java:513)02-08 08:52:21.904: ERROR/AndroidRuntime(1393):     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:565)02-08 08:52:21.904: ERROR/AndroidRuntime(1393):     at android.view.LayoutInflater.inflate(LayoutInflater.java:385)02-08 08:52:21.904: ERROR/AndroidRuntime(1393):     at android.view.LayoutInflater.inflate(LayoutInflater.java:320)02-08 08:52:21.904: ERROR/AndroidRuntime(1393):     at android.view.LayoutInflater.inflate(LayoutInflater.java:276)02-08 08:52:21.904: ERROR/AndroidRuntime(1393):     at android.view.View.inflate(View.java:8666)02-08 08:52:21.904: ERROR/AndroidRuntime(1393):     at com.android.appionresourcemanager.Widgets.DigitalGauge.init(DigitalGauge.java:45)02-08 08:52:21.904: ERROR/AndroidRuntime(1393):     at com.android.appionresourcemanager.Widgets.AppionWidget.&lt;init&gt;(AppionWidget.java:30)02-08 08:52:21.904: ERROR/AndroidRuntime(1393):     at com.android.appionresourcemanager.Widgets.Gauge.&lt;init&gt;(Gauge.java:13)02-08 08:52:21.904: ERROR/AndroidRuntime(1393):     ... 35 more02-08 08:52:21.904: ERROR/AndroidRuntime(1393): Caused by: java.lang.reflect.InvocationTargetException02-08 08:52:21.904: ERROR/AndroidRuntime(1393):     at com.android.appionresourcemanager.Widgets.DigitalGauge.&lt;init&gt;(DigitalGauge.java:41)02-08 08:52:21.904: ERROR/AndroidRuntime(1393):     at java.lang.reflect.Constructor.constructNative(Native Method)02-08 08:52:21.904: ERROR/AndroidRuntime(1393):     at java.lang.reflect.Constructor.newInstance(Constructor.java:446)02-08 08:52:21.904: ERROR/AndroidRuntime(1393):     at android.view.LayoutInflater.createView(LayoutInflater.java:500)02-08 08:52:21.904: ERROR/AndroidRuntime(1393):     ... 43 more02-08 08:52:21.904: ERROR/AndroidRuntime(1393): Caused by: android.view.InflateException: B</code></pre><p>And this is the first part of the class. It has to deal with initializing the layout.</p><pre><code>public class Digital extends RelativeLayout{    /*****  *****   *****   *****   *****   *****   *****   *****\     * BEGIN ALL CONSTANTS AND VARIALBES     \*****  *****   *****   *****   *****   *****   *****   *****/    // Class name for logging purposes    private final String TAG    =   ""Digital"";    /**     * All of the display types used for the Digital Gauge display     */    private TextView mReadDisplay, mHeadDisplay, mMeasureDisplay, mTypeDisplay;    /**     * The grouping that the gauge is in. Clear if none. Click-able to reassign     */    private Button mGrouping;       /** The current type of the gauge the we will display. */    private int mType = 0;    public Digital(Context context, AttributeSet attrs){        super(context, attrs);    }    public void init() {        Digital mDigital = (Digital)View.inflate(context, R.layout.digital, null);        mReadDisplay = (TextView)mDigital.findViewById(R.id.digi_reading);            mReadDisplay.setTypeface(Typeface.createFromAsset(context.getAssets(),                    ""font/DIGITALDREAM.ttf""));            mReadDisplay.setTextSize(18f);        mHeadDisplay = (TextView)mDigital.findViewById(R.id.digi_header);            mHeadDisplay.setTextSize(14f);        mMeasureDisplay = (TextView)mDigital.findViewById(R.id.digi_measurement);            mMeasureDisplay.setTextSize(10f);        mTypeDisplay = (TextView)mDigital.findViewById(R.id.digi_type);            mTypeDisplay.setTextSize(10f);        mGrouping = (Button)mDigital.findViewById(R.id.digi_grouping);            mGrouping.setBackgroundColor(0x00000000);    }</code></pre>","480691","","480691","","2011-02-08 17:10:08","2011-02-08 17:10:08","XML Inflater not seeing any of the views?","<android><xml><views><inflate>","3","2","1","",""
"4928033","1","","","2011-02-07 23:41:11","1","645","<p>We are planning a a project. Basically we have tons of restful services sitting on our server. These restful services will return XML as data type.</p><p>We will build apps on various mobile platforms, like Adroid/iOS/possible others. The app potentially need to call those restful services quite frequently.</p><p>Since we are in the planning stage, I am wondering whether anyone here has insights about performance regarding different mobile platforms. For example, on the mobile platforms we assume that we’ll need to return data in a very efficient manner. We can compress data differently for particular mobile platform. Or any other possible differences we need to pay attention to those mobile platforms when consuming restful service?</p>","607327","","","","","2013-04-06 21:27:34","How to improve performance for Android/iOS/etc to consume web service?","<android><performance><ios>","4","0","","",""
"4928219","1","4928360","","2011-02-08 00:10:16","0","495","<p>Hey, There's a lot of posts on here about read barcodes but I want to generate barcodes from a string of numbers and display the generated barcode to the user in my application.I've had a look at a few libraries iTextPdf and Barbecue, in particular I've been trying to work with iTextPdf</p><p>I wondered if anyone knows of or could provide a simple implementation or suggest something better....</p><p>I want to draw the barcode directly to a custom view for display in a linear layout with other controls.</p><pre><code>public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    Barcode128 code128 = new Barcode128();    code128.setCodeType(Barcode128.CODE128);    code128.setCode(""123456789"");    Image image128 = code128.createTemplateWithBarcode(barcodeview, null, null);}</code></pre><p>For starters this errors and the app wont actually run, but I don't know how to draw this on to the layout.</p><p>This gives the following error</p><pre><code>02-07 23:55:31.868: ERROR/AndroidRuntime(212): Uncaught handler: thread main exiting due to uncaught exception02-07 23:55:31.878: ERROR/AndroidRuntime(212): java.lang.VerifyError: com.itextpdf.text.pdf.Barcode12802-07 23:55:31.878: ERROR/AndroidRuntime(212):     at com.example.barcodetest.Main.onCreate(Main.java:17)02-07 23:55:31.878: ERROR/AndroidRuntime(212):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1123)02-07 23:55:31.878: ERROR/AndroidRuntime(212):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2364)02-07 23:55:31.878: ERROR/AndroidRuntime(212):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2417)02-07 23:55:31.878: ERROR/AndroidRuntime(212):     at android.app.ActivityThread.access$2100(ActivityThread.java:116)02-07 23:55:31.878: ERROR/AndroidRuntime(212):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1794)02-07 23:55:31.878: ERROR/AndroidRuntime(212):     at android.os.Handler.dispatchMessage(Handler.java:99)02-07 23:55:31.878: ERROR/AndroidRuntime(212):     at android.os.Looper.loop(Looper.java:123)02-07 23:55:31.878: ERROR/AndroidRuntime(212):     at android.app.ActivityThread.main(ActivityThread.java:4203)02-07 23:55:31.878: ERROR/AndroidRuntime(212):     at java.lang.reflect.Method.invokeNative(Native Method)02-07 23:55:31.878: ERROR/AndroidRuntime(212):     at java.lang.reflect.Method.invoke(Method.java:521)02-07 23:55:31.878: ERROR/AndroidRuntime(212):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)02-07 23:55:31.878: ERROR/AndroidRuntime(212):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)02-07 23:55:31.878: ERROR/AndroidRuntime(212):     at dalvik.system.NativeStart.main(Native Method)</code></pre><p>Thanks for your help.</p>","149615","","","","","2011-02-08 00:32:39","Generating 1D barcodes with android","<android><view>","1","0","","",""
"4928267","1","5039203","","2011-02-08 00:18:58","10","3212","<p>I'm looking for a place to report Android bugs on Samsung devices.  The place would ideally have actual representation by Samsung developers.  Japanese forums are ok.</p><p>I have tried:<br> - <a href=""http://innovator.samsungmobile.com"">http://innovator.samsungmobile.com</a> - This has a Java ME forum but the existing Android posts are unanswered.<br> - <a href=""http://developer.samsung.com"">http://developer.samsung.com</a> - Points to the same content as the 1st link.<br> - Calling Samsung 3rd level support to ask for a reference - they told me to use the 1st link but couldn't tell me which forum was appropriate to file bugs against Android devices.</p>","322939","","","","","2014-04-15 14:37:50","Where to report device-specific bugs to Samsung?","<android><bug-tracking>","2","0","0","",""
"4928291","1","","","2011-02-08 00:23:00","0","662","<p>In my activity I need a ListView on top of my TextView.  How can I achieve such a thing?</p><p>Thanks</p><hr><p>Mitchell</p>","445342","","","","","2011-02-08 10:26:51","Stacking a listview on top of a textview Android","<android><listview><activity><textview><stacking>","3","0","","",""
"4928429","1","4928460","","2011-02-08 00:42:50","1","1070","<p>If I create a Service like this:</p><pre><code>    Intent intent = new Intent(context, MyService.class);    context.startService(intent);</code></pre><p>Can you please tell me how can my code else where get the instance of that service class that I start?And if i start Service, does that class runs in its own thread?</p><p>Thank you.</p>","286802","","","","","2014-03-24 09:02:55","Can I get the instance of the service class that I created","<android>","1","0","","",""
"4928570","1","4928765","","2011-02-08 01:04:14","0","219","<p>I think I read somewhere that there's a system event for when the time changes (each second?) but are there other levels of granularity such as when the hour changes?</p><p>I have a <code>TabActivity</code> for a 7 day TV Guide - the indicator for the first (leftmost) always shows 'Today' with the others showing a three-letter day (Mon, Tue, Wed etc) obviously depending on what the day is today.</p><p>What I'd like to do is have the activity 'know' when midnight comes so it pops up a 'Re-loading please wait...' <code>ProgressDialog</code> and adjusts the indicator on each tab and the associated tab contents.</p><p>Is there a built-in system event that can help or is <code>AlarmManager</code> my best approach?</p>","488241","","","","","2011-02-08 02:08:22","Need to know when it's a new day, i.e., when the time is 00:00:00","<android>","1","0","","",""
"4928592","1","4929074","","2011-02-08 01:08:13","0","343","<p>Hi is there a way to dynamically load text that is too long into a text field of a fixed line length, and then have the remaining text flow into another textView in another view? I want to load HTML data into a view and not have the user have to scroll but jump to the next view to see the remaining text.  Thanx for any input or suggestions.</p>","742030","","","","","2011-02-08 02:38:29","Android: Text flow to another view?","<android><html><webview><textview>","1","0","","",""
"4928660","1","","","2011-02-08 01:21:54","1","940","<p>How can I retrieve metadata information such as format (jpeg, bmp, png, ..), width, height etc. from image files in Android environment?</p>","607424","","674039","","2011-12-13 01:49:00","2012-06-12 05:00:55","How to retrieve metadata from image file in Android","<android><image><metadata>","2","0","","",""
"4928677","1","5048662","","2011-02-08 01:23:30","0","1758","<p>I am trying to delete a texture when I'm done with it on android running opengl es 1.1</p><p>On Galaxy S (phone) and Droid X, everything seems to work fine. In fact it works too well, I don't seem to even need to delete the texture when I'm done with it, I never seem to run out of memory...</p><p>On another device (not allowed to name at the moment) it seems like glDeleteTextures doesn't work. After I load 6 large texture (and a number of other small ones) no new textures can be loaded, they just come out white.</p><p>On a nexus one, I have a report that it turns white and throws the following error log</p><blockquote>  <p>E/Adreno200-EGL(  632): eglLockWindowSurface: failed to map the memory for fd=37 offs=4796416  E/Adreno200-EGL(  632): eglLockWindowSurface: failed to map the memory for fd=38 offs=1662976  E/Adreno200-EGL(  632): eglLockWindowSurface: failed to map the memory for fd=37 offs=4796416  E/Adreno200-EGL(  632): eglLockWindowSurface: failed to map the memory for fd=38 offs=1662976  E/Adreno200-EGL(  632): eglLockWindowSurface: failed to map the memory for fd=37 offs=4796416  E/Adreno200-EGL(  632): eglLockWindowSurface: failed to map the memory for fd=38 offs=1662976  E/Adreno200-EGL(  632): eglLockWindowSurface: failed to map the memory for fd=37 offs=4796416  E/Adreno200-EGL(  632): eglLockWindowSurface: failed to map the memory for fd=38 offs=1662976</p></blockquote><p>I'm far from an expert on OpenGL, but:a) I can't find a complete example that both creates and deletes textures to ensure my code is correctb) the exact same methodology works perfectly on iPhone</p><p>The only thing I can think of is I am using a fair amount of threading so perhaps my unbinds are escaping the correct thread, or in some way not being timed correctly. I don't have any hardware at the moment that has the error so I can't test this theory until I get another device myself.</p><p>Do you need to do anything special before deleting a texture, or should you be able to just slip a glDeleteTextures() in wherever in your flow and it should work?</p><p>Apologies for not posting any example code, I currently have some restrictions on it.</p>","463183","","","","","2012-10-10 06:32:05","properly delete texture","<android><opengl-es>","2","2","0","",""
"4928700","1","4929141","","2011-02-08 01:28:46","2","762","<p>Writing an app which takes a picture from the camera and retrieves it as a bitmap. I then write this file to the disk and attempt to send the picture as an email, in the gmail app it says there is an attachment however when I receive the email no file is attached. Here are the two appropriate methods I am trying to get working.</p><pre><code>protected void onActivityResult(int requestCode, int resultCode, Intent data) {      if (requestCode == CAMERA_PIC_REQUEST) {      thumbnail = (Bitmap) data.getExtras().get(""data"");      ImageView image = (ImageView) findViewById(R.id.photoResultView);      image.setImageBitmap(thumbnail);    try {            pic = new File(""pic"");        FileOutputStream out = new FileOutputStream(pic);        thumbnail.compress(CompressFormat.PNG, 100, out);        out.flush();        out.close();    }    catch (java.io.FileNotFoundException e) {        // that's OK, we probably haven't created it yet    }    catch (Throwable t) {        Toast            .makeText(this, ""Exception: ""+t.toString(), Toast.LENGTH_LONG)            .show();    }       sendPictureButton.setVisibility(Button.VISIBLE);    }  }private OnClickListener sendPictureButtonListener = new OnClickListener() {    @Override    public void onClick(View arg0){        Intent i = new Intent(Intent.ACTION_SEND);        i.putExtra(Intent.EXTRA_EMAIL, new String[]{""fakeaddress@hello.edu""});        i.putExtra(Intent.EXTRA_SUBJECT,""On The Job"");        i.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(pic));        i.setType(""image/png"");        startActivity(Intent.createChooser(i,""Share you on the jobing""));    }    };</code></pre>","180825","","","","","2011-02-08 02:52:57","Attaching an image to an email","<android>","2","0","","",""
"4928772","1","4928826","","2011-02-08 01:42:35","4","2993","<p>Okay, so I have an integer variable in my application. It's the value of a color, being set by a color picker in my preferences. Now, I need to use both that color and a darker version of any color it might be.</p><p>Now I know in standard Java there is a Color.darker() method, but there doesn't seem to be an equivalent in Android. Does anyone know of an equivalent or any workarounds? Thanks.</p>","468498","","","","","2013-11-13 02:42:13","Android Color Darker","<java><android><colors><darken>","1","0","1","",""
"4928784","1","4960822","","2011-02-08 01:44:34","10","12444","<p>My goal is to duplicate the NotePad sample project such that if I tinker with the source files in order to learn through experimentation, the original sample files will <strong>not</strong> be affected. The rational behind this goal is explained very well in bullets 1-2-3 in <a href=""http://stackoverflow.com/questions/2951068/how-to-start-an-android-project-with-downloaded-sample-code/3373804#3373804"">this post</a> by @Neutrino.</p><p>Based on @Neutrino's post, I performed the following steps:</p><p>Step 1: Copy sample code to a temporary location (outside of the workspace directory):</p><pre><code> 1. Close Eclipse. 2. Copy the entire sample folder    **NotePad** from C:\android-sdk-windows\samples\android-7    to C:\Users\androideve\Documents\NotePad</code></pre><p>Step 2. Import from copy to workspace:</p><pre><code>   1. Start Eclipse   2. File &gt; New &gt; Project &gt; Android Project [Next]      &gt; Create project from existing **source**: C:\Users\androideve\Documents\NotePad   3. Delete project from Package Explorer (without deleting its files from disk!)   4. File &gt; Import...       &gt; General &gt; Existing Projects into Workspace [Next]        &gt; Browse: C:\Users\androideve\Documents\NotePad        &gt; Check ""Copy projects into workspace"" [Finish]   5. Delete entire folder C:\Users\androideve\Documents\NotePad from disk.</code></pre><p>This results in the project creation but it comes with 21 errors without any clue as to what causes them (remember, I am an Android newbie and I didn't write the NotePad program):</p><pre><code>Description Resource    Path    Location    TypeError generating final archive: java.io.FileNotFoundException: C:\sb\workspace\NotesList\bin\resources.ap_ does not exist   NotesList       Unknown Android Packaging Problemerror: Error: String types not allowed (at 'layout_height' with value 'match_parent').  note_editor.xml /NotesList/res/layout   line 17 Android AAPT Problemerror: Error: String types not allowed (at 'layout_width' with value 'match_parent').   note_editor.xml /NotesList/res/layout   line 17 Android AAPT Problemerror: Error: String types not allowed (at 'layout_width' with value 'match_parent').   noteslist_item.xml  /NotesList/res/layout   line 17 Android AAPT ProblemR cannot be resolved to a variable  NoteEditor.java /NotesList/src/com/example/android/notepad  line 148    Java ProblemR cannot be resolved to a variable  NoteEditor.java /NotesList/src/com/example/android/notepad  line 151    Java ProblemR cannot be resolved to a variable  NoteEditor.java /NotesList/src/com/example/android/notepad  line 175    Java ProblemR cannot be resolved to a variable  NoteEditor.java /NotesList/src/com/example/android/notepad  line 177    Java ProblemR cannot be resolved to a variable  NoteEditor.java /NotesList/src/com/example/android/notepad  line 194    Java ProblemR cannot be resolved to a variable  NoteEditor.java /NotesList/src/com/example/android/notepad  line 195    Java ProblemR cannot be resolved to a variable  NoteEditor.java /NotesList/src/com/example/android/notepad  line 265    Java ProblemR cannot be resolved to a variable  NoteEditor.java /NotesList/src/com/example/android/notepad  line 269    Java ProblemR cannot be resolved to a variable  NoteEditor.java /NotesList/src/com/example/android/notepad  line 276    Java ProblemR cannot be resolved to a variable  NotesList.java  /NotesList/src/com/example/android/notepad  line 83 Java ProblemR cannot be resolved to a variable  NotesList.java  /NotesList/src/com/example/android/notepad  line 94 Java ProblemR cannot be resolved to a variable  NotesList.java  /NotesList/src/com/example/android/notepad  line 177    Java ProblemR cannot be resolved to a variable  NotesLiveFolder.java    /NotesList/src/com/example/android/notepad  line 48 Java ProblemR cannot be resolved to a variable  NotesLiveFolder.java    /NotesList/src/com/example/android/notepad  line 51 Java ProblemR cannot be resolved to a variable  TitleEditor.java    /NotesList/src/com/example/android/notepad  line 71 Java ProblemR cannot be resolved to a variable  TitleEditor.java    /NotesList/src/com/example/android/notepad  line 80 Java ProblemR cannot be resolved to a variable  TitleEditor.java    /NotesList/src/com/example/android/notepad  line 83 Java Problem</code></pre><p>What did I do wrong and what do I need to make the <strong>copy</strong> of this NotePad sample build and run?</p>","418055","","1131435","","2013-04-13 00:36:53","2013-04-13 00:36:53","How to duplicate an SDK-sample project into workspace?","<android><eclipse><eclipse-plugin>","4","0","4","",""
"4928841","1","4930853","","2011-02-08 01:53:27","0","447","<p>After completion of some work in Middleware C library, Need to show few notifications to Notification bar.  Please suggest if any work around to show the notifications.This C library doesnt have GUI part of it.</p>","469119","","","","","2011-02-08 08:13:19","In Android How to show Notification From C library","<android><notifications><middleware>","2","0","0","",""
"4928896","1","","","2011-02-08 02:00:50","2","1334","<p>I like to take all 3rd party application's backup to the SD Card. I tried out to copy .apk file from /data folder but no such permission to do so.Please let me know is there any way to grant permissions or another way to take application backup.</p><p>Thanks</p>","579875","","","","","2011-02-08 02:00:50","How to take backup of installed applications (.apk) to sdcard?","<android>","0","4","3","2011-04-22 18:45:15",""
"4928971","1","4929068","","2011-02-08 02:16:18","1","1755","<p>I'm  trying to change the drop shadow of the text in a button and I can't get it working.</p><p>I want to change the color based on the state of the button.  I tried using a color selector for the shadow color but it crashed the app. It didn't seem to want to use a selector for that attribute. So, now I am trying to do it at run time using </p><pre><code>button.setShadowLayer(1, 1, 1, android.R.color.black);</code></pre><p>However, it doesn't change anything at all.</p><p>How can I get this to work?</p><p>Thanks much</p>","445348","","","","","2011-06-02 11:05:08","Does setShadowLayer() work on a Button?","<android><button><shadow>","1","0","","",""
"4929040","1","","","2011-02-08 02:31:27","3","1026","<p>I want to specify that Android should start the soft keyboard for a given EditText in the numeric/symbols mode. I know this can be done by setting the input type of the EditText to be numeric using EditText.setInputType() except that I do not want to restrict the input type for the EditText to numeric input only**. Is there another way to tell Android what keyboard it should open for a given EditText?</p><p>** I want essentially a Math class of numeric input, accepting arbitrary mathematical expressions, including [0,9.+-/*()@:].</p>","58164","","","","","2011-11-13 20:37:07","android: start in symbol keyboard mode, but don't restrict to numbers-only input","<java><android>","2","0","1","",""
"4929062","1","","","2011-02-08 02:36:27","0","502","<p>I'm trying to make an app that allows the user to set tasks and alarms or notifications for each task.  I have created a 'setAlarm' method below.  However, I have an error that whenever I set multiple tasks with alarms, somehow all the previous ones get cancelled and only the most recently set alarm will go off.  Do you know whats the problem?  My guess is that the 'calendar' instance gets reset every time I call 'setAlarm'.  How could I get around this?</p><pre><code>  public void setAlarm() {      Intent intent1 = new Intent(NewGoal.this, SingleAlarm.class);      PendingIntent sender = PendingIntent.getBroadcast(NewGoal.this,              0, intent1, 0);      Calendar calendar = Calendar.getInstance();      calendar.setTimeInMillis(System.currentTimeMillis());      if (alarm_time == 10) {          calendar.add(Calendar.SECOND, alarm_time);      } else if (alarm_time == 30 {          calendar.add(Calendar.SECOND, alarm_time)      }      AlarmManager am = (AlarmManager)getSystemService(ALARM_SERVICE);      am.set(AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis(), sender);      Log.i(TEST, ""In setAlarm method"");      Log.i(TEST, ""calendar="" + calendar.MILLISECOND);}</code></pre>","607484","","607484","","2011-02-08 07:30:02","2011-02-08 23:34:56","set multiple alarms/notifications bug/error?","<java><android><notifications><alarm>","3","4","2","",""
"4929100","1","4930213","","2011-02-08 02:43:29","1","1150","<p>I am working on a game and would like to move the status bar(navigation bar) to the top. I can imagine. The status bar getting in the way. Can be pushed accidentally during the game play easily. </p><p>Thanks.</p>","594612","","750987","","2011-05-29 06:46:51","2011-05-29 06:46:51","In Android honeycomb OS can I move the Status bar to the top?","<android><android-3.0-honeycomb>","1","2","","",""
"4929161","1","","","2011-02-08 03:00:03","0","148","<p>See <a href=""http://www.rentonlive.com"" rel=""nofollow"">http://www.rentonlive.com</a>   Click on any article title.  Hyperlinks work for every browser.  </p><p>Android is not allowing this simple hyperlink:  <a href=""http://rentonlive.com/TandL.aspx?xid=106&amp;xtitle=RED%LIGHT%CAMERAS%READER%SURVEY"" rel=""nofollow"">http://rentonlive.com/TandL.aspx?xid=106&amp;xtitle=RED%LIGHT%CAMERAS%READER%SURVEY</a></p><p>I get a web page not found error.</p><p>Is there something wrong with the construction of the link in terms of Android?</p><p>I downloaded an emulator, same problem.  The phone says it has a browser, finding the 'rules' to this 'browser' is very difficult.  And, all works fine in Google Chrome.</p><p>Any pointers or sites that provide answers to Android issues appreciated.</p>","607212","","76337","","2011-03-29 19:38:31","2011-03-29 19:38:31","Android Does Not Process my Hyperlinks ASP .NET","<.net><asp.net><android>","1","3","","",""
"4929167","1","4934295","","2011-02-08 03:02:06","1","624","<p>I'm able to retrieve the display name of contact using the id Code as follows:</p><pre><code>Uri uri = ContentUris.withAppendedId(ContactsContract.Contacts.CONTENT_URI, selectedid);Cursor cur = managedQuery(uri, null, null, null, null);startManagingCursor(cur);cur.moveToNext();String mname = cur.getString(cur.getColumnIndex(ContactsContract.Contacts.DISPLAY_NAME));</code></pre><p>Where the ""selectedid"" is my id of the contact to be retrieved.Now i have a problem in retrieving the phone number from that id.</p><p>If possible can u type me the code which i have to add to get the phone number from that id </p>","601142","","114066","","2011-02-08 15:56:20","2011-02-08 15:56:20","Retrieving the Phone number from a contact using ""ContactsContract"" by an ID?","<android><contactscontract>","2","1","1","",""
"4929299","1","5628992","","2011-02-08 03:35:28","0","570","<p>In my app, I managed to send intent to Barcode Scanner app and get result. </p><p>My problem is: After sent intent, Barcode Scanner activates and shows rectangle view finder in center and message ""Place a barcode inside the viewfinder rectangle to scan it."". At this stage, I want to show custom background image which has some pictures around remaining center rectangle area transparent for view finder. Has anyone accomplished this?</p>","588521","","","","","2011-04-12 00:14:57","can I change background image of Barcode Scanner viewfinder?","<android><barcode-scanner>","1","0","","",""
"4929438","1","4929570","","2011-02-08 04:02:12","0","3577","<p>I am trying to make an application which can connect from a mobile to a wifi controller. Planning to do a socket connection(multicast) ... The only values that i am able to get through the wifi android apis are SSID and BSSID.. Can anyone tell me if i am supposed to proceed with these values or am i supposed to connect with an IP address ? If i am supposed to connect with BSSID.. how do i go about it?</p>","448005","","","","","2011-02-08 07:57:47","Does Wifi access points have an ip address?","<android><wifi>","1","0","2","",""
"4929504","1","","","2011-02-08 04:15:21","0","79","<p>On certain pages of my Android project, fields are not moving up when the dial pad comes up. Why? How can I get them to move?</p>","515643","","122607","","2011-12-28 19:46:49","2011-12-28 19:46:49","Fields are not moving up when dial pad comes up","<android>","1","1","","",""
"4929545","1","","","2011-02-08 04:29:12","2","540","<p>I'm trying to write a function to dynamically create midi files on Android. Since there is no javax.sound.midi library I'm just writing the bytes out to file myself. I've found some great guides (see below) so I've been able to create multiple track midis. However I haven't been able to figure out how to switch instruments for any of the tracks so everythign is just using the default instrument. I think from the documents I read the code I need is to ""program change"" followed by the program number.</p><p>What I've tried so far is writing the following out to a byteoutputstream array:</p><pre><code>track.write((byte) 192); // 128 + 64track.write((byte) x); // x is the instrument number between 1-128.</code></pre><p>I've put this before the start of the note on/ note off track information, but it doesn't seem to do anything except make the midi take a long time to start. Am I on the right track here, or am I missing something? Any help is appreciated.  </p><p><a href=""http://faydoc.tripod.com/formats/mid.htm"" rel=""nofollow"">http://faydoc.tripod.com/formats/mid.htm</a>https://ccrma.stanford.edu/~craig/articles/linuxmidi/misc/essenmidi.html</p>","522710","","","","","2011-02-08 22:12:16","Changing instruments in midi encoding?","<java><android><midi>","1","0","1","",""
"4929574","1","4929595","","2011-02-08 04:34:10","7","14252","<p>I am currently using Eclipse to develop my Android applications. Are there any other development environments or tools are available for Android?</p>","536148","","122607","","2011-02-08 18:25:30","2013-06-02 18:56:03","What are alternatives to Eclipse, for developing Android applications?","<android><ide>","7","4","1","2013-08-03 16:28:49",""
"4929603","1","4930279","","2011-02-08 04:39:10","0","651","<p>My goal is make same thing as power button do.<br>I try PARTIAL_WAKE_LOCK and this is my code..</p><pre><code>PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE);PowerManager.WakeLock wl = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, TAG);wl.acquire();</code></pre><p>after that I open WAKE_LOCK permission in AndroidManifest.xml</p><pre><code>&lt;uses-permission android:name=""android.permission.WAKE_LOCK"" /&gt;</code></pre><p>But when I launch my application not thing happen.<br>Do I miss something ?  </p><p>Thanks</p>","466693","","","","","2011-06-11 07:31:16","What should I do as power button do (turn off screen, lock keyboard)?","<android>","1","0","1","",""
"4929675","1","","","2011-02-08 04:49:48","1","968","<p>I've doubled checked that I'm targeting Android 1.6 , but layout-large-mdpi-land, layout-large-land, and layout-mdpi-land all show an 'invalid resource directory name:' error.</p><p>The weird thing is that layout-large-mdpi works just fine, and so does layout-land, but whenever I combine the land tag with another tag, suddenly eclipse yells at me. Any ideas would be helpful.</p>","607582","","","","","2012-10-17 16:22:11","layout-large-mdpi-land not working on Android 1.6?","<android><android-layout>","1","0","","",""
"4929709","1","","","2011-02-08 04:54:13","0","302","<p>can you give me the code of design first screen eg. how to ser nevigation bar,tab bar,table view in android.</p>","552027","","","","","2011-02-08 06:23:48","how can i design mockflow of an android project","<android>","1","1","1","2013-12-09 02:08:30",""
"4929830","1","4929866","","2011-02-08 05:15:16","1","1399","<p>I am having a lot of trouble getting an EditText within a ListView row to behave correctly. Does anyone know of any tutorials that walk you through the process?</p><p>Thanks!</p>","467569","","","","","2012-12-07 14:15:42","Android EditText inside a ListView","<android><listview><edittext>","2","0","","",""
"4929883","1","4930008","","2011-02-08 05:23:50","3","4420","<p>I have 15Mb database files and i want to use in my application.i stored that file in assets folder.because of that large size file of 15Mb i cant copy that file to sdcard.i have tried all the things..Is there any limitation to read file using input stream.my code is work well for up to 1Mb size data file but it not support for larger than 3to4 Mb.i making my file zip and then store into assets folder.</p><p>Here`s my code: </p><pre><code>private Thread thread = new Thread()    {        @Override        public void run()        {            // Create a directory in the SDCard to store the files            File file = new File(ROOT_FOLDER);            if (!file.exists())            {                file.mkdirs();            }            else            {                file.delete();            }            try            {                // Open the ZipInputStream               ZipInputStream in = new ZipInputStream(getAssets().open(""lds_scriptures.zip""));                // Loop through all the files and folders                for (ZipEntry entry = in.getNextEntry(); entry != null; entry = in                        .getNextEntry())                {                    sendMessage(""Extracting: "" + entry.getName() + ""..."");                    String innerFileName = ROOT_FOLDER + File.separator + entry.getName();                    File innerFile = new File(innerFileName);                    if (innerFile.exists())                    {                        innerFile.delete();                    }                    int size=in.available();                    //Toast.makeText(SdCardData.this, String.valueOf(size),2000).show();                    Log.e(""value"",String.valueOf(size));                    // Check if it is a folder                    if (entry.isDirectory())                    {                        // Its a folder, create that folder                        innerFile.mkdirs();                    }                    else                    {                        // Create a file output stream                        FileOutputStream outputStream = new FileOutputStream(innerFileName);                        final int BUFFER = 2048;                        // Buffer the ouput to the file                        BufferedOutputStream bufferedOutputStream = new BufferedOutputStream(outputStream,                                BUFFER);                        // Write the contents                        int count = 0;                        byte[] data = new byte[BUFFER];                        while ((count = in.read(data, 0, BUFFER)) != -1)                        {                            bufferedOutputStream.write(data, 0, count);                        }                        // Flush and close the buffers                        bufferedOutputStream.flush();                        bufferedOutputStream.close();                    }                 //   sendMessage(""DONE"");                    // Close the current entry                    in.closeEntry();                }                in.close();               // sendMessage(""-----------------------------------------------"");             //   sendMessage(""Unzipping complete"");            }            catch (IOException e)            {                sendMessage(""Exception occured: "" + e.getMessage());                e.printStackTrace();            }        }    };    private Handler handler = new Handler()    {       // @Override        public void handleMessage(Message msg)        {           // tv.append(""\n"" + msg.getData().getString(""data""));           // super.handleMessage(msg);        }    };    private void sendMessage(String text)    {        Message message = new Message();        Bundle data = new Bundle();        data.putString(""data"", text);        message.setData(data);        handler.sendMessage(message);    }</code></pre>","554830","","1482632","","2012-11-02 12:58:43","2012-11-02 12:58:43","how to copy 15Mb files from assets folder to sdcard...?","<android>","2","0","3","",""
"4929902","1","","","2011-02-08 05:27:43","0","6088","<p>How I can programmatically find the list of applications that starts on device startup.Is there any way to programmatically reset applications property to prevent run on startup .?</p><p>Thanks</p>","579875","","579875","","2011-02-08 07:05:17","2011-07-20 19:39:06","android - how to stop startup applications","<android>","3","0","0","",""
"4929970","1","","","2011-02-08 05:39:34","0","179","<p>I have some flash games with motion tweens and interactivity features. Is anyone aware if such a kind of flash animation would work correctly on a  Android 2.2 device.Most of the articles I have seen is more about videos rather than considering Flash as an interactive animation platform</p>","399255","","","","","2011-06-01 09:21:11","Playing Flash ( having tweens and event handlers ) on Android","<android><flash>","3","0","","",""
"4929989","1","4930158","","2011-02-08 05:43:58","1","10215","<p>I am making an application in which i am getting an Mjpg Images from Live IP Camera in Android.</p><p>The problem is that since when i get the Image in the form of <code>ByteArray</code>. How can I display the <code>Image</code>?</p><p>I'm using the following code to display the image:</p><pre><code>ImageView imageView = (ImageView) findViewById(R.id.imageView1);Bitmap bmp = BitmapFactory.decodeByteArray(buffer, start, a);imageView.setImageBitmap(bmp);</code></pre><p>but i m getiing an exception</p><pre><code>android.view.ViewRoot CallFromWrongThreadException</code></pre><p>Please explain how to display the bytearray on android layout.</p>","521015","","11683","","2011-06-08 23:29:37","2011-06-08 23:29:37","How to display Bitmap Image in Android","<android><image><decoding>","4","0","","",""
"4930077","1","4930191","","2011-02-08 05:59:53","0","594","<p>How to set focus to the first element from the last element in GridView in android?</p>","606335","","","","","2011-02-08 06:24:25","focusSearch(int direction)-value of direction?","<android>","1","0","","",""
"4930086","1","4930115","","2011-02-08 06:03:04","2","1595","<p>I implement a TabActivity exactly like this - </p><pre><code>http://blog.henriklarsentoft.com/2010/07/android-tabactivity-nested-activities/</code></pre><p>Now the problem is, I have some Spinner in an activity. When i click to expand the Spinner - the following exception occur - </p><pre><code>android.view.WindowManager$BadTokenException: Unable to add window -- token android.app.LocalActivityManager$LocalActivityRecord@43b957c0 is not valid; is your activity running?</code></pre><p>Anybody have solution?</p>","595543","","","","","2013-07-10 11:11:45","Need Help on TabActivity","<android><tabactivity><activitygroup>","3","0","3","",""
"4930114","1","4930124","","2011-02-08 06:08:47","32","8690","<p>I'm currently working my way through the book ""Teach Yourself Android Application Development in 24 Hours"" published by Sams.  I'm relatively new to Java, Android or otherwise.  I have a very solid background in ActionScript 3, which has enough similarities with Java that the language itself isn't hard to grasp, but I do still have some questions about the rationale behind some of the code samples in the book.  For example, here's a function that comes with the sample code for Hour 9:</p><pre><code>private void processScores(final TableLayout scoreTable,       XmlResourceParser scores) throws IOException, XmlPullParserException{</code></pre><p>In this function signature, the authors have declared the scoreTable argument as final.  I'm a little puzzled as to why they did this.  It wouldn't cross my mind to even attempt to assign a new value to the function argument scoreTable (it's considered a bad practice in ActionScript).  Further, I haven't actually seen anyone do this in any of the real-world Java I've examined or ported into AS3.  </p><p>Is there something specific about Android development that makes it a necessity to sometimes declare certain function arguments as final? </p><p>Why is the TableLayout object declared final, but not the XmlResourceParser?</p>","605918","","501557","","2012-02-13 07:01:31","2012-02-13 07:01:31","Why declare a function argument to be final?","<java><android><final>","1","0","6","",""
"4930228","1","4930319","","2011-02-08 06:30:52","17","15170","<p>I have to open a URL on Click of <code>OK</code> Button in a view. Can someone tell how to do this?</p>","475349","","2176945","","2014-03-24 16:41:40","2014-03-24 16:41:40","open a url on click of ok button in android","<android><button><click>","1","6","6","",""
"4930247","1","","","2011-02-08 06:33:34","1","465","<p>here i call the customdialog through my parent activity.. where as the dialog is in another activity contains listview...from that dialog i transfer a selected content from listview.. but fail to achieve my target.. and tried so many way.. can any one assist me to achieve it. Note: i got error in on listitemclick listener...</p><p>customdialog.class</p><pre><code>public class CustomizeDialog extends Dialog {org.me.dailogfrmchildact.MainActivity ma;    Button cancelButton;    ListView list;    int item_pos;    public CustomizeDialog(Context context) {        super(context);         Context cs = context;        /** 'Window.FEATURE_NO_TITLE' - Used to hide the title */        requestWindowFeature(Window.FEATURE_NO_TITLE);        setContentView(R.layout.dialog);        ma=new MainActivity();        list = (ListView) findViewById(R.id.list);        cancelButton = (Button) findViewById(R.id.OkButton);        ListviewContent.add(""item1"");        ListviewCount.add(""20"");        ListviewContent.add(""item2"");        ListviewCount.add(""30"");        list.setAdapter(new ListViewAdapter(cs));        list.setOnItemClickListener(new AdapterView.OnItemClickListener() {                public void onItemClick(AdapterView&lt;?&gt; arg0, View arg1, int pos, long arg3) {                item_pos = pos;                System.out.println(""===========item_pos"" + pos);                ma.txt.setText(ListviewContent.get(pos).toString());                    dismiss();                                }        });        cancelButton.setOnClickListener(new View.OnClickListener() {            public void onClick(View arg0) {                dismiss();            }        });    }        private static ArrayList&lt;String&gt; ListviewContent = new ArrayList&lt;String&gt;();    private static ArrayList&lt;String&gt; ListviewCount = new ArrayList&lt;String&gt;();    private static class ListViewAdapter extends BaseAdapter {        private LayoutInflater mInflater;        public ListViewAdapter(Context context) {            mInflater = LayoutInflater.from(context);        }        public int getCount() {            return ListviewContent.size();        }        public Object getItem(int position) {            return position;        }        public String getCount(int position) {            return ListviewCount.get(position);        }        public String[] getSizeType(int position) {            String[] str = new String[2];            str[0] = ListviewContent.get(position);            str[1] = ListviewCount.get(position);            return str;        }        public long getItemId(int position) {            return position;        }        public View getView(int position, View convertView, ViewGroup parent) {            ListContent holder;                if (convertView == null) {                convertView = mInflater.inflate(R.layout.listviewinflate, null);                holder = new ListContent();                holder.text = (TextView) convertView.findViewById(R.id.TextView01);                holder.text.setCompoundDrawables(null, null, null, null);                holder.count = (TextView) convertView.findViewById(R.id.TextView02);                holder.count.setCompoundDrawables(null, null, null, null);                convertView.setTag(holder);            } else {                    holder = (ListContent) convertView.getTag();            }                holder.text.setText(ListviewContent.get(position));            holder.count.setText(ListviewCount.get(position));            return convertView;        }            static class ListContent {            TextView text;            TextView count;        }    }}</code></pre><p>mainactivity.class:</p><pre><code>public class MainActivity extends Activity {    org.me.dailogfrmchildact.CustomizeDialog cd;    Button btn;    EditText txt;    CustomizeDialog customizeDialog;    boolean click = false;        @Override    public void onCreate(Bundle icicle) {        super.onCreate(icicle);        setContentView(R.layout.main);        cd = new CustomizeDialog(this);        btn = (Button) findViewById(R.id.btn1);        txt = (EditText) findViewById(R.id.txt1);        /** Display Custom Dialog */        btn.setOnClickListener(new OnClickListener() {            public void onClick(View arg0) {                customizeDialog = new CustomizeDialog(MainActivity.this);                customizeDialog.show();            }        });    }}</code></pre>","569553","","41956","","2011-02-08 08:06:00","2011-02-10 05:02:51","Transfer data from customdialog class to parent class","<java><android>","1","2","0","",""
"4930398","1","4930521","","2011-02-08 06:58:08","83","21101","<p>Right now, i stores every xml layout file inside the layout folder, so it is feasible and simple to manage small projects, but when there is a case of large and heavy projects, then there should be a hierarchy and sub-folders needed inside the layout folder.</p><p>for e.g. </p><pre><code>layout-- layout_personal   -- personal_detail.xml   -- personal_other.xml--layout_address  -- address1.xml  -- address2.xml</code></pre><p>Like the same way, we would like to have sub-folders for the large application, so is there any way to do so inside the android project?</p><p>I am able to create layout-personal and layout_address sub-folders inside the layout folder, but when the time comes to access the xml layout file using R.layout.<strong><em>_</em></strong> , at that time there is no any xml layout pop-up inside the menu.</p>","379693","","293280","","2014-03-19 18:22:35","2014-03-19 18:22:35","Can the Android Layout folder contain subfolders?","<android><android-layout>","6","1","12","",""
"4930406","1","4932157","","2011-02-08 06:59:19","2","337","<p>I have a edit text. i want to enter the decimal values in it. </p><p>that is when i have enter a first number. it should be like this: <code>.01</code></p><p>then i have enter a second number. it should be like this: <code>.12</code></p><p>then for third one. it should be like this: <code>1.23</code></p><p>it will go like this.... how to implement this scenario in the <strong>Android Platform</strong>. Any Idea?</p><p>Edit:</p><p>I have tried this.But i got the StackOverFlowError when i am appending the string into the EditText. i have posted my code below:</p><pre><code>amount.addTextChangedListener(new TextWatcher() {            public void afterTextChanged(Editable s) {                try {                    if (s.length() == 1) {                        Float f = Float.parseFloat(s.toString()) / 100;                        System.out.println(String.valueOf(f));                        amount.setText("""");                        amount.append(String.valueOf(f));//getting stackoverflow error here                    } else if (s.length() &gt; 1) {                        String str = s.toString().replace(""."", """");                        Float f = Float.parseFloat(str) / 100;                        System.out.println(String.valueOf(f));                        amount.setText("""");                        amount.append(String.valueOf(f));                    }                } catch (Exception e) {                }            }            public void beforeTextChanged(CharSequence s, int start, int count,                    int after) {            }            public void onTextChanged(CharSequence s, int start, int before,                    int count) {            }        });  </code></pre>","267269","","45664","","2011-02-08 10:27:02","2011-02-08 12:26:33","DecimalFormat Problem throws a StackOverFlowError?","<java><android>","1","6","","",""
"4930416","1","","","2011-02-08 07:00:13","1","991","<p>How can I get the coordinates of the cursor in the EditText ? I am not trying to get the cursor position here but the EditText coordinates of the cursor.</p><p>In my case, when I send a number via KeyEvent to the EditText, the cursor position (getSelectionStart) is changed, but its location is always at the right of the EditText.</p><p>I want to know the coordinates of the cursor (the right of the EditText).</p>","607684","","67097","","2012-05-25 15:37:54","2012-05-25 15:37:54","Android EditText's cursor coordinates (absolute position)","<android><coordinates><edittext><cursor-position>","0","4","","",""
"4930423","1","","","2011-02-08 07:01:32","8","2238","<p>So, I would like to be able to recognize advanced Gestures using the GestureOverlayView and OnGestureListener as well as be able to detect double-taps and long presses using GestureDetector.  I have both features working fine separately in two different projects.  However, I am trying to combine them and am running into some problems.  It seems that when I attempt a double-tap / long press, it is not being recognized because the GestureOverlayView is covering the whole screen and will only recognize the advanced gestures defined in the Gesture Builder.  Does anyone know how to set-up the GestureOverlayView so that it will allow GestureDetector to do it's job?  My code:</p><pre><code>public class HelloAndroid extends Activity implements OnGesturePerformedListener, OnDoubleTapListener, OnGestureListener {/** Called when the activity is first created. */private GestureLibrary mLibrary;private GestureDetector detector;@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    mLibrary = GestureLibraries.fromRawResource(this, R.raw.gestures);    if (!mLibrary.load()) {        finish();    }    GestureOverlayView gestures = (GestureOverlayView) findViewById(R.id.gestures);    gestures.addOnGesturePerformedListener(this);    detector = new GestureDetector(this, this);\</code></pre><p>And the xml...</p><pre><code> &lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;android.gesture.GestureOverlayView xmlns:android=""http://schemas.android.com/apk/res/android""        android:id=""@+id/gestures""        android:layout_width=""fill_parent""         android:visibility=""invisible""        android:layout_height=""fill_parent""&gt;    &lt;LinearLayout        android:orientation=""vertical""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""        &gt;    &lt;TextView          android:id=""@+id/text1""        android:layout_width=""fill_parent""         android:layout_height=""wrap_content""         android:text=""@string/hello""        /&gt;      &lt;/LinearLayout&gt;    &lt;/android.gesture.GestureOverlayView&gt;</code></pre><p>Thanks in advance!</p>","607723","","","","","2012-02-28 13:11:54","GestureOverlayView and Double-Tap","<android>","2","0","1","",""
"4930424","1","","","2011-02-08 07:01:42","5","10256","<p>I tried googling in google but unable to find the answer</p><p>Will anyone please let me know, how can i retrieve the current phone number from the android code. I think phone number will be stored in the sim card.</p><p>Thanks &amp; Regards,SSuman185</p>","607625","","","","","2013-12-03 14:01:19","How to get the phone number of the phone in android code?","<android>","2","1","5","",""
"4930466","1","4930489","","2011-02-08 07:09:12","0","370","<p>I have a text in an view in android.I want that my url should be hyperlighted and It should have different color other that background color..Can anyone tell,Whats the procedure?Thanks in advance</p><p>RegardsTushar</p>","475349","","","","","2011-02-08 07:13:02","hyperlink a url in android","<android>","2","1","1","",""
"4930623","1","4941816","","2011-02-08 07:32:08","0","2925","<p>I'm using WebView to load and render a variety of websites with no problem.  Oddly, the one that seems to cause errors is www.google.com</p><p>When loading this page, the Search button does not work when clicked.  When it is clicked, I see this error in LogCat (I also see 3 similar errors reported during the page load):</p><blockquote>  <p>02-07 23:23:59.230: ERROR/Web Console(3721): Uncaught TypeError: Cannot call method 'getItem' of null at <a href=""http://www.google.com/:342"" rel=""nofollow"">http://www.google.com/:342</a></p></blockquote><p>I am enabling JavaScript (among other things) in my onResume override:</p><pre><code>    WebSettings settings = webView.getSettings();    settings.setJavaScriptEnabled(true);    settings.setBuiltInZoomControls(true);    settings.setLoadWithOverviewMode(true);    settings.setUseWideViewPort(true);    settings.setDatabaseEnabled(true);</code></pre><p>Any idea what could be causing these errors?  Thanks!</p>","569091","","","","","2011-02-10 07:06:11","WebView causing Uncaught TypeError when loading www.google.com","<android><webview><android-webview>","3","0","","",""
"4930640","1","","","2011-02-08 07:36:26","1","341","<p>helllo,</p><p>I want to download whole android plateform code. I am able to use GIT in my windows pc but i am not getting any idea how to install Repo. if some one can help me with it then it would be really helpful to me.</p>","512973","","","","","2012-04-02 18:37:41","repo installation problem on windows","<android>","1","1","","",""
"4930680","1","","","2011-02-08 07:41:21","1","460","<p>We are looking for a rules engine(similar to CLIPS,JESS) which works on android. It should not require us to do any source code modification.</p>","587081","","","","","2011-07-17 01:54:54","Is there any rules engine(cheap or free) known to work in android","<android><android-ndk>","3","0","","",""
"4930715","1","","","2011-02-08 07:48:28","1","199","<p>I would like to run standard sqlite tests(TCL_Tests, which comes along with source code from official site). How can i build them and run on Android phone, i found no instructions about it.</p>","312512","","312512","","2011-02-08 08:03:48","2011-02-08 08:12:47","Running sqlite tests on Android","<android><sqlite><testing>","1","1","","",""
"4930775","1","","","2011-02-08 07:59:01","2","1878","<p>I would like to use my netbook for Android development, but when I try to run the SDK with Eclipse, nothing loads. Are netbooks generally powerful enough for Android development? Why or why not?</p>","607763","","546999","","2011-02-08 18:33:46","2011-02-08 20:19:17","Is Android development possible on netbooks?","<android><android-emulator>","4","3","","2012-02-03 17:24:18",""
"4930791","1","4930964","","2011-02-08 08:02:44","0","3033","<p>I have a menu item and icons for it in 36x36,48x48 and 72x72 pixel ratio sizes. Now, how do I make each icon render in specific cases. Is it possible to define that in xml file?</p>","607767","","","","","2012-08-09 11:14:07","Android menu icons","<android><menu><icons><size><screen>","2","1","","",""
"4930836","1","4931054","","2011-02-08 08:11:20","2","9208","<p>Anyone who have solved the problem to have an arbitrary number of columns inside a list view in jQuery Mobile?</p><p>What I want to achieve is basically a table representation, but with the styled list view features.</p><p>I know that the jQuery Mobile list view supports ""a couple of columns"" but i need to be able to use several (maybe four or five).</p><p>Or do you have any suggestions on pure CSS-framworks to get the right iPhone ""look and feel""? I've tried iWebKit, but since I would like to get rid of the navigation bar (and couldn't find any solution to this), I chose not to use it.</p><p>Thanks!</p>","595724","","","","","2011-04-06 10:48:37","jQuery Mobile with multiple columns inside listview","<iphone><android><table><jquery-mobile>","2","0","1","",""
"4930896","1","7389702","","2011-02-08 08:20:06","7","4181","<p>i want to develop an application which contain malyalam text for  that i want to add malayalam font.. is this compatible on all android devices.can any one please help me to solve this</p><p>Thanks in advance</p>","244540","","237838","","2014-01-11 17:14:29","2014-01-11 17:14:29","malayalam font in android?","<android>","4","4","6","",""
"4930922","1","","","2011-02-08 08:25:33","4","3735","<p>Does anyone know where I can find the list of system call that can be used in Android Mobile phones? I guess that looking to the kernel should work, but I cannot find any *.h or *.c with the declaration of them.</p><p>Best regards</p>","596571","","","","","2011-02-08 18:20:21","Android Linux system call List","<android><system><kernel>","2","0","","",""
"4930944","1","4931032","","2011-02-08 08:29:17","1","2563","<p>How can I compare two resources in android?</p><pre><code> if(newButton.getBackground()!=getResources().getDrawable(R.drawable.addbutton)){        newButton.setBackgroundResource(R.drawable.deletebutton);        }        else{            newButton.setBackgroundResource(R.drawable.addbutton);        }</code></pre><p>I want to change the button background in each click..</p>","573700","","573700","","2011-02-08 09:00:30","2012-11-02 12:33:12","how to compare resources in android","<android><resources>","2","1","","",""
"4930971","1","4931108","","2011-02-08 08:33:31","6","1325","<p>I am having a design issue sending progress bar value from class called from a Thread in Activity class to update the GUI, as the following </p><p><em><strong>[The code snippet don't compile it's for explaining only]:</em></strong></p><pre><code>Class A : Extend Activity {  new Thread(new Runnable()     {       public void run()        {            B objB = new B();            objB.DownloadFile();        }    }).start();}Class B {    public void DownloadFile()    {       ... some work [preparing SOAP request]       while(response.read())       {         //send calculated progress to Class A to update the progress value       }    }}</code></pre><p>Any help or guide would be greatly appreciated</p>","488434","","488434","","2013-02-17 08:31:19","2013-02-17 08:31:19","How to pass progress value from thread to activity?","<java><android><multithreading><progressdialog><handlers>","3","0","1","",""
"4931057","1","4931085","","2011-02-08 08:44:38","12","15267","<p>everyone. I have read on the android site the description of the excute() of AsyncTask:</p><p><code>public final AsyncTask&lt;Params, Progress, Result&gt; execute (Params... params)</code></p><p>But within my project, I have read the code like this:</p><pre><code>private static final int JSON = 0;private static final int NAME = 1;@Overrideprotected String doInBackground(String... strData) {           FileOutputTask task = new FileOutputTask(context);       task.execute(strData[JSON], strData[NAME]);}</code></pre><p>Somebody can tell me why there are <strong>2 input parameters</strong> for the <strong>execute()</strong> method? </p><p>Since according the specification, there should be only one input parameter.</p><p>Thanks in advance!</p>","453676","","","","","2011-05-08 23:54:39","Multiple input parameters for the method execute() of AsyncTask","<android><android-asynctask><execute>","2","0","4","",""
"4931071","1","14479314","","2011-02-08 08:46:44","20","42641","<p>Is there really no XML attribute counterpart to <code>setAlpha(int)</code>?</p><p>If not, what alternatives are there?</p>","283311","","","","","2014-03-25 11:50:26","Android and setting alpha for (image) view alpha","<android><xml><alpha>","8","0","","",""
"4931094","1","","","2011-02-08 08:48:59","0","3359","<p>Hi im wondering how to execute a simple helloworld c or c++ program on a Android phone i googled it but i dont find any crystal clear working methods guys direct me in this....</p>","596317","","","","","2012-08-31 06:28:05","How to run a c or c++ program on a Android Device like Samsung galaxy tab?","<c++><android><c><native>","2","0","1","",""
"4931102","1","4950754","","2011-02-08 08:50:17","2","1786","<p>I've got the feeling that javascript itself is pretty fast in an andorid webview, but there is a long delay between touching an element and the onclick event beeing fired.</p><p>I could imagine that this is a feature if you navigate between pages - you first see the highlight on the element, and then you see the effect (navigation). But for applications, this is too slow.</p><p>Is there a way to change this behavior?</p><p>Or is there maybe another event I should go for, like an onHover or onTouch? Something which fires way before the onClick?</p>","204769","","539542","","2012-01-15 06:26:08","2012-01-15 06:26:08","onClick event in android webview too slow","<android><webview><android-webview>","1","0","","",""
"4931186","1","","","2011-02-08 09:02:21","2","2328","<p>I have a spinner with a background image. But when I add array adapter to the spinner, the text is shown on the background image. I want to hide this text. There is also a TextView. My requirement is, when I click the image, the spinner should pop up and when I selects an item, the TextView gets updated with the selected item.</p>","536091","","536091","","2011-02-08 15:34:46","2013-03-25 07:32:08","Hide text of Android spinner","<android>","3","2","1","",""
"4931217","1","","","2011-02-08 09:06:29","2","1055","<p>I'm using in my application an external jar-library, which is working with bitmaps. This causes an out of memory exception in my application. This kind of problem is described in following issue:<a href=""http://code.google.com/p/android/issues/detail?id=8488"" rel=""nofollow"">http://code.google.com/p/android/issues/detail?id=8488</a></p><p>Once OOME occurs, an activity crashes, application is still going runing, memory will be free, but the wifi-connection will be lost.</p><p>Is there the way to get memory free before activity crashes? Probably, I should say, I have no access to bitmaps, which are using by the library. I also tried to call System.gc() in onPause and onDestroy, but that doesn't help.</p><p>Why would be memory free when activity crashes?</p><p>What did happen with wi-fi-connection?</p><p>Thank you</p><p><strong>upd</strong></p><p>this library is <a href=""http://code.google.com/p/osmdroid/"" rel=""nofollow"">osmdroid</a></p>","408780","","408780","","2011-02-08 12:35:34","2011-02-08 12:35:34","OutOfMemory Exception on Android","<android><memory><memory-management><memory-leaks><out-of-memory>","1","2","","",""
"4931227","1","","","2011-02-08 09:08:41","0","1355","<p>HI all</p><p>i want to implement a getSimstate() listener in my service class. I m not able to do that.</p><p>I know it can be done with the help of sim listeners in Telephony class. but i didnt get any code to implement it. </p><p>If anybody is having code to listen sim wither is ready or not...pls provide me...</p>","383597","","","","","2012-09-18 21:32:44","android sim card listeners","<android>","1","2","0","",""
"4931245","1","4931341","","2011-02-08 09:10:53","8","3824","<p>I coded  program about dictionary sentence and I want to have function to go to ""google translator"" application in my app </p><p>How can I use it , Should I import anything?</p>","605358","","130929","","2011-02-08 11:37:24","2013-10-19 17:50:49","How to use google translator app","<android><google-translate>","5","0","7","",""
"4931307","1","","","2011-02-08 09:19:52","0","204","<p>Is there any free software for Android that can send my mobile phone's geolocation information to a Google map or to my own URL?</p>","607850","","122607","","2011-02-08 17:43:48","2011-08-22 20:20:25","Is there any free software for Android that can send my geolocation to a web service?","<android>","2","0","","",""
"4931351","1","4933298","","2011-02-08 09:26:16","0","671","<p>I'm looking for a way to verify if the phone is docked (car dock, desk dock) on Android 1.6 (API 4).I know that there is a broadcast receiver android.intent.action.DOCK_EVENT, but only for API 5.</p>","467780","","","","","2011-02-08 12:59:00","How to verify if the phone is docked?","<android><dock><receiver>","1","0","","",""
"4931431","1","4931651","","2011-02-08 09:37:29","0","942","<p>I have integrated the Facebook SDK in my app using the official facebook connect API. I am able to login to the facebook app via my app and the whole single sign on thing works fine.</p><p>The problem is coming when I logout of the installed facebook app, the session still persists in my app and I can still post messages. Logging out of the facebook app does not affect my app. If I go into the manage applications and clear cache of my application then the session is also removed from my app. Can anybody help me figure out how logging out of the facebook app should clean the session from my app as well??</p>","237403","","","","","2011-02-08 10:02:55","facebook session presists in my app even after logging out of the facebook app","<android><facebook>","1","0","1","",""
"4931446","1","5002780","","2011-02-08 09:39:04","1","764","<p><br>I am trying to separate an application into an app project and a library project (besides moving it from Netbeans to Eclipse). The app will contain resources that are used by the library - for this, I had read on Stackoverflow that we can bundle the resources in the library project and then override them in the app project.</p><p>But when I did this, I am getting the error:<br>    ...\res\values\attrs.xml:5: error: Attribute ""pageBackground"" has already been defined  </p><p>Am I doing something wrong here? Any of my assumptions is faulty?</p><p>Thanks,Rajath</p>","313042","","","","","2011-02-15 10:57:45","Android Redefinition of Resources","<android><resources>","1","2","","",""
"4931494","1","4931591","","2011-02-08 09:44:17","0","1309","<p>I want to use default keyboard for, but want also that it occurs with numeric input type.</p><p>Does anybody know how to do that?</p><p>Maybe there is a way to press '?123'-key programmatically?</p><p>I've took a look to <a href=""http://developer.android.com/reference/android/widget/TextView.html#attr_android%3ainputType"" rel=""nofollow"">list of inputTypes</a>, but none of them seems to be the proper one for my need.</p><p>Thank you</p>","408780","","","","","2011-02-08 09:55:49","InputType of EditText in Android","<android><keyboard><edittext>","3","0","0","",""
"4931506","1","","","2011-02-08 09:45:18","0","669","<p>This is My Database Class .In this I want to insert the data in to the database in the run time .Another class i have edittext while clicking the button the edittext value is inserted in to the database but it is not inserted,how it can be done in this class.</p><pre><code>public class DatabaseHelper extends SQLiteOpenHelper {        public static final String DATABASE_NAME = ""employee_directory1"";        public DatabaseHelper(Context context) {                super(context, DATABASE_NAME, null, 1);        }        @Override        public void onCreate(SQLiteDatabase db) {                /*public void onCreate(SQLiteDatabase db) {                /*                 * Create the employee table and populate it with sample data.                 * In step 6, we will move these hardcoded statements to an XML document.                 */                String sql = ""CREATE TABLE IF NOT EXISTS employee ("" +                                                ""_id INTEGER PRIMARY KEY AUTOINCREMENT, "" +                                                 ""firstName TEXT, "" +                                                ""lastName TEXT, "" +                                                ""title TEXT, "" +                                                ""officePhone TEXT, "" +                                                ""cellPhone TEXT, "" +                                                ""email TEXT, "" +                                                ""managerId INTEGER)"";                db.execSQL(sql);                ContentValues values = new ContentValues();                values.put(""firstName"", ""John"");                values.put(""lastName"", ""Smith"");                values.put(""title"", ""CEO"");                values.put(""officePhone"", ""617-219-2001"");                values.put(""cellPhone"", ""617-456-7890"");                values.put(""email"", ""jsmith@email.com"");                db.insert(""employee"", null, values);        }        @Override        public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {                db.execSQL(""DROP TABLE IF EXISTS employees"");                onCreate(db);        }}</code></pre>","555910","","546999","","2011-02-08 09:46:53","2013-09-12 12:14:59","insert edittext in databasehelper class","<android><sqlite><select><delete><insert>","1","3","","",""
"4931536","1","","","2011-02-08 09:48:36","1","969","<p>I wrote an BaseAdapter which implement the SectionIndexer interface and all work fine, I can switch my index section using the setFastScrollingEnabled(true) of my ListView, the only issues is that the box of my letter index, which normally (in the Contacts app for example) are displayed in the bottom center of the screen, are displayed at the left top corner and drew with the color white: can I customize the position of the letter box?</p><p>Thanks in advance.</p><p>pedr0</p>","554892","","","","","2011-03-28 22:00:41","BaseAdapter and SectionIndexer on ListView","<android><listview><adapter>","1","0","","",""
"4931615","1","","","2011-02-08 09:58:03","0","332","<p>Hi all iam new to android can anybody help me. i have a total of 30 buttons if i click each button i should get a edit dialog with OK button where i will type some name and click OK button then that name should go and sit on that clicked button can anybody suggest how to go about it. Thanks in advance</p>","571423","","","","","2011-02-08 10:14:46","using buttons and textedit","<android>","1","0","","",""
"4931666","1","4933162","","2011-02-08 10:04:49","0","817","<p>I have a service in which I am starting an alert whenever SMS/Email is received, but now I want to stop the alert (if it is playing) once user unlock the screen.</p><p>For alerting I am using MediaPlayer class.</p><p>Please help me.</p><p>Thanks</p>","437833","","437833","","2011-02-08 10:13:16","2011-02-08 12:44:23","How to stop alert on lock/unlock event?","<android>","1","1","0","",""
"4931733","1","","","2011-02-08 10:12:36","2","311","<p>Having some issue with Android 2.3 not picking up the <code>Content-Encoding</code> header from our server.</p><p>See <a href=""http://pastebin.com/v0Jvn0nD"" rel=""nofollow"">http://pastebin.com/v0Jvn0nD</a> for a comparison with <code>2.2</code> and <code>2.3</code>.</p><p>So, I am trying to get a workaround so Android can handle the GZIP, at the moment it just fails. Here is the connection logic:</p><p>Any help would be cool. Many thanks</p><pre><code>URL test = null;try {    test = new URL(url);                } catch (MalformedURLException e1) {                    // TODO Auto-generated catch block                    e1.printStackTrace();                }                URLConnection connection = null;                try {                    connection = test.openConnection();                } catch (IOException e) {                    // TODO Auto-generated catch block                    e.printStackTrace();                }                InputStream stream = null;                try {                    stream = connection.getInputStream();                    Log.d(""HttpHelper"",""getContentEncoding: "" + connection.getContentEncoding()); // RETURNING NULL ON 2.3                } catch (IOException e) {                    // TODO Auto-generated catch block                    e.printStackTrace();                }                if (""gzip"".equals(connection.getContentEncoding())) { // NULL HERE ON 2.3                    try {                        stream = new GZIPInputStream(stream);                        responseString = textHelper.getText(stream);                        globallistener.onComplete(responseString);                    } catch (IOException e) {                        // TODO Auto-generated catch block                        e.printStackTrace();                    }                }</code></pre>","607909","","881286","","2013-08-18 02:30:58","2013-08-18 02:30:58","Can't get Android 2.3 to handle GZIp","<java><android>","0","0","","",""
"4931736","1","","","2011-02-08 10:12:55","0","432","<p>Please recommend any method/best practice which takes unique data from phone, munches it and always produces the same key for given user on his/her device.</p>","119031","","","","","2011-02-08 10:15:22","How to manage unique code in mobile application corresponding to each application user?","<java><android><user><key><uniqueidentifier>","1","3","","",""
"4931744","1","","","2011-02-08 10:13:20","0","358","<p>Is it possible to display a <code>TextView</code> dynamically so that the height of the text can be retrieved in the middle of the Application but not at the end that is done using <code>onGlobalLayout()</code> or <code>onSizeChanged()</code>.</p><p>My requirement is to display the text in the TextView to a certain height limit. I need to check the height of the text in the TextView so that I can achieve my requirement but using any of the <code>onGlobalLayout()</code> or <code>onSizeChanged()</code>, I am getting the height at the end which is of no use to me because I can't check at the end.</p><p>Is there anyway to achieve my requirement?</p>","598331","","418183","","2011-02-08 11:01:47","2011-02-08 11:01:47","Dynamically display a TextView","<android><textview>","1","0","","",""
"4931981","1","","","2011-02-08 10:36:50","0","283","<p>In my project i am rendering pdf, in landscape mode i am fitting to pagewidth and in portrait mode i am fitting to pageheight mode. can anybody suggest me how to do scrolling in landscape mode only and swiping in both orientations. thank you in advance..</p>","493244","","","","","2011-02-08 14:22:56","scrolling and swiping problem in android","<android>","1","0","","",""
"4932179","1","9548572","","2011-02-08 10:57:37","6","1456","<h1>Question</h1><p>How do you save view widget instance state when, by using XML-defined widget layouts, components of the individual widget instances all have the same ID?</p><h1>Example</h1><p>Take, for example, the <code>NumberPicker</code> widget that's used in the <code>TimePicker</code> widget (note that <code>NumberPicker</code> is not exposed to the SDK). This is a simple widget with three components which are inflated from <code>number_picker.xml</code>: one increment button, one decrement button, and one <code>EditText</code> where you can directly enter a number. In order for the code to interact with these widgets, they all have IDs (<code>R.id.increment</code>, <code>R.id.decrement</code> and <code>R.id.timepicker_input</code> respectively).</p><p>Let's say you have three <code>NumberPicker</code>s in an XML layout and you give them distinct IDs (eg. <code>R.id.hour</code>, <code>R.id.minute</code>).¹ This layout is then inflated to the content view of an activity. We decide to change the activity's orientation, so <code>Activity.onSaveInstanceState(Bundle)</code> helpfully saves our view state for each view that has an ID (this is the default behavior). </p><p>Unfortunately, the three <code>NumberPicker</code>s have <code>EditText</code>s that all share the same ID — <code>R.id.timepicker_input</code>. Thus, when the activity is restored, the one furthest down in the view hierarchy is the one whose state seems to be preserved for all three of them. Additionally, the focus goes to the first <code>NumberPicker</code> when restored regardless of which one had focus when saved.</p><p><code>TimePicker</code> gets around this problem by preserving the state itself, separately. Unfortunately, this won't preserve the cursor position or the focused view without a lot more work. I'm not sure how it preserves that state if it does at all (and quickly playing with a time input dialog seems to indicate that it can somehow).</p><p>Please see the sample code to demonstrate this issue:<a href=""https://github.com/xxv/AndroidNumberPickerBug"">https://github.com/xxv/AndroidNumberPickerBug</a></p><hr><p>¹ In the view hierarchy, this sets the ID of the <code>LinearLayout</code> that <code>NumberPicker</code> extends to your IDs.</p>","90934","","90934","","2011-02-09 02:41:15","2012-07-09 09:19:25","saving state on compound view widgets","<android><android-layout><android-custom-view>","5","3","2","",""
"4932245","1","","","2011-02-08 11:03:28","1","434","<p>Let's try to make it easy to understand.</p><p>For an Example I got ""Page1"" and ""Page2"" And ""Page3"".OK. I created a splash screen on ""Page2"", so the user can see ""Page2"" for a specific time (5seconds). and it auto directs him to ""Page3"" and I also added two buttons on ""Page2"" so the user can either click ""Button1"" that goes to ""Page3"" quicker. or ""Button2"" that goes to ""Page 1""Ok i done that all correct.But if ""Page2"" is on and the user doesnt touch anything it takes him to ""Page3"".. my problem is that the user can touch anything ""Button1"" or ""Button2"" it directs him to ""Page3"", and if he touches ""Button2"" and goes to ""Page1"" (after the timelimit of splashscreen on ""Page2"" is up, it auto directs him from ""Page1"" to ""Page3"" </p><p>Please Help.</p><p>My Code Is</p><pre><code>import android.app.Activity;import android.os.Bundle;import android.os.Handler;import android.view.View;import android.content.Intent;import android.view.View.OnClickListener;import android.widget.Button;public class StartGame extends Activity {    // ===========================================================    // Fields    // ===========================================================    private final int SPLASH_DISPLAY_LENGHT = 3000;    // ===========================================================    // ""Constructors""    // ===========================================================    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle icicle) {        super.onCreate(icicle);        setContentView(R.layout.startgame);        /* New Handler to start the Menu-Activity          * and close this Splash-Screen after some seconds.*/        new Handler().postDelayed(new Runnable(){            @Override            public void run() {                /* Create an Intent that will start the Menu-Activity. */                Intent mainIntent = new Intent(StartGame.this,Fail.class);                StartGame.this.startActivity(mainIntent);                StartGame.this.finish();            }        }, SPLASH_DISPLAY_LENGHT);</code></pre><p>Please Help, Thanks.Wahid</p><p>EDIT:</p><p>sorry I'm a beginner and I really don't know how to create variables,Please if you can share some of your knowledge with me and show me an source code.</p><p>If variables mean buttons., that's already in there but i didn't </p>","607987","","507519","","2011-12-08 12:03:27","2011-12-08 12:03:27","Android: SplashScreen keeps Loading No Matter What I Do","<java><android><activity><splash-screen>","1","0","","",""
"4932282","1","4932341","","2011-02-08 11:07:52","45","117072","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/885009/r-cannot-be-resolved-android-error"">R cannot be resolved - Android error</a>  </p></blockquote><p>I am having a issue which I have had before and I don't understand the cause. My project and code is fine as it was running yesterday. I have open Eclipse today and the whole project looks like it contains errors.</p><p>I believe it is some sort of build path issue. I don't understand why it randomly occurs? But in the code where there is <code>R.Layout.LayoutName</code> there is an issue... can anyone help?</p><p>I have tried cleaning and building it, I have tried importing android.R but I didn't have this before,  it then gives and error and says the layout file doesn't exist. </p>","569654","","252701","","2012-10-03 22:03:57","2013-08-02 13:37:44","Android - R cannot be resolved to a variable","<android><buildpath>","8","3","12","2012-02-28 22:36:22",""
"4932350","1","","","2011-02-08 11:16:03","0","1925","<p>I am trying to access the internet from my application.</p><blockquote>  <p>We are using proxy in our company, so i entered the proxy settings for the simulator by using the -http-proxy XXXXX.   </p>    <p>I added the android.permission.INTERNET in android manifest file as well.</p>    <p>When i am trying to access the internet i am getting this exception and my application is getting force closed. </p></blockquote><p>Note: When i am using the browser application in the Emulator, i am able to access the internet.</p><p>I just copy pasted this code <a href=""http://w3mentor.com/learn/java/android-development/android-http-services/example-of-http-get-request-using-httpclient-in-android/"" rel=""nofollow"">http://w3mentor.com/learn/java/android-development/android-http-services/example-of-http-get-request-using-httpclient-in-android/</a></p><p>I am getting the error:<strong>WARN/System.err(300): org.apache.http.MalformedChunkCodingException: CRLF expected at end of chunk</strong></p><p>Please help me in resolving the same.</p><p>Thanks &amp; Regards,<br>SSuman185</p>","607625","","","","","2011-12-14 10:15:25","I am getting org.apache.http.MalformedChunkCodingException: CRLF expected at end of chunk error in android internet app","<android>","2","1","","",""
"4932402","1","","","2011-02-08 11:22:59","2","9512","<p>I am trying to write to a file the log of my application. I have created an method which appends a line to the end of the line.</p><pre><code>    public static void write2Log(String s){    StringBuilder contents = new StringBuilder();    File root = Environment.getExternalStorageDirectory();    File logFile = new File(root, ""testWrite2file.log"");    if (root.canWrite()){                       try {            BufferedReader input =  new BufferedReader(new FileReader(logFile));            String line = null;                                        while (( line = input.readLine()) != null){              contents.append(line);             // contents.append(System.getProperty(""line.separator""));                    }        input.close();        FileWriter logWriter = new FileWriter(logFile);                          BufferedWriter out = new BufferedWriter(logWriter);         out.write(contents.toString()+""\r\n""+s);////&lt;---HERE IS MY QUESTION        out.close();        }        catch (IOException e) {            Log.e(""test"", ""Could not read/write file "" + e.getMessage());        }    }}</code></pre><p>Everything works fine less the new character line.</p><p>I have tried using: </p><pre><code>\r\nSystem.getProperty(""line.separator"")newline()</code></pre><p>But i keep getting all in just one line :(</p><p>Any ideas?</p>","588925","","588925","","2011-02-08 12:19:00","2014-04-07 10:56:19","New line writing to a file in Android","<android><filewriter>","1","6","2","",""
"4932403","1","","","2011-02-08 11:23:02","1","309","<p>I am developing game application in androoid.i Created continue button in the game screen. </p><p>""If user chooses continue, itshould resume the game from the level which it has already stopped. Get thelevel from xml and directly jump that level. ""</p><p>how can i do it</p>","608013","","","","","2011-02-08 13:09:05","how to continue the game from where it is stopped in android","<android>","1","0","1","",""
"4932412","1","4933102","","2011-02-08 11:24:01","7","4439","<p>I have application which uploaded into Subversion/SVN repo. Is it possible to use script to somehow change application version code stored in <code>AndroidManifest</code>? I mean during/after checkout/update?</p><pre><code>&lt;manifest xmlns:android=""http://schemas.android.com/apk/res/android""          package=""mypackage""          android:versionCode=""100000""          android:versionName=""1.0""&gt;</code></pre>","472270","","119895","","2011-02-08 11:26:26","2012-11-18 10:53:08","How to automate version code incrementing in AndroidManifest?","<android><svn><version-control><versioning>","4","0","3","",""
"4932416","1","4932979","","2011-02-08 11:24:43","0","521","<p>I am calculating creating apps for Online Shopping in which i am having a Deals Start Date and End Date..</p><p>From this two date i want to calculate the time remaining for the Deal to end in Seconds basis.. I calculated remaining days,seconds,hours,minutes..</p><p>I want to display the Remaining time in Days:Hours:Minutes:Seconds format...</p><p>Although i move to next activity this time should runs in background in which the second must updated every seconds..</p><p>If i move this activity again i want to display the Updated Remaining time...</p><p>Also in my UI the Remaining time must get reduced second by second.</p>","555221","","114066","","2011-02-08 12:23:19","2011-02-08 12:38:31","Android Running Timer","<android>","2","0","1","",""
"4932462","1","4936159","","2011-02-08 11:29:57","44","51023","<p>I'm trying to animate the transition between fragments. I got the answer from the following<br><a href=""http://stackoverflow.com/questions/4817900/android-fragments-and-animation"">Android Fragments and animation</a>  </p><pre><code>FragmentTransaction ft = getFragmentManager().beginTransaction();ft.setCustomAnimations(R.anim.slide_in_left, R.anim.slide_out_right);DetailsFragment newFragment = DetailsFragment.newInstance();ft.replace(R.id.details_fragment_container, newFragment, ""detailFragment"");// Start the animated transition.ft.commit();</code></pre><p>And my R.anim.slide_in_left </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=""50%p"" android:toXDelta=""0""            android:duration=""@android:integer/config_mediumAnimTime""/&gt;       &lt;alpha android:fromAlpha=""0.0"" android:toAlpha=""1.0""            android:duration=""@android:integer/config_mediumAnimTime"" /&gt;&lt;/set&gt;</code></pre><p>But when I tried this it showed  </p><pre><code>02-08 16:27:37.961: ERROR/AndroidRuntime(1717): FATAL EXCEPTION: main02-08 16:27:37.961: ERROR/AndroidRuntime(1717): java.lang.RuntimeException: Unknown animator name: translate02-08 16:27:37.961: ERROR/AndroidRuntime(1717):     at android.animation.AnimatorInflater.createAnimatorFromXml(AnimatorInflater.java:129)02-08 16:27:37.961: ERROR/AndroidRuntime(1717):     at android.animation.AnimatorInflater.createAnimatorFromXml(AnimatorInflater.java:126)02-08 16:27:37.961: ERROR/AndroidRuntime(1717):     at android.animation.AnimatorInflater.createAnimatorFromXml(AnimatorInflater.java:93)02-08 16:27:37.961: ERROR/AndroidRuntime(1717):     at android.animation.AnimatorInflater.loadAnimator(AnimatorInflater.java:72)02-08 16:27:37.961: ERROR/AndroidRuntime(1717):     at android.app.FragmentManagerImpl.loadAnimator(FragmentManager.java:621)02-08 16:27:37.961: ERROR/AndroidRuntime(1717):     at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:733)02-08 16:27:37.961: ERROR/AndroidRuntime(1717):     at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:919)02-08 16:27:37.961: ERROR/AndroidRuntime(1717):     at android.app.BackStackRecord.run(BackStackRecord.java:578)02-08 16:27:37.961: ERROR/AndroidRuntime(1717):     at android.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1217)</code></pre><p>Any ideas? When I checked Honeycomb API reference <code>translate</code> is there. What did I miss?<br>Is there any other way to animate the transition between fragments?Thank you </p>","477754","","918431","","2013-02-11 20:23:43","2013-05-27 03:31:04","Animate the transition between fragments","<android><android-3.0-honeycomb>","5","5","45","",""
"4932603","1","","","2011-02-08 11:45:12","2","1680","<p>Please Tell me it is possible to run a shell script file from My Android application.</p><p>and read the data from script file.</p><p>If it is possible than how to proceed , Please give me some guideline.</p>","587090","","244296","","2011-02-08 12:16:56","2014-01-29 23:43:41","How can we execute a shell script file from my Android Application","<android><shell>","2","0","","",""
"4932634","1","4932698","","2011-02-08 11:48:48","6","4266","<p>Is android supports dual screen display?. If then how to do this?. Please help</p>","536091","","1089811","","2012-01-12 06:07:11","2012-01-12 06:07:11","Android dual screen display","<android><dual-monitor>","2","0","1","",""
"4932647","1","4932681","","2011-02-08 11:50:26","5","6489","<p>I've just noticed that, while most of getters from a <code>Bundle</code> have the possibiliy of including a default value, in case the key doesn't exist in that particular bundle instance, <code>getString</code> does not have that possibility, returning null if that case.</p><p>Any ideas on why is that and if there is some way of easy solution to that (by easy I mean not having to check each individual value or extending the <code>Bundle</code> class).</p><p>As an example, right now you have only this:</p><pre><code>bundle.getString(""ITEM_TITLE"");</code></pre><p>While I would like to do:</p><pre><code>bundle.getString(""ITEM_TITLE"",""Unknown Title"");</code></pre><p>Thanks!</p>","259425","","","","","2012-10-19 09:41:14","Default value on Bundle.getString(String key)","<android><bundle>","4","0","2","",""
"4932674","1","4933099","","2011-02-08 11:53:58","2","8132","<p>How can I add a button on a <code>WebView</code>?. I have a WebView and I want to show a popup. For that I need to add a button on the bottom-left corner of WebVew. How can I do this?</p>","2311189","","220155","","2012-11-21 12:37:53","2012-11-21 12:37:53","Android Add Button on WebView?","<android><android-layout>","3","2","","",""
"4932751","1","","","2011-02-08 12:02:18","0","2150","<p>how to compare date coloumn in sqlite  where condition </p>","555910","","","","","2012-04-05 16:20:03","how to compare date coloumn in sqlite where condition","<android><sqlite><datetime>","4","0","","2012-08-17 01:17:43",""
"4932861","1","4933283","","2011-02-08 12:17:13","0","181","<p>Is it possible to create an Android service that would listen in the background for Playback button (in the Android media player) clicks (something like onPlaybackListener) and then activate a GUI from which the current song can be controlled? i.e. stopped.</p><p>Thanks</p>","584513","","584513","","2011-02-08 12:25:45","2011-02-08 12:57:31","Android Multimedia service - simple question","<java><android><multimedia>","1","0","","",""
"4932920","1","4957890","","2011-02-08 12:22:54","0","4511","<p>I have an Android app, running a WebView that loads a certain page, also part of the app. I want to use the Android DatePicker to get a date from the user and set the value on an input inside the page in the WebView.</p><p>The DatePickerDialog opens when the user clicks the input, but when i get the return of the date selection, i can't run the loadUrl method to set the value in the input, it gives me an error and the app crashes.</p><p>A little bit of code (It's a test code, so don't mind if it is a bit out of context):</p><p><strong>Class i provide to the WebView:</strong></p><pre><code>public class webViewInterface {    public void openDatePicker(){        showDialog(0);    }}</code></pre><p><strong>Javascript function on the page, called on the click of the input:</strong></p><pre><code>function openDatePicker() {        if (objAndroid != null) objAndroid.openDatePicker();    }</code></pre><p><strong>Listener for the date selection</strong></p><pre><code>private DatePickerDialog.OnDateSetListener mDateSetListener =    new DatePickerDialog.OnDateSetListener() {        public void onDateSet(DatePicker view, int year,                               int monthOfYear, int dayOfMonth) {            mWebView.loadUrl(""javascript:setReturnDate();"");        }    };</code></pre><p><strong>Javascript function that sets a value on the input</strong></p><pre><code>function setReturnDate() {        document.getElementById('txtAgency').value = '9999';    }</code></pre><p>Any ideas?</p><p>Thanks in advance.</p>","608097","","608097","","2011-02-10 14:05:45","2011-02-14 12:57:27","Injecting Javascript into a Webview outside the onPageFinished Event (Using DatePicker to set a date on an input of a WebView)","<javascript><android><webview><injection>","1","1","1","",""
"4932962","1","","","2011-02-08 12:26:39","0","383","<p>My Android app shows an alert box. If the user doesn't select a button in the alert box, I change the screen orientation which causes the alert box to disappear. How can I change the screen orientation without causing the alert box to disappear?</p>","608104","","124538","","2011-02-08 14:29:25","2011-02-08 15:48:27","alert box is in same state when screen orientation has changed in android","<android><alert><screen-orientation>","2","0","","",""
"4932966","1","4933348","","2011-02-08 12:27:06","3","7438","<p>I have a question about services in Android. I want to know what's the best approach to get the Location variables from GPS. I am doing an application with geolocation using a service wich implements the GPS module. And for getting the location I create a variable in the class static and public method static to be called from outside the class, and that is it. To retrieve the position from the GPS I just used in my classes:</p><p>Location mLocation = ServiceGPS.getLocation();The class ServiceGPS has this method:</p><p>public static Location getLocation(){    return mLocation;}</p><p>I dont really see the point of binding to a service in this case, as I just have to call the static method. I also was thinking of doing a base class or implements the LocationListener, but this way is really simple and it works and saves code writting.</p><p>Thanks a lot for your help, and sharing your knowledge with me.</p><p>BR. David.</p>","588925","","","","","2011-02-11 13:03:10","GPS Service in Android","<android><gps>","2","2","6","",""
"4933003","1","","","2011-02-08 12:30:51","1","69","<p>While  reading the  testing tutorial at  <a href=""http://developer.android.com/resources/tutorials/testing/activity_test.html"" rel=""nofollow"">http://developer.android.com/resources/tutorials/testing/activity_test.html</a>  </p><p>I  began to  wonder  why   is  the  below code  needed.  </p><pre><code>public void testSpinnerUI() {    mActivity.runOnUiThread(      new Runnable() {        public void run() {          mSpinner.requestFocus();          mSpinner.setSelection(INITIAL_POSITION);        } // end of run() method definition      } // end of anonymous Runnable object instantiation    ); // end of invocation of runOnUiThread</code></pre><p>Why is it not better to use    sendKeys( KeyEvent.KEYCODE_DPAD_DOWN );  alone  to  set  the  focus?</p><p>Such  as  here</p><p><a href=""http://mihaifonoage.blogspot.com/2010/01/unit-and-functional-testing-in-android.html"" rel=""nofollow"">http://mihaifonoage.blogspot.com/2010/01/unit-and-functional-testing-in-android.html</a></p><pre><code>public void testAdd() throws Throwable {        //First field value        sendKeys( KeyEvent.KEYCODE_3 );        sendKeys( KeyEvent.KEYCODE_PERIOD );        sendKeys( KeyEvent.KEYCODE_5 );</code></pre>","179285","","","","","2011-02-08 12:30:51","Code in a test app that interacts with a View of the AUT must run in the main apps thread but is .runOnUiThread always needed?","<android><unit-testing>","0","0","","",""
"4933012","1","5403634","","2011-02-08 12:31:24","0","866","<p>Assuming several devices can be associated with the same Exchange ActiveSync account, I'm looking for a way to correlate between the specific device my app is running on and the device as it's defined in exchange server.</p><p>Is there any API way to retrieve the device id sent to exchange server?</p><p>this seems to be different between OEMs, so looking at the android exchange support source code wouldn't solve the problem.</p>","16418","","","","","2011-03-23 10:14:10","Retrieve device id sent to to Exchange ActiveSync server","<android><exchange-server>","1","0","","",""
"4933047","1","4933207","","2011-02-08 12:34:33","1","590","<p>Just wondering, since Android apps are Java programs, would it be possible to write one entirely from scratch without using an SDK? If no, then why not?</p>","2232662","","114066","","2011-02-08 12:54:32","2011-02-08 12:54:32","Is it possible to write Android app without an SDK?","<android>","2","6","","",""
"4933069","1","4933345","","2011-02-08 12:36:21","24","12237","<p>I'm using some webviews in my android app, but are unable to make them display in utf-8 encoding.</p><p>If use this one I won't see my scandinavian charcters:</p><pre><code>mWebView.loadUrl(""file:///android_asset/om.html"")</code></pre><p>And if try this one, I won't get anything displayed at all</p><pre><code>mWebView.loadDataWithBaseURL(""file:///android_asset/om.html"", null, ""text/html"", ""utf-8"",null);</code></pre><p>Regards</p>","498112","","410867","","2012-07-10 07:47:19","2013-10-08 22:26:30","Android WebView with garbled UTF-8 characters.","<android><webview><utf>","7","1","12","",""
"4933107","1","4937057","","2011-02-08 12:39:51","0","542","<p>I was going through the cloud back up.In there it says that to use the Google provided Android Backup Service, i need to register my application which will give me Backup Service Key.My question is how will the same application on different devices receive their specific data?</p><p>Example:- the application remembers choice of burger and orders it from the online store:</p><p>It backs up application data like choice of burgers, payment gateway etc.</p><p>Person A and Person B is using the same application on different devices and have different choice of burgers and gateways.</p><p>So when the data are retrieved during re-install how will Person A have his choices and Person B his?Is it possible to do this?</p>","544631","","","","","2012-05-02 08:34:10","Android Cloud back-up","<android>","3","0","","",""
"4933160","1","4933197","","2011-02-08 12:44:16","2","830","<p>I want to know about the battery usage percentage for each apps and available battery power in the android.</p>","504130","","418613","","2012-06-07 02:51:57","2012-06-23 11:23:02","How to save the Battery life in Android Phone?","<android><power-management>","2","5","3","",""
"4933189","1","4933227","","2011-02-08 12:45:59","0","790","<p>Currently my manifest 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.itrack.enfora""      android:versionCode=""1""      android:versionName=""1.0""      android:screenOrientation=""portrait""&gt;&lt;uses-permission android:name=""android.permission.SEND_SMS""&gt;&lt;/uses-permission&gt;&lt;uses-permission android:name=""android.permission.RECEIVE_SMS""&gt;&lt;/uses-permission&gt;&lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;    &lt;activity android:name="".EnforaSMS""              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;</code></pre><p></p><p>But it's still not locked in portrait mode and rotations still happens.Anyone know if this is Gingerbread bug? </p>","606903","","","","","2011-02-08 12:50:32","Android Gingerbread 2.3 Orientation Lock","<android><rotation><screen><orientation><portrait>","1","0","","",""
"4933261","1","","","2011-02-08 12:55:32","1","728","<p>Hiya!I want to do AES/ECB/PKCS7 encryption in my android project. For that, I was thinking of using the bouncy castle algorithm. Can anybody tell me how to add this to the project? When I give the comand</p><p>Security.addProvider(new org.bouncycastle.jce.provider.BouncyCastleProvider());</p><p>it shows an error like ""org.bouncycastle cannot be resolved to a type"".</p>","600910","","","","","2013-04-27 13:58:40","How to add bouncy castle algorithm to Androidproject","<android><encryption>","1","1","","",""
"4933299","1","4933525","","2011-02-08 12:59:04","3","914","<p>I am developing a map rendering application for Android. The map data is quite big about 1.1 Gb. Since there are limits both in the market and in the phone for .apk size the recommendations is to download it when application starts.</p><p><strong>This is the pattern I use now:</strong><br>1. Main activity (used for rendering the map) checks if the data is avaiable, if not i starts a download activity<br>2. The download activity starts a local service<br>3. The service downloads the zip files and unpacks the mapdata<br>4. The service sends events to the download activity and notifications  </p><p>I spawn a service since the whole process can take some time from 30min to a couple of hours depending on phone and network.</p><p>But I have trouble making sure that only one instance of the program is running, I have tried all combinations of the launchmode property to no help. </p><p>As you may understand two instances running will crash the download/unzip. </p><p><em>This is really frustrating! Now I am doing some ugly read/write to sdcard file lock and it is working most of the time to make sure only one instance is running.</em></p><p>I am targeting Android 1.6 and above.</p>","192927","","","","","2011-02-08 13:21:06","Download large application data pattern","<android><data><download>","2","4","","",""
"4933474","1","","","2011-02-08 13:15:23","1","5265","<p>I'm writing to a file using the code below:</p><pre><code>File file = new File(getCacheDir(), ""cachefile"");FileOutputStream fos = new FileOutputStream(file);StringBuilder cachetext = new StringBuilder();Iterator bri = brands.iterator();Iterator bli = brand_id.iterator();while(bli.hasNext()) {    cachetext.append(bli.next() + ""|"" + bri.next() + System.getProperty(""line.separator""));}fos.write(cachetext.toString().getBytes());fos.close();</code></pre><p>This works fine - no errors and the file ends up containing what I expect it to contain. When I go to read it via openFileInput(), however, I get an exception telling me that path separators are not allowed</p><pre><code>FileInputStream fis = openFileInput(getCacheDir() + ""/cachefile"");</code></pre><p>Fair enough, that contains a slash, but how else can I specify the path of the file I want to open? There must be a way to do this, of course, but I can't find answers via Google ('read', 'cache' and 'file' not being the most niche of terms ...) so I thought I'd try the human touch. Thanks in advance!</p>","587319","","","","","2013-10-12 01:02:48","Reading a cache file previously written by the same app","<android><android-file>","1","1","","",""
"4933569","1","4966289","","2011-02-08 13:25:36","2","1366","<p>Can I use the Android Cloud to back up my application's databases? What are some limits to this feature?</p>","544631","","421372","","2012-10-29 10:15:30","2012-10-29 10:15:30","Backing up databases in android cloud:","<android><android-backup-service>","1","4","5","",""
"4933612","1","4934840","","2011-02-08 13:29:12","12","10421","<p>In my app I need to let users to check the eyes at some photo.In OnTouchListener.onTouch(...) I get the coordinates of the ImageView.</p><p>How can I convert this coordinates to the point at the bitmap that was touched?</p>","184860","","","","","2012-07-04 18:38:40","How to convert coordinates of the image view to the coordinates of the bitmap?","<android><image>","5","0","7","",""
"4933632","1","","","2011-02-08 13:30:59","0","751","<p>I made an android application with a database. I want to run the application on my friends android device.Whenever I try to run the application on the device, it throws a security exception. I have enabled debugging on the device. Earlier, when I ran the same thing without the database, the device would throw no exception.The application is perfectly fine on the emulator.What could be the problem and how can I solve it?Thank you in advance.</p><p>Edit:</p><p>This is the stack trace</p><pre><code>02-08 19:18:43.474: DEBUG/Twitter-MessageReceiver(5593): action android.intent.action.USER_PRESENT02-08 19:18:43.474: DEBUG/dalvikvm(9522): GC freed 367 objects / 20200 bytes in 124ms02-08 19:18:43.574: ERROR/Database(9522): sqlite3_open_v2(""/data/data/myListActivity.helios/Recipe.db"", &amp;handle, 2, NULL) failed02-08 19:18:43.574: DEBUG/AndroidRuntime(9522): Shutting down VM02-08 19:18:43.574: WARN/dalvikvm(9522): threadid=3: thread exiting with uncaught exception (group=0x4001e390)02-08 19:18:43.584: ERROR/AndroidRuntime(9522): Uncaught handler: thread main exiting due to uncaught exception02-08 19:18:43.594: ERROR/AndroidRuntime(9522): java.lang.RuntimeException: Unable to start activity ComponentInfo{myListActivity.helios/myListActivity.helios.MyListActivity}: android.database.sqlite.SQLiteException: unable to open database file02-08 19:18:43.594: ERROR/AndroidRuntime(9522):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2596)02-08 19:18:43.594: ERROR/AndroidRuntime(9522):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2621)02-08 19:18:43.594: ERROR/AndroidRuntime(9522):     at android.app.ActivityThread.access$2200(ActivityThread.java:126)02-08 19:18:43.594: ERROR/AndroidRuntime(9522):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1932)02-08 19:18:43.594: ERROR/AndroidRuntime(9522):     at android.os.Handler.dispatchMessage(Handler.java:99)02-08 19:18:43.594: ERROR/AndroidRuntime(9522):     at android.os.Looper.loop(Looper.java:123)02-08 19:18:43.594: ERROR/AndroidRuntime(9522):     at android.app.ActivityThread.main(ActivityThread.java:4603)02-08 19:18:43.594: ERROR/AndroidRuntime(9522):     at java.lang.reflect.Method.invokeNative(Native Method)02-08 19:18:43.594: ERROR/AndroidRuntime(9522):     at java.lang.reflect.Method.invoke(Method.java:521)02-08 19:18:43.594: ERROR/AndroidRuntime(9522):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)02-08 19:18:43.594: ERROR/AndroidRuntime(9522):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)02-08 19:18:43.594: ERROR/AndroidRuntime(9522):     at dalvik.system.NativeStart.main(Native Method)02-08 19:18:43.594: ERROR/AndroidRuntime(9522): Caused by: android.database.sqlite.SQLiteException: unable to open database file02-08 19:18:43.594: ERROR/AndroidRuntime(9522):     at android.database.sqlite.SQLiteDatabase.dbopen(Native Method)02-08 19:18:43.594: ERROR/AndroidRuntime(9522):     at android.database.sqlite.SQLiteDatabase.&lt;init&gt;(SQLiteDatabase.java:1789)02-08 19:18:43.594: ERROR/AndroidRuntime(9522):     at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:805)02-08 19:18:43.594: ERROR/AndroidRuntime(9522):     at myListActivity.helios.MyListActivity.getDetails(MyListActivity.java:153)02-08 19:18:43.594: ERROR/AndroidRuntime(9522):     at myListActivity.helios.MyListActivity.onCreate(MyListActivity.java:29)02-08 19:18:43.594: ERROR/AndroidRuntime(9522):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)02-08 19:18:43.594: ERROR/AndroidRuntime(9522):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2544)02-08 19:18:43.594: ERROR/AndroidRuntime(9522):     ... 11 more02-08 19:18:43.614: INFO/Process(82): Sending signal. PID: 9522 SIG: 302-08 19:18:43.624: INFO/dalvikvm(9522): threadid=7: reacting to signal 302-08 19:18:43.644: DEBUG/apiurl(5593): apiurl twitter.com02-08 19:18:43.644: INFO/dalvikvm(9522): Wrote stack trace to '/data/anr/traces.txt'02-08 19:18:43.704: DEBUG/PhoneWindow(82): DebugMonitor class=com.android.server.am.AppErrorDialog focus=true02-08 19:18:43.774: DEBUG/PlurkReceiver(5593): Intent.ACTION_USER_PRESENT SyncInterval=3600000,currTime=129717292377502-08 19:18:43.774: DEBUG/PlurkReceiver(5593): Intent.ACTION_USER_PRESENT lastStreamSyncTime=0,lastFriendSyncTime=002-08 19:18:43.814: DEBUG/FlickrReceiver(5593): Intent.ACTION_USER_PRESENT SyncInterval=7200000,currTime=1297172923816</code></pre>","352707","","135152","","2011-05-25 02:57:17","2011-05-25 02:57:17","How to run android application with database on device?","<android><sqlite>","1","1","0","",""
"4933672","1","","","2011-02-08 13:34:12","0","796","<p>For the life of me I can't run this on my android emulator;I'm new to this but I thought getting an image output should be easy!</p><p>I get these two errors in Eclipse(Android plug-in)IDE</p><pre><code>1.findViewbyId cannot be resolved2.the method setImageView(String) is undefined for the type catwalk</code></pre><p>Please see the code below</p><pre><code>package com.marueli.catwalk;import android.app.Activity;import android.os.Bundle;import android.widget.ImageView;public class Catwalk extends Activity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        ImageView(findViewById);        setImageView(""R.drawable.Cat.PNG"");        setContentView(R.layout.main);          }}</code></pre><p>It is my first code after going through several tutorials.Thank you.</p><p>Regards,Eli.</p>","469100","","750613","","2012-07-13 09:31:31","2012-07-13 09:31:31","Android widget-ImageView issue/error","<android><android-widget>","1","0","","",""
"4933712","1","4933763","","2011-02-08 13:38:11","3","558","<p>Lets say my Activity has a list object containing stuff. This Activity starts off several AsyncTasks. When these tasks finish, they modify this list (add stuff in it for example), in their postExecute() methods. Should this list be thread-safe?</p><p>My bet is that it's not neccesary, because the code in the postExecute() methods run in the UI thread, sequentially. So they don't get to modify the list in parallel. Is this correct?</p>","446529","","","","","2011-02-08 13:43:10","AsyncTasks and thread-safe data objects?","<android><thread-safety><android-asynctask>","1","0","","",""
"4933718","1","7311482","","2011-02-08 13:39:12","1","7508","<p>I am new to android... I want to create simple android game using Andengine. Could you tell how to install Andengine in eclipse....I'm using eclipse on linux.</p><p><strong>Edit:</strong></p><p>Andengine is installed but I get this error message in logcat:</p><pre><code>  02-09 00:36:53.562: ERROR/AndEngine(501): java.io.FileNotFoundException: ggg  02-09 00:36:53.562: ERROR/AndEngine(501): at android.content.res.AssetManager.  openAsset(Native Method) 02-09 00:36:53.562: ERROR/AndEngine(501): at android.content.res.AssetManager .open(AssetManager.java:313) 02-09 00:36:53.562: ERROR/AndEngine(501): at android.content.res.AssetManager .open(AssetManager.java:287) 02-09 00:36:53.562: ERROR/AndEngine(501): at org.anddev.andengine.opengl.texture.source.AssetTextureSource.&lt;init&gt;(AssetTextureSource.java:46) 02-09 00:36:53.562: ERROR/AndEngine(501): at org.anddev.andengine.opengl.texture .region.TextureRegionFactory.createFromAsset(TextureRegionFactory.java:66)  02-09 00:36:53.562: ERROR/AndEngine(501): at org.anddev.andengine.examples.minimal   .AndEngineMinimalExample.onLoadResources(AndEngineMinimalExample.java:59) 02-09 00:36:53.562: ERROR/AndEngine(501): at org.anddev.andengine.ui.activity .BaseGameActivity.doResume(BaseGameActivity.java:158) 02-09 00:36:53.562: ERROR/AndEngine(501): at org.anddev.andengine.ui.activity .BaseGameActivity.onWindowFocusChanged(BaseGameActivity.java:83) 02-09 00:36:53.562: ERROR/AndEngine(501): at com.android.internal.policy.impl .PhoneWindow$DecorView.onWindowFocusChanged(PhoneWindow.java:1981) 02-09 00:36:53.562: ERROR/AndEngine(501): at android.view.View .dispatchWindowFocusChanged(View.java:3788) 02-09 00:36:53.562: ERROR/AndEngine(501): at android.view.ViewGroup .dispatchWindowFocusChanged(ViewGroup.java:658)  02-09 00:36:53.562: ERROR/AndEngine(501):     at     android.view.ViewRoot.handleMessage(ViewRoot.java:1921)  02-09 00:36:53.562: ERROR/AndEngine(501):     at   android.os.Handler.dispatchMessage(Handler.java:99)  02-09 00:36:53.562: ERROR/AndEngine(501): at android.os.Looper.loop(Looper.java:123)  02-09 00:36:53.562: ERROR/AndEngine(501): at  android.app.ActivityThread.main(ActivityThread.java:4627)  02-09 00:36:53.562: ERROR/AndEngine(501):     at    java.lang.reflect.Method.invokeNative(Native Method)   02-09 00:36:53.562: ERROR/AndEngine(501):     at    java.lang.reflect.Method.invoke(Method.java:521)   02-09 00:36:53.562: ERROR/AndEngine(501):     at    com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)   02-09 00:36:53.562: ERROR/AndEngine(501):     at    com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)   02-09 00:36:53.562: ERROR/AndEngine(501):     at dalvik.system.NativeStart.main   (Native Method)   02-09 00:36:53.821: DEBUG/dalvikvm(501): GC_EXTERNAL_ALLOC freed 1797 objects /    148120 bytes in 173ms   02-09 00:36:54.160: DEBUG/libEGL(501): egl.cfg not found, using default config   02-09 00:36:54.230: DEBUG/libEGL(501): loaded /system/lib/egl/libGLES_android.so   02-09 00:36:54.425: DEBUG/AndEngine(501): onSurfaceCreated   02-09 00:36:54.441: DEBUG/AndEngine(501): RENDERER: Android PixelFlinger 1.3   02-09 00:36:54.500: DEBUG/AndEngine(501): VERSION: OpenGL ES-CM 1.0   02-09 00:36:54.511: DEBUG/AndEngine(501): EXTENSIONS: GL_OES_byte_coordinates    GL_OES_fixed_point GL_OES_single_precision GL_OES_read_format     GL_OES_compressed_paletted_texture GL_OES_draw_texture GL_OES_matrix_get    GL_OES_query_matrix GL_OES_EGL_image GL_OES_compressed_ETC1_RGB8_texture    GL_ARB_texture_compression GL_ARB_texture_non_power_of_two      GL_ANDROID_user_clip_plane    GL_ANDROID_vertex_buffer_object GL_ANDROID_generate_mipmap    02-09 00:36:54.531: DEBUG/AndEngine(501): EXTENSIONS_VERXTEXBUFFEROBJECTS = false   02-09 00:36:54.531: DEBUG/AndEngine(501): EXTENSIONS_DRAWTEXTURE = true   02-09 00:36:54.541: DEBUG/AndEngine(501): onSurfaceChanged: pWidth=480  pHeight=320   02-09 00:36:54.630: ERROR/AndEngine(501): Failed loading Bitmap in    AssetTextureSource. AssetPath: ggg   02-09 00:36:54.630: ERROR/AndEngine(501): java.io.FileNotFoundException: ggg   02-09 00:36:54.630: ERROR/AndEngine(501):     at    android.content.res.AssetManager.openAsset(Native Method)   02-09 00:36:54.630: ERROR/AndEngine(501):     at    android.content.res.AssetManager.open(AssetManager.java:313)   02-09 00:36:54.630: ERROR/AndEngine(501):     at    android.content.res.AssetManager.open(AssetManager.java:287)   02-09 00:36:54.630: ERROR/AndEngine(501):     at    org.anddev.andengine.opengl.texture.source  .AssetTextureSource.onLoadBitmap(AssetTextureSource.java:95)   02-09 00:36:54.630: ERROR/AndEngine(501):     at org.anddev.andengine.opengl.texture  .Texture$TextureSourceWithLocation.onLoadBitmap(Texture.java:364)  02-09 00:36:54.630: ERROR/AndEngine(501):     at org.anddev.andengine.opengl.texture  .Texture.writeTextureToHardware(Texture.java:208)  02-09 00:36:54.630: ERROR/AndEngine(501):     at   org.anddev.andengine.opengl.texture.Texture.loadToHardware(Texture.java:175)  02-09 00:36:54.630: ERROR/AndEngine(501):     at org.anddev.andengine.opengl.texture  .TextureManager.updateTextures(TextureManager.java:136)  02-09 00:36:54.630: ERROR/AndEngine(501):     at org.anddev.andengine.engine.Engine .onDrawFrame(Engine.java:508)  02-09 00:36:54.630: ERROR/AndEngine(501):     at org.anddev.andengine.opengl.view .RenderSurfaceView$Renderer.onDrawFrame(RenderSurfaceView.java:148)  02-09 00:36:54.630: ERROR/AndEngine(501):     at org.anddev.andengine.opengl.view .GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:617) 02-09 00:36:54.630: ERROR/AndEngine(501):     at org.anddev.andengine.opengl.view .GLSurfaceView$GLThread.run(GLSurfaceView.java:549) 02-09 00:36:54.751: ERROR/AndEngine(501): Error loading: AssetTextureSource(ggg) 02-09 00:36:54.751: ERROR/AndEngine(501): java.lang.IllegalArgumentException:  TextureSource: AssetTextureSource(ggg) returned a null Bitmap. 02-09 00:36:54.751: ERROR/AndEngine(501):     at org.anddev.andengine.opengl.texture .Texture.writeTextureToHardware(Texture.java:211) 02-09 00:36:54.751: ERROR/AndEngine(501):     at  org.anddev.andengine.opengl.texture.Texture.loadToHardware(Texture.java:175) 02-09 00:36:54.751: ERROR/AndEngine(501):     at org.anddev.andengine.opengl.texture.TextureManager.updateTextures(TextureManager.java:136) 02-09 00:36:54.751: ERROR/AndEngine(501):     at  org.anddev.andengine.engine.Engine.onDrawFrame(Engine.java:508) 02-09 00:36:54.751: ERROR/AndEngine(501):     at org.anddev.andengine.opengl.view.RenderSurfaceView$Renderer.onDrawFrame(RenderSurfaceView.java:148) 02-09 00:36:54.751: ERROR/AndEngine(501):     at org.anddev.andengine.opengl.view.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:617) 02-09 00:36:54.751: ERROR/AndEngine(501):     at org.anddev.andengine.opengl.view .GLSurfaceView$GLThread.run(GLSurfaceView.java:549) 02-09 00:36:54.793: WARN/dalvikvm(501): threadid=7: thread exiting with uncaught  exception (group=0x4001d800) 02-09 00:36:54.831: ERROR/AndroidRuntime(501): FATAL EXCEPTION: GLThread 02-09 00:36:54.831: ERROR/AndroidRuntime(501): java.lang.IllegalArgumentException:  TextureSource: AssetTextureSource(ggg) returned a null Bitmap. 02-09 00:36:54.831: ERROR/AndroidRuntime(501): at org.anddev.andengine.opengl.texture .Texture.writeTextureToHardware(Texture.java:211)  02-09 00:36:54.831: ERROR/AndroidRuntime(501):at org.anddev.andengine.opengl.texture  .Texture.loadToHardware(Texture.java:175) 02-09 00:36:54.831: ERROR/AndroidRuntime(501):   at  org.anddev.andengine.opengl.texture .TextureManager.updateTextures(TextureManager.java:136) 02-09 00:36:54.831: ERROR/AndroidRuntime(501):     at org.anddev.andengine.engine .Engine.onDrawFrame(Engine.java:508) 02-09 00:36:54.831: ERROR/AndroidRuntime(501):     at org.anddev.andengine.opengl.view .RenderSurfaceView$Renderer.onDrawFrame(RenderSurfaceView.java:148) 02-09 00:36:54.831: ERROR/AndroidRuntime(501):     at org.anddev.andengine.opengl.view .GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:617) 02-09 00:36:54.831: ERROR/AndroidRuntime(501):     at org.anddev.andengine.opengl.view .GLSurfaceView$GLThread.run(GLSurfaceView.java:549) 02-09 00:36:54.983: WARN/ActivityManager(66):Force finishing  activityorg.anddev.andengine.examples.minimal/.AndEngineMinimalExample 02-09 00:36:55.661: DEBUG/dalvikvm(66): GC_EXPLICIT freed 2704 objects /  163368 bytes in 265ms02-09 00:36:55.743: INFO/WindowManager(66): Setting rotation to 0, animFlags=102-09 00:36:55.781: INFO/ActivityManager(66): Config changed: { scale=1.0 imsi=310/260 loc=en_US touch=3 keys=2/1/2 nav=3/1 orien=1 layout=18 uiMode=17 seq=13}02-09 00:36:56.240: WARN/ActivityManager(66): Activity pause timeout for HistoryRecord{43fd2338 org.anddev.andengine.examples.minimal/.AndEngineMinimalExample} 02-09 00:36:56.922: WARN/IInputConnectionWrapper(288): showStatusIcon on inactive  InputConnection  02-09 00:36:57.416: WARN/WindowManager(66): Window freeze timeout expired.  02-09 00:36:57.416: WARN/WindowManager(66): Force clearing orientation change:   Window{43fecea8 StatusBarExpanded paused=false}  02-09 00:36:57.431: WARN/WindowManager(66): Force clearing orientation change:    Window{43fba7b0 com.android.launcher/com.android.launcher2.Launcher paused=false}   02-09 00:36:59.090: DEBUG/dalvikvm(335): GC_EXPLICIT freed 85 objects / 3560bytes     in 12084ms 02-09 00:36:59.891: DEBUG/dalvikvm(66): GC_EXPLICIT freed 1126 objects / 61592 bytes  in 399ms 02-09 00:37:07.941: WARN/ActivityManager(66): Activity destroy timeout for  HistoryRecord{43fd2338 org.anddev.andengine.examples.minimal/ .AndEngineMinimalExample}</code></pre>","486554","","54606","","2011-04-28 09:46:10","2013-05-23 22:23:30","How to install Andengine in my eclipse?","<android><installation><andengine>","2","0","1","",""
"4933770","1","","","2011-02-08 13:43:33","0","1143","<p>I've had a bug report that when a user is playing my game and an incoming call is received, after the call is finished with my app is crashing.</p><p>The problem is I've tried to recreate the error - I've been sitting here all morning running it and phoning in - and it always resumes without any problems. I can't see any error reports relating to this problem either. I've been quite exhaustive too, calling it during various stages (ie. entering highscores, on the splash screen, during gameplay) and never any problems.</p><p>It's weird because I have had this bug reported before a while ago, and then the user said it was okay now. So I guess it must be intermittent.</p><p>I'm guessing the problem is somewhere in my onCreate() method. I thought this was the entry point when resuming an app.</p><p>Does anyone have an idea how to debug this ""blind"" without a crash report?</p>","465286","","","","","2012-03-02 07:04:44","Android app crashing after incoming call","<android>","4","1","","",""
"4933791","1","","","2011-02-08 13:45:00","5","5813","<p>I am working on an Android auto-start app that's basically dependent on SIM card state.  When my app auto starts I need it to check where the SIM card has been changed or not.  After that I compare the current SIM with the past SIM by obtaining the shared preference.  But the app returns a null pointer exception when getting the new SIM card's value.</p><p>I want to react of sim states.</p><p>When I receive the <code>SIM_STATE_READY</code> state I want to get the new SIM state from telephone manager.</p><pre><code>  telMgr = (TelephonyManager)getSystemService(TELEPHONY_SERVICE);     int simState = telMgr.getSimState();     switch (simState)     {        case (TelephonyManager.SIM_STATE_ABSENT):            System.out.println(""*******************************************Sim State absent******************************"");            break;        case (TelephonyManager.SIM_STATE_NETWORK_LOCKED):             System.out.println(""*******************************************SIM_STATE_NETWORK_LOCKED******************************""+sim);            break;        case (TelephonyManager.SIM_STATE_PIN_REQUIRED):             System.out.println(""*******************************************SIM_STATE_PIN_REQUIRED******************************""+sim);        break;        case (TelephonyManager.SIM_STATE_PUK_REQUIRED):             System.out.println(""*******************************************SIM_STATE_PUK_REQUIRED******************************""+sim);        break;        case (TelephonyManager.SIM_STATE_UNKNOWN):             System.out.println(""*******************************************SIM_STATE_UNKNOWN******************************""+sim);        break;        case (TelephonyManager.SIM_STATE_READY):         {        }    break;    }    default: break;    }</code></pre><p>I'm doing this but dont know how to listen for SIM the states I want when the SIM is ready so that I can then execute some code.  When the device boots up it always returns ""SIM_STATE_UNKNOWN"" and causes program's execution got complete. </p><p>Please help me to achieve this.</p>","383597","","423105","","2013-05-02 23:04:18","2013-05-02 23:04:18","Android Telephone manager to detect sim","<android>","3","0","3","",""
"4933812","1","","","2011-02-08 13:46:22","0","361","<p>I have seen examples on how to use XferMode to make part of an image transparent.</p><p>But I can't make it work when using real Bitmaps based on <code>*.PNG</code> files. </p><p>I have two images on top of each other, but I want to gradually erase the top image when dragging my finger on it.</p>","608210","","750613","","2012-07-13 09:29:32","2012-07-13 09:29:32","How to erase part of an image by touch?","<android><transparent><paint>","0","4","","",""
"4933831","1","4953187","","2011-02-08 13:48:52","0","680","<p>I plan to create an application on android which use openfire(XMPP) and also use mysql to collect data at server.</p><p>My application need to:</p><pre><code>1. Check login account2. Send data to collect at server3. Receive data from server  </code></pre><p>So,I need to know:</p><pre><code>1. Could i download smack to my app right? how?2. How openfire can work with mysql ?  3. Should I use LDAP ?</code></pre>","538788","","750613","","2012-07-13 09:29:02","2012-07-13 09:29:02","Can openfire merge with mysql server","<android><mysql><ldap><xmpp><openfire>","3","0","","",""
"4933837","1","4936558","","2011-02-08 13:49:16","0","1027","<p>I'm trying to detect shake events in my application so that I would be able to do something when user shakes the device. But the problem is; ShakeListener which I used, detects orientation changes as a shake event.(When I move the phone from landscape to portrait, it detects a shake)</p><p>I tried changing the force threshold but at that time it can't detect any shake event.</p><p>Here is the ShakeListener code which i took from <a href=""http://android.hlidskialf.com/blog/code/android-shake-detection-listener"" rel=""nofollow"">this site</a> :</p><pre><code>import android.content.Context;import android.hardware.Sensor;import android.hardware.SensorEvent;import android.hardware.SensorEventListener;import android.hardware.SensorManager;public class ShakeListener implements SensorEventListener {private static final int FORCE_THRESHOLD = 500;private static final int TIME_THRESHOLD = 100;private static final int SHAKE_TIMEOUT = 500;private static final int SHAKE_DURATION = 1000;private static final int SHAKE_COUNT = 3;private SensorManager mSensorMgr;private float mLastX = -1.0f, mLastY = -1.0f, mLastZ = -1.0f;private long mLastTime;private OnShakeListener mShakeListener;private Context mContext;private int mShakeCount = 0;private long mLastShake;private long mLastForce;public interface OnShakeListener {    public void onShake();}public ShakeListener(Context context) {    mContext = context;}public void setOnShakeListener(OnShakeListener listener) {    mShakeListener = listener;}public void resume(OnShakeListener listener) {    this.setOnShakeListener(listener);    mSensorMgr = (SensorManager) mContext            .getSystemService(Context.SENSOR_SERVICE);    if (mSensorMgr == null) {        throw new UnsupportedOperationException(""Sensors not supported"");    }    boolean supported = mSensorMgr.registerListener(this,            mSensorMgr.getDefaultSensor(SensorManager.SENSOR_ACCELEROMETER),            SensorManager.SENSOR_DELAY_UI);    if (!supported) {        mSensorMgr.unregisterListener(this,                mSensorMgr.getDefaultSensor(SensorManager.SENSOR_ACCELEROMETER));        throw new UnsupportedOperationException(                ""Accelerometer not supported"");    }}public void pause() {    mShakeListener = null;    if (mSensorMgr != null) {        mSensorMgr.unregisterListener(this,                mSensorMgr.getDefaultSensor(SensorManager.SENSOR_ACCELEROMETER));        mSensorMgr = null;    }}public void onAccuracyChanged(Sensor sensor, int accuracy) {    // TODO Auto-generated method stub}public void onSensorChanged(SensorEvent event) {    if (event.sensor.getType() != SensorManager.SENSOR_ACCELEROMETER)        return;    long now = System.currentTimeMillis();    if ((now - mLastForce) &gt; SHAKE_TIMEOUT) {        mShakeCount = 0;    }    if ((now - mLastTime) &gt; TIME_THRESHOLD) {        long diff = now - mLastTime;        float speed = Math.abs(event.values[SensorManager.DATA_X]                + event.values[SensorManager.DATA_Y]                + event.values[SensorManager.DATA_Z] - mLastX - mLastY - mLastZ)                / diff * 10000;        if (speed &gt; FORCE_THRESHOLD) {            if ((++mShakeCount &gt;= SHAKE_COUNT)                    &amp;&amp; (now - mLastShake &gt; SHAKE_DURATION)) {                mLastShake = now;                mShakeCount = 0;                if (mShakeListener != null) {                    mShakeListener.onShake();                }            }            mLastForce = now;        }        mLastTime = now;        mLastX = event.values[SensorManager.DATA_X];        mLastY = event.values[SensorManager.DATA_Y];        mLastZ = event.values[SensorManager.DATA_Z];    }}}</code></pre><p>I want to detect only shake movements, not orientation changes.</p><p>Any suggestion?</p>","439051","","","","","2011-02-08 18:00:51","Shake Listener detects orientation changes","<android><orientation><shake>","1","0","","",""
"4933866","1","","","2011-02-08 13:51:42","1","698","<p>Display listview item containing a button in it as a overlay on top of other <code>listview</code> item's on click in android</p>","478700","","750613","","2012-07-13 09:28:28","2012-07-13 09:28:28","Display listview item containing a button in it as a overlay on top of other listview item's on click","<android>","1","2","","",""
"4933874","1","4934262","","2011-02-08 13:52:15","0","785","<p>Is it possible to load activities from an external dex-file? I'm thinking of some plug-in style-architecture, where an application can be extended by downloading dex-files with activities and classes containing extra functionality.</p><p>I've managed to load and invoke methods on a class from a downloaded dex-file using DexClassLoader and reflection. But could I somehow use this technique to download and present an Activity? Is it possible to register this new Activity programmatically so that I can invoke it using an Intent?</p><p>I know that it's possible (and the recommended way is) to install the other Activity through the normal procedure with an APK, and then load it from my main activity using Intents or simply update the installed application, but I want to extend my already installed application by downloading some extra classes and execute everything in the same VM, same sandbox.</p><p>Hm, let me know if you don't understand what I mean, cause this got a bit messy.. :)</p>","492067","","492067","","2011-02-08 14:38:54","2011-02-08 14:38:54","Android: Load Activities from external dex","<android><reflection><activity><sandbox><dex>","1","0","","",""
"4933899","1","","","2011-02-08 13:54:04","0","2208","<p>i'm a junior programmer. I have a base class that extends activity, i use this class to set up the menu in my app. All my activity classes extends this base class. Now, i have a new class which extend ExpandableListActivity this class's purpose is to show an expandable list and of course when the user is viewing this activity the menu becomes unavailable. So how can i do to be able to use the menu while viewing the expandable list. I know that it's impossible to extend more than one class in Java, so what's the trick?</p><p>Thanks in advance </p>","526924","","","","","2011-02-08 14:29:35","extend 2 classes problem android","<java><android>","2","0","","",""
"4933902","1","","","2011-02-08 07:10:30","1","374","<p>How I can programmatically find the list of applications that starts on device startup. Is there any way to <strong>programmatically</strong> disable autostarting applications you don't need.</p><p>Thanks</p>","579875","Android_IT","","","","2011-02-08 14:46:36","How to disable all the autostarting apps","<startup><android>","2","1","0","",""
"4933944","1","","","2011-02-08 13:58:50","0","1863","<p>I can't solve this problem. I have preference screen and there is sub-preference that opens up another screen. On that another screen change of items can be caught with <code>OnSharedPreferenceChangeListener</code> and I change summary in parent preference screen, but when I go back to that parent preference screen, summary did not changed.</p><p>Same question was asked <a href=""http://stackoverflow.com/questions/2396153/preferencescreen-androidsummary-update"">here</a>, but conclusion was not clear, and I could not solve this problem. It seems a common problem to me and I guess there is good solution for this.</p><p>Dose anyone know a solution for this problem?</p><ul><li>There is one thing I like to keep: sub-preference is standard one, not custom. </li></ul>","576442","","750613","","2012-07-13 09:26:44","2013-08-11 13:04:05","How to update summary of preference from sub-preference","<android><summary><preference>","2","0","","",""
"4933988","1","","","2011-02-08 14:02:29","0","618","<p>I am using <strong>Phonegap</strong>. Is there any method to display image or button or circle on top of camera preview. I am also using Sencha Touch.</p>","608234","","750613","","2012-07-13 09:26:19","2012-07-13 09:26:31","Image/button/circle on top of camera preview using Phonegap","<android><iphone><phonegap><sencha-touch>","1","0","","",""
"4934030","1","4947023","","2011-02-08 13:43:40","3","583","<p>Is it possible to load activities from an external dex-file? I'm thinking of some plug-in style-architecture, where an application can be extended by downloading dex-files with activities and classes containing extra functionality.</p><p>I've managed to load and invoke methods on a class from a downloaded dex-file using DexClassLoader and reflection. But could I somehow use this technique to present download and present an Activity? Is it possible to register this new Activity programmatically so that I can invoke it using an Intent?</p><p>I know that it's possible (and the recommended way is) to install the other Activity through the normal procedure with an APK, and then load it from my main activity using Intents or simply update the installed application, but I want to extend my already installed application by downloading some extra classes and execute everything in the same VM, same sandbox.</p><p>Hm, let me know if you don't understand what I mean, cause this got a bit messy.. :)</p>","492067","Shabby","1288","","2011-06-08 13:15:27","2011-11-08 15:03:15","Load Activities from external dex","<android>","2","2","1","",""
"4934066","1","4937236","","2011-02-08 14:10:53","0","253","<p>Anyone knows if it's possible to check APK size from IntelliJ? I cannot find this info on their site, but I've posted this question anyway. </p><p>Thanks</p>","437039","","","","","2011-02-08 19:11:43","Possible to check APK size from IntelliJ?","<android><intellij-idea>","1","1","","",""
"4934070","1","","","2011-02-08 14:11:26","1","1897","<p>I am new in opengl as well as in jni. I know how to draw using java and opengl, but I want to draw the same using C.</p><p>Can anyone help me out?</p><p>I want to draw a square by calling draw( written in c) function from my java renderer class, where all the drawing will be done.</p><p>I have seen the san-angeles example, but it's complicated.</p>","562086","","44729","","2011-02-08 16:18:27","2011-02-08 16:18:27","How to draw a square using JNI and OpenGL in Android","<android><opengl-es><jni>","1","0","","",""
"4934071","1","4934110","","2011-02-08 14:11:29","1","1098","<p>I am asking because i can install the app on a device with a small screen via the file system.Thanks for Help.</p>","457378","","19750","","2011-02-08 14:13:31","2011-02-08 14:16:07","Will setting <supports-screens android:smallScreens=""false""> hide the App in the Android Market for such devices?","<android><manifest>","2","0","","",""
"4934136","1","","","2011-02-08 14:18:06","3","4839","<p>How do I do a custom theme android spinner dialog?</p>","457394","","102937","","2011-02-08 15:25:55","2012-07-13 09:19:19","Custom spinner dialog for Android","<android><dialog><themes><spinner>","2","1","","",""
"4934175","1","4958044","","2011-02-08 14:21:11","1","192","<p>Ok. So I'm doing something very similar to what the person at <a href=""http://stackoverflow.com/questions/4295271/strange-jumping-values-for-ontouchlistener-using-a-relativelayout-in-android"">Strange jumping values for onTouchListener using a RelativeLayout in Android</a> is doing. Unfortunately I'm having the same problem as that person. They supposedly solved the problem but didn't really post a solution. Does anyone by chance know how to fix this problem?</p>","604591","","","","","2011-02-10 14:04:23","Jumping ImageView when dragging in Android","<android>","1","2","","",""
"4934305","1","","","2011-02-08 14:34:14","2","3222","<p>I am creating an application that lets the user log in to a profile they create, I just want to know how I would get a correct username and password entry to take the user to another activity as at the moment I just get errors if I try to use intent and startactivity.</p><pre><code>public class Login extends Activity implements OnClickListener{/** Called when the activity is first created. */private EditText etUsername;private EditText etPassword;private Button btnLogin;//private Button btnRegister;private TextView lblResult;public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.login);    // Get the EditText and Button References    etUsername = (EditText)findViewById(R.id.EditUsername);    etPassword = (EditText)findViewById(R.id.EditPassword);    btnLogin = (Button)findViewById(R.id.login);    //btnRegister = (Button)findViewById(R.id.btnRegister);    lblResult = (TextView)findViewById(R.id.lblmsg);   // Button btnArrival = (Button) findViewById(R.id.btnRegister);    //btnArrival.setOnClickListener(this);// Set Click ListenerbtnLogin.setOnClickListener(new OnClickListener() {    @Override    public void onClick(View v) {        // Check Login        String username = etUsername.getText().toString();        String password = etPassword.getText().toString();        if(username.equals(""User"") &amp;&amp; password.equals(""user"")){            Intent i = new Intent();            startActivity(i);        } else {            lblResult.setText(""Login failed. Username and/or password doesn't match."");        }    }});    }    public void onClick(View v)    {            Intent intent = new Intent(this, UsersDbAdapter.class);            startActivity(intent);}}</code></pre>","604769","","508666","","2012-01-29 13:11:42","2012-01-29 13:11:42","Android user log in","<android><activity><login>","3","2","0","",""
"4934333","1","4934599","","2011-02-08 14:37:08","5","5051","<p>In my app I want measure the amount of time that the accelerometer is at rest. </p><p>For example, if I set a threshold of 0.4 m/s and the accelerometer speed is always below this than it means that the phone is at rest (threshold is to account for jitter in values). </p><p>I want to be able to count the amount of time that the phone is at rest and upon reaching a certain amount of time at rest, then react to that event.  </p><p>I already have the accelerometer working fine, I just need to count this time and I'm unfamiliar with how to do this, can anyone help me out here? Thanks in advance  </p><p><strong>Solution:</strong></p><pre><code>  start = System.currentTimeMillis();    if (vectorTotal &gt; 10.1 || vectorTotal &lt; 9.5){        timelimit = (System.currentTimeMillis()+ 10000);    }    else if (start &gt;= timelimit){        checkUser();        timelimit = (System.currentTimeMillis()+ 10000);    }</code></pre>","506929","","506929","","2011-02-15 16:19:58","2011-02-15 16:19:58","Android - How to count time over a long period","<android><time><timer><count><accelerometer>","4","0","","",""
"4934345","1","4935932","","2011-02-08 14:37:54","2","2320","<p>I have a web service that returns a single Class Object to me from a database query.. I know how to retrieve a property from the soapObject but, that property contains the object. So, for example if I use: </p><pre><code>SoapObject resultsRequestSOAP = (SoapObject) envelope.bodyIn;        Object obj = resultsRequestSOAP.getProperty(""return"");</code></pre><p>The objects entire value is: ""Contacts{ id=value, username=value, location=value, date=value}""</p><p>The problem is: I can't do anything with this unless I want to break it up as a string using ""split"". I need to know how to get this object out of the envelope or SoapObject with types and values that I can work with. Any help would be much appreciated. I can post the source code if needed, but I don't think it's necessary for such a small problem.</p><p>EDIT: When I ""watch"" the SoapObject the breakdown is: the object has a property named ""return"" then this property has a value named ""Contacts"". This value as 4 properties which are my values that I need. Hope this helps.</p><p>Thanks!</p>","600137","","","","","2011-02-08 16:59:31","Retreive Class Object from SOAP envelope?","<java><android><web-services><soap><ksoap2>","1","0","1","",""
"4934362","1","4934739","","2011-02-08 14:39:27","3","10259","<p>I've followed instructions on developer.android.com carefully:</p><ol><li>I've downloaded Eclipse Classic 3.6.1</li><li>I've opened Help->Install New Software and added ADT Plugin site</li></ol><p>But install still fails to match all dependences.I've tried to add additional repositories, but it didn't help.Are there some clues for installing v9.0.0 ADT plugin on Eclipse 3.6.1 Classic properly?</p><p>I've also tried this <a href=""http://stackoverflow.com/questions/4520290/correct-install-of-android-sdk-adt-with-eclipse-3-6-1"">Correct install of Android SDK, ADT with Eclipse 3.6.1</a> - didn't help.</p>","435680","","435680","","2011-02-08 15:00:20","2011-10-18 10:10:23","Installing Android ADT plugin v9.0.0 on Eclipse Classic 3.6.1 failed","<android><eclipse><eclipse-plugin><adt><eclipse-3.6>","2","2","","",""
"4934367","1","5306157","","2011-02-08 14:40:13","2","8660","<p>I have the following code:</p><pre><code>public void onSurfaceCreated(GL10 gl, EGLConfig config) {    gl.glClearColor(0.0f, 0.0f, 0.0f, 0.5f);    gl.glShadeModel(GL10.GL_SMOOTH);    gl.glClearDepthf(1.0f);    gl.glEnable(GL10.GL_DEPTH_TEST);    gl.glDepthFunc(GL10.GL_LEQUAL);    //gl.glHint(GL10.GL_PERSPECTIVE_CORRECTION_HINT, GL10.GL_NICEST);    gl.glHint(GL10.GL_POLYGON_SMOOTH_HINT, GL10.GL_NICEST);}public void onDrawFrame(GL10 gl) {    gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT);    gl.glLoadIdentity();</code></pre><p>But still the edges are severely jagged in Android Emulator. What is the solution?</p>","574122","","253583","","2011-02-08 14:49:50","2012-09-16 19:47:12","How to get rid of Jagged edges in Android OpenGL ES?","<android><opengl-es>","5","0","1","",""
"4934451","1","","","2011-02-08 14:47:24","0","251","<p>I have been asked by my employer to develop an mobile web application which will need to connect to database. I have experience working on C#.net,asp.net,sql server, AJAX and Jquery. I also have experience developing iphone apps using objective C. Can you suggest me a good and reliable mobile frame work which is based on above technologies. I would like the web application  to be compatible with many type of devices(iPhone,Android,BB at least….!!!!).</p><p>Thanks in advance…</p>","522505","","","","","2011-06-24 12:46:26","Mobile frame work suggestion","<iphone><android><mobile>","3","0","","",""
"4934543","1","4935000","","2011-02-08 14:54:27","1","330","<p>at the moment i'm trying to write an app which has a listview, and if i swipe especially left the listitem switches to another xml like it's used in the twitter app. </p><p>Especially i have a list of items only with some text and when i swipe left on a single item it changes to an other item (via a xml-file) especially with some buttons or anything else. </p><p>I hope anyone, has an idea how i can do this?</p><p>Thanks.</p>","325479","","","","","2011-02-08 17:33:52","How can i change the List XML via a swipe gesture","<java><android><xml><listview><swipe>","1","2","","",""
"4934618","1","","","2011-02-08 14:59:58","1","502","<p>Due to the fragmentation in camera equipment taking pictures seems to be not unproblematic.</p><p>Especially taking pictures in full quality often times lead to memory problems. I don't own a device with a 8MP Camera, so I can't reliably test. Is there a bulletproof way of taking pictures in Android?</p><p>I also wrote a filter (sepia) that works well with smaller images. For full size images there are again some memory issues. For this I'm creating an new bitmap with the same dimensions as the bitmap that needs to be filtered.</p><pre><code>Bitmap filteredBitmap = Bitmap.createBitmap(bitmap.getWidth(), bitmap.getHeight(), Bitmap.Config.ARGB_8888);</code></pre><p>It's clear that the app-memory isn't sufficient for two full size bitmaps. Is there another way I could create such a filter?</p>","458361","","","","","2011-02-08 17:49:19","Android pictures, filters and memory issues","<android><camera><image>","1","0","","",""
"4935035","1","4935106","","2011-02-08 15:35:58","3","1127","<p>Currently I am displaying a single frame animation in full screen on a SurfaceView using a Timer and <code>Canvas.onDraw()</code> / <code>canvas.drawBitmap</code>. Every frame has a resolution of 480x320 pixels and will be stretched at drawing time to the screen resolution. This works quiet well on faster devices, achieving frame rates up to 15 fps. The problem is that I have to load every frame (the animation consists of 30 single frames that loop) before the animation starts since the animation will be displayed with a high frame rate. Given the small heap space for Android processes of usually 16 MB most of my testing devices are not capable of preloading all 30 frames into the memory so I am thinking to use OpenGL instead. As I read OpenGLs memory will not be considered within the 16 MB process heap space, using OpenGL could be an alternative.</p><p>Now my question is: Will OpenGL be fast enough to change and display the textures (my single frames) fast enough to achieve high frame rates of 15fps? I read an article saying that swapping textures too often will slow down OpenGL significantly. Did you guys got any experience about that? I don't want to spend time on getting OpenGL to run if you can already say that swapping fullscreen textures with 15fps is not feasible.</p><p><strong>Edit:</strong></p><p>I am now using a technique that uses the default Android NDK without making use of OpenGL. See my <a href=""http://stackoverflow.com/questions/4724355/draw-high-res-animations-with-high-frame-rate-on-android#5101189"">answer here</a>.</p>","543875","","543875","","2011-03-25 13:32:22","2011-04-02 10:26:41","Is drawing a fullscreen single frame animation using OpenGL feasible on Android?","<android><animation><opengl-es>","2","3","","",""
"4935143","1","","","2011-02-08 15:46:38","2","390","<p>I'm new to Java &amp; Android development.  I'm trying to develop an app that has 2 tabs, 1 tab has a listview inside of it.  When you click on an item in the list, it takes you to another list.. and then you select another item, onto another list, ect.. until they reach the final page which I have setup as a non-selectable list.  My question is.. should I create a new activity every time the user clicks on an item in the list? Or is that something normally done with changing views? If done with views, doesn't that pretty much disable their use of going back with the back button? </p><p>In the other tab I have an area with a list I guess in which you can remove items off of the list.. Now would I create a new activity for this and put this tab activity on every activity of the lists? I guess this part is what got me confused.. if I hadn't had the other tab my current setup of creating a new activity as the user drills down the lists worked just fine. </p><p>This all might sounds a little confusing but let me know if you guys need further explanation..</p>","608371","","","","","2011-02-08 15:55:43","Should I use Activities or Views with tabs & lists?","<android>","1","1","","",""
"4935207","1","","","2011-02-08 15:52:38","3","1117","<p>I am attempting to create an in-app page that loads a YouTube channel inside a WebView.  I've gotten pretty much everything working except the actual playing of the video.  It's as if inside the WebView, when I tap on the video to play it, the message gets lost.  I do not see a call to shouldOverrideUrlLoading() as I would expect.</p><p>Code is:</p><pre><code>    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.webview);        webView = (WebView)findViewById(R.id.webview);        webView.getSettings().setJavaScriptEnabled(true);        webView.setWebViewClient(new webViewClient());        webView.loadUrl(getIntent().getStringExtra(""url""));    }       private class webViewClient extends WebViewClient {        public boolean shouldOverrideUrlLoading(WebView view, String url) {            if (url.equals(""about:blank"")) {                return true;            }            view.loadUrl(url);            return true;        }    }</code></pre><p>The URL that gets loaded is something like: <a href=""http://www.youtube.com/tinhtevideo"" rel=""nofollow"">http://www.youtube.com/tinhtevideo</a> for an example.  Am I missing something?  I would exepct that shouldOverridingUrlLoading() would be called with a URL like ""vnd.youtube:"" but I never see it.</p><p>Of course if I load the above URL in the Android browser, everything works fine.</p>","435210","","","","","2012-10-01 08:10:51","Android: How to load a YouTube Channel in a WebView?","<android><youtube><webview>","1","1","","",""
"4935248","1","4935313","","2011-02-08 15:56:08","1","697","<p>I have gone through many post but did not got any clear answer. I want to get address input from user and want to get lat long value corresponding to that address.</p>","569938","","","","","2011-02-08 16:02:27","How to get Lat & Long Value for an address input in android?","<android>","2","0","","",""
"4935388","1","4935972","","2011-02-08 16:08:52","14","18125","<p>I'm working on some SQLite code and would like to examine the database.  If I run the code on the emulator I am able to pull the file from data\data\myProject\databases using the DDMS file manager but if I run it on actual hardware the data\data folder is inaccessible.  Is there any way around this other than gaining root access to the phone?</p>","574740","","","","","2013-10-31 04:07:34","DDMS file explorer can't access data\data (HTC Desire HD)","<android><sqlite><ddms>","5","2","3","",""
"4935424","1","4935609","","2011-02-08 16:12:37","8","3612","<p>I see that this question has been asked before but the context around the questions are usually vague. I'm looking to build an Android multiplayer real-time game where there is global state that needs to be shared amongst all the clients. Thus, I have a tendency to believe that UDP might not suffice. TCP gives reliability but with the inherent overhead. However, since this is the first time I have tackled such a problem, I'm looking for some feedback from other peoples experiences.</p><p>Therefore, (generally) in the context of a multiplayer real-time game on an android smart phone, is the overhead associated with TCP acceptable enough such that the user experience is not affected to such an adverse extent? Also it's worth mentioning that the TCP connection would have to be a persistent connection. Also, would UDP coupled with some reliable custom developed mechanisms be a better approach? Any input would really help me out &amp; would be greatly appreciated. </p><p>many thanks indeed</p>","543220","","","","","2011-11-23 09:57:52","Android game UDP / TCP?","<android>","4","0","5","",""
"4935480","1","","","2011-02-08 16:18:32","4","2981","<p>My application has a generic main activity.Main activity reads its configuration from arrays.xml like follow</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;resources&gt;  &lt;string-array name=""home_buttons_text""&gt;    &lt;item&gt;@string/Title_1&lt;/item&gt;  &lt;/string-array&gt;  &lt;array name=""home_buttons_icon""&gt;    &lt;item&gt;@drawable/google&lt;/item&gt;  &lt;/array&gt;  &lt;string-array name=""home_buttons_url""&gt;    &lt;item&gt;http://www.google.com&lt;/item&gt;  &lt;/string-array&gt;  &lt;array name=""themes""&gt;    &lt;item&gt;@style/my_theme&lt;/item&gt;  &lt;/array&gt;&lt;/resources&gt;</code></pre><p>In this way to add a new icon, i just put new lines here.</p><p>So in ""themes"" I've theme's name. How i can load and apply theme referred by name?</p><p>For icons I've used</p><pre><code>TypedArray mItemsIcons = resources.obtainTypedArray(R.array.home_buttons_icon);TypedArray mThemes = resources.obtainTypedArray(R.array.themes);...mItemsIcons.getDrawable(position);...</code></pre><p>But I've no idea on how to get theme.I've tested </p><pre><code>int theme = mThemes.getResourceId(position);setTheme(theme);</code></pre><p>but it doesn't work.</p><p>Check here for details: <a href=""http://developer.android.com/guide/topics/resources/more-resources.html#TypedArray"" rel=""nofollow"">http://developer.android.com/guide/topics/resources/more-resources.html#TypedArray</a></p>","251434","","251434","","2011-02-08 16:32:58","2011-10-13 10:24:34","Dynamically change activity theme","<android><coding-style><load><themes>","1","0","1","",""
"4935606","1","4935767","","2011-02-08 16:31:53","2","533","<p>I have a database with five tables in an Android application. I have been surfing around looking for a way to put conditions in the query (WHERE, &amp;&amp;, OR). My queries are the form:</p><pre><code>public Cursor getAlternative(int questionid) {            Cursor cursor =  mDb.query(DBTABLE_ALTERNATIVE, new String[] { KEY_ALT }, KEY_QID + ""="" + questionid, null, null, null, null, null);                            return cursor;        }</code></pre><p>But I find that many people write their queries with regular sql, for ex:</p><pre><code>Cursor c = myDB.query(""SELECT FirstName,Age"" +                     "" FROM "" + MY_DATABASE_TABLE                     + "" WHERE Age &gt; 10 LIMIT 7;"",                     null);</code></pre><p>What is the most efficient way? To me it seems easier form regular sql-statements, but after reading the tutorials on the Android Dev site I started forming the qeries like above. </p><p>Question 2. If I use the first way, how can I use two conditions? Say I have two parameters, questionid and categoryid, how do I put the next KEY_CID + ""="" + categoryid in there?I have tried with &amp;&amp; and AND but none seem to work. THanks. </p>","455479","","","","","2011-02-08 17:10:19","What's the best way to form sql-queries in Android?","<android><database><sqlite>","2","1","2","",""
"4935683","1","4935755","","2011-02-08 16:38:33","1","1912","<p>Greetings,</p><p>I'm trying to upload an image on my Android device.</p><p>I have the following code which causes the image picker to come up and examine the SD card (which is what I want).</p><pre><code>Intent photoPickerIntent = new Intent(Intent.ACTION_GET_CONTENT);            photoPickerIntent.setType(""image/*"");            startActivityForResult(photoPickerIntent, 1);</code></pre><p>But what do I do next? Is there some class I can override to handle the image that was clicked on? I've tried googling but can't find anything. I hope someone can point me in the right direction.</p><hr><p>Tried taking willytate's advice, but now I keep getting the following error:</p><pre><code>02-08 16:58:01.574: ERROR/AndroidRuntime(16962): FATAL EXCEPTION: WebViewCoreThread02-08 16:58:01.574: ERROR/AndroidRuntime(16962): java.lang.NullPointerException02-08 16:58:01.574: ERROR/AndroidRuntime(16962):     at android.app.Activity.startActivityForResult(Activity.java:2890)02-08 16:58:01.574: ERROR/AndroidRuntime(16962):     at prestocab.driver.Main$Uploader.upload(Main.java:172)02-08 16:58:01.574: ERROR/AndroidRuntime(16962):     at android.webkit.WebViewCore.nativeTouchUp(Native Method)02-08 16:58:01.574: ERROR/AndroidRuntime(16962):     at android.webkit.WebViewCore.access$3300(WebViewCore.java:66)02-08 16:58:01.574: ERROR/AndroidRuntime(16962):     at android.webkit.WebViewCore$EventHub$1.handleMessage(WebViewCore.java:1226)02-08 16:58:01.574: ERROR/AndroidRuntime(16962):     at android.os.Handler.dispatchMessage(Handler.java:99)02-08 16:58:01.574: ERROR/AndroidRuntime(16962):     at android.os.Looper.loop(Looper.java:143)02-08 16:58:01.574: ERROR/AndroidRuntime(16962):     at android.webkit.WebViewCore$WebCoreThread.run(WebViewCore.java:642)02-08 16:58:01.574: ERROR/AndroidRuntime(16962):     at java.lang.Thread.run(Thread.java:1102)</code></pre><p>Here is my class:</p><pre><code>public class Uploader extends Activity{   //uploader        @Override        protected void onCreate(Bundle savedInstanceState){            super.onCreate(savedInstanceState);        }        public void upload(){            Intent photoPickerIntent = new Intent(Intent.ACTION_GET_CONTENT);            photoPickerIntent.setType(""image/*"");            startActivityForResult(photoPickerIntent,0);        }        @Override        public void onActivityResult(int requestCode, int resultCode, Intent data) {            super.onActivityResult(requestCode, resultCode, data);            if (resultCode == RESULT_OK) {                Uri selectedImageUri = data.getData();                String selectedImagePath = data.getDataString();                Toast.makeText(Main.this, selectedImagePath, 2000);            }        }    }</code></pre><p>Many thanks in advance,</p>","395974","","395974","","2011-02-08 17:01:40","2012-02-20 17:29:27","Android upload image","<android><image><upload>","1","3","","",""
"4935689","1","","","2011-02-08 16:39:10","1","745","<p>if I run following in Honycomb preview SDK I run into signal 11</p><pre><code>package com.android.samples;import android.app.Activity;import android.os.Bundle;import android.view.Window;import android.webkit.WebChromeClient;import android.webkit.WebView;public class MyWebView extends Activity {WebView mWebView;         /** Called when the activity is first created. */   @Override   public void onCreate(Bundle savedInstanceState)     {           super.onCreate(savedInstanceState);                   // Adds Progrss bar Support           this.getWindow().requestFeature(Window.FEATURE_PROGRESS);           setContentView(R.layout.main );                   // Makes Progress bar Visible           getWindow().setFeatureInt( Window.FEATURE_PROGRESS, Window.PROGRESS_VISIBILITY_ON);               // Get Web view            mWebView = (WebView) findViewById( R.id.MyWebview );     //This is the id you gave                                                    //to the WebView in the main.xml            mWebView.getSettings().setJavaScriptEnabled(true);               //mWebView.getSettings().setSupportZoom(true);           //Zoom Control on web (You don't need this                                                    //if ROM supports Multi-Touch                  mWebView.getSettings().setBuiltInZoomControls(true); //Enable Multitouch if supported by ROM                    //Load URL            mWebView.loadUrl(""http://www.google.com"");    // Sets the Chrome Client, and defines the onProgressChanged            // This makes the Progress bar be updated.            final Activity MyActivity = this;            mWebView.setWebChromeClient(new WebChromeClient() {                 public void onProgressChanged(WebView view, int progress)            {                      //Make the bar disappear after URL is loaded, and changes string to Loading...                      MyActivity.setTitle(""Loading..."");                      MyActivity.setProgress(progress * 100);             //Make the bar disappear after URL is loaded                        // Return the app name after finish loading                         if(progress == 100)                                MyActivity.setTitle(R.string.app_name);                       }                 });                               } //End of Method onCreate} </code></pre><p>And this is my main.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:orientation=""vertical""                android:layout_width=""fill_parent""                android:layout_height=""fill_parent"" &gt;     &lt;WebView  android:id=""@+id/MyWebview""                android:layout_width=""fill_parent""                android:layout_height=""fill_parent"" /&gt; &lt;/LinearLayout&gt; </code></pre><p>If I switch to say 2.2 or 2.3 emulator this is running fine but running in 3.0 emulator gives something like this in logcat</p><pre><code>02-07 20:53:11.740: INFO/DEBUG(1399): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***02-07 20:53:11.740: INFO/DEBUG(1399): Build fingerprint: 'generic/sdk/generic:Honeycomb/HPI20B/eng.xav.20110125.162619:eng/test-keys'02-07 20:53:11.768: INFO/DEBUG(1399): pid: 1429, tid: 1451  &gt;&gt;&gt; com.android.samples &lt;&lt;&lt;02-07 20:53:11.768: INFO/DEBUG(1399): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr caccecb802-07 20:53:11.768: INFO/DEBUG(1399):  r0 caa137c0  r1 000000c4  r2 00000008  r3 002bb4f8</code></pre><p>So far I I could not find anything how to resolve this.Any idea what I should do to let this work?</p>","596088","","","","","2011-02-08 17:07:57","WebView in Honycomb getting Signal 11","<android><webview><emulator>","1","0","","",""
"4935691","1","","","2011-02-08 16:39:12","4","3668","<p>I'm developing an app and I need some way to compare 2 voices if they' match or not, I know that Voice Recognizer is a way to do that but since (i think) it needs to translate the voice into string first, it won't be so suitable for other language apart from the lang supported by the speech recognizer....any idea? Just like old-day phone used to do, the voice tag where it just compare the voice input with the voice it recorded earlier during the setup </p>","566271","","","","","2011-11-10 11:33:19","Compare voice wav in android or voice tag ( voice commands ) API","<android><wav><speech-recognition><voice-recognition><wave>","2","1","2","",""
"4935991","1","4936073","","2011-02-08 17:05:27","1","1166","<p>I'm a flash developer with no previous Java experience, just starting to learn android development.  I'm trying to make a simple kid's flash cards app, consisting of a load of images of animals, and a load of sounds that they make.</p><p>Currently I have the images in a gallery view, storing them in an array.  I also have an array of the sounds.  So each image and the corresponding sound are in the same position in the array, so it's easy to play the right sound for the right image.</p><p>Now I want to shuffle the cards so that they appear in a different order each time the app is started up.  I managed to shuffle the arrays into a random order, but kept the images and sounds in the same positions in each array but I can feel this getting messy and I'm sure this isn't the best way to go about this problem.</p><p>If this were a flash movie, I'd use objects to link the images and sounds and stick the objects in an array.  Can anyone help me with some code which would achieve the same thing for android?  Bear in mind I'm a complete beginner with Java and have gotten this far with tutorials and basic concepts being the same as AS3.</p>","608478","","244296","","2011-02-10 03:22:09","2013-04-22 10:49:53","Working with objects in android","<android><object><random><shuffle><android-gallery>","2","1","1","",""
"4936022","1","4937143","","2011-02-08 17:07:40","1","1617","<p>I'm looking into creating a library for myself that handles common internet-related functions. So far I have http GET and POST functions, and now I'm looking into developing a one-size-fits-all JSON parsing function that will convert JSON it receives as a string into a multi-dimentional associative array that can be searched through.</p><p>I looked through stackoverflow and found <a href=""http://stackoverflow.com/questions/3341111/sample-code-to-parse-data-through-json-in-android"">this link</a> which looks very helpful, other than that the code is designed to be very specific. Is there a nice handy function in org.json.* that can let you turn your JSON string into a multi-dimentional associative array that I can return and manipulate outside the class?</p><p>Thanks,John.</p><p>Ps. I should mention that I have very little prior experience with java - I'm a PHP developer at heart.</p>","315827","","315827","","2011-02-08 17:18:00","2011-02-08 19:01:58","JSON to multidimentional array in android/java","<java><android><arrays><json><multidimensional-array>","1","3","","",""
"4936085","1","4937297","","2011-02-08 17:14:10","1","938","<p>I would like to know if it is possible to make a hot spot or image mapping in Android SDK. almost like you would in adobe flash or dream weaver. this information would be really helpful seeing as the buttons I got keep moving into different spots of the phone and on every device I try it on or in landscape mode all the buttons and texts is messed up. any help would be awesome.Thanks-Christian</p>","424421","","246246","","2013-11-15 18:26:38","2013-11-15 18:26:38","android sdk image hot spot?","<android><imagemap>","1","5","","",""
"4936091","1","","","2011-02-08 17:14:30","4","199","<p>I have the following working code:</p><pre><code>startActivity(    new Intent(Intent.ACTION_VIEW,        Uri.parse(""http://market.android.com/details?id=me.cexi.accuapp"")));</code></pre><p>When the user clicks on the Action Button, they get the Complete action using dialog with the following:</p><pre><code>BrowserMarket</code></pre><p>How do I limit the option to just the market?</p>","608500","","418183","","2011-02-08 17:19:39","2012-01-04 08:46:40","Android Market Link shows two options","<android><hyperlink><google-play>","1","1","","",""
"4936112","1","","","2011-02-08 17:17:01","0","551","<p>i have made a android application that uses a database. I have run the application on the emulator and it runs fine. Now i want to test the application on an external device.Earlier when i was not using the database functionality in the application, it was running fine on the external device.Now that i am running the same thing with a database, a security exception is being thrown.I am not able to push my database in the android device.How do i push my sqlite database into my android device?any help is appreciated.thank you in advance.</p>","590849","","135152","","2011-07-05 17:47:39","2011-07-05 17:47:39","test database application in android on external device?","<android><sqlite><android-emulator>","1","1","","",""
"4936351","1","4936420","","2011-02-08 17:38:58","0","391","<p>How can I declare in <code>Manifest</code>?</p>","605358","","750613","","2012-07-13 09:16:44","2012-11-25 01:02:02","If I have more than 1 package","<android><packages>","3","0","1","",""
"4936359","1","4936444","","2011-02-08 17:39:54","1","151","<p>I am using <code>twitter4j</code> in my android app. I have done so many research, but unable to signout programaticaly the account by this api.Rest of the things doing well. But how to signout, so that session will clear.Please help me.</p>","489762","","1471203","","2013-02-19 13:43:55","2013-02-19 13:43:55","twitter in Android","<android><android-twitter>","1","0","","",""
"4936531","1","4936604","","2011-02-08 17:57:55","2","2380","<p>I'm studying Android process management and I'm wondering whether apps using multiple processes (not threads) share a Dalvik instance or there exists a Dalvik instance per process, even for the same app.</p><p>Could you point me to some official source (<strong>doc, talk, paper</strong> etc.)?</p><p>Thanks</p>","247095","","750613","","2012-07-13 09:16:22","2012-09-20 04:25:24","Do apps using multiple processes share a Dalvik instance?","<android><process><dalvik>","1","0","1","",""
"4936553","1","4936732","","2011-02-08 18:00:11","15","17180","<p>I want to have a button at the bottom of the listview.</p><p>If I use relativeLayout/FrameLayout, it aligns but listView goes down to very botton.</p><p>(Behind the button at the bottom)</p><p><img src=""http://i.stack.imgur.com/Qe8Gp.png"" alt=""enter image description here""></p><p>FrameLayout:</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;ListView        android:id=""@+id/listview""        android:layout_width=""match_parent""        android:layout_height=""wrap_content""        /&gt;    &lt;FrameLayout        android:layout_width=""wrap_content""        android:layout_height=""match_parent""        android:layout_alignParentBottom=""true""&gt;        &lt;Button            android:id=""@+id/btnButton""            android:text=""Hello""            android:layout_width=""match_parent""            android:layout_height=""wrap_content""            android:layout_gravity=""bottom"" /&gt;    &lt;/FrameLayout&gt;&lt;/FrameLayout&gt;</code></pre><p>RelativeLayout:</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;ListView        android:id=""@+id/listview""        android:layout_width=""match_parent""        android:layout_height=""match_parent""        /&gt;    &lt;RelativeLayout        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:layout_alignParentBottom=""true""&gt;        &lt;Button            android:id=""@+id/btnButton""            android:text=""Hello""            android:layout_width=""match_parent""            android:layout_height=""wrap_content""            android:layout_gravity=""bottom"" /&gt;    &lt;/RelativeLayout&gt;&lt;/RelativeLayout&gt;</code></pre><p>Above two codes only work like the first image. What I want is second image.</p><p>Can anybody help?</p><p>Thank you.</p>","432056","","","","","2014-03-25 19:10:44","Android: How can you align a button at the bottom and listview above?","<android><listview><layout><alignment>","6","0","8","",""
"4936581","1","4936823","","2011-02-08 18:02:34","18","6969","<p>I'm a bit confused about the difference between a task and a process in Android.</p><p>If I understand correctly a task is just a stack of activities. From what I read so far I <em>think</em> a task could look like this:</p><pre><code>| Activity A running in Process P1 || Activity B running in Process P2 || Activity C running in Process P3 |</code></pre><p>So basically activities from different processes can be contained in the same stack. Am I correct?</p><p><strong>Another question</strong>: What is the real meaning of ""application context""? The process or the task?</p><p>And <strong>final question</strong>: The application class (which is basically a singleton) represents the process or the task?</p>","62811","","750613","","2012-07-13 09:14:58","2014-01-21 09:56:36","Difference between task and process in Android","<android>","3","0","9","",""
"4936586","1","5358818","","2011-02-08 18:03:07","4","5187","<p>I cannot find reference to this. All Android developer docs are focused on OpenGL ES 1.0. How can I start using OpenGL 2.0 in Android SDK using API level 8? If level 8 is not supported then what level I need to use?</p><p>What percentage of android phones that are out there in the market currently support OpenGL ES 2.0 ?</p>","574122","","44729","","2012-06-04 14:42:59","2012-06-04 14:42:59","How to use OpenGL ES 2.0 in Android SDK ( not NDK)?","<android><opengl-es>","3","0","1","",""
"4936712","1","4936748","","2011-02-08 18:15:25","25","6463","<p>I understand that Content Providers are made to allow publicly sharing data between applications. However, I'm wondering if anyone has thoughts about making a Content Provider to use just within your own app. Would there be any advantages to doing this? Any disadvantages? </p><p>In the past I've just implemented the SQliteOpenHelper to access data from my database, but I'm considering creating a Content Provider. I feel like the URI approach to requesting data is clear and concise. On the other hand, will using a Content Provider just for my application be redundant ( since within it I will have a SQliteOpenHelper class ) and more work than I need?</p>","375490","","1174526","","2012-03-20 01:58:32","2014-02-14 11:24:36","When to use a Content Provider","<android><android-contentprovider>","5","1","5","",""
"4936751","1","","","2011-02-08 18:20:28","1","278","<p>I'm using a ResourceCursorAdapter to display a list of downloads froma ContentProvider that track's my application's downloads -- modeledafter Android's DownloadProvider.</p><p>The problem is that when a download is actively running it frequentlycalls bind view--every few seconds--to update a download progress bar,with a view object that is NOT currently associated with a givenitem/cursor position.  Thus, bind view is constantly recycling and bindingview objects to different item/cursor positions (call it ""flip-flopping"").  Note, I only have one view type.</p><p>This is especially a problem if the user attempts to push a button onone of the items while it's being bound to a different view object andcursor position, which results in an event being fired for the wrongdata.</p><p>Does anyone have advice on how to minimize unnecessary view recycling, or not have the view objects flip-flop between positions?</p><p>This view object flip-flopping appears to only occur for the bottom and top list items (of the three on the screen), while the middle item/cursor remains tied to a single view object.</p><p>Thanks,-Ivan </p>","608578","","","","","2011-02-08 18:20:28","Awkward CursorAdaptor view recycling","<android>","0","0","","",""
"4936758","1","","","2011-02-08 18:21:05","5","4330","<p>When I launch my application on my phone, I get a lot of the following error from the log :</p><pre><code>E/dalvikvm( 2052): No free temp registersE/dalvikvm( 2052): Jit: aborting trace compilation, reverting to interpreterE/dalvikvm( 2052): No free temp registersE/dalvikvm( 2052): Jit: aborting trace compilation, reverting to interpreter</code></pre><p>what's happened ?</p>","164460","","1321640","","2013-02-15 05:14:14","2013-02-15 05:14:14","Android exception in dalvikvm","<android><exception><dalvik>","2","2","","",""
"4936793","1","4936824","","2011-02-08 18:24:18","0","697","<p>HY!!</p><p>I have a webservice that returns a json object with a decodes image</p><p>Link to JSON:</p><p><a href=""http://surfkid.redio.de/getChannelImage?session_id=ac9892e83e10994b7de728e44450808e&amp;channel_id=1"" rel=""nofollow"">JSON OBJECT</a></p><p>My Java Code:</p><pre><code>String im = json.getChannelImage();                        if (!im.equals(null))                        {                            byte[] decodedString = Base64Coder.decode(im);                            Bitmap bitmap = BitmapFactory.decodeByteArray(decodedString, 0, decodedString.length);                             iv.setImageBitmap(bitmap);                    }</code></pre><p>Error:</p><pre><code>ERROR/Error(285): Length of Base64 encoded input string is not a multiple of 4.</code></pre><p>I use a libary called Base64Coder, because i want to have the api level 3</p><p>Please help</p>","547995","","","","","2011-02-08 18:27:37","Problem to parsing pictures from JSON","<java><android><json><base64>","1","0","","",""
"4936962","1","4936992","","2011-02-08 18:41:55","0","826","<p>I'm looking for a <strong>complete</strong> example of an activity which uses async task and implements a way to refer to a running async task after the activity is paused (onPause).I searched the web for an example which I could use but didn't find a complete one, only code fragments.</p><p>I'm using async task to ping servers in my app, but a way to save a reference to running async tasks is missing so after onPause, the running tasks get lost.</p><p>thanks in advance :-)</p>","539701","","","","","2011-02-08 18:45:39","Restore running Async Task in Activity","<java><android><android-asynctask>","1","2","","",""
"4936983","1","","","2011-02-08 18:44:54","2","2702","<p>As enums aren't primitive types, what's the most effective way to pass an enum through an aidl interface in Android?  Is there a way to convert the enum to an ordinal first?</p>","608626","","","","","2012-05-22 19:52:27","Passing enums through aidl interfaces","<java><android><enums><primitive><aidl>","2","3","","",""
"4937075","1","5568400","","2011-02-08 18:54:21","21","10308","<p>I have an UI where I need a <code>Fragment</code> to be displayed (with a view) in landscape mode but not in portrait mode. In portrait mode it should still be available but will display its result using <code>ListPopupWindow</code> instead.</p><p>I figured I could handle this by using the <code>&lt;fragment /&gt;</code> tag for the landscape layout while creating the fragment programmatically if it wasn't started (in the case when we are in portrait).</p><p>This works fine as long as you start out in landscape, if you start in portrait where the fragment is created programmatically your application will crash when you rotate the emulator when it tries to attach the fragment to your layout:</p><blockquote>  <p>java.lang.IllegalStateException:  Fragment  did not create a view.  at  android.app.Activity.onCreateView(Activity.java:4095)</p></blockquote><p>The docs for <code>Fragment.isInLayout()</code> seems to hint that it should be able to handle it this way:</p><blockquote>  <p>Return true if the layout is included  as part of an activity view hierarchy  via the  tag. This will  always be true when fragments are  created through the  tag,  except in the case where an old  fragment is restored from a previous  state and it does not appear in the  layout of the current state.</p></blockquote><p>So the question is how to do this correctly or if there is something I'm missing?</p><p><strong>UPDATE:</strong></p><p>Seems like <code>isInLayout()</code> isn't behaving as it should currently as well. It returns false if you have added a <code>Fragment</code> to a container manually. </p><p>Also, if you add a <code>Fragment</code> manually to a container and then rotate (the device) to a layout that does not contain that layout it will crash:</p><blockquote>  <p>Caused by:  java.lang.IllegalArgumentException: No  view found for id 0x7f060011 for  fragment SearchFragment{4042f868 #2  id=0x7f060011 SearchFragment} at  android.app.FragmentManagerImpl.moveToState(FragmentManager.java:722)</p></blockquote>","253583","","750987","","2011-05-29 06:46:21","2012-01-04 17:46:32","Fragment without a view crashes on configuration change","<java><android><android-fragments><android-3.0-honeycomb>","2","5","5","",""
"4937094","1","4937157","","2011-02-08 18:56:55","2","944","<p>In android, is it possible to register an inner class of a class as Boardcast receiver?</p><pre><code>public class A extends AnotherClass {   public class B extends BroadcasetReceiver {   }}</code></pre><p>how can I register B of A to listen for an intent?</p><p>Thank you.</p>","286802","","546999","","2011-02-08 18:59:08","2011-02-08 19:03:44","Is it possible to register an inner class of a class as Boardcast receiver","<android>","2","3","","",""
"4937147","1","","","2011-02-08 19:02:31","6","3250","<p>I would like to know whether there is an android intent to check for change in the system date.I want to an intent that is  broadcasted  when time changes from 23:59 to 00:00 (the next date).I searched the net and found about android.intent.action.DATE_CHANGED but it seems like this intent is broadcast only if the date is changed manually.</p><p>If there is no intent like this let me know if an alternative exists.One alternative i can think of is using an AlarmManger and broadcast a pending intent.Is there anything simpler than this?</p>","598714","","11296","","2011-02-08 19:41:44","2011-02-08 19:41:44","broadcast Intent when date changes?","<android>","2","0","","",""
"4937149","1","4937320","","2011-02-08 19:02:37","0","347","<p>I need to know how to jumble a word entered into EditText. </p><p>The jumbled word will show in another TextView in the same interface. </p><p>I have tried to do this but I get a force close error. This is what I have tried within the button:</p><pre><code>wordE = (EditText)findViewById(R.id.entry); jumble = (TextView) findViewById(R.id.jumble);Button link5Btn = (Button)findViewById( R.id.selected );link5Btn.setOnClickListener( new View.OnClickListener(){public void onClick(View v)    {jumbleMe(al);}</code></pre><p>Which calls the method:</p><pre><code>private void jumbleMe( String word ){al = wordE.getText().toString(); ArrayList&lt;Character&gt; al = new ArrayList&lt;Character&gt;();for (int i = 0; i &lt; wordE.length(); i++) {    al.add(word.charAt(i));}Collections.shuffle(al);jumble.setText( al.toString() );}</code></pre><p>I would appreciate any help on this. Thanks</p>","608658","","546999","","2011-02-08 19:04:17","2011-02-08 19:22:03","How to jumble a word from EditText and apply the jumbled word into a TextView","<android>","1","3","","",""
"4937191","1","4937304","","2011-02-08 19:07:58","1","780","<p>I'd like to create an app that is the same as the default camera app only with one small modification (i.e. video disabled or extra functionality added). How do I do it?</p><p>Do I just get the source code of the camera app and modify it or is there a way to extend core components of the Android system?</p>","338825","","338825","","2011-02-08 19:14:13","2011-02-08 19:19:57","Extend android app","<android><components>","2","0","1","",""
"4937253","1","4939064","","2011-02-08 19:13:20","0","480","<p>In my current project I've extended BaseAdapter (using the tutorial EfficientAdapter as a guide) to handle a couple of different custom cell types, each with its own custom view. Some of those cell types start asynchronous operations (playing and recording media, for example). I'd like to pause them when the activity they belong to goes away (which several other cell types can cause to happen). Is there any way to notify a particular view that the ListActivity to which it ""belongs"" is going away?</p><p>My first thought was to iterate over the views in the <code>onPause()</code> method of the activity:</p><pre><code>@Overridepublic void onPause() {    super.onPause();    for (int i = 0; i &lt; adapter.getCount(); i++) {        CustomCellHolder holder = adapter./* Some magic goes here */;        holder.handlePause();    }}</code></pre><p>but I can't figure out how to iterate over the views owned by the list adapter. Is there a way to do that, or am I barking up the wrong tree?</p><p>If it's relevant, my getView method looks something like this:</p><pre><code>public View getView(final int position, View convertView, ViewGroup parent) {    CustomCellHolder holder;    if (convertView == null) {        /* Create and cache a new view */        holder = newHolderForItem(someArrayListOfObjects.get(position));        holder.setItem(feature.attributes.get(position));        holder.setActivity(MyListActivity.this);        convertView = holder.getView();    } else {        /* Load a cached view */        holder = (CustomCellHolder) convertView.getTag();        holder.setItem(feature.attributes.get(position));        holder.setActivity(MyListActivity.this);    }    holder.doSomeStuff();    return convertView;}</code></pre>","118815","","118815","","2011-02-08 21:31:49","2011-02-08 22:06:53","How do I notify views owned by a custom adapter that they're going away?","<android><listview>","2","4","","",""
"4937322","1","","","2011-02-08 19:22:09","12","5001","<p>I'm trying to do kernel debugging for my Nexus One, and have been following instructions from <a href=""http://bootloader.wikidot.com/android:kgdb"" rel=""nofollow"">http://bootloader.wikidot.com/android:kgdb</a>. I was wondering if someone has actually got this to work? And has anyone done a more up to date solution for using KGDB to debug the kernel?</p>","548852","","1031417","","2012-12-24 22:26:44","2012-12-24 22:26:44","Android: Kernel Debugging with KGDB","<android><debugging><kernel><android-source><kgdb>","1","2","6","",""
"4937348","1","","","2011-02-08 19:24:28","1","2340","<p>hey people,I have a text file which I need to append in my app.  Now I could rewrite the entire file incorporating the changes to a specific line but I'm hoping there is a more efficient solution.I know the line number I need to append however I'm unsure how to get to that line, preferably without looping through all of the others unless that is the only way.  This is what I have so far which recreates the entire file:`     </p><pre><code>        try {            FileOutputStream fOut = openFileOutput(""tasklist.txt"", MODE_APPEND);            BufferedOutputStream buf = new BufferedOutputStream(fOut);            OutputStreamWriter osw = new OutputStreamWriter(buf);            BufferedWriter writer = new BufferedWriter(osw);            for(int count = 0; count &lt; str.size(); count++)            {                writer.write(str[count]);                writer.write(""\r\n"");            }            writer.flush();            writer.close();        } catch (Exception e) {            e.printStackTrace();            Toast.makeText(this, ""Error saving txt file"", Toast.LENGTH_SHORT);        }`</code></pre><p>Hopefully someone knows of a more efficient solution.  Thanks.</p>","597334","","","","","2011-02-08 20:40:39","Android - Append Specfic Line In A Text File","<java><android>","1","0","0","",""
"4937392","1","4940692","","2011-02-08 19:28:37","0","285","<p>I have been trying to use a Tileset in a game I am making on an Android phone, however the image always comes out wrong, when not used on the exactly right density/size phone.I suspect the compile process, or the folder used in res in eclipse, is effecting it somehow, does anyne have any experience in this? (Edited because missed part out last time)</p>","451484","","451484","","2011-02-09 01:49:09","2011-02-09 02:20:13","Tilesets in Android","<android><tiles>","1","0","","",""
"4937570","1","4937688","","2011-02-08 19:46:04","1","914","<p>I have custom <code>AsyncTask</code> (ListDownloadTask) that download data and updates UI. I want to make it forever while activity opened. So after AsyncTask did the work it must be scheduled. There are delays between attempts. </p><p>I tried to use timer but the problem is <code>new ListDownloadTask().execute();</code> must be invoked from UI thread. </p><p>Now i have timer that generates message for <code>Handler</code>. That seems ugly to me. What is best practice?</p><pre><code>@Overridepublic void onCreate(Bundle savedInstanceState) {// ...    new ListDownloadTask().execute();}private static final long DOWNLOAD_UPDATES_DELAY = 5 * 1000;private final Timer mUpdatesDownloaderTimer = new Timer(true);Handler mDownloadTrigger = new Handler(new Handler.Callback() {    public boolean handleMessage(Message message) {        new ListDownloadTask().execute();        return true;    }});private void scheduleUpdatesDownload() {    mUpdatesDownloaderTimer.schedule(new TimerTask() {        @Override        public void run() {            mDownloadTrigger.sendEmptyMessage(0);        }    }, DOWNLOAD_UPDATES_DELAY);}private class ListDownloadTask extends AsyncTask&lt;Long, String, Integer&gt; {    @Override    protected void onPostExecute(Integer result) {        //...        scheduleUpdatesDownload();    }</code></pre>","341490","","","","","2011-02-08 20:53:48","Looping AsyncTask","<android><multithreading><thread-safety><android-asynctask>","3","1","","",""
"4937791","1","","","2011-02-08 20:07:05","0","2845","<p>I am having extreme difficulty in running this quiz application. The application uses a db file which is created in SQLite browser. I have a Database helper class from which I have added the path to the db.</p><p>I have also added the db file within the assets folder in my application. When I run the application I receive an unexpectedly error. </p><p>I can open the database within DDMS view and see the contents within data/data/mypackage/</p><p>When I debug this I receive an error message in Logcat and an activity thread opens which says source not found, Edit source look up Path:</p><p>I tried adding an image of log cat but I cannot do so yet. </p><p>I receive the following error:</p><p><strong>sqlite returned: error code = 14, msg = cannot open file at source 25467sqlite3_open_v2(""/data/data/com.quiz.easy/database/quizzed"", &amp;handle, 1, NULL) failed</strong></p><p>I have tried changing the paths within the Database helper class and the path changes but I'm not sure what is wrong.</p><p>The path within the database helper class:</p><pre><code>public class DataBaseHelper extends SQLiteOpenHelper{//The Android's default system path of your application database.private static String DB_PATH = ""/data/data/com.quiz.easy/databases/"";private static String DB_NAME = ""quizzed"";private static String Table_name=""Quiz"";</code></pre><p>I can upload all the source code if needed. I would appreciate any help with this as I am going in circles and have been trying to get this to work for a whole week. </p><p>Please help me. Thanks</p>","608658","","","","","2012-02-09 13:33:43","Sqlite problem within eclipse, not recognizing db file","<android>","2","7","","",""
"4937814","1","4937845","","2011-02-08 20:08:29","2","10647","<p>I really want to get into android programming and I've already read two books and a lot of the stuff that is going on here. Thanks a lot. This site has already become my very favorite resource. Anyhow, does somebody have any additional tips on how to accelerate the time to take off? Thanks a lot!</p>","608728","","892493","","2012-04-29 19:38:15","2012-04-29 19:38:15","What's the best way to learn android for someone with no previous programming experience?","<android>","6","4","0","2011-11-18 18:29:25",""
"4937833","1","","","2011-02-08 20:10:17","0","118","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/4936924/i-have-errornull-and-logcat-like-this"">I have error:null and logcat like this</a>  </p></blockquote><p><a href=""http://plixi.com/p/75764929"" rel=""nofollow"">This is my logcat</a></p><p>My app is about translate and when I press the button to translate it doesn't work and show logcat like the hi-light in that picture</p><p>What does the logcat mean?</p><p>What should I do?</p>","605358","","","","","2011-02-08 20:10:17","I have error:null and logcat like this","<android><google-app-engine><google-translate>","0","3","","2011-02-09 13:22:12",""
"4937934","1","4946993","","2011-02-08 20:18:27","1","4449","<p>I am using some code that will copy an existing SQLite database from my assets folder into my /data/data/package folder.I have written the code and tested it on the android emulator, and it works fine. If I try and install it on my device (HTC Desire)I get 'SQLiteException:unable to open database file'</p><p>I have been stuck on this for 3 days now and cannot figure out what is going wrong.I don't know if the database cannot be opened because it is not created, or if I am lacking some database permissions in the manifest file.This is my DataBaseHelper code:</p><pre><code>import java.io.FileOutputStream;import java.io.IOException;import java.io.InputStream;import java.io.OutputStream;import android.content.Context;import android.database.Cursor;import android.database.SQLException;import android.database.sqlite.SQLiteDatabase;import android.database.sqlite.SQLiteOpenHelper;import android.os.Environment;import android.util.Log;public class DataBaseHelper extends SQLiteOpenHelper{    //private static String DB_PATH = ""/data/data/com.drager/databases/"";    private static String DB_PATH = Environment.getDataDirectory()+""/data/com.drager/databases/"";    final static String DB_NAME = ""myDBName"";    private SQLiteDatabase myDataBase=null;    private final Context myContext;    private DataBaseHelper myDbHelper;    private static String TAG =""MyActivity"";    public DataBaseHelper(Context context){        super(context, DB_NAME, null, 1);        this.myContext = context;    }    public DataBaseHelper createDataBase() throws IOException{        boolean dbExist =checkDataBase();        //SQLiteDatabase db_read =null;        Log.i(TAG,""############value of dbExist""+dbExist+""##########"");        //if (dbExist){            //db must exist        //}        //else{        //myDbHelper = new DataBaseHelper(myContext);        //myDataBase = myDbHelper.getReadableDatabase();        //myDataBase.close();        //this.getReadableDatabase();            //db_read.close();        //    try {                copyDataBase();        //  } catch (IOException e) {        //      throw new Error(""error copying database"");        //  }    //  }        return this;    }    public Cursor executeStatement(){        Log.i(TAG,""in execute statement"");        Cursor cursor=null;        cursor=myDataBase.rawQuery(""SELECT _ID, title, value ""+                    ""FROM constants ORDER BY title"",                     null);        return cursor;    }    public String getTextViewItem(){        Cursor cursor=null;        String str="""";        //store query results in cursor        cursor=myDataBase.rawQuery(""SELECT description FROM product_details"" ,                     null);        cursor.moveToNext();        //cast cursor content from the index of 'description Column as a string        str =cursor.getString(cursor.getColumnIndex(""description""));        return str;    }    public void copyDataBase() throws IOException{        // open db as input stream        InputStream myInput = myContext.getAssets().open(DB_NAME);        //path to newly created db        String outFileName =DB_PATH + DB_NAME;        //open empty db as output stream        OutputStream myOutPut = new FileOutputStream(outFileName);        //transfer bytes from the inputFile to the outPutFile        byte[] buffer = new byte[1024];        int length;        while((length = myInput.read(buffer))&gt;0){            myOutPut.write(buffer, 0, length);        }        myOutPut.flush();        myOutPut.close();        myInput.close();    }    private boolean checkDataBase() {        SQLiteDatabase checkDB = null;        String myPath = DB_PATH + DB_NAME;        checkDB = SQLiteDatabase.openDatabase(myPath, null, SQLiteDatabase.OPEN_READWRITE);        /*        if (checkDB != null){            checkDB.close();        }*/        return checkDB !=null ? true : false;    }    public void openDataBase()throws SQLException{        //open the database        String myPath = DB_PATH + DB_NAME;        myDataBase = SQLiteDatabase.openDatabase(myPath, null, SQLiteDatabase.OPEN_READONLY);    }    @Override    public synchronized void close(){        if(myDataBase != null){            myDataBase.close();        }        super.close();    }    @Override    public void onCreate(SQLiteDatabase db) {        // TODO Auto-generated method stub    }    @Override    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {        // TODO Auto-generated method stub    }}</code></pre><p>This is my manifest file</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.drager"" 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="".Drager""             android:label=""Drager""&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>This is the Logcat</p><pre><code>02-09 09:09:15.883: ERROR/AndroidRuntime(8313):java.lang.RuntimeException: Unable to start activityComponentInfo{com.drager/com.drager.Drager}:android.database.sqlite.SQLiteException: unable to open database file02-09 09:09:15.883: ERROR/AndroidRuntime(8313):     atandroid.app.ActivityThread.performLaunchActivity(ActivityThread.java:2787)02-09 09:09:15.883: ERROR/AndroidRuntime(8313):     atandroid.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2803)02-09 09:09:15.883: ERROR/AndroidRuntime(8313):     atandroid.app.ActivityThread.access$2300(ActivityThread.java:135)02-09 09:09:15.883: ERROR/AndroidRuntime(8313):     atandroid.app.ActivityThread$H.handleMessage(ActivityThread.java:2136)02-09 09:09:15.883: ERROR/AndroidRuntime(8313):     atandroid.os.Handler.dispatchMessage(Handler.java:99)02-09 09:09:15.883: ERROR/AndroidRuntime(8313):     atandroid.os.Looper.loop(Looper.java:144)02-09 09:09:15.883: ERROR/AndroidRuntime(8313):     atandroid.app.ActivityThread.main(ActivityThread.java:4937)02-09 09:09:15.883: ERROR/AndroidRuntime(8313):     atjava.lang.reflect.Method.invokeNative(Native Method)02-09 09:09:15.883: ERROR/AndroidRuntime(8313):     atjava.lang.reflect.Method.invoke(Method.java:521)02-09 09:09:15.883: ERROR/AndroidRuntime(8313):     atcom.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)02-09 09:09:15.883: ERROR/AndroidRuntime(8313):     atcom.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)02-09 09:09:15.883: ERROR/AndroidRuntime(8313):     atdalvik.system.NativeStart.main(Native Method)02-09 09:09:15.883: ERROR/AndroidRuntime(8313): Caused by:android.database.sqlite.SQLiteException: unable to open database file02-09 09:09:15.883: ERROR/AndroidRuntime(8313):     atandroid.database.sqlite.SQLiteDatabase.dbopen(Native Method)02-09 09:09:15.883: ERROR/AndroidRuntime(8313):     atandroid.database.sqlite.SQLiteDatabase.&lt;init&gt;(SQLiteDatabase.java:1902)02-09 09:09:15.883: ERROR/AndroidRuntime(8313):     atandroid.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:884)02-09 09:09:15.883: ERROR/AndroidRuntime(8313):     atcom.drager.DataBaseHelper.checkDataBase(DataBaseHelper.java:108)02-09 09:09:15.883: ERROR/AndroidRuntime(8313):     atcom.drager.DataBaseHelper.createDataBase(DataBaseHelper.java:32)02-09 09:09:15.883: ERROR/AndroidRuntime(8313):     atcom.drager.Drager.onCreate(Drager.java:46)02-09 09:09:15.883: ERROR/AndroidRuntime(8313):     atandroid.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1069)02-09 09:09:15.883: ERROR/AndroidRuntime(8313):     atandroid.app.ActivityThread.performLaunchActivity(ActivityThread.java:2751)</code></pre><p>Thank you in advance</p>","608750","","180538","","2011-02-09 15:43:19","2013-04-09 11:05:01","Unable to open database file on device (HTC Desire)","<android><database><sqlite>","1","9","2","",""
"4937945","1","4938330","","2011-02-08 20:19:44","4","2478","<p>I have written and tested a library in C++. The code even works in my Android application if I add the source files directly. While I do have experience compiling static and dynamic libraries for common operating systems, I have zero experience compiling for a mobile system like this. I've done some research, and I'm still a bit lost as to exactly how to approach this. For example, I am unsure of whether to build a makefile for use with ndk-build or to just invoke one of the Android's compilers directly.</p><p>I did see <a href=""http://stackoverflow.com/questions/2943828/how-to-compile-a-static-library-using-the-android-ndk"">this question</a>, but it does not quite match my situation. I just want to run build and have it spit out libfoo.a (I'd like to produce libfoo.so as well, but libfoo.a is of greater interest to me right now.) The example in that question's winning answer implied that it would build the library as one step/module for building the final application. I tried doing it that way just to see, but I had no luck.</p><p>Can anyone please guide me in this endeavor?</p><p>CLARIFICATION -- I do not want to build the library and immediately pipe it into an application. I want a .a or .so file that I can link against in multiple future Android applications.</p>","264712","","264712","","2011-02-08 21:07:50","2011-02-08 21:07:50","How do I compile my own C++ library for Android?","<c++><android><android-ndk>","2","0","1","",""
"4937961","1","4960244","","2011-02-08 20:21:39","1","526","<p>Certainly the Google's LVL is the standard for license verification when selling through the official Market, but with the influx of tablets that don't have access to the Market, I'm beginning to look at making my app available through other distribution channels. </p><p>How should one attempt license verification when selling through distribution channels other than the Market?</p>","8117","","226476","","2011-02-08 20:28:40","2011-02-10 17:03:39","License verification for non-Market distribution channels?","<android><google-play><android-lvl>","2","0","","",""
"4938098","1","","","2011-02-08 20:35:09","0","5278","<p>Hi I am new to Android NDK Development.</p><pre><code>MacBook-Pro:JNIexample sk$ ndk-buildusage: dirname pathgmake: /Users/sk/build/core/build-local.mk: No such file or directorygmake: *** No rule to make target `/Users/sk/build/core/build-local.mk'.  Stop.</code></pre><p>Why do I get his error?</p>","421372","","","","","2014-01-30 12:00:51","NDK build error","<android><android-ndk-r5>","5","0","","",""
"4938137","1","4967059","","2011-02-08 20:38:48","3","2938","<p>I have some issue playing streaming* audio on a Galaxy Tab (works on HTC Desire HD and Nexus One). When I create the MediaPlayer object, it produces an error like this:</p><pre><code>02-09 02:21:39.088: VERBOSE/MediaPlayer-JNI(9325): native_setup02-09 02:21:39.088: VERBOSE/MediaPlayer(9325): constructor02-09 02:21:39.088: VERBOSE/MediaPlayer(9325): setListener02-09 02:21:39.092: INFO/MediaPlayer(9325): uri is:http://147.83.39.86:3200/osgi/files/TTS/1297185775715.ogg02-09 02:21:39.092: INFO/MediaPlayer(9325): path is null02-09 02:21:39.092: DEBUG/MediaPlayer(9325): Couldn't open file on client side, trying server side02-09 02:21:39.092: VERBOSE/MediaPlayer-JNI(9325): setDataSource: path http://147.83.39.86:3200/osgi/files/TTS/1297185775715.ogg02-09 02:21:39.092: VERBOSE/MediaPlayer(9325): setDataSource(http://147.83.39.86:3200/osgi/files/TTS/1297185775715.ogg)02-09 02:21:39.092: ERROR/MediaPlayerService(2392): Failed to create player object02-09 02:21:39.092: ERROR/MediaPlayer(9325): Unable to to create media player02-09 02:21:39.104: DEBUG/MediaPlayer(9325): create failed:02-09 02:21:39.104: DEBUG/MediaPlayer(9325): java.io.IOException: setDataSource failed.: status=0x8000000002-09 02:21:39.104: DEBUG/MediaPlayer(9325):     at android.media.MediaPlayer.setDataSource(Native Method)02-09 02:21:39.104: DEBUG/MediaPlayer(9325):     at android.media.MediaPlayer.setDataSource(MediaPlayer.java:745)02-09 02:21:39.104: DEBUG/MediaPlayer(9325):     at android.media.MediaPlayer.setDataSource(MediaPlayer.java:675)02-09 02:21:39.104: DEBUG/MediaPlayer(9325):     at android.media.MediaPlayer.create(MediaPlayer.java:611)02-09 02:21:39.104: DEBUG/MediaPlayer(9325):     at android.media.MediaPlayer.create(MediaPlayer.java:592)02-09 02:21:39.104: DEBUG/MediaPlayer(9325):     at com.vodafone.inredis.movil.interfazweb.InredisWebViewClient.shouldOverrideUrlLoading(InredisWebViewClient.java:37)</code></pre><p>And this is how I create the MediaPlayer object, nothing weird:</p><pre><code>Uri tempPath = Uri.parse(url);player = MediaPlayer.create(interfazWeb, tempPath);if (player != null){  player.start();} else {  Log.e(TAG, ""No se puede abrir el audio:"" + url);}return true;</code></pre><p>And to provide more information, I can say I tested the url passed, and I can download it with the native browser and play it normally. Obviously I can play it with my desktop browser.</p><p>Has anyboedy experienced this problem with the mentioned device?</p><p>Thanks in advance.</p>######## EDIT ##############<p>I haven't solved this issue yet, but I've been researching a bit, now I'm downloading the file in a separate thread, saving it to a temp file and opening with the <code>MediaPlayer</code>. It produces another kind of error, I'm suspecting of the file folders and permissions, but I'm not sure yet.</p><p>So now I have those temp files which I can play with the galaxy's native player, but not with the one I create in my code, and a different piece of log trace, which gives me no hint.</p><pre><code>02-10 01:36:36.945: VERBOSE/MediaPlayer-JNI(8371): native_setup02-10 01:36:36.945: VERBOSE/MediaPlayer(8371): constructor02-10 01:36:36.945: VERBOSE/MediaPlayer(8371): setListener02-10 01:36:36.948: VERBOSE/MediaPlayer-JNI(8371): setDataSource: path /sdcard/audioTmp360988.ogg02-10 01:36:36.948: VERBOSE/MediaPlayer(8371): setDataSource(/sdcard/audioTmp360988.ogg)02-10 01:36:36.952: VERBOSE/MediaPlayer(8371): prepare02-10 01:36:36.952: ERROR/MediaPlayerService(2394): Client::notify In02-10 01:36:36.952: ERROR/MediaPlayer(8371): message received msg=1, ext1=0, ext2=002-10 01:36:36.952: VERBOSE/MediaPlayer(8371): prepared02-10 01:36:36.952: VERBOSE/MediaPlayer(8371): signal application thread02-10 01:36:36.952: ERROR/MediaPlayer(8371): callback application02-10 01:36:36.952: ERROR/MediaPlayer(8371): back from callback02-10 01:36:36.952: VERBOSE/MediaPlayer(8371): prepare complete - status=002-10 01:36:41.437: VERBOSE/MediaPlayer-JNI(8371): native_finalize02-10 01:36:41.437: VERBOSE/MediaPlayer-JNI(8371): release02-10 01:36:41.437: VERBOSE/MediaPlayer(8371): setListener02-10 01:36:41.437: VERBOSE/MediaPlayer(8371): disconnect02-10 01:36:41.437: VERBOSE/MediaPlayer(8371): destructor02-10 01:36:41.437: VERBOSE/MediaPlayer(8371): disconnect</code></pre><p>Come on, I can't be the only one!</p>","467900","","467900","","2011-02-11 08:04:45","2013-04-25 06:16:19","MediaPlayer audio streaming fails on Galaxy Tab","<android><media-player><tablet><galaxy>","2","0","1","",""
"4938159","1","4938283","","2011-02-08 20:41:06","4","2095","<p>I linked jets3t into a test app and got logcats I've not yet seen during install ..</p><pre><code>02-08 12:21:11.825: DEBUG/PackageParser(1086): Scanning package: /data/app/vmdl28891.tmp02-08 12:21:12.059: DEBUG/PackageManager(1086): Scanning package org.jets3t02-08 12:21:12.075: INFO/PackageManager(1086): /data/app/org.jets3t-1.apk changed; unpacking02-08 12:21:12.082: DEBUG/installd(1009): DexInv: --- BEGIN '/data/app/org.jets3t-1.apk' ---02-08 12:21:12.481: DEBUG/dalvikvm(26867): creating instr width table02-08 12:21:12.715: DEBUG/dalvikvm(26867): DexOpt: 'Lorg/apache/commons/codec/Decoder;' has an earlier definition; blocking out02-08 12:21:12.715: DEBUG/dalvikvm(26867): DexOpt: 'Lorg/apache/commons/codec/BinaryDecoder;' has an earlier definition; blocking out02-08 12:21:12.715: DEBUG/dalvikvm(26867): DexOpt: 'Lorg/apache/commons/codec/Encoder;' has an earlier definition; blocking out02-08 12:21:12.715: DEBUG/dalvikvm(26867): DexOpt: 'Lorg/apache/commons/codec/BinaryEncoder;' has an earlier definition; blocking out... many more ...'Lorg/apache/commons/logging/impl/WeakHashtable$Entry;': multiple definitions02-08 12:21:12.973: DEBUG/dalvikvm(26867): DexOpt: not verifying 'Lorg/apache/commons/logging/impl/WeakHashtable$Referenced;': multiple definitions02-08 12:21:12.973: DEBUG/dalvikvm(26867): DexOpt: not verifying 'Lorg/apache/commons/logging/impl/WeakHashtable$WeakKey;': multiple definitions02-08 12:21:12.973: DEBUG/dalvikvm(26867): DexOpt: not verifying 'Lorg/apache/commons/logging/impl/WeakHashtable;': multiple definitions02-08 12:21:13.168: INFO/dalvikvm(26867): DexOpt: not resolving ambiguous class 'Lorg/apache/commons/logging/LogFactory;'... many more ...02-08 12:21:13.364: INFO/dalvikvm(26867): DexOpt: not resolving ambiguous class 'Lorg/apache/commons/logging/LogFactory;'02-08 12:21:13.387: DEBUG/libgps(1086): GpsInterface_inject_location( 37.378289, -122.059655, 897.000 )02-08 12:21:13.387: DEBUG/dalvikvm(26867): DexOpt: load 111ms, verify 540ms, opt 21ms02-08 12:21:13.543: DEBUG/installd(1009): DexInv: --- END '/data/app/org.jets3t-1.apk' (success) ---02-08 12:21:13.551: INFO/ActivityManager(1086): Force stopping package org.jets3t uid=1008402-08 12:21:13.559: DEBUG/PackageManager(1086):   Activities: org.jets3t.MainActivity02-08 12:21:13.832: INFO/installd(1009): move /data/dalvik-cache/data@app@org.jets3t-1.apk@classes.dex -&gt; /data/dalvik-cache/data@app@org.jets3t-1.apk@classes.dex02-08 12:21:13.832: DEBUG/PackageManager(1086): New package installed in /data/app/org.jets3t-1.apk</code></pre><p>I'm reading that as shared library overwrites.  If it is, I'm wondering if this is a result of something I did wrong?  If I overwrite, what are the chances that other apps could break?  Of course any properly created library will be backward compatible .. and I guess Android package mgr would not replace a package with an older variant?  </p><p>Plus ""multiple definitions""?  ""not resolving ambiguous class""?</p><p>Oh yeah.. the test app seems to work fine so far :)</p><p>Thanks.  Guess I need to go read up on pkg install, load, and link lol.</p>","294973","","","","","2011-02-08 20:52:25","Can a library I use in my Android app .apk collide with that library used in another app?","<android><install><apk>","1","1","0","",""
"4938231","1","4942901","","2011-02-08 20:47:18","1","3076","<p>I'm trying to parse an xml document using the xml pull parser.Everything worked fine until i started dealing with an xml document containing an xxml declartation: </p><p>When the declaration is there i get the following error:</p><p>02-08 15:37:16.960: WARN/System.err(9721): org.xmlpull.v1.XmlPullParserException: PI must not start with xml (position:unknown ï»¿@1:5 in java.io.InputStreamReader@47ec2770) </p><p>If I take out the declaration from the document, everything works.It's too late for me to switch to another parser so i need to make it work!</p><p>Here's what my parser code looks like</p><pre><code>XmlPullParserFactory factory = XmlPullParserFactory.newInstance();    factory.setNamespaceAware(false);    // factory.setFeature(XmlPullParser.FEATURE_PROCESS_DOCDECL, true);    XmlPullParser xpp = factory.newPullParser();    // get a reference to the file.    File file = new File(Environment.getExternalStorageDirectory() + ""/""            + Constants.SD_CARD_DIR + ""/"" + Constants.XMLPATH);    // create an input stream to be read by the stream reader.    FileInputStream fis = new FileInputStream(file);    // set the input for the parser using an InputStreamReader    xpp.setInput(new InputStreamReader(fis));    int eventType = xpp.getEventType();    // /    while (eventType != XmlPullParser.END_DOCUMENT) {...}</code></pre>","571921","","","","","2013-08-11 17:52:20","XML Pull Parser error when declaration present","<android><xml><xmlpullparser>","3","1","","",""
"4938241","1","4940111","","2011-02-08 20:48:17","1","1488","<p>I have an activity which, onclick of a widget, launches another with a WebView.  This WebView is rather slow-loading.</p><p>What I would like to do is pre-load the contents of the WebView, such that showing it is instantaneous.</p><p>I tried the solution suggested <a href=""http://stackoverflow.com/questions/3189893/preload-webview"">here</a>, which would work.. but for the fact that the first screen is best viewed in Portrait, while the WebView is best viewed landscape.  And as such, if the screen orientation changes (either by user action or setRequestedOrientation()), the Activity reloads and the first screen is displayed (not what I want at all).</p><p>Any ideas?</p>","534173","","","","","2011-02-09 00:19:44","Preload data for webview","<android><android-widget>","1","0","","",""
"4938322","1","4940331","","2011-02-08 20:56:24","1","1592","<p>I have my class implements Drawable. I need to redraw it periodicaly to get some ""blink"" effect. I am using timer.schedule to schedule invalidateSelf() but nothing happend.</p><pre><code>private class DrawableImpl extends Drawable {    private boolean blinkFlag = false;    private Timer timer = new Timer(false);    private int maxFlashCount = 21;    private int intervalBetweenFlashesInMs = 100;    private int currentFlashNumber = 0;    @Override    public void draw(Canvas canvas) {        Log.i(TAG, ""draw"");        /*draw stable part*/        if (blinkFlag ) {            Log.i(TAG, ""blink"");            /*draw bliking part*/        }        blinkFlag = !blinkFlag;        final DrawableImpl drawableImpl = this;         if (currentFlashNumber &lt; maxFlashCount) {            Log.i(TAG, ""schedule"");            timer.schedule(new TimerTask() {                @Override                public void run() {                    runOnUiThread(new Runnable() {                        @Override                        public void run() {                            Log.i(TAG, ""run from back"");                            drawableImpl.invalidateSelf();                        }                    });                }            }, intervalBetweenFlashesInMs);            currentFlashNumber++;        }    }}</code></pre><p>In Log something like this<br>02-08 23:07:44.791: INFO/(258): draw<br>02-08 23:07:44.791: INFO/(258): blink<br>02-08 23:07:44.791: INFO/(258): schedule<br>02-08 23:07:45.011: INFO/(258): run from back<br>02-08 23:07:45.021: INFO/(258): draw<br>02-08 23:07:45.021: INFO/(258): schedule<br>02-08 23:07:45.171: INFO/(258): run from back<br>02-08 23:07:45.171: INFO/(258): draw<br>02-08 23:07:45.171: INFO/(258): blink<br>02-08 23:07:45.171: INFO/(258): schedule<br>02-08 23:07:45.331: INFO/(258): run from back</p><p>Why it didn`t work? Should I use another methods for that?</p>","608795","","","","","2011-02-09 00:57:28","Redraw Drawable by timer using invalidateSelf() not working","<android><drawable><redraw><timertask>","1","1","","",""
"4938480","1","","","2011-02-08 21:09:24","0","17372","<p>I want to change the image of a button in my code. I found this can be done in xml:</p><p>please check <a href=""http://developer.android.com/resources/tutorials/views/hello-formstuff.html"" rel=""nofollow"">this</a> link</p><p>but the image will not stay on after I released the button. I want to click the buttonand the button change to a new image. Can this be done?</p><p>Thanks</p>","195678","","1371853","","2013-11-14 08:42:27","2013-11-14 08:42:27","change button image in android","<android><image><button>","2","2","1","",""
"4938537","1","","","2011-02-08 21:15:06","0","653","<p>I have some code to post an image to my php script that uploads to a database, when it adds to the database the file type is application/oct???? (what is this)</p><p>is there anyway of changing this to a jpg file at the android stage?</p><p>Below is my code</p><pre><code>HttpClient client = new DefaultHttpClient();               String postURL = ""http://10.0.2.2:90/mobileupload3.php"";                             HttpPost post = new HttpPost(postURL);          FileBody bin = new FileBody(file);         MultipartEntity reqEntity = new MultipartEntity();           reqEntity.addPart(""image"", bin);         reqEntity.addPart(""name"", new StringBody(enteredName));         reqEntity.addPart(""gender"", new StringBody(radio));         reqEntity.addPart(""cat"", new StringBody(radio2));         reqEntity.addPart(""lat"", new StringBody(lat));         reqEntity.addPart(""lon"", new StringBody(lon));         post.setEntity(reqEntity);           HttpResponse response = client.execute(post);           HttpEntity resEntity = response.getEntity();           if (resEntity != null) {                       Log.i(""RESPONSE"",EntityUtils.toString(resEntity));             }    } catch (Exception e) {        e.printStackTrace();    }    }}</code></pre>","601915","","476681","","2011-12-23 11:54:14","2011-12-23 11:54:14","Set image type in android","<android><android-image><android-file>","1","2","","",""
"4938543","1","4938622","","2011-02-08 21:16:12","1","322","<p>I would like to know how the android market initiates the remote download through their website. I'm guessing there is some sort of push notification system. I want to know if it's possible to do the same thing using a different web interface. </p>","311001","","","","","2011-02-08 21:23:07","Android market initiate remote download","<android><google-play>","2","0","","",""
"4938734","1","","","2011-02-08 21:34:00","2","620","<p>I've got a bunch of small two colour png images and I'd like to effectively change one of the two colours to another one. Say <code>RED =&gt; BLUE</code>.</p><p>I know I can either loop over each pixel or use <code>Bitmap.setXfermode</code> to do this but it feels like a big waste on such a simple problem. What I want to do is to access the header of the file and change it in the colour table directly. This hints that <code>png:</code>s are indexed <a href=""http://developer.android.com/guide/topics/resources/drawable-resource.html#Bitmap"" rel=""nofollow"">http://developer.android.com/guide/topics/resources/drawable-resource.html#Bitmap</a> :</p><blockquote>  <p>Note: Bitmap files may be automatically optimized with lossless image compression by the aapt tool. For example, a true-color PNG that does not require more than 256 colors may be converted to an 8-bit PNG with a color palette. This will result in an image of equal quality but which requires less memory. So be aware that the image binaries placed in this directory can change during the build. If you plan on reading an image as a bit stream in order to convert it to a bitmap, put your images in the res/raw/ folder instead, where they will not be optimized.</p></blockquote><p>The files I put in the ""project"" are indexed png images so I know for sure they are in fact indexed and does have a colour table. Will I have to read the files as binary data and manipulate before I make a Bitmap object? I would really prefer if that wasn't the case but there instead is some hidden Bitmap.switchColor (<code>Col1, Col2</code>); which would do just that since I want to be able to switch back or to a third colour.</p><p>Please only android related answers and not general ones since I'm only looking for how to do it in android, using android classes.</p><p>Thanks in advance</p>","308912","","881286","","2013-08-18 02:30:15","2013-08-18 02:30:15","Get and set bitmap colour table in android","<android><bitmap>","0","2","","",""
"4938822","1","4946893","","2011-02-08 21:42:56","29","23494","<p>I want to use certain animations such as bounce inside my canvas. Is it possible to use the animation interpolators inside?</p><p>In my case I want to rotate an image from 0 to 180 degrees with a bounce at the end. </p><p>How is it possible? </p>","217527","","2683275","","2013-10-13 14:20:30","2013-10-13 14:20:30","How can I use the animation framework inside the canvas?","<android><android-animation>","1","0","47","",""
"4938831","1","4944382","","2011-02-08 21:43:57","0","693","<p>How can I draw for example a rectangle inside a CameraPreview (SurfaceView)?In setPreviewCallback I've implement the invalidate method which should call the onDraw method. But nothing happened. Can anyone help? </p>","588275","","1288","","2011-03-16 12:11:19","2011-04-01 16:25:36","Draw sth. like rectangles inside a CameraPreview (SurfaceView)","<android><preview><surfaceview>","1","0","","",""
"4938856","1","4938958","","2011-02-08 21:46:37","3","639","<p>I have a call to </p><pre><code>Resources resources = Resources.getSystem();String[] networkFiles = resources.getStringArray(R.array.xmlNetworkFiles);</code></pre><p>and I know this resource array exists (since I can reference it with the auto generated R file) but yet it continues to throw <code>ResourceNotFoundException</code>. </p><p><strong>What could be causing this and what can I do to fix this?</strong> </p><p>I have used similar code elsewhere for retrieving an array of ints, but this one always fails in my unit tests.</p>","243203","","","","","2011-02-08 22:03:27","Why would resources.getStringArray(int) throw exception?","<java><android><exception><resources>","2","0","","",""
"4938867","1","4945737","","2011-02-08 21:47:52","17","11230","<p>Can anyone point me to an example of using sqlite with Monodroid? I've been unable to find even one.</p>","595936","","265167","","2011-12-21 18:02:09","2013-05-18 08:56:32","Need an example of sqlite with Monodroid","<c#><android><sqlite><monodroid>","1","1","11","",""
"4939001","1","4939514","","2011-02-08 22:01:10","2","829","<p>I'm using an activity with android:theme=""@android:style/Theme.Dialog"" to make it act as a dialog. What lies closest to the <strong>native</strong> behavior of dialogs: Should a dialog fill the screen (in width) or not? And should it grow dynamically if, for instance, a text box is filled up by typing?</p><p>My hunch is that the dialog should not fill the screen. I have tried to get this behavior, but whatever I do, on Android 2.2, the dialog width <strong>seems to fill the parent</strong>.</p><p>My layout xml:</p><pre><code>&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""wrap_content"" android:layout_height=""wrap_content""    android:orientation=""vertical""&gt;    &lt;TextView android:id=""@+id/text"" android:layout_width=""fill_parent""         android:layout_height=""wrap_content"" android:autoText=""true""         android:text=""@string/item_delete_dialog_label""         android:padding=""5dip"" /&gt;    &lt;LinearLayout android:layout_height=""wrap_content""         android:orientation=""horizontal""        style=""@android:style/ButtonBar"" android:layout_width=""fill_parent""&gt;        &lt;Button android:id=""@+id/yes"" android:layout_height=""wrap_content""             android:text=""@string/button_yes""            android:layout_width=""wrap_content""            android:layout_weight=""1""/&gt;        &lt;Button android:id=""@+id/no"" android:layout_height=""wrap_content""             android:text=""@string/button_no""            android:layout_width=""wrap_content""            android:layout_weight=""1""/&gt;    &lt;/LinearLayout&gt;&lt;/LinearLayout&gt; </code></pre><p>I've found many questions regarding making a dialog fill the screen in width, but none about making it wrap in width. How can I get this?</p>","458813","","","","","2011-02-08 23:00:27","Android: What should the width of a dialog be?","<android><dialog>","2","0","1","",""
"4939058","1","","","2011-02-08 22:06:17","0","227","<p>In my app, I'd like to put an Android market link which points to a future version of the app doesn't exist yet.</p><p>startActivity(new Intent(Intent.ACTION_VIEW,Uri.parse(""market://details?id=com.example.mystuff.future_app"")));</p><p>Currently, if user click the button, Android will show ""The requested item could not be found"" message.</p><p>Instead of this generic message, I'd like to show a customized message --- ""Coming soon... please stay tuned"".</p><p>How can i catch this error and override the message?</p><p>Thanks in advance!</p>","608881","","608881","","2011-02-08 22:12:21","2011-02-08 22:48:05","How to override the generic ""Could not be found"" msg for the app doexn't exist on the market","<android><google-play>","1","0","","",""
"4939266","1","4947896","","2011-02-08 22:29:43","5","2593","<p>I have a problem when compiling my app, which is inspired from bitmap-plasma. I was calling </p><pre><code>    if ((ret = AndroidBitmap_getInfo(env, bitmap, &amp;info)) &lt; 0) {    LOGE(""AndroidBitmap_getInfo() failed ! error=%d"", ret);    return;}if (info.format != ANDROID_BITMAP_FORMAT_RGB_565) {    LOGE(""Bitmap format is not RGB_565 !"");    return;}if ((ret = AndroidBitmap_lockPixels(env, bitmap, &amp;pixels)) &lt; 0) {    LOGE(""AndroidBitmap_lockPixels() failed ! error=%d"", ret);}       /*****code here***********/AndroidBitmap_unlockPixels(env, bitmap);</code></pre><p>I have included android/bitmap.h in my source file. I am using android-ndk-r5b and sdk-9 on ubuntu 10.10. </p><p>I am getting an error </p><pre><code> /home/user5432/workspace/bitmapproj/obj/local/armeabi/objs-debug/mybitmap.o : In function Java_com_example_plasma_PlasmaView_renderPlasma""undefined reference to AndroidBitmap_getInfo""""undefined reference to AndroidBitmap_lockPixels""""undefined reference to AndroidBitmap_unlockPixels""</code></pre><p>The problem is with debug code. But what is the problem? Can anybody has an answer?  </p>","574911","","574911","","2011-02-08 23:44:50","2011-02-09 16:49:01","Android bitmap native code - linking problem","<android><bitmap><android-ndk>","1","0","1","",""
"4939542","1","","","2011-02-08 23:03:24","0","649","<p>I'm trying to find a way to bypass the selection pop-up for podcasts and just tell android to download the file.</p><p>Currently when you open a link to a podcast a little menu pops up and has two buttons. One says download, and one says listen. Instead I want ""Download"" or ""Cancel"".</p><p>I have looked into this and I found the DownloadManager class, but sadly (I think) it is only for 2.3, and the app is being developed for 2.2.</p><p>Does anyone know how android did file downloading before this? Is there a specific intent I can pass the link to?</p><p>Thanks!</p>","608933","","","","","2011-02-08 23:37:50","How do you force android to download a podcast instead of playing it?","<android>","1","0","","",""
"4939567","1","4939623","","2011-02-08 23:07:18","0","706","<p>I'm recording videos with MediaRecorder, but it appears that whatever setting I use, the framerate is appalling (~ 1fps)</p><p>This is my code:</p><pre><code>    recorder.setAudioSource(MediaRecorder.AudioSource.DEFAULT);    recorder.setVideoSource(MediaRecorder.VideoSource.DEFAULT);    CamcorderProfile cp = CamcorderProfile.get(HIGH_QUALITY ? CamcorderProfile.QUALITY_HIGH : CamcorderProfile.QUALITY_LOW);    System.out.println(""RECORDING AT "" + cp.videoFrameRate); // Says 30fps    recorder.setProfile(cp);    recordingFilename = tempFileName();    recorder.setOutputFile(recordingFilename);    recorder.setPreviewDisplay(holder.getSurface());    try {        recorder.prepare();    } catch (IllegalStateException e) {        e.printStackTrace();        finish();    } catch (IOException e) {        e.printStackTrace();        finish();    }    recorder.start();</code></pre>","310455","","213269","","2011-08-15 19:53:04","2011-08-15 19:53:04","MediaRecorder video framerate","<android><video-capture><mediarecorder>","1","0","","",""
"4939718","1","4940013","","2011-02-08 23:29:35","0","963","<p>I'm kinda stuck with this problem on android. I created a maps API application, with a custom overlay and every time I try to click an overlay and start an intent (google maps) the thing crashes:</p><p>possibly relevant code:</p><pre><code>threadid=3: thread exiting with uncaught exception (group=0x4001b188)Uncaught handler: thread main exiting due to uncaught exceptionjava.lang.NullPointerExceptionat android.app.Activity.startActivityForResult(Activity.java:2749)at android.app.Activity.startActivity(Activity.java:2855)at com.jcfrei.chparking.funtionality.startgmapsnav(funtionality.java:16) at com.jcfrei.chparking.ParkingOverlay.onTap(ParkingOverlay.java:91) at com.google.android.maps.ItemizedOverlay.onTap(ItemizedOverlay.java:453) at com.google.android.maps.OverlayBundle.onTap(OverlayBundle.java:83) at com.google.android.maps.MapView$1.onSingleTapUp(MapView.java:346) at android.view.GestureDetector.onTouchEvent(GestureDetector.java:506) at com.google.android.maps.MapView.onTouchEvent(MapView.java:628) at android.view.View.dispatchTouchEvent(View.java:3709) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:852) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884) at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1659) at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1107) at android.app.Activity.dispatchTouchEvent(Activity.java:2061) at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1643) at android.view.ViewRoot.handleMessage(ViewRoot.java:1691) 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)</code></pre><p>and</p><pre><code> public class funtionality extends Activity {   public void startgmapsnav (String lat, String lon) {    Intent myIntent = new Intent(android.content.Intent.ACTION_VIEW, Uri.parse(""geo:38.899533,-77.036476""));         startActivity(myIntent);} }</code></pre><p>inside Overlay</p><pre><code>    @Overrideprotected boolean onTap(int index)  {  //OverlayItem item = mOverlays.get(index);  funtionality lm = new funtionality();  lm.startgmapsnav(lat, lon);  return true;} </code></pre>","321749","","","","","2014-01-21 20:44:18","Android: NullPointerException for new Intent for Google Maps","<android><google-maps><android-intent><nullpointerexception>","2","0","","",""
"4939820","1","4952233","","2011-02-08 23:43:43","0","1048","<p>I'm making an app which should show alerts whenever the user/device gets close to one of the predefined points of interest.</p><p>The only way I found for doing that (in fact i got it working like that) is to create a pending intent (with a unique name) for every single point of interest. But I think thats not the best way to do it in terms of resources..</p><p>Is it possible to achieve such functionality using just one pending intend instead of multiple separate ones?</p><p>Is there any other better way of doing that?</p><p>Thanks in advance</p><p>Mike</p><hr><pre><code>private void addProximityAlert(double latitude, double longitude, String poiName) {        Bundle extras = new Bundle();           extras.putString(""name"", poiName);                Intent intent = new Intent(PROX_ALERT_INTENT+poiName);               intent.putExtras(extras);        PendingIntent proximityIntent = PendingIntent.getBroadcast(MainMenu.this, 0, intent, 0);        locationManager.addProximityAlert(            latitude, // the latitude of the central point of the alert region            longitude, // the longitude of the central point of the alert region            POINT_RADIUS, // the radius of the central point of the alert region, in meters            PROX_ALERT_EXPIRATION, // time for this proximity alert, in milliseconds, or -1 to indicate no expiration             proximityIntent // will be used to generate an Intent to fire when entry to or exit from the alert region is detected       );       IntentFilter filter = new IntentFilter(poiName);       registerReceiver(new ProximityIntentReceiver(), filter);    }}</code></pre>","582665","","1288","","2011-09-28 11:12:12","2011-09-28 11:12:12","Android location aware app - Set multiple points of interest without using multiple listeners","<android><android-intent><android-pendingintent><proximity><point-of-interest>","1","2","1","",""
"4939908","1","4940669","","2011-02-08 23:54:44","0","625","<p>I am in the planning phase a new project. I want to be able to control multiple relays from my android powered phone over the internet. I need to use an HTTP based server as a middleman between the phone and the relays. Django is my preferred platform because Python is my strongest skill set. This would not be a ""web app"" (with the exception of the admin interface for managing the user and their access to the relays). Rather, the server would simply provide an API in the form of HTTPS requests and JSON encoding. Though, I should note that I have never done any web development in my life, so I don't know best practices (yet). The authentication method should meet the following criteria:</p><ul><li>Works over HTTPS (self-signed SSL)</li><li>Provides multi-factor authentication (in the form of something you have and something you know)</li><li>Be reasonably secure (Would be very difficult to fool, guess at. or otherwise bypass)</li><li>Is simple in implementation for the server operator and end user on the mobile client</li><li><p>Is lightweight in in terms of both CPU cycles and bandwidth</p><p>I plan to use the following scheme to solve this:</p><ol><li>An administrator logs into the web interface, creates a user, and sets up his/her permissions (including a username and a password chosen by the user).</li><li>The user starts the client, selects add server, and enters the server URL and his/her credentials.</li><li>The client attempts to authenticate the the user via HTTP auth(over SSL). If the authentication was successful, the server will generate an API key in the form of a UUID and sends it to the client. The client will save this key and use it in all API calls over HTTPS. HTTP auth is only used for the initial authentication process prior to reviving a key, as a session scheme would not be nessessary for this application. Right? The client will only work if the phone is configured to automatically lock with a PIN or pattern after a short timeout. The server will only allow one key to be generated per user, unless an administrator resets the key. Hence, simple, mobile, multifactor authentication.</li></ol></li></ul><p>Is this sound from a security standpoint? Also, can anyone point me to an example of how to use the HTTP auth that is built into Django? From a Google search, I can find a lot of snipits witch hack the feature together. But, none of them implement HTTP auth in the way<a href=""http://code.djangoproject.com/ticket/689"" rel=""nofollow"">it was added to Django in 1.1</a>. <a href=""http://docs.djangoproject.com/en/1.2/howto/auth-remote-user/"" rel=""nofollow"">The official documentation for REMOTE_AUTH can be found here</a>, but I am having difficulty understanding the documentation as I am very new to Django.</p>","501333","","501333","","2011-02-09 01:33:18","2011-02-09 02:14:11","How should I properly impliment HTTP(S) auth (REMOTE_AUTH) in django?","<android><django><http><authentication>","1","0","1","",""
"4939920","1","4940468","","2011-02-08 23:55:44","0","963","<p>I am novice in android platform &amp; I'd like to use Bengali as language for android phone.</p><p>In the latest release it says: <strong>Expanded I18N support (full worldwide encodings, more locales)</strong>Does it mean it has by default support for Bengali or such languages?</p><p>Or still I need to do framework translation and submit to google under opensource project etc etc? If so I am thinking to <strong>take it as my semester project</strong> (atleast I can convert some part of the android os and test it in the emulator?) Please let me know what do you think..</p><p>And thanks for your help in advance.</p>","474986","","474986","","2011-02-12 02:24:15","2011-03-10 04:39:34","How to enable a custom language in Android Phone?","<android><frameworks><locale>","1","0","","",""
"4940009","1","","","2011-02-09 00:06:04","2","87","<p>Images on the Android device can originate from many different sources - from the device camera, from an external SD card, from an e-mail, synced from another system.  I'm developing an application which uploads images from an Android device to a web application.  It turns out that the web application can perform some significant optimizations if it can be determined that the uploaded image originated from the device's camera. </p><p>I guess that this would have to be done at the point that the Android application user selects the image from those presented in the picker.  At that point, the Android application has an image in hand.  Is there image metadata available, and, if so, would it include a marker which indicates that the image originates from the device's camera?</p><p>Thanks for any thoughts.</p><p>Peter Hornby</p>","608980","","","","","2011-02-09 00:10:49","Determining whether selected image originated from device camera","<android>","1","0","","",""
"4940028","1","4940633","","2011-02-09 00:09:12","0","844","<p>I have an application that makes a lot of network requests for xml data that is parsed and presented to the user. Best practices dictate to relegate the network request code and parsing to another thread but since the UI elements have thread affinity it's hard to get the information onto the main thread to be displayed. Does anyone know of any good resources for android threading?</p>","165198","","","","","2013-01-27 18:44:31","android concurrency","<android><multithreading>","3","0","","",""
"4940060","1","4940542","","2011-02-09 00:13:41","0","938","<p>When i open my contact list i want to able to select a person and get his(her) number. At the moment i can open the contact list, also, i have a onActivityResult witch is being fired when i select a person. The code is:</p><pre><code>@Overrideprotected void onActivityResult(int requestCode, int resultCode, Intent data) {    if (requestCode == PICK_REQUEST) {        if (resultCode == RESULT_OK) {            //get the selected person's phone number.        }    }}</code></pre>","491239","","","","","2011-02-09 01:42:51","Get a contact phone number","<android>","1","0","","",""
"4940119","1","4940163","","2011-02-09 00:21:24","0","146","<p><img src=""http://i.stack.imgur.com/VUNjT.png"" alt=""enter image description here""></p><p>If you add only one button in a whole new Activity, the screen looks like this:</p><p><img src=""http://i.stack.imgur.com/A5f1E.png"" alt=""enter image description here""></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/Button01""         android:layout_height=""wrap_content""         android:text=""false""         android:layout_width=""wrap_content"" &gt;&lt;/Button&gt;&lt;/LinearLayout&gt;</code></pre><p>But if you add a ListView, then everything is OK:</p><p><img src=""http://i.stack.imgur.com/vbAc6.png"" alt=""enter image description here""></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=""fill_parent""          android:id=""@+id/contactList""          android:layout_height=""wrap_content""          android:layout_weight=""1""/&gt;&lt;Button android:id=""@+id/Button01""         android:layout_height=""wrap_content""         android:text=""false""         android:layout_width=""wrap_content"" &gt;&lt;/Button&gt;&lt;/LinearLayout&gt;</code></pre><p><strong>EDIT:</strong> This only happened in QVGA mode. HVGA mode worked fine.</p>","84325","","23897","","2011-02-09 01:01:37","2011-02-09 01:01:37","A bug of the 2d layout engine of Android?","<android><android-layout>","1","5","0","",""
"4940167","1","","","2011-02-09 00:28:45","0","1096","<p>We've noticed that when you put Android views with view animation (nothing complex, just AlphaAnimation and TranslateAnimation) on top of a GLSurfaceView, the animation runs slowly (i.e. you see a lot of stuttering.) I am calling pause() on the GLSurfaceView, and I believe I've confirmed (through setting breakpoints) that the GL draw calls are not getting hit while the animation is playing, so I'm not sure where the slowness is coming from. </p><p>Does anyone know of a way around this? I know that on iPhone this also used to be a problem, but there was some OS update they made to fix the issue. They are short view animations (e.g. You Win!) so it's not the worst thing in the world, but it would be nice if there was some workaround.</p><p>The reason we are not doing the animations in GL is that they have to be able to run from any Activity in our game, and not all of our Activities have GLSurfaceViews.</p><p>Finally, if it matters, we am using the modified GLSurfaceView source from Replica Island <a href=""http://code.google.com/p/replicaisland/"" rel=""nofollow"">http://code.google.com/p/replicaisland/</a></p>","609015","","","","","2011-02-09 01:20:27","Android view animation on top of GLSurfaceView is slow","<android><animation><view><glsurfaceview><compositing>","1","0","1","",""
"4940241","1","","","2011-02-09 00:40:18","6","1400","<p>I found some references and ended up with the following code:</p><pre><code>String[] args = { ""/system/bin/cat"", ""/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq"" };cmd = new ProcessBuilder(args);Process process = cmd.start();InputStream in = process.getInputStream();byte[] re = new byte[1024];while (in.read(re) != -1) {    System.out.println(new String(re));    result = result + new String(re);}in.close();</code></pre><p>The above code works pretty well but not all the time. I've gotten some reports that it reports higher than the frequency set by SetCPU at max setting on some phones.</p><p>Is there a more reliable way to find the clock speed of Android phones?</p>","609024","","142162","","2011-02-09 00:41:06","2011-02-19 23:56:56","What is the most reliable way to determine the CPU clock frequency of Android phones?","<java><android><cpu><clock><frequency>","1","2","4","",""
"4940308","1","4940343","","2011-02-09 00:53:04","6","13421","<p>Here is the error:</p><p><em>02-08 16:35:00.899: ERROR/Database(468): android.database.sqlite.DatabaseObjectNotClosedException: Application did not close the cursor or database object that was opened here</em></p><p>Except, well, I am. Here is the method where this problem is occuring:</p><pre><code>    public static void getUpdates(String username, Context context) {    HttpClient httpClient = new DefaultHttpClient();    HttpPost httpPost = new HttpPost(""http://10.0.2.2/tag/appgetfriendinfo.php"");    try {        List&lt;NameValuePair&gt; nVPs = new ArrayList&lt;NameValuePair&gt;();        nVPs.add(new BasicNameValuePair(""username"", username));        httpPost.setEntity(new UrlEncodedFormEntity(nVPs));        HttpResponse response = httpClient.execute(httpPost);        ResponseHandler&lt;String&gt; rHandler = new BasicResponseHandler();        String result = rHandler.handleResponse(response);        JSONArray jArray = new JSONArray(result);        for(int i = 0; i &lt; jArray.length(); i++) {            JSONObject jObj = jArray.getJSONObject(i);            String userCheck = jObj.getString(""username"");            TagDBAdapter dbHelper = new TagDBAdapter(context);            dbHelper.open();//OPENING THE DATABASE            Contact contact = new Contact();            String first = jObj.getString(""firstname"");            String last = jObj.getString(""lastname"");            String name = first + "" "" + last;            contact.setUsername(jObj.getString(""username""));            contact.setFirstName(first);            contact.setLastName(last);            contact.setName(name);            contact.setPhoneNumber(jObj.getString(""phonenumber""));            contact.setEmail(jObj.getString(""email""));            contact.setHomePhone(jObj.getString(""homephone""));            contact.setWorkPhone(jObj.getString(""workphone""));            if(dbHelper.checkForExisting(userCheck) == true) {                dbHelper.createContact(contact);            }            else {                dbHelper.updateContactAuto(userCheck, contact);            }            dbHelper.close();//CLOSING THE DATABASE        }    } catch(ClientProtocolException e) {        Log.e(""GETUPDATES"", ""CPE"", e);        e.printStackTrace();    } catch(IOException e) {        Log.e(""GETUPDATES"", ""IOE"", e);        e.printStackTrace();    } catch(JSONException e) {        Log.e(""GETUPDATES"", ""JSONE"", e);        e.printStackTrace();    }}</code></pre><p>As you can see on the lines I noted in //comments, I am opening AND closing the database, yet I am still getting the error. Here is what is strange though, the error's source is in the SQLite's open() method.</p><p><em>ERROR/Database(468): at com.tagapp.android.TagDBAdapter.open(TagDBAdapter.java:62)</em></p><p>Which is this:</p><pre><code>    /**THESE ARE MY DBADAPTER'S OPEN AND CLOSE METHODS*/    public TagDBAdapter open() throws SQLException {    mDBHelper = new DatabaseHelper(m_context);    mDb = mDBHelper.getWritableDatabase();    return this;}public void close() {    mDBHelper.close();}</code></pre><p>These are straight from Google's notepad tutorial, and they have worked 100% for me in different instances. Does anyone have an idea of what is going on here? Thanks a lot.</p>","588758","","","","","2014-01-17 20:15:52","I'm getting a Database Object Not Closed Exception in SQLite (Android), but I'm explicitly closing my database... Help?","<android><sqlite>","2","3","2","",""
"4940347","1","4981055","","2011-02-09 00:59:59","1","1607","<p>What category or action would I use to make my application show up when the phone gets placed in a dock?</p>","424421","","116938","","2011-02-09 01:41:39","2012-12-16 13:14:01","Creating an application that shows up when an Android phone is docked","<android><dock>","2","2","1","",""
"4940359","1","4940623","","2011-02-09 01:02:10","0","281","<p>Hello Everyone I an using webview in my android app . The problem i am facing that i want to remove the scroll bar white color because i an using black color as a body bgcolor . So in simple words hw we can remove scrolling or scroll bar  in the android web view . Thanks </p>","592344","","","","","2011-02-09 02:03:00","Android webview","<android><android-layout>","1","1","","",""
"4940387","1","4940410","","2011-02-09 01:08:06","0","560","<p>I was wandering if there is anyway to save a String from an EditText and clear it within the same onClick button. </p><p>The reason is I am creating a jumble word game where 1 player can jumble a word and then clear the word so the 2nd player cannot see it. The reason why I want to save the String is so I can match it with what player 2 enters. </p><p>Any advise would be helpful. Thanks</p>","608658","","","","","2011-02-09 01:12:51","Save state of String within EditText and clear string within same button","<android>","1","0","","",""
"4940422","1","","","2011-02-09 01:15:29","0","715","<p>I'm trying to add an overlay for myLocation in Android.  The map displays, but the overlay does not.  I did get the overlay to appear using a separate class that extends ItemizedOverlay.  I'm wondering of there is a way to display this individual point without creating a separate class?</p><p>Attached is the source code for the activity class.</p><pre><code>public class WalkAbout extends MapActivity {    //for Hello_mapview    List&lt;Overlay&gt; mapOverlays;    Drawable drawable;    private MapView m_vwMap;    private MapController m_mapController;    private PathOverlay m_pathOverlay;    private MyLocationOverlay m_locationOverlay;    private ArrayList&lt;GeoPoint&gt; m_arrPathPoints;    private ArrayList&lt;OverlayItem&gt; m_arrPicturePoints;    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);         initLocationData();        initLayout();     }    @Override    protected boolean isRouteDisplayed() {        return false;    }    private void initLocationData() {        // TODO    }    private void initLayout() {        //instantiate XML File into corresponding view objects.        //Then inflate new view from XML resource.        setContentView(R.layout.map_layout);        MapView m_vwMap = (MapView)findViewById(R.id.mapview);        m_vwMap.setBuiltInZoomControls(true);        m_vwMap.setSatellite(true);        //retrieve list of overlay objects        mapOverlays=m_vwMap.getOverlays();        //set market for overlays        drawable=this.getResources().getDrawable(R.drawable.item);        drawable.setBounds(0, 0, drawable.getIntrinsicWidth(),                                   drawable.getIntrinsicHeight());        //create OverlayItem with my location        m_locationOverlay= new MyLocationOverlay(this, m_vwMap);        //enable market to set location and direction        m_locationOverlay.enableCompass();        m_locationOverlay.enableMyLocation();        mapOverlays.add(m_locationOverlay);       }}</code></pre>","609064","","116938","","2011-02-09 02:06:41","2011-02-09 02:06:41","Android MapView","<android><android-mapview>","1","1","","",""
"4940429","1","","","2011-02-09 01:16:57","14","13409","<p>I'd like to be able to mimic the behavior of the <code>:active</code> pseudo class on all elements in Android webkit. Currently, the <code>:active</code> syntax only works on <code>a</code> elements (links). Nearly all of the actionable elements in the app I'm working on are something other than a standard link tag. iOS webkit supports <code>:active</code> on all elements.</p><pre><code>/* works on both android iOS webkit */a:active {    color: blue;}/* works on iOS webkit, does not work on android webkit */div:active {    color: red;}</code></pre><p>I've found a couple of resources [1,2] that solve similar problems, but they're both a bit heavy, and I'm wondering if there's a lighter weight solution that I'm just not able to find.</p><ol><li><a href=""http://cubiq.org/remove-onclick-delay-on-webkit-for-iphone"">http://cubiq.org/remove-onclick-delay-on-webkit-for-iphone</a></li><li><a href=""http://code.google.com/intl/ro-RO/mobile/articles/fast_buttons.html"">http://code.google.com/intl/ro-RO/mobile/articles/fast_buttons.html</a></li></ol>","203013","","203013","","2011-02-09 19:41:29","2014-03-24 08:53:21","How to simulate :active css pseudo class in android on non-link elements?","<android><css><webkit>","8","1","8","",""
"4940539","1","","","2011-02-09 01:42:26","1","1227","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/2792062/objective-c-to-java-cross-compiler"">Objective-C to Java cross compiler</a>  </p></blockquote><p>I have a working iPhone app and want to convert to Android app with minimal effort. Can anyone suggest ?</p>","609073","","","","","2011-02-09 01:47:35","Is there any tool that converts Objective C code to java for Android","<java><iphone><android><objective-c>","1","2","","2011-02-09 01:53:59",""
"4940574","1","","","2011-02-09 01:50:12","4","3529","<p>I tried to do Google search but I only found the solution for intra-activity animation using overridePendingTransition() method. However, is there any solution if I would like to have my own animation when my application is started by launcher?</p><p>Thanks a lot!</p>","609080","","","","","2011-02-09 02:00:02","How to override the enter activity animation if it is stated by launcher","<android><animation><activity><launcher>","1","0","","",""
"4940852","1","","","2011-02-09 02:53:20","2","1510","<p>I am trying to enable facebook login in my android app. I have linked the the facebook app in my application. But once i press login, then I get the facebook error <strong>android_key_not_configured</strong></p><p>Has any body seen this before?</p>","607948","","","","","2012-11-18 03:37:42","Getting android_key_not_configured facebook error","<android><facebook><android-emulator>","1","3","","",""
"4940912","1","4940944","","2011-02-09 03:05:27","0","509","<p>I have a column of Checkboxes and associated EditTexts and I want one pair of these to have a distinct appearance because it has a distinct significance.    </p><p>Short of writing custom controls, or using custom drawables, does Android have any way to style or alter the appearance of basic controls like buttons, checkboxes, etc, in the XML where the control is declared?    Or is there just one native style or appearance for all Android Checkboxes, Buttons, EditTexts, etc? </p><p>Thanks in advance.       </p>","424690","","","","","2011-02-09 03:12:54","Do Android controls/widgets have choice of styles?","<android>","1","0","","",""
"4940987","1","4941022","","2011-02-09 03:21:05","0","494","<p>i am trying to show an image directly under a text which i had retrieved from a file in the sdcard but only the text is showing but not the image,</p><p>have been trying several methods but non of it is workable</p><p>below is my code to display them</p><pre><code>//Find the directory for the SD Card using the API    //*Don't* hardcode ""/sdcard""    File sdcard = Environment.getExternalStorageDirectory();    //Get the text file    File file = new File(sdcard,""file.txt"");    //Read text from file    StringBuilder text = new StringBuilder();    try {        BufferedReader br = new BufferedReader(new FileReader(file));        String line;        while ((line = br.readLine()) != null) {            text.append(line);            text.append('\n');        }    }    catch (IOException e) {        //You'll need to add proper error handling here    }    //Find the view by its id    TextView tv = (TextView)findViewById(R.id.TextView01);    //Set the text    tv.setText(text);    Bitmap bitmap = BitmapFactory.decodeResource(getResources(),R.drawable.icon);    Canvas canvas = new Canvas(bitmap);    canvas.drawColor(Color.BLACK);    canvas.drawBitmap(bitmap, 130, 10, null);</code></pre>","578198","","","","","2011-02-09 03:53:10","problem with bitmap not displaying image after a text","<android>","2","0","","",""
"4941018","1","4941086","","2011-02-09 03:27:00","0","262","<p>I was wandering if there was any way to track the amount of clicks a user clicks a button. </p><p>I am creating a game and the user will only be allowed to take 5 turns. After these turns the user has lost the game.</p><p>I need to create maybe an if statement where the amount of clicks the user takes reaches > 5 then the user has lost. Is this possible. </p><p>I appreciate any help on this. Thanks</p><p>Edit: </p><pre><code>Button link2Btn = (Button)findViewById( R.id.answerSelected );</code></pre><p>link2Btn.setOnClickListener( new View.OnClickListener(){public void onClick(View v){    i++;</p><p>getAnswer();    }</p><p>The get Answer method works fine except the if i > 5 statement within get Answer which is:</p><pre><code>else if(i&gt;5){    correctAnswer.setText(""You have lost"");</code></pre>","608658","","608658","","2011-02-09 05:33:12","2011-02-09 05:33:12","Track amount of clicks user clicks button","<android>","1","1","","",""
"4941036","1","5039309","","2011-02-09 03:30:25","0","132","<p>maybe some one can help me with this...I have a custom search button (i do have the google search as well but I need this)..</p><p>here is the scenario:</p><ul><li><p>on main page I have list of records</p></li><li><p>I click on the search button which shows list of tags that I can click on for the system to search</p></li></ul><p>-I return to the main page with a string telling me which records to view</p><p>-the main page shows those records</p><p>this is all fine, but the problem is if I click back the app quits, which is understandable and what is suppose to happen.what I want is the same as the android search function where it opens the result in a new page and when I click back it takes me to my full list</p><pre><code>Cursor notesCursor3 = mDbHelper.fetchSearchTagNotes(matchNotes);startManagingCursor(notesCursor3);String[] from = new String[]{NotesDbAdapter.KEY_TITLE,NotesDbAdapter.KEY_CREATEDON};int[] to = new int[]{R.id.text1,R.id.date};SimpleCursorAdapter notes = new SimpleCursorAdapter(this, R.layout.notes_row, notesCursor3, from, to);setListAdapter(notes);</code></pre><p>this is my simple code after getting the search result, which is simply changing the adapter to the list (I do the same for the default android search which works like I said).</p>","609146","","","","","2011-02-18 08:58:03","Search to show a new intent?","<android>","1","0","","2011-02-18 16:24:26",""
"4941058","1","","","2011-02-09 03:35:19","0","639","<p>I want to load an images from a URI resource and would like to subdivide an image into smaller regions, and be able to place a marker or an icon over a particular region on the image. I'm not sure how to get started on this. Can you some point me to some documentation, provide sample code or tutorials to help me get started?</p>","609154","","","","","2011-09-09 12:42:26","How to load images from url resources in droid app?","<android><image><view><overlay>","1","0","","",""
"4941091","1","4941160","","2011-02-09 03:43:19","1","905","<p>I'm getting the following error back when trying to get a google auth token by using</p><pre><code>AccountManagerFuture&lt;Bundle&gt; amf = am.getAuthToken(    accounts[0], ""finance"", null, activity[0], null, null);try{    auth_token = amf.getResult().getString(""authtoken"");    Log.v(""PORTFOLIO"", ""getting token...: ""+auth_token);}catch (Exception e){    e.printStackTrace();}</code></pre><p>I get a valid-looking token, but then when I try and use it, I get a ""Token expired"" error back:</p><pre><code>V/PORTFOLIO(11970): &lt;HTML&gt;V/PORTFOLIO(11970): &lt;HEAD&gt;V/PORTFOLIO(11970): &lt;TITLE&gt;Token expired&lt;/TITLE&gt;V/PORTFOLIO(11970): &lt;/HEAD&gt;V/PORTFOLIO(11970): &lt;BODY BGCOLOR=""#FFFFFF"" TEXT=""#000000""&gt;V/PORTFOLIO(11970): &lt;H1&gt;Token expired&lt;/H1&gt;V/PORTFOLIO(11970): &lt;H2&gt;Error 401&lt;/H2&gt;V/PORTFOLIO(11970): &lt;/BODY&gt;V/PORTFOLIO(11970): &lt;/HTML&gt;</code></pre><p>Along with:</p><pre><code>W/DefaultRequestDirector(11970): Authentication error: Unable to respond to any of these challenges: {googlelogin=WWW-Authenticate: GoogleLogin realm=""http://www.google.com/accounts/ClientLogin"", service=""finance""}</code></pre><p>I'm a little confused why this is happening, as it was working properly before. How do I get a ""non-expired"" token? I'm probably doing something terribly wrong. If anyone has a link to a proper auth token tutorial, that would help too.</p>","99514","","","","","2011-02-09 03:56:31","""Token expired"" Obtaining Google Auth Token","<android>","1","0","1","",""
"4941094","1","","","2011-02-09 03:43:44","0","416","<p>In my application am downloading lot of images from web in order to use them in my application. But problem is that android creating thumbnails for all my images (Gallery). </p><p>Is there any way to protect my images so other applications like gallery can not access them?</p>","414777","","345078","","2012-09-24 10:57:56","2012-09-24 10:57:56","How to protect images from other applications in android?","<android><image-gallery>","2","0","","",""
"4941176","1","4941351","","2011-02-09 03:59:15","1","801","<p>I was wondering if anyone knew of a library or some code to join .wav files together in android OS.</p><p>Thanks</p>","542285","","","","","2012-07-03 10:20:21","join .wav files in android","<android><wav>","1","0","1","",""
"4941277","1","","","2011-02-09 04:21:05","0","671","<p>I would be glad to have a chance to call a static method of my Activity class whenever it's used to create Intent. For example I have static reset method that must be called before every activity launch, and the trick I use looks like:</p><pre><code>MyActivity.reset();Intent intent = new Intent(getBaseContext(), MyActivity.class);...startActivity(intent);</code></pre><p>Is there any way via reflection or somehow else to call such a static method when class is being used?</p>","366101","","","","","2011-02-09 04:21:05","call static method of Activity class when it's used in Intent creation","<android><reflection><static><android-intent>","0","3","","",""
"4941285","1","","","2011-02-09 04:22:51","0","162","<p>I'm working with SaxParser to parse an xml. The problem is, I have a few screens or activities coded. At the moment, every time I transition to the new activity from a button press for example, the new activity needs to then parse the xml all over again, so it can populate the screen with the specific content.</p><p>Is there a way in which I only parse the xml once through the life of the program?</p><p>Thank you.</p>","583097","","","","","2011-02-09 04:56:04","Parse an xml once for use across many activities","<android><parsing><activity><sax>","4","0","","",""
"4941353","1","","","2011-02-09 04:38:21","0","1537","<p>I must be able to detect the press and release of a button, but I must also have the position of the item in the gridview that is being touched. I basically have a gridview that is a d-pad control. So when the user pushed on it i need it to send ""go"" and when they release i need it to send ""stop""</p><p>with this below , there is no way to tell when they lift off the button (that i know!).</p><pre><code>    Grid.setAdapter(new ImageAdapter(c, mThumbIds));    Grid.setOnItemClickListener(new OnItemClickListener() {        public void onItemClick(AdapterView&lt;?&gt; parent, View v, int position, long id) {            Message msg = new Message();            msg.what = what;            msg.arg1 = position;            cHandler.sendMessage(msg);        }    });</code></pre><p>but If i use a ontouch listner I cant tell which item in the grid they have selected</p><pre><code>Grid.setOnTouchListener(new OnTouchListener() {            public boolean onTouch(View v, MotionEvent event) {                if (event.getAction() == MotionEvent.ACTION_UP) {                    Message msg = new Message();                    msg.what = 255;                    msg.arg1 = 255;                    cHandler.sendMessage(msg);                }                if (event.getAction() == MotionEvent.ACTION_DOWN) {                        Message msg = new Message();                        msg.what = what;                        msg.arg1 = 55;                        cHandler.sendMessage(msg);                }                return false;            }        });</code></pre><p>your time is greatly appreciated !! </p><p>/// well this is what i've been trying to do, i can never get the bounds of the different parts of the gridview. The r.getX etc always returns 0. if i have the id of the resource how can i pull its rectangle ? </p><pre><code>Grid.setOnTouchListener(new OnTouchListener() {            public boolean onTouch(View v, MotionEvent event) {                if (event.getAction() == MotionEvent.ACTION_UP) {                    Rect r = new Rect();                    ImageView imageView = new ImageView(c);                    for(int n: mThumbIds){                        imageView.setImageResource(n);                        r = imageView.getDrawable().getBounds();                        if(r.contains((int)event.getX(),(int)event.getY()))                        {                            Message msg = new Message();                            msg.what = what;                            msg.arg1 = n;                            msg.arg2 = (int)event.getRawY();                            cHandler.sendMessage(msg);                            break;                        }else{                            Message msg = new Message();                            msg.what = what;                            msg.arg1 = r.centerX();                            msg.arg2 = n;                            cHandler.sendMessage(msg);                        }                    }// end for                }// end if action up</code></pre>","609193","","40342","","2011-02-09 16:17:35","2011-02-09 16:17:35","How to get position of item selecte in gridview, or detect release of key with onItemClick?","<java><android><gridview>","1","0","","",""
"4941356","1","","","2011-02-09 04:38:43","0","4836","<p>How to put dynamic button using xml.i want to fetch the position of button from the xml and place them in screen.</p>","584127","","584127","","2011-02-09 05:11:46","2012-08-22 05:29:59","how to put dynamic button in android useing its position","<android>","3","1","1","",""
"4941370","1","4941419","","2011-02-09 04:41:01","0","487","<p>Suppose root activity A starts activity B, and then activity B starts activity C. Then the current task stack contains A, B, C.</p><p>Suppose now the system memory got low, and OS killed activity B. After that, the user pressed back key to exit activity C. My question is, after activity C exits, will activity B be recreated and shows up, or will activity A shows up?</p><p>Thanks.</p>","445302","","","","","2011-02-09 04:51:21","Question about an activity killed by system","<android>","1","0","","",""
"4941378","1","4941478","","2011-02-09 04:43:25","0","877","<p>I'm rather new to Android development, and am trying to learn with a bit of a hobby project. My app has a relatively small amount of state that needs to be stored for the main Activity in order for the app to resume properly. Moreover, since my app syncs with a webapp, I already have JSON-based serialization logic included for all the state that I might want to save. Is it a good use of SharedPreferences to store relatively small (~ a few KiB) strings that serialize objects? Would it be better to just use internal storage and write out to a text file? Thanks for the advice!</p>","267841","","","","","2011-03-02 14:08:46","SharedPreferences for serialization?","<android><serialization><sharedpreferences>","2","0","","",""
"4941383","1","","","2011-02-09 04:44:08","0","1383","<p>I want to get calendar event updates (when a new event is added or an existing event is deleted ) on android 2.2 devices ? </p><p>In other words, my program wants to get notifications for any calendar event changes</p><p>Anyone has any thoughts regarding how to do this?</p>","609197","","","","","2011-05-10 05:21:37","How to get calendar event updates on Android device?","<android><calendar>","1","0","2","",""
"4941403","1","","","2011-02-09 04:48:54","0","599","<p>I'm using the following Intent to pass on to the next Screen were it shows user information that can be edited and saved.......This works good</p><pre><code>@Overrideprotected void onListItemClick(ListView l, View v, int position, long id) {    super.onListItemClick(l, v, position, id);    Intent i = new Intent(this, Contact.class);    i.putExtra(NotesDbAdapter.KEY_ROWID, id);    startActivityForResult(i, ACTIVITY_EDIT);}</code></pre><p>However on the Contact Screen I have a button and use the following to go to the Admin screen were you can edit and save other information, but when you click the button the screen goes black and terminates. </p><pre><code>public void onClick(View v) {String id = null;switch (v.getId()) {case R.id.admin: // doStuff    Intent i = new Intent(this, Admin.class);    i.putExtra(NotesDbAdapter.KEY_ROWID, id);    startActivity(i);       break;</code></pre><p>I'm sure that the KEY_ROWID is the problem and needs to be recoded to work with a onClick compared to a onListItemClick....... Tryed alot but with no luck, any help would be great. </p>","607482","","","","","2011-02-09 05:09:24","problem with intent - onClick compared to a onListItemClick","<android><android-intent>","1","0","","",""
"4941437","1","","","2011-02-09 04:53:52","0","353","<p>I am getting problem in order to implement the twitter in Android. I am using twitter4j and it is doing every thing very well. But ""sign in as different user"" is not working. It is showing the last login info. i want to sign in as different user but it is not working. Is there any idea? Please some body help.</p>","489762","","1471203","","2013-01-09 11:57:17","2013-01-09 11:57:17","Twitter4J in Android","<android>","0","5","","",""
"4941513","1","4952796","","2011-02-09 05:05:08","2","4574","<p>openssl is <a href=""http://android.git.kernel.org/?p=platform/external/openssl.git"" rel=""nofollow"">included in the Android operating system</a>, and Google also includes some arm4/thumb assembler code in their builds (aes/asm/aes-armv4.s,  bn/asm/armv4-mont.s, sha/asm/sha1-armv4-large.s, sha/asm/sha256-armv4.s, sha/asm/sha512-armv4.s). I have <a href=""https://github.com/eighthave/openssl-android"" rel=""nofollow"">the Android openssl building</a> with <code>ndk-build</code> but it will only builds properly with the plain C aes_core.c, not the arm4 files. It even creates the .o files, but it can't find the *.o.d.org files, which I have no idea where they come from.</p><p>Any ideas on this?</p><p><code>/usr/local/android-ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/darwin-x86/bin/arm-linux-androideabi-gcc -MMD -MP -MF /Users/hans/code/eighthave/openssl-android/obj/local/armeabi/objs/crypto/aes/asm/aes-armv4.o.d.org -fpic -ffunction-sections -funwind-tables -fstack-protector -D__ARM_ARCH_5__ -D__ARM_ARCH_5T__ -D__ARM_ARCH_5E__ -D__ARM_ARCH_5TE__  -Wno-psabi -march=armv5te -mtune=xscale -msoft-float -mthumb -Os -fomit-frame-pointer -fno-strict-aliasing -finline-limit=64 -I/Users/hans/code/eighthave/openssl-android -I/Users/hans/code/eighthave/openssl-android/crypto/asn1 -I/Users/hans/code/eighthave/openssl-android/crypto/evp -I/Users/hans/code/eighthave/openssl-android/include -I/Users/hans/code/eighthave/openssl-android/include/openssl -Iexternal/zlib -I/Users/hans/code/eighthave/openssl-android/crypto -DANDROID -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -DL_ENDIAN -DOPENSSL_NO_CAMELLIA -DOPENSSL_NO_CAPIENG -DOPENSSL_NO_CAST -DOPENSSL_NO_CMS -DOPENSSL_NO_GMP -DOPENSSL_NO_IDEA -DOPENSSL_NO_JPAKE -DOPENSSL_NO_MD2 -DOPENSSL_NO_MDC2 -DOPENSSL_NO_RC5 -DOPENSSL_NO_SHA0 -DOPENSSL_NO_RFC3779 -DOPENSSL_NO_SEED -DOPENSSL_NO_STORE -DOPENSSL_NO_WHIRLPOOL -DOPENSSL_NO_HW -DOPENSSL_NO_ENGINE -DZLIB -DNO_WINDOWS_BRAINDEATH -DOPENSSL_BN_ASM_MONT -DAES_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -Wa,--noexecstack -O2 -DNDEBUG -g -I/usr/local/android-ndk/platforms/android-8/arch-arm/usr/include -c  /Users/hans/code/eighthave/openssl-android/crypto/aes/asm/aes-armv4.s -o /Users/hans/code/eighthave/openssl-android/obj/local/armeabi/objs/crypto/aes/asm/aes-armv4.o &amp;&amp; rm -f /Users/hans/code/eighthave/openssl-android/obj/local/armeabi/objs/crypto/aes/asm/aes-armv4.o.d &amp;&amp; mv /Users/hans/code/eighthave/openssl-android/obj/local/armeabi/objs/crypto/aes/asm/aes-armv4.o.d.org /Users/hans/code/eighthave/openssl-android/obj/local/armeabi/objs/crypto/aes/asm/aes-armv4.o.dmv: cannot stat `/Users/hans/code/eighthave/openssl-android/obj/local/armeabi/objs/crypto/aes/asm/aes-armv4.o.d.org': No such file or directorymake: <em>*</em> [/Users/hans/code/eighthave/openssl-android/obj/local/armeabi/objs/crypto/aes/asm/aes-armv4.o] Error 1</code></p>","306864","","49246","","2011-02-16 21:18:34","2013-07-01 22:21:15","Building Android openssl using NDK doesn't make arm4 assembly files properly","<android><openssl><assembly><android-ndk>","1","0","1","",""
"4941522","1","","","2011-02-09 05:06:59","2","428","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/3164325/tabstripenabled-for-tabwidget-in-older-apis"">tabStripEnabled for TabWidget in Older API&#39;s</a>  </p></blockquote><p>The TabHost BorderLine are present in my app but I don't want this.</p><p>I have the solution are in Android 2.2 using ""android:tabStripEnabled==False"".</p><p>But I want Solution in version Android 1.6 and above.</p><p>Thankx</p>","584040","","","","","2011-02-09 05:06:59","Android TabHost Border Line","<android>","0","0","1","2011-04-23 21:49:50",""
"4941555","1","","","2011-02-09 05:12:06","0","205","<p>I know that SQLite is the default database loaded in all Android devices. What other databases can we use in Android devices, and how do we load them on the device?</p><p>Additionally, as per my knowledge, SQLite is using phone memory to store all the data. Can a memory card be used for storing the data instead? How / where would I specify this location? </p>","609223","","50049","","2011-02-09 08:34:50","2011-02-09 08:34:50","Is it possible to load other database in Android devices?","<android>","2","0","","",""
"4941580","1","","","2011-02-09 05:18:04","0","5424","<p>I am trying to have my application upload images to the webserver using the code below. It works sometimes, but also seems to fail with a memory error. Can someone please post an example of how to accomplish this if the file size is to big? Also, I am building this to support 1.5 and up. I don't mind if the code given to me resizes the image smaller before upload.</p><pre><code>HttpClient httpclient = new DefaultHttpClient();HttpPost httppost = new HttpPost(urlString);File file = new File(nameOfFile);FileInputStream fileInputStream = new FileInputStream(file);InputStreamEntity reqEntity = new InputStreamEntity(fileInputStream, file.length());httppost.setEntity(reqEntity);reqEntity.setContentType(""binary/octet-stream"");HttpResponse response = httpclient.execute(httppost);HttpEntity responseEntity = response.getEntity();if (responseEntity != null) {    responseEntity.consumeContent();}httpclient.getConnectionManager().shutdown();</code></pre>","609230","","","","","2011-11-17 23:58:01","Android - Upload Large image to server","<android>","3","1","1","",""
"4941581","1","4983655","","2011-02-09 05:18:18","5","5572","<p>I have an application where i need to download a large amount of data via a SOAP call to a webservice into the application when it is first run. The response is then sent to a function which converts the XML and stores the data in a db file.</p><p>The data is more than 16MB in size and i have a java.lang.OutOfMemoryError everytime.</p><p>Modifying the webservice to give out smaller amounts of data is not an option.</p><p>Is there a way to be able to download the large data? Something like an InputStream perhaps?</p><p>This is my code</p><pre><code>public Protocol[] getProtocols() {    String METHOD_NAME = ""GetProtocols"";    String SOAP_ACTION = ""urn:protocolpedia#GetProtocols"";    Log.d(""service"", ""getProtocols"");    SoapObject response = invokeMethod(METHOD_NAME, SOAP_ACTION);    return retrieveProtocolsFromSoap(response);}private SoapObject invokeMethod(String methodName, String soapAction) {    Log.d(TAG, ""invokeMethod"");    SoapObject request = GetSoapObject(methodName);    SoapSerializationEnvelope envelope = getEnvelope(request);    return makeCall(envelope, methodName, soapAction);}</code></pre><p>Can anyone suggest what should be done in this case?</p><p>Thanks and regardsMukul</p>","579705","","","","","2013-04-13 06:45:15","Very large SOAP response - Android- out of memory error","<android><soap><android-ksoap2>","3","2","8","",""
"4941606","1","4943888","","2011-02-09 05:23:19","8","12115","<p>I'm experimenting with Drawable backgrounds and have had no problems so far.</p><p>I'm now trying to change the gradient background color at runtime.</p><p>Unfortunately, there's no API to change it at runtime, it seems. Not even by trying to mutate() the drawable, as explained here: <a href=""http://android-developers.blogspot.com/2009/05/drawable-mutations.html"">Drawable mutations</a></p><p>The sample XML looks like this. It works, as expected.</p><pre><code>&lt;shape xmlns:android=""http://schemas.android.com/apk/res/android""    android:shape=""rectangle""&gt;    &lt;gradient        android:startColor=""#330000FF""        android:endColor=""#110000FF""        android:angle=""90""/&gt;&lt;/shape&gt;</code></pre><p>Sadly, I want a list with various colors, and they'd have to be programatically altered at runtime.</p><p>Is there another way to create this gradient background at runtime? Perhaps even not using XML altogether?</p>","215768","","","","","2011-08-09 06:15:15","Changing gradient background colors on Android at runtime","<android><background><gradient><drawable>","3","0","8","",""
"4941615","1","","","2011-02-09 05:24:43","1","666","<p>My bluetooth connection with server get reset after some time. Is it possible to write keep alive thread in android application? How?</p>","536091","","","","","2011-02-09 05:24:43","Android Bluetooth connection keep alive thread","<android><bluetooth>","0","0","","",""
"4941636","1","4944187","","2011-02-09 05:28:17","1","809","<p>when i am using my own background theme for spinner it is stretching icon.</p><p><img src=""http://i.stack.imgur.com/ssaAe.png"" alt=""enter image description here""></p><p>my spinner code is :</p><pre><code>&lt;Spinner android:id=""@+id/spinnerCategory"" style=""@style/spinner""                    android:entries=""@array/category_array"" android:prompt=""@string/category_prompt""                    android:background=""@drawable/spinner"" /&gt;</code></pre><p>my spinner.xml is:</p><pre><code>&lt;selector xmlns:android=""http://schemas.android.com/apk/res/android""&gt;    &lt;item android:state_window_focused=""false"" android:state_enabled=""true""        android:drawable=""@drawable/btn_dropdown_normal"" /&gt;    &lt;item android:state_pressed=""true"" android:drawable=""@drawable/btn_dropdown_pressed"" /&gt;    &lt;item android:state_focused=""true"" android:state_enabled=""true""        android:drawable=""@drawable/btn_dropdown_selected"" /&gt;    &lt;item android:state_enabled=""true"" android:drawable=""@drawable/btn_dropdown_normal"" /&gt;&lt;/selector&gt; </code></pre><p>and images i copied from the sdk 4.</p><p>so kindly help me out. how can i stop spinner icon stretching. </p>","309990","","","","","2011-02-09 11:23:04","streching spinner icon","<android>","1","0","","",""
"4941671","1","4942370","","2011-02-09 05:33:21","1","1098","<p>I would like to know that how can I upload a video file on server using POST in  android. Please, let me know the answer, if anyone knows about it?</p><p>Thanks</p>","493193","","493193","","2011-02-09 05:42:52","2011-02-09 07:37:08","Uploading video on server through POST","<android>","1","0","2","",""
"4941687","1","","","2011-02-09 05:37:35","1","371","<p>is this possible to uninstall application without using uninstallerActivity.... I want to create my own uninstaller. is PackageManager is responsible for deleting a package then whats the method?</p>","609243","","","","","2011-02-09 05:37:35","How to uninstall application by coding without using UninstallActivity in android","<android>","0","2","1","",""
"4941700","1","","","2011-02-09 05:39:44","1","3828","<p>I have a so file named <code>libJSA.so</code> in memory card in android and wanna load it in my application.</p><p>How can i load this file using <code>System.loadLibrary(""libname"");</code> ?</p><p>Things i have tried:-</p><ul><li>try to copy it to <code>/system/lib</code>.    ----   Not worked </li><li><code>System.loadlibrary(""/mnt/sdcard/folder/libJSA.so"");</code>     -------- Not worked</li></ul>","559070","","","","","2012-11-23 13:43:05","how to load .so file that are not in System/lib folder in android?","<android>","3","0","","",""
"4941706","1","4942754","","2011-02-09 05:41:56","0","570","<p>How to generate a .vcf file from PhoneBook contacts programmatically in Android?</p>","491211","","","","","2011-02-09 08:35:30","Generating a .vcf file from Phone Book Contact","<android>","1","0","","",""
"4941724","1","4942215","","2011-02-09 05:45:44","0","964","<p>I have created a custom ListView with custom rows. They work just fine when using the touchscreen; however, when I attempt to click on the items in the row with the keyboard D-Pad nothing happens. By that I mean my OnClickListener is not called. Does anyone know of any good references or tutorials on how to add keyboard support for new custom rows in a ListView?</p>","467569","","467569","","2011-02-09 05:59:26","2011-02-09 07:36:27","Android ListView and Keyboard","<android><listview>","1","1","","",""
"4941733","1","4944428","","2011-02-09 05:47:11","0","1397","<p>I am trying to render an openGL es surface from the NDK, but got halted early in my work. I have a setup similar to the 3d example in the NDK. I have a class inheriting from GLSurface view and one inheriting from GLSurfaceView.Renderer. In my .c file, I have a simple method that does NOTHING. It is just a void function with nothing in it. I can call this function in my class that inherit from activity onCreate method.<br>private static native void nativeSetup();  </p><pre><code>@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    requestWindowFeature(Window.FEATURE_NO_TITLE);    mGLView = new GraphGLSurfaceView(this);    setContentView(mGLView);    nativeSetup();}</code></pre><p>The program works fine. However, if i put the call (and declaration) in one of the GLSurfaceView classes, the program immediately fails (nativeSetup is the call in question). I have verified that everything is working fine without the native call (a colored surface is drawn). Does anyone have any ideas about why I cannot call native code from GLSurface classes?</p><p>My c file:</p><pre><code>#include &lt;string.h&gt;#include &lt;jni.h&gt;void Java_com_test_intro_nativeSetup( JNIEnv*  env ){}</code></pre><p>My java file in a non working manner:</p><pre><code>package com.test;import javax.microedition.khronos.egl.EGLConfig;import javax.microedition.khronos.opengles.GL10;import android.app.Activity;import android.content.Context;import android.opengl.GLSurfaceView;import android.os.Bundle;import android.util.Log;import android.view.Window;public class intro extends Activity {    static{        System.loadLibrary(""graphrender"");    }    private GLSurfaceView mGLView;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        requestWindowFeature(Window.FEATURE_NO_TITLE);        mGLView = new GraphGLSurfaceView(this);        setContentView(mGLView);    }}class GraphGLSurfaceView extends GLSurfaceView {    GraphRenderer mRenderer;        public GraphGLSurfaceView(Context context) {        super(context);        mRenderer = new GraphRenderer();        setRenderer(mRenderer);    }}class GraphRenderer implements GLSurfaceView.Renderer {     private static native void nativeSetup();    private float _red = 0.9f;    private float _green = 0.2f;    private float _blue = 0.2f;    public void onSurfaceCreated(GL10 gl, EGLConfig config) {        Log.d(""intro"", ""Got to intro 4"" );    }    public void onSurfaceChanged(GL10 gl, int w, int h) {        gl.glViewport(0, 0, w, h);        nativeSetup();        //Log.d(""intro"", ""Got to intro 2"" + debugStr);    }    public void onDrawFrame(GL10 gl) {        Log.d(""intro"", ""Got to intro 3"");        gl.glClearColor(_red, _green, _blue, 1.0f);        // clear the color buffer to show the ClearColor we called above...        gl.glClear(GL10.GL_COLOR_BUFFER_BIT);    }}</code></pre>","523412","","","","","2011-02-09 11:46:48","NDK call in a GLSurfaceView class","<android><opengl-es><android-ndk><glsurfaceview>","1","0","","",""
"4941765","1","4941956","","2011-02-09 05:53:49","1","2617","<p>It is often nice to have some default values in Shared Preferences to begin with.  Is there  a good way to initialize them from an xml file or property file? Looking for the best way to do this.  Thanks.</p>","602260","","","","","2011-02-09 06:30:49","Android Shared Preferences Initialization","<android><initialization><sharedpreferences>","1","0","","",""
"4941770","1","4942269","","2011-02-09 05:54:25","1","718","<p>HI..I doing geocoding in android map.(i.e)getting address as input from user &amp; locate that particular point using marker.How could i do this?</p><p>My code</p><h2>simpleGoogleMaps.java</h2><pre><code>public class simpleGoogleMaps extends MapActivity{Geocoder geocoder=null;MapView mapView=null;@Overrideprotected boolean isLocationDisplayed(){return false;}@Overrideprotected boolean isRouteDisplayed(){return false;}@Overrideprotected void onCreate(Bundle savedInstanceState){super.onCreate(savedInstanceState);setContentView(R.layout.main);mapView=(MapView)findViewById(R.id.map);mapView.setBuiltInZoomControls(true);Button geoBtn=(Button)findViewById(R.id.geocodeBtn);geocoder=new Geocoder(this);geoBtn.setOnClickListener(new OnClickListener(){@Overridepublic void onClick(View srg0){try{EditText loc=(EditText)findViewById(R.id.location);String locationName=loc.getText().toString();List&lt;Address&gt;addressList=geocoder.getFromLocationName(locationName,5);if(addressList!=null &amp;&amp; addressList.size()&gt;0){ int lat=(int)(addressList.get(0).getLatitude()*1000000); int lng=(int)(addressList.get(0).getLongitude()*1000000);GeoPoint pt=new GeoPoint(lat,lng);mapView.getController().setZoom(15);mapView.getController().setCenter(pt);}}catch(IOException e){e.printStackTrace();}}});}}</code></pre><hr><h2>XML file is</h2><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_width=""fill_parent""android:layout_alignParentBottom=""true""android:layout_height=""wrap_content""android:orientation=""vertical""&gt;&lt;EditText android:layout_width=""fill_parent"" android:id=""@+id/location""android:layout_height=""wrap_content""/&gt;&lt;Button android:id=""@+id/geocodeBtn""android:layout_width=""wrap_content""android:layout_height=""wrap_content"" android:text=""Find""/&gt;&lt;/LinearLayout&gt;&lt;com.google.android.maps.MapViewandroid:id=""@+id/map"" android:clickable=""true""android:layout_width=""fill_parent""android:layout_height=""320px""android:apiKey=""0JfVbxbXShKp6h-xycpoR1hw_yawrKng5eUMX0g""/&gt;&lt;/RelativeLayout&gt;</code></pre><hr><h2>when i try to run this.,i got run time error....in DDMS..i got..</h2><pre><code>02-09 12:25:55.735: WARN/dalvikvm(360): threadid=3: thread exiting with uncaught exception (group=0x4001aa28)02-09 12:25:55.744: ERROR/AndroidRuntime(360): Uncaught handler: thread main exiting due to uncaught exception02-09 12:25:55.774: ERROR/AndroidRuntime(360): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.make/com.make.simpleGoogleMaps}: java.lang.ClassNotFoundException: com.make.simpleGoogleMaps in loader dalvik.system.PathClassLoader@4376a9f802-09 12:25:55.774: ERROR/AndroidRuntime(360):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2324)02-09 12:25:55.774: ERROR/AndroidRuntime(360):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2417)02-09 12:25:55.774: ERROR/AndroidRuntime(360):     at android.app.ActivityThread.access$2100(ActivityThread.java:116)02-09 12:25:55.774: ERROR/AndroidRuntime(360):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1794)02-09 12:25:55.774: ERROR/AndroidRuntime(360):     at android.os.Handler.dispatchMessage(Handler.java:99)02-09 12:25:55.774: ERROR/AndroidRuntime(360):     at android.os.Looper.loop(Looper.java:123)02-09 12:25:55.774: ERROR/AndroidRuntime(360):     at android.app.ActivityThread.main(ActivityThread.java:4203)02-09 12:25:55.774: ERROR/AndroidRuntime(360):     at java.lang.reflect.Method.invokeNative(Native Method)02-09 12:25:55.774: ERROR/AndroidRuntime(360):     at java.lang.reflect.Method.invoke(Method.java:521)02-09 12:25:55.774: ERROR/AndroidRuntime(360):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)02-09 12:25:55.774: ERROR/AndroidRuntime(360):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)02-09 12:25:55.774: ERROR/AndroidRuntime(360):     at dalvik.system.NativeStart.main(Native Method)02-09 12:25:55.774: ERROR/AndroidRuntime(360): Caused by: java.lang.ClassNotFoundException: com.make.simpleGoogleMaps in loader dalvik.system.PathClassLoader@4376a9f802-09 12:25:55.774: ERROR/AndroidRuntime(360):     at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)02-09 12:25:55.774: ERROR/AndroidRuntime(360):     at java.lang.ClassLoader.loadClass(ClassLoader.java:573)02-09 12:25:55.774: ERROR/AndroidRuntime(360):     at java.lang.ClassLoader.loadClass(ClassLoader.java:532)02-09 12:25:55.774: ERROR/AndroidRuntime(360):     at android.app.Instrumentation.newActivity(Instrumentation.java:1097)02-09 12:25:55.774: ERROR/AndroidRuntime(360):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2316)</code></pre>","555948","","1371853","","2012-06-04 15:49:50","2012-06-04 15:49:50","geocoding in android map","<android><geocoding><android-maps>","1","2","","",""
"4941790","1","","","2011-02-09 06:01:25","0","1024","<p>Hi im new to android development i have an alertdialog with multichoice buttoni want to set one button by clicking this button all item in the alertdialog list will automatically select programitically.</p><p>but i unable to find any way kindly help me in this regards.</p>","609272","","","","","2011-06-21 17:52:18","How to select all item programatically in AlertDialgue Multichoice button in Android","<android>","1","2","1","",""
"4941791","1","4948451","","2011-02-09 06:01:25","0","582","<p>I am trying to compile my app with debug options set. I have included the android/bitmap.h file. Everything compiles well with methods in android/bitmap.h file, but the linker has problems as it says </p><pre><code>/home/user5432/workspace/bitmapproj/obj/local/armeabi/objs-debug/mybitmap.o : In function Java_com_example_plasma_PlasmaView_renderPlasma""undefined reference to AndroidBitmap_getInfo""""undefined reference to AndroidBitmap_lockPixels""""undefined reference to AndroidBitmap_unlockPixels""</code></pre><p>Can anybody tell me what's the problem?</p>","574911","","","","","2011-02-09 17:41:20","undefined references with debgging symbols on android","<android><linker><android-ndk>","1","0","","",""
"4941898","1","","","2011-02-09 06:18:28","0","2311","<p>I'm working on an Android application which includes a widget.  The main interface of the app is a simple activity, but some of the things users can do in the activity make it necessary to update the widget - i.e. run its onUpdate method.</p><p>How can I trigger this method from the activity?  Looking at <a href=""http://stackoverflow.com/questions/4777298/how-to-update-a-widget-on-app-start"">other</a> <a href=""http://stackoverflow.com/questions/3455123/programmatically-update-widget-from-activity"">questions</a>, I've been able to write code which changes its layout, but it doesn't seem to run onUpdate (since I'm just left with the empty layout and none of the data which is added during onUpdate).</p><p>Any ideas or code samples very much appreciated!</p>","593886","","","","","2011-04-25 21:38:54","Call widget's onUpdate method from the app's main activity","<android><activity><widget><onupdate>","1","0","","",""
"4941901","1","","","2011-02-09 06:19:26","1","463","<p>I am developing Android Applicastion,I am retriving data from one server to display data in to android grid through webservices,i created webservices in .net and connected to server in that webservice application,Now i am getting the problem i have data in xmlfile i don't nkow how to bind that XML data in android GridView,if knows any one that steps please post the code,Thanks in  advance</p>","591812","","218196","","2012-05-09 12:29:27","2012-05-09 12:29:27","bind xmldata in android grid","<android><xml><gridview><binding>","0","0","","",""
"4941954","1","4941967","","2011-02-09 06:30:11","2","1921","<blockquote>  <p>[2011-02-09 23:59:11 - Timerproject] ------------------------------<br>  [2011-02-09 23:59:11 - Timerproject] Android Launch!<br>  [2011-02-09 23:59:11 - Timerproject] adb is running normally.<br>  [2011-02-09 23:59:11 - Timerproject] Performing acarin.timetracker.project.ezhil.Timerproject activity launch<br>  [2011-02-09 23:59:11 - Timerproject] Automatic Target Mode: Preferred AVD 'MA_AVD_2.3.1' is not available. Launching new emulator.<br>  [2011-02-09 23:59:11 - Timerproject] Launching a new emulator with Virtual Device 'MA_AVD_2.3.1'<br>  [2011-02-09 23:59:31 - Timetracker] New emulator found: emulator-5554<br>  [2011-02-09 23:59:31 - Timetracker] Waiting for HOME ('android.process.acore') to be launched...<br>  [2011-02-10 00:01:40 - Timetracker] HOME is up on device 'emulator-5554'<br>  [2011-02-10 00:01:40 - Timetracker] Uploading Timetracker.apk onto device 'emulator-5554'<br>  [2011-02-10 00:01:40 - Timetracker] Installing Timetracker.apk...<br>  [2011-02-10 00:04:11 - Timetracker] Failed to install Timetracker.apk on device 'emulator-5554!<br>  [2011-02-10 00:04:11 - Timetracker] (null)<br>  [2011-02-10 00:04:11 - Timetracker] Launch canceled!</p></blockquote><hr><p>i run the Timerproject but another timetrack project is only running the same timetracker project also doest responding</p>","565106","","436938","","2012-03-29 09:53:59","2012-05-03 13:10:24","emulator: ERROR: the user data image is used by another emulator. aborting","<android><android-emulator>","3","0","","",""
"4941965","1","","","2011-02-09 06:32:37","8","10244","<p>Im trying to get a list of all the contacts and there email address. </p><p>Currently im using this code, however I get a lot of duplicate names and emails. What i want is just one person and one email. Is there a way I can merge contacts while querying for them?</p><p>Also im just looking for a > 2.0 solution. </p><pre><code>    private void init() {    ContentResolver cr = getContentResolver();    Cursor cur = cr.query(ContactsContract.Contacts.CONTENT_URI,null, null, null, null);    if (cur.getCount() &gt; 0) {    while (cur.moveToNext()) {        String id = cur.getString(cur.getColumnIndex(ContactsContract.Contacts._ID));    String name = cur.getString(cur.getColumnIndex(ContactsContract.Contacts.DISPLAY_NAME));        Cursor emailCur = cr.query(ContactsContract.CommonDataKinds.Email.CONTENT_URI,null,ContactsContract.CommonDataKinds.Email.CONTACT_ID + "" = ?"", new String[]{id},null);         while (emailCur.moveToNext()) {                 String email = emailCur.getString( emailCur.getColumnIndex(ContactsContract.CommonDataKinds.Email.DATA));                Log.e(""Email"",name+"" ""+email);            }             emailCur.close();        }    }</code></pre>","117691","","","","","2013-02-13 08:35:57","Getting android contacts","<android><contacts>","1","6","5","",""
"4942033","1","","","2011-02-09 06:44:35","0","3082","<pre><code>    02-09 12:06:38.745: WARN/dalvikvm(198): threadid=3: thread exiting with uncaught     exception (group=0x4001b188)02-09 12:06:38.766: ERROR/AndroidRuntime(198): Uncaught handler: thread main exiting due   to uncaught exception  02-09 12:06:39.415: DEBUG/dalvikvm(198): GC freed 1522 objects / 308248 bytes in 400ms  02-09 12:06:39.574: ERROR/AndroidRuntime(198): java.lang.IllegalStateException: Could    not execute method of the activity 02-09 12:06:39.574: ERROR/AndroidRuntime(198):     at android.view.View$1.onClick(View.java:2031) 02-09 12:06:39.574: ERROR/AndroidRuntime(198):     at android.view.View.performClick(View.java:2364)02-09 12:06:39.574: ERROR/AndroidRuntime(198):     at android.view.View.onTouchEvent(View.java:4179)02-09 12:06:39.574: ERROR/AndroidRuntime(198):     at  android.widget.TextView.onTouchEvent(TextView.java:6541) 02-09 12:06:39.574: ERROR/AndroidRuntime(198):     at android.view.View.dispatchTouchEvent(View.java:3709)02-09 12:06:39.574: ERROR/AndroidRuntime(198):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884) 02-09 12:06:39.574: ERROR/AndroidRuntime(198):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884) 02-09 12:06:39.574: ERROR/AndroidRuntime(198):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)02-09 12:06:39.574: ERROR/AndroidRuntime(198):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)  02-09 12:06:39.574: ERROR/AndroidRuntime(198):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884) 02-09 12:06:39.574: ERROR/AndroidRuntime(198):     at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1659)02-09 12:06:39.574: ERROR/AndroidRuntime(198):     at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1107)02-09 12:06:39.574: ERROR/AndroidRuntime(198):     at android.app.Activity.dispatchTouchEvent(Activity.java:2061) 02-09 12:06:39.574: ERROR/AndroidRuntime(198):     at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1643) 02-09 12:06:39.574: ERROR/AndroidRuntime(198):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1691) 02-09 12:06:39.574: ERROR/AndroidRuntime(198):     at android.os.Handler.dispatchMessage(Handler.java:99)  02-09 12:06:39.574: ERROR/AndroidRuntime(198):     at android.os.Looper.loop(Looper.java:123)02-09 12:06:39.574: ERROR/AndroidRuntime(198):     at android.app.ActivityThread.main(ActivityThread.java:4363)  02-09 12:06:39.574: ERROR/AndroidRuntime(198):     at java.lang.reflect.Method.invokeNative(Native Method)   02-09 12:06:39.574: ERROR/AndroidRuntime(198):     at java.lang.reflect.Method.invoke(Method.java:521) 02-09 12:06:39.574: ERROR/AndroidRuntime(198):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)    02-09 12:06:39.574: ERROR/AndroidRuntime(198):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)     02-09 12:06:39.574: ERROR/AndroidRuntime(198):     at dalvik.system.NativeStart.main(Native Method)    02-09 12:06:39.574: ERROR/AndroidRuntime(198): Caused by: java.lang.reflect.InvocationTargetException   02-09 12:06:39.574: ERROR/AndroidRuntime(198):     at com.ey.eyconnect.Connect_EY.btnSaveActive(Connect_EY.java:1734)    02-09 12:06:39.574: ERROR/AndroidRuntime(198):     at java.lang.reflect.Method.invokeNative(Native Method)   02-09 12:06:39.574: ERROR/AndroidRuntime(198):     at java.lang.reflect.Method.invoke(Method.java:521)02-09 12:06:39.574: ERROR/AndroidRuntime(198):     at android.view.View$1.onClick(View.java:2026)  02-09 12:06:39.574: ERROR/AndroidRuntime(198):     ... 22 more    02-09 12:06:39.574: ERROR/AndroidRuntime(198): Caused by: java.lang.IllegalStateException: Could not execute method of the activity    02-09 12:06:39.574: ERROR/AndroidRuntime(198):     at android.view.View$1.onClick(View.java:2031)        02-09 12:06:39.574: ERROR/AndroidRuntime(198):     at android. view.View.performClick(View.java:2364)           02-09 12:06:39.574: ERROR/AndroidRuntime(198):     at android.view.View.onTouchEvent(View.java:4179)          02-09 12:06:39.574: ERROR/AndroidRuntime(198):     at android.widget.TextView.onTouchEvent(TextView.java:6541)       02-09 12:06:39.574: ERROR/AndroidRuntime(198):     at android.view.View.dispatchTouchEvent(View.java:3709)      02-09 12:06:39.574: ERROR/AndroidRuntime(198):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)      02-09 12:06:39.574: ERROR/AndroidRuntime(198):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)           02-09 12:06:39.574: ERROR/AndroidRuntime(198):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)        02-09 12:06:39.574: ERROR/AndroidRuntime(198):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)      02-09 12:06:39.574: ERROR/AndroidRuntime(198):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)            02-09 12:06:39.574: ERROR/AndroidRuntime(198):     at              com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1659)      02-09 12:06:39.574: ERROR/AndroidRuntime(198):     at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1107)    02-09 12:06:39.574: ERROR/AndroidRuntime(198):     at android.app.Activity.dispatchTouchEvent(Activity.java:2061)  02-09 12:06:39.574: ERROR/AndroidRuntime(198):     at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1643)    02-09 12:06:39.574: ERROR/AndroidRuntime(198):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1691)    02-09 12:06:39.574: ERROR/AndroidRuntime(198):     at android.os.Handler.dispatchMessage(Handler.java:99)        02-09 12:06:39.574: ERROR/AndroidRuntime(198):     at android.os.Looper.loop(Looper .java:123)          02-09 12:06:39.574: ERROR/AndroidRuntime(198):     ... 26 more         02-09 12:06:39.574: ERROR/AndroidRuntime(198): Caused by: java.lang.reflect.InvocationTargetException   02-09 12:06:39.574: ERROR/AndroidRuntime(198):     at com.ey.eyconnect.Connect_EY.btnSaveActive(Connect_EY.java:1734)  02-09 12:06:39.574: ERROR/AndroidRuntime(198):     at java.lang.reflect.Method.invokeNative(Native Method) 02-09 12:06:39.574: ERROR/AndroidRuntime(198):     at java.lang.reflect.Method.invoke(Method.java:521) 02-09 12:06:39.574: ERROR/AndroidRuntime(198):     at android.view.View$1.onClick(View.java:2026)  02-09 12:06:39.574: ERROR/AndroidRuntime(198):     ... 42 more  02-09 12:06:39.574: ERROR/AndroidRuntime(198): Caused by: java.lang.IllegalStateException: Could not execute method of the activity     02-09 12:06:39.574: ERROR/AndroidRuntime(198):     at android.view.View$1.onClick(View.java:2031)    02-09 12:06:39.574: ERROR/AndroidRuntime(198):     at android.view.View.performClick(View.java:2364) 02-09 12:06:39.574: ERROR/AndroidRuntime(198):     at android.view.View.onTouchEvent(View.java:4179)       02-09 12:06:39.574: ERROR/AndroidRuntime(198):     at android.widget.TextView.onTouchEvent(TextView.java:6541)          02-09 12:06:39.574: ERROR/AndroidRuntime(198):     at android.view.View.dispatchTouchEvent(View.java:3709)     02-09 12:06:39.574: ERROR/AndroidRuntime(198):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)      02-09 12:06:39.574: ERROR/AndroidRuntime(198):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)     02-09 12:06:39.574: ERROR/AndroidRuntime(198):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)     02-09 12:06:39.574: ERROR/AndroidRuntime(198):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884) 02-09 12:06:39.574: ERROR/AndroidRuntime(198):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:</code></pre><p>I need to save a number. when i save for 5-6 times this exception is throwing..</p><pre><code>  its shown is the   ***background.start();        Looper.loop(); line***   background is the Thread  and my method for saving a number is :  public void btnSave(View v) { // Save Button Invoked db = eventsData.getWritableDatabase();edt = (EditText) this.findViewById(R.id.edteyconnect);edt1 = (EditText) this.findViewById(R.id.edtpass);String prevedt = edt.getText().toString();String eyid = edt.getText().toString();    Thread background = new Thread(new Runnable() {    public void run() {    boolean res = false;    boolean stringres = false;     db = eventsData.getWritableDatabase();    String eyid = edt.getText().toString();    Looper.prepare();    // -------------------------------------------------------------------------    try {                            CharSequence char0 = ""success"";        CharSequence char1 = edt2.getText().toString();        res = result.contains(char0);        stringres = result.contains(char1);        Bundle bundle = new Bundle();        bundle.putBoolean(""key1"", res);        bundle.putBoolean(""key2"", stringres);        bundle.putInt(""flag"", 1);        Message message = new Message();        message.setData(bundle);        handler.sendMessage(message);    } catch (Exception e) {         ContentValues values = new      ContentValues();        values.put(EventDataSQLHelper.STATUS, stat);        db.update(EventDataSQLHelper.TABLE, values, ""ID = "" + eyid,            null);        Bundle bundle = new Bundle();        bundle.putInt(""flag"", 0);        Message message = new Message();        message.setData(bundle);    }    }});// start the background threadbackground.start();Looper.loop();}</code></pre>","548218","","548218","","2011-02-09 06:58:04","2011-02-09 07:04:11","How to avoid .IllegalStateException","<android>","1","2","","",""
"4942049","1","4942167","","2011-02-09 06:46:54","0","2014","<p>I'm starting an intent in an activity class TTWifi.java as follows</p><pre><code>Intent i = new Intent(this, SocketClient.class);startActivity(i);</code></pre><p>Now how do i access the variables of <code>TTWifi.class</code> from <code>SocketClient.class</code>?</p><p>I believe there is a way to send values between them. I am very new to android, guess this is a very fundamental stuff :) Would really appreciate if someone can help me out in this...</p>","448005","","750613","","2012-07-13 10:57:19","2012-07-13 10:57:19","Android accessing parent class values after starting an intent?","<android>","2","0","","",""
"4942054","1","4942156","","2011-02-09 06:47:44","1","136","<p>I am creating a game and I would highly appreciate any advise on this. </p><p>I have an activity which loads a class and as that class is loaded, the text view would shows player 1 turn. I understand I can set this in the xml. </p><p>But then when player 1 loses the game the text field should show player 2 turn. </p><p>It would be great if someone could explain how I could do this. </p><p>Even better would be if two people could enter there names one as player 1 and then as player 2 which would then show the names of whose turn it is. </p><p>Many thanks.</p>","608658","","","","","2011-02-09 07:00:54","Determine turn taking in game","<android>","1","0","","",""
"4942075","1","4942147","","2011-02-09 06:50:55","1","1427","<p>I'm using HttpClient to fetch an XML file and I'm having issues getting the entire document returned (it only returns one line of the XML file). So:</p><pre><code>DefaultHttpClient c = new DefaultHttpClient();BasicResponseHandler r = new BasicResponseHandler();String s = null;try{    s = c.execute(new HttpGet(""http://localhost/activity.xml""), r);}catch (Exception e){    e.printStackTrace();}Log.i(TAG, s);</code></pre><p>The resulting string is always just <code>&lt;?xml version=""1.0"" encoding=""UTF-8""?&gt;</code></p><p>Is there something I need to do to tell HttpClient to load the entire file or process newlines or something? XML is super simple:</p><pre><code>&lt;?xml version=""1.0"" encoding=""UTF-8""?&gt;&lt;project&gt;    &lt;group-id type=""integer""&gt;2187&lt;/group-id&gt;    &lt;icon type=""integer""&gt;2&lt;/icon&gt;    &lt;name&gt;Android&lt;/name&gt;    &lt;overview&gt;android app&lt;/overview&gt;    &lt;permalink&gt;codebase&lt;/permalink&gt;    &lt;start-page&gt;tickets&lt;/start-page&gt;    &lt;status&gt;active&lt;/status&gt;&lt;/project&gt;</code></pre>","53653","","","","","2011-02-09 07:04:43","HttpClient response only one line of XML","<java><android><apache><httpclient>","2","0","","",""
"4942109","1","4943161","","2011-02-09 06:55:00","0","624","<p>I am a new Android developer. I want to connect my app with Facebook. I tried the Fb rocket code in following link:</p><p><a href=""http://www.androidpeople.com/android-facebook-api-example-using-fbrocket/#idc-cover"" rel=""nofollow"">http://www.androidpeople.com/android-facebook-api-example-using-fbrocket/#idc-cover</a></p><p>When I am using the API key in the coding with my APP name, the status gets posted successfully, but when I use my own API key and my APP name, it goes till the login page and shows <code>Sorry, something went wrong</code>. Please help me solve my issue. I am very new to Android.</p>","596364","","1128737","","2012-01-14 08:13:32","2012-01-14 08:13:32","Facebook rocket for Android","<java><android><facebook>","1","1","0","",""
"4942114","1","4942676","","2011-02-09 06:55:44","0","890","<p>I build custom gallery for photos only. I taking photos from sdcard with this class:</p><pre><code>public class Photos {public static final String PHOTO_BUCKET_NAME =    Environment.getExternalStorageState().toString() + ""/DCIM/Camera"";public static final int PHOTO_BUCKET_ID = getBucketId(PHOTO_BUCKET_NAME);public static int getBucketId(String path) {    return path.toLowerCase().hashCode();}public static List&lt;String&gt; getPhotos(Context context) {    final String[] projection = {MediaStore.Images.Media.DATA};    final String selection = MediaStore.Images.Media.BUCKET_ID;    Cursor c = context.getContentResolver().query(Images.Media.EXTERNAL_CONTENT_URI, projection, selection, null, null);    List&lt;String&gt; result = new ArrayList&lt;String&gt;(c.getCount());    if (c.moveToFirst()) {        int dataColumn = c.getColumnIndexOrThrow(MediaStore.Images.Media.DATA);        do {            String data = c.getString(dataColumn);            result.add(data);        } while (c.moveToNext());    }    c.close();    return result;}</code></pre><p>And set adapter to gallery:</p><pre><code>public class ImageAdapter extends BaseAdapter {    int GalItemBg;    private Context mContext;    private List&lt;String&gt; photoList;    public ImageAdapter(Context c) {        mContext = c;        photoList = Photos.getPhotos(c);        TypedArray typArray = obtainStyledAttributes(R.styleable.GalleryTheme);        GalItemBg = typArray.getResourceId(R.styleable.GalleryTheme_android_galleryItemBackground, 0);        typArray.recycle();    }    @Override    public int getCount() {        return photoList.size();    }    @Override    public Object getItem(int position) {        return position;    }     @Override    public long getItemId(int position) {        return position;    }    @Override    public View getView(int position, View convertView, ViewGroup parent) {        ImageView i = new ImageView(mContext);        Bitmap bm = BitmapFactory.decodeFile(photoList.get(position));        i.setImageBitmap(bm);        i.setLayoutParams(new Gallery.LayoutParams(80,70));        i.setScaleType(ImageView.ScaleType.FIT_XY);        i.setBackgroundResource(GalItemBg);        return i;    }}</code></pre><p>}There is nothing special. When i run my app, all good it works. After that I launch camera and taking some photos, in this time my app running in background. When I back to my app, I need to see new photos. How to do it?</p><p>Tried:update adapter in onResume method like this:</p><pre><code>Gallery g;public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    g = (Gallery) findViewById(R.id.gallery);    g.setAdapter(new ImageAdapter(this));} @Overridepublic void onResume() {    g.setAdapter(new ImageAdapter(this));}</code></pre><p>App crashing. May be I do something wrong?</p><p>LogCat:</p><pre><code>02-09 08:12:33.719: ERROR/AndroidRuntime(276): Uncaught handler: thread main exiting due to uncaught exception02-09 08:12:34.129: ERROR/AndroidRuntime(276): java.lang.RuntimeException: Unable to resume activity {ru.home.tabexample/ru.home.tabexample.TabAct}: java.lang.RuntimeException: Unable to resume activity {ru.home.tabexample/ru.home.tabexample.FirstTab}: android.app.SuperNotCalledException: Activity {ru.home.tabexample/ru.home.tabexample.FirstTab} did not call through to super.onResume()02-09 08:12:34.129: ERROR/AndroidRuntime(276):     at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2950)02-09 08:12:34.129: ERROR/AndroidRuntime(276):     at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2965)02-09 08:12:34.129: ERROR/AndroidRuntime(276):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2516)02-09 08:12:34.129: ERROR/AndroidRuntime(276):     at android.app.ActivityThread.access$2200(ActivityThread.java:119)02-09 08:12:34.129: ERROR/AndroidRuntime(276):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863)02-09 08:12:34.129: ERROR/AndroidRuntime(276):     at android.os.Handler.dispatchMessage(Handler.java:99)02-09 08:12:34.129: ERROR/AndroidRuntime(276):     at android.os.Looper.loop(Looper.java:123)02-09 08:12:34.129: ERROR/AndroidRuntime(276):     at android.app.ActivityThread.main(ActivityThread.java:4363)02-09 08:12:34.129: ERROR/AndroidRuntime(276):     at java.lang.reflect.Method.invokeNative(Native Method)02-09 08:12:34.129: ERROR/AndroidRuntime(276):     at java.lang.reflect.Method.invoke(Method.java:521)02-09 08:12:34.129: ERROR/AndroidRuntime(276):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)02-09 08:12:34.129: ERROR/AndroidRuntime(276):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)02-09 08:12:34.129: ERROR/AndroidRuntime(276):     at dalvik.system.NativeStart.main(Native Method)02-09 08:12:34.129: ERROR/AndroidRuntime(276): Caused by: java.lang.RuntimeException: Unable to resume activity {ru.home.tabexample/ru.home.tabexample.FirstTab}: android.app.SuperNotCalledException: Activity {ru.home.tabexample/ru.home.tabexample.FirstTab} did not call through to super.onResume()02-09 08:12:34.129: ERROR/AndroidRuntime(276):     at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2950)02-09 08:12:34.129: ERROR/AndroidRuntime(276):     at android.app.LocalActivityManager.moveToState(LocalActivityManager.java:170)02-09 08:12:34.129: ERROR/AndroidRuntime(276):     at android.app.LocalActivityManager.dispatchResume(LocalActivityManager.java:518)02-09 08:12:34.129: ERROR/AndroidRuntime(276):     at android.app.ActivityGroup.onResume(ActivityGroup.java:58)02-09 08:12:34.129: ERROR/AndroidRuntime(276):     at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1149)02-09 08:12:34.129: ERROR/AndroidRuntime(276):     at android.app.Activity.performResume(Activity.java:3763)02-09 08:12:34.129: ERROR/AndroidRuntime(276):     at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2937)02-09 08:12:34.129: ERROR/AndroidRuntime(276):     ... 12 more02-09 08:12:34.129: ERROR/AndroidRuntime(276): Caused by: android.app.SuperNotCalledException: Activity {ru.home.tabexample/ru.home.tabexample.FirstTab} did not call through to super.onResume()02-09 08:12:34.129: ERROR/AndroidRuntime(276):     at android.app.Activity.performResume(Activity.java:3765)02-09 08:12:34.129: ERROR/AndroidRuntime(276):     at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2937)02-09 08:12:34.129: ERROR/AndroidRuntime(276):     ... 18 more</code></pre>","609327","","114066","","2011-02-09 08:22:06","2011-02-09 08:24:28","How to sync my app with photos","<android>","1","4","","",""
"4942144","1","4942201","","2011-02-09 06:59:23","9","26553","<p>[2011-02-10 00:14:34 - newproject] Unable to resolve target 'android-2'</p><hr><p>and the newproject java and xml files does't have an any error but the project is in error from when i import what problem in it</p><hr>","565106","","","","","2013-06-07 11:12:40","Error:Unable to resolve target 'android-2'","<android>","4","5","8","",""
"4942168","1","","","2011-02-09 07:02:16","3","271","<p>In my android application i would like to allow the user to print the data on phone  to the nearest printer on click of print button.</p><p>Is it possible in android.How could i get the printers nearby?</p><p>Please share your valuable suggestions.</p><p>Thanks in advance :)</p>","420261","","","","","2012-07-14 10:03:09","printing data from phone in android","<android>","1","0","2","",""
"4942175","1","4942696","","2011-02-09 07:04:05","3","4500","<p>i am trying to create a custom tab in my android app and i got some sample codes but that code is showing errors in setIndicator method...here is my code</p><p>error i am getting is - The method <code>setIndicator(CharSequence)</code> in the type <code>TabHost.TabSpec</code> is not applicable for the arguments (TextView)</p><pre><code>package com.myapp;import android.app.Activity;import android.graphics.Color;import android.os.Bundle;import android.view.Gravity;import android.view.View;import android.widget.FrameLayout;import android.widget.LinearLayout;import android.widget.TabHost;import android.widget.TabWidget;import android.widget.TextView;import android.widget.LinearLayout.LayoutParams;import android.widget.TabHost.TabContentFactory;import android.widget.TabHost.TabSpec;//Custom Tabspublic class MyActivity extends Activity {int tabHeight = 40;@Overridepublic void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);LinearLayout main = new LinearLayout(this);main.setOrientation(LinearLayout.VERTICAL);setContentView(main);TabHost tabs = new TabHost(this);tabs.setId(android.R.id.tabhost);main.addView(tabs);TabWidget tabWidget = new TabWidget(this);tabWidget.setId(android.R.id.tabs);tabs.addView(tabWidget);FrameLayout tabContent = new FrameLayout(this);tabContent.setId(android.R.id.tabcontent);tabContent.setPadding(0, tabHeight, 0, 0);tabs.addView(tabContent);TextView content = new TextView(this);content.setText(""This is the Frame Content"");content.setId(100);tabs.setup();TabSpec tspec1 = tabs.newTabSpec(""Tab1"");tspec1.setIndicator(makeTabIndicator(""One""));tspec1.setContent(new PreExistingViewFactory(content));tabs.addTab(tspec1);TabSpec tspec2 = tabs.newTabSpec(""Tab2"");tspec2.setIndicator(makeTabIndicator(""Two""));tspec2.setContent(new PreExistingViewFactory(content));tabs.addTab(tspec2);TabSpec tspec3 = tabs.newTabSpec(""Tab3"");tspec3.setIndicator(makeTabIndicator(""Three""));tspec3.setContent(new PreExistingViewFactory(content));tabs.addTab(tspec3);}private TextView makeTabIndicator(String text){TextView tabView = new TextView(this);LayoutParams lp3 = new LayoutParams(LayoutParams.WRAP_CONTENT, tabHeight, 1);lp3.setMargins(1, 0, 1, 0);tabView.setLayoutParams(lp3);tabView.setText(text);tabView.setTextColor(Color.WHITE);tabView.setGravity(Gravity.CENTER_HORIZONTAL|Gravity.CENTER_VERTICAL);tabView.setBackgroundDrawable( getResources().getDrawable(R.drawable.tab_indicator));tabView.setPadding(13, 0, 13, 0);return tabView;}class PreExistingViewFactory implements TabContentFactory{private final View preExisting;protected PreExistingViewFactory(View view){preExisting = view;}public View createTabContent(String tag) {return preExisting;}}}</code></pre><p>anybody pls help me to fix this issue ...</p><p>thanx in advance ..kris</p>","543393","","463721","","2011-02-09 07:27:39","2011-09-03 11:33:13","Custom tab in android - getting error while using ""setIndicator""","<android><tabs>","3","0","","",""
"4942196","1","4942224","","2011-02-09 07:06:51","5","7652","<p>I have a vertically aligned LinearLayout which contains a TextView, my own custom view class, and i'm hoping to put an ad at the bottom. </p><p>I'm drawing objects in my custom view class (that extends View), but it does not get updated to the screen unless i call <code>setContentView(R.layout.myview)</code>, but this resets my TextView to the default text (what is stored in the xml file) which i don't want, and i assume it would redraw a new ad as well... annoying.</p><p>Is there a way i can redraw/refresh my custom View to the screen without affecting my textview or whatever else i may have on my layout?</p>","605933","","62921","","2014-03-31 17:57:55","2014-03-31 17:57:55","Android: Redrawing a specific view inside a layout","<android><layout><view><refresh><draw>","1","0","","",""
"4942213","1","4942241","","2011-02-09 07:09:43","2","10373","<p>Has anyone developed any code for converting an address to a lat/long value.I am getting confused with Geocoder.It would be of great help if i can get sample code, I am using below code. it always gives error <code>no address found</code>. does not crashes</p><pre><code>public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        myMap = (MapView) findViewById(R.id.simpleGM_map); // Get map from XML        btnSearch = (Button) findViewById(R.id.simpleGM_btn_search); // Get button from xml        adress = (EditText) findViewById(R.id.simpleGM_adress); // Get address from XML        gc = new Geocoder(this); // create new geocoder instance        btnSearch.setOnClickListener(new OnClickListener() {            public void onClick(View v) {                pd = ProgressDialog.show(simpleGoogleMaps.this, ""Working.."", ""Searching your address"", true, false); //Show a progress dialog                //Thread thread = new Thread(simpleGoogleMaps.this); //then create a new thread            //  thread.start(); //and start the thread. it will automatically call the standard run-function.                searchAdress = new Thread() {                    public void run(){                        String addressInput = adress.getText().toString(); // Get input text                        try {                            foundAdresses = gc.getFromLocationName(addressInput, 5); // Search addresses                            Thread.sleep(1500);                        } catch (Exception e) {                            // @todo: Show error message                        }                        showAdressResults.sendEmptyMessage(0);                                          }                };                searchAdress.start();            }        });    }    private Handler showAdressResults = new Handler() {            @Override            public void handleMessage(Message msg) {                pd.dismiss();                if (foundAdresses.size() == 0) { // if no address found,                    // display an error                    Dialog locationError = new AlertDialog.Builder(                            simpleGoogleMaps.this).setIcon(0).setTitle(                            ""Error"").setPositiveButton(R.string.ok, null)                            .setMessage(                                    ""Sorry, your address doesn't exist."")                            .create();                    locationError.show();                } else { // else display address on map                    for (int i = 0; i &lt; foundAdresses.size(); ++i) {                        // Save results as Longitude and Latitude                        // @todo: if more than one result, then show a                        // select-list                        Address x = foundAdresses.get(i);                        lat = x.getLatitude();                        lon = x.getLongitude();                    }                    navigateToLocation((lat * 1000000), (lon * 1000000),myMap); // display the found address                }            }        };      /**     * Navigates a given MapView to the specified Longitude and Latitude     *      * @param latitude     * @param longitude     * @param mv     */    public static void navigateToLocation(double latitude, double longitude, MapView mv) {        GeoPoint p = new GeoPoint((int) latitude, (int) longitude); // new        // GeoPoint        mv.displayZoomControls(true); // display Zoom (seems that it doesn't        // work yet)        MapController mc = mv.getController();        mc.animateTo(p); // move map to the given point        int zoomlevel = mv.getMaxZoomLevel(); // detect maximum zoom level        mc.setZoom(zoomlevel - 1); // zoom        mv.setSatellite(false); // display only ""normal"" mapview    }}</code></pre>","569938","","299924","","2011-02-09 07:14:05","2011-02-09 07:19:47","Forward Geocoding example Code for android?","<android>","1","0","1","",""
"4942233","1","4943114","","2011-02-09 07:12:28","0","182","<p>When we touch a widget say an image in android, a color will be shown surrounding it showing that image is pressed. How to remove it?</p>","504162","","","","","2011-02-09 16:42:02","remove the color shown while selecting a widget","<android>","4","1","","",""
"4942246","1","","","2011-02-09 07:13:41","1","889","<p>How do I get the storage size of all installed applications, programmatically, which are also displayed over application's <code>ApplicationInfo</code> page?</p>","579875","","579875","","2011-02-09 08:39:29","2012-10-22 04:50:17","How to get Storage size of the Application","<android>","2","1","1","",""
"4942295","1","","","2011-02-09 07:21:56","0","400","<p>I like the Android market apps design, very bright and catchy layout. How it has been done? i tried to put such green semi-circle bar on top with transparency on circle, but my listview is not going behind, where in market apps listview scrolls behind the green bar. </p><p>Many thanks in advance.</p><p>RgdsBalaji</p>","606229","","","","","2011-02-09 07:58:59","Android Design Layout","<android><android-layout>","1","2","","",""
"4942307","1","4942380","","2011-02-09 07:23:42","0","3221","<p>how can i get gmail tasks on android?</p><p>i really need gmail tasks </p><p>please help me  </p>","607441","","","","","2011-02-09 07:38:37","how can i get gmail tasks on android","<android>","1","2","","2011-02-09 07:46:00",""
"4942317","1","","","2011-02-09 07:25:51","6","586","<p>On the <a href=""http://source.android.com/compatibility/index.html"">Android Compatibility page</a> it is stated that:</p><blockquote>  <p>Once you've built a compatible device,  you may wish to include Android Market  to provide your users access to the  third-party app ecosystem.  Unfortunately, for a variety of legal  and business reasons, we aren't able  to automatically license Android  Market to all compatible devices. To  inquire about access about Android  Market, you can contact us.</p></blockquote><p>Does anybody know what the actual procedure is to get Android Market on you own device, assuming the <a href=""http://source.android.com/compatibility/overview.html"">CDD</a> is followed and the <a href=""http://source.android.com/compatibility/cts-intro.html"">CTS</a> is passed. Specifically I would like to hear from someone who have experience on licensing the Android Market?</p><p>Also, I hear that Google has relaxed the restrictions on licensing the Android Market after version 2.3, but I cannot find any sources supporting this statement. Does anybody have additional information on this?</p><p>Thanks</p>","81398","","881229","","2013-12-24 17:06:49","2013-12-24 17:06:49","Procedure for licensing Android market","<android><google-play><procedure>","1","0","5","",""
"4942338","1","","","2011-02-09 07:31:50","1","2858","<p>Hello I am New to Android, My requirement is allow the user to check maximum 3 number of checkboxes. when user is trying to check fourth one should populate dailogue.Iam trying but the problem is fourth one is not unchecking...</p><p>can any one help me...</p><p>Regards Shiva.M</p>","554827","","","","","2012-05-21 03:11:04","How to uncheck the CheckBox, when limit exceeds in android?","<android>","1","3","","",""
"4942342","1","","","2011-02-09 07:32:17","0","472","<p>This is my TextView:</p><pre><code>public IconifiedTextView(Context context, IconifiedText aIconifiedText) {    super(context);    /*     * First Icon and the Text to the right (horizontal), not above and     * below (vertical)     */    this.setOrientation(HORIZONTAL);    mIcon = new ImageView(context);    mIcon.setImageDrawable(aIconifiedText.getIcon());    // left, top, right, bottom    mIcon.setPadding(0, 3, 7, 3); // 5px to the right    /*     * At first, add the Icon to ourself (! we are extending LinearLayout)     */    addView(mIcon, new LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT,            LayoutParams.WRAP_CONTENT));    mText = new TextView(context);    mText.setText(aIconifiedText.getText());    mText.setTextSize(16);    /* Now the text (after the icon) */    addView(mText, new LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT,            LayoutParams.WRAP_CONTENT));    mInfo = new TextView(context);    mInfo.setText(aIconifiedText.getInfo());    /* Now the Info (below the Text) */    addView(mInfo, new LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT,            LayoutParams.WRAP_CONTENT));}</code></pre><p>And when i call the object I have:</p><pre><code>this.directoryEntries.add(new IconifiedText(currentFile                    .getPath(), currentIcon, ""\nInfo""));</code></pre><p>Where ""\nInfo"" will be replaced by something later. When i run this, I get this:</p><pre><code>d Infodata    Infodev   Infosystem      Info</code></pre><p>How do i get rid of this padding to the left of Info so they both start at the same place?</p>","598046","","50476","","2011-02-09 07:49:13","2011-07-13 20:17:03","Line break in TextView adds padding","<java><android><textview><padding>","1","0","","",""
"4942398","1","4952165","","2011-02-09 07:41:18","4","4828","<p>I am trying to create multiple proximity alerts but I cant get it to work...</p><p>I think that the broadcast receiver gets overwritten and thus is handling only the last broadcast. So if I had two points close by only the one whose intent was created last will generate an alert...</p><p>I read that I should use request codes but I have no idea on how to do that...</p><hr><p>My method for setting up the pending intents and the broadcast receiver...</p><pre><code>private void addProximityAlert(double latitude, double longitude, String poiName, String intentfilter) {    Bundle extras = new Bundle();    extras.putString(""name"", poiName);    Intent intent = new Intent(PROX_ALERT_INTENT+poiName);      intent.putExtras(extras);           PendingIntent proximityIntent = PendingIntent.getBroadcast(MainMenu.this, requestCode, intent, 0);    locationManager.addProximityAlert(        latitude, // the latitude of the central point of the alert region        longitude, // the longitude of the central point of the alert region        POINT_RADIUS, // the radius of the central point of the alert region, in meters        PROX_ALERT_EXPIRATION, // time for this proximity alert, in milliseconds, or -1 to indicate no expiration         proximityIntent // will be used to generate an Intent to fire when entry to or exit from the alert region is detected   );    requestCode++;   IntentFilter filter = new IntentFilter(intentfilter);    registerReceiver(new ProximityIntentReceiver(), filter);}</code></pre><p>My broadcastreceiver class</p><pre><code>public class ProximityIntentReceiver extends BroadcastReceiver {private static final int NOTIFICATION_ID = 1000;@Overridepublic void onReceive(Context context, Intent intent) {    String key = LocationManager.KEY_PROXIMITY_ENTERING;    Boolean entering = intent.getBooleanExtra(key, false);    if (entering) {        Log.d(getClass().getSimpleName(), ""entering"");    }    else {        Log.d(getClass().getSimpleName(), ""exiting"");    }    NotificationManager notificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);    PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, null, 0);            Notification notification = createNotification();            notification.setLatestEventInfo(context,         ""Proximity Alert!"", ""You are approaching: "" +intent.getExtras().get(""name""), pendingIntent);                                                                             //here-------------------------------------    notificationManager.notify(NOTIFICATION_ID, notification);}private Notification createNotification() {    Notification notification = new Notification();    notification.icon = R.drawable.androidmarker;    notification.when = System.currentTimeMillis();    notification.flags |= Notification.FLAG_AUTO_CANCEL;    notification.flags |= Notification.FLAG_SHOW_LIGHTS;            notification.flags |= Notification.FLAG_INSISTENT;    notification.defaults |= Notification.DEFAULT_VIBRATE;    notification.defaults |= Notification.DEFAULT_LIGHTS;    notification.defaults |= Notification.DEFAULT_SOUND;    notification.ledARGB = Color.WHITE;    notification.ledOnMS = 300;    notification.ledOffMS = 1500;    return notification;}}</code></pre><p>Can you please help me??? I'm really stuck with this...</p><p>Any help would be really appreciated!!!</p>","582665","","1649309","","2013-02-05 11:53:05","2014-02-12 05:43:02","Can a broadcastReceiver catch multiple broadcasts?","<android><geolocation><broadcast><proximity><android-pendingintent>","1","0","3","",""
"4942402","1","4942462","","2011-02-09 07:41:46","0","421","<p>I want to catch an  IOException Error and want to show it in the form of toast for android application development. But when ever i apply catch(<code>IOexception</code> e), after try block it says to throws (throws <code>IOException</code>) with function name after which i am to catch error message.. Please Provide Some assistance....</p>","566590","","750613","","2012-07-13 10:52:55","2012-07-13 10:53:11","How to catch IOException Error in eclispe for Android?","<android>","1","1","","",""
"4942409","1","","","2011-02-09 07:42:13","0","1041","<p>Not sure how this should be implemented.  I have an activity with an Edit Text and Button (a text field to specify search parameters, and a button to execute the search).  Right now the user has to enter text in the field and then press the Search button.  How can I make that button the default action, or someone configure the edit text field to click that button when the user presses enter?  </p><p>Currently with the default behavior, when I select that edit text field, there is no return key shown on the virtual keyboard.  </p><p>Any ideas?</p>","106418","","","","","2011-02-09 07:48:33","Android EditText Link to Button","<android>","1","0","","",""
"4942420","1","","","2011-02-09 07:43:26","3","1833","<p>I have 2 service running in background.. if <code>Service 1</code> is closed, <code>Service 2</code> will start up <code>Service 1</code> again, and vice versa, the problem is, I want to know how to detect if that service is closed or exited.</p>","609361","","321731","","2014-02-21 04:21:19","2014-02-21 04:21:19","How to detect if an application has been closed / exited","<android>","1","0","1","",""
"4942444","1","4942489","","2011-02-09 07:47:21","0","1056","<p>I am trying to run a listfragment prog during that i got the below error in log cat and the emulator shown Force close in alert box.  Can any one solve the problem please....</p><blockquote>  <p><strong>ERROR:</strong> 02-09 07:24:55.633: ERROR/AndroidRuntime(517):  java.lang.RuntimeException: Unable to  instantiate activity  ComponentInfo{com.android.Frags/com.android.Frags.FragsActivity}:  java.lang.ClassCastException:  com.android.Frags.FragsActivity cannot  be cast to android.app.Activity</p></blockquote>","218679","","24054","","2011-02-09 07:51:44","2011-02-09 07:54:33","i got a runtime error as ""java.lang.RuntimeException: Unable to instantiate activity ComponentInfo"" what would be the reason?","<android><instantiation>","1","0","","",""
"4942483","1","4942508","","2011-02-09 07:53:16","0","387","<p>hi now i am create simple andengine application...now my logcat indicate error....what mistake i made for my application.....</p><pre><code>    02-09 13:05:01.560: ERROR/AndEngine(280): Failed loading Bitmap in     AssetTextureSource.AssetPath: ggg    02-09 13:05:01.560: ERROR/AndEngine(280): java.io.FileNotFoundException: ggg    02-09 13:05:01.560: ERROR/AndEngine(280):     at android.content.res    .AssetManager.openAsset(Native Method)    02-09 13:05:01.560: ERROR/AndEngine(280):     at android.content.res   .AssetManager.open(AssetManager.java:313)    02-09 13:05:01.560: ERROR/AndEngine(280):     at android.content.res   .AssetManager.open(AssetManager.java:287)    02-09 13:05:01.560: ERROR/AndEngine(280):     at org.anddev.andengine.opengl   .texture.source.AssetTextureSource.&lt;init&gt;(AssetTextureSource.java:46)    02-09 13:05:01.560: ERROR/AndEngine(280):     at org.anddev   .andengine.opengl.texture.region.TextureRegionFactory   .createFromAsset(TextureRegionFactory.java:66)    02-09 13:05:01.560: ERROR/AndEngine(280):     at org.anddev    .andengine.examples.minimal   .AndEngineMinimalExample.onLoadResources(AndEngineMinimalExample.java:59)    02-09 13:05:01.560: ERROR/AndEngine(280):     at org.anddev.andengine.ui.activity   .BaseGameActivity.doResume(BaseGameActivity.java:158)    02-09 13:05:01.560: ERROR/AndEngine(280):     at org.anddev.andengine.ui.activity   .BaseGameActivity.onWindowFocusChanged(BaseGameActivity.java:83)    02-09 13:05:01.560: ERROR/AndEngine(280):     at com.android.internal.policy.impl   .PhoneWindow$DecorView.onWindowFocusChanged(PhoneWindow.java:1981)    02-09 13:05:01.560: ERROR/AndEngine(280):     at android.view.View   .dispatchWindowFocusChanged(View.java:3788)    02-09 13:05:01.560: ERROR/AndEngine(280):     at android.view.ViewGroup  . dispatchWindowFocusChanged(ViewGroup.java:658)    02-09 13:05:01.560: ERROR/AndEngine(280):     at android.view.ViewRoot   .handleMessage(ViewRoot.java:1921)    02-09 13:05:01.560: ERROR/AndEngine(280):     at android.os.Handler   .dispatchMessage(Handler.java:99)    02-09 13:05:01.560: ERROR/AndEngine(280):     at android.os.Looper   .loop(Looper.java:123)    02-09 13:05:01.560: ERROR/AndEngine(280):     at android.app.ActivityThread    .main(ActivityThread.java:4627)    02-09 13:05:01.560: ERROR/AndEngine(280):     at java.lang.reflect.Method   .invokeNative(Native Method)    02-09 13:05:01.560: ERROR/AndEngine(280):     at java.lang.reflect.Method    .invoke(Method.java:521)    02-09 13:05:01.560: ERROR/AndEngine(280):     at com.android.internal.os   .ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)    02-09 13:05:01.560: ERROR/AndEngine(280):     at com.android.internal.os    .ZygoteInit.main(ZygoteInit.java:626)    02-09 13:05:01.560: ERROR/AndEngine(280):     at dalvik.system    .NativeStart.main(Native Method)    02-09 13:05:02.330: ERROR/AndEngine(280): Failed loading Bitmap in      AssetTextureSource. AssetPath: ggg    02-09 13:05:02.330: ERROR/AndEngine(280): java.io.FileNotFoundException: ggg    02-09 13:05:02.330: ERROR/AndEngine(280):     at     android.content.res.AssetManager.openAsset(Native Method)    02-09 13:05:02.330: ERROR/AndEngine(280):     at android.content.res   .AssetManager.open(AssetManager.java:313)</code></pre>","486554","","","","","2011-02-09 07:58:33","logcat indicate error?","<android><logcat>","1","4","","",""
"4942507","1","","","2011-02-09 07:58:23","2","130","<p>I'm busy building an Activity that has the ExpandableListView. I'm mostly doing research at this point on how to do it etc. </p><p>The thing is with my list is there is cost field which displays the amount the item is worth. Each item is associated with a category, so that's why I have the expandablelistview. </p><p>Is it all possible to have the last row in the group be a totals record? Or have the total in the group header? If possible, are there any examples I can work from?</p><p>If this isn't possible, are there any other kind of widgets, views that can provide that kind of functionality?</p><p>Thanks</p><p>EDIT: As an example of what I mean, please see below</p><pre><code>---Category - Cats ---- &gt;Cat 1         $10Cat 2         $10Cat 3         $10Total         $30---Category - Dogs ---- &gt;Dog 1         $10Dog 2         $10Dog 3         $10Total         $30---Category - Etc ---- &gt;Etc 1         $10Etc 2         $10Etc 3         $10Total         $30-------------------------------------Grand Total: $90Another option is to have it display like this---Category - Cats - Total $30---- &gt;Cat 1         $10Cat 2         $10Cat 3         $10---Category - Dogs - Total $30 ---- &gt;Dog 1         $10Dog 2         $10Dog 3         $10---Category - Etc - Total $30 ---- &gt;Etc 1         $10Etc 2         $10Etc 3         $10-------------------------------------Grand Total: $90</code></pre><p>Just keep in mind that the categories are all expandable as the lists will be much longer. </p>","594874","","594874","","2011-02-09 11:39:01","2011-02-09 11:39:01","Is it possible to have sub-totals with an ExpandalbeListView?","<android><listview><android-layout><android-listview>","1","0","1","",""
"4942513","1","4942594","","2011-02-09 07:59:06","11","8738","<p><strong>What I have:</strong> I have a ListView with custom rows, having a CheckBox &amp; two TextViews in each row. I have a button for ""Select All"". </p><p><strong>What i want:</strong> I want that when I click the button, all the CheckBox in ListView get checked/unchecked.</p><p><strong>What is the problem:</strong> In OnClick of the ""Select All"" button. i am doing this:</p><pre><code>public void OnClickSelectAllButton(View view){    ListView l = getListView();    int count = l.getCount();    for(int i=0; i&lt;count; ++i)     {       ViewGroup row = (ViewGroup)l.getChildAt(i);       CheckBox check = (CheckBox) row.findViewById(R.id.checkBoxID);       check.setChecked(true); // true for select all and false for unselect all etc..    }}</code></pre><p>Here <strong>l.getChildAt(i)</strong> is giving me the visible items only. And when the index goes out of visible items, the problem occurs. I want to check all the CheckBox in List, not just the visible ones.</p>","559090","","","","","2014-02-06 06:15:46","Select All items of a ListView (custom row with checkbox in it)","<android><android-listview>","2","0","2","",""
"4942603","1","4942642","","2011-02-09 08:15:29","0","1018","<p>I have to write monthly payment for these two platforms for one of my clients.</p><p>My question is:</p><ol><li>Can I use PayPal payment for iPhone for this kind of payment? (not buying anything for iTunes, just paying subscribtion).</li><li>What other payment services providers would you recommend? (for example: In-app purchase for iPhone, something else for Android, etc.)</li><li>What can you recommend me to use as a library (I saw PayPal X, is this good for example?)</li></ol><p>thanks in advance,Danail</p>","232798","","","","","2011-12-05 10:20:10","iPhone and Android monthly payment - best ways","<iphone><android><payment-gateway><payment>","1","1","","",""
"4942618","1","5104104","","2011-02-09 08:17:20","4","6135","<p>Can anybody explain me what formula android use to calculate screen density? Waiting for your responds)))</p>","556337","","","","","2011-02-24 11:37:43","How does density value calculate in android","<android>","4","0","1","",""
"4942684","1","","","2011-02-09 08:25:10","1","684","<p>I'm making a program that is based on sending many notifications to the phone. I have come across a problem with making the phone act like its an actual call or message anyone know any other way to achieve this?</p><p>I need the text <code>message/call</code> to come from the program but when it appears on the phone to act like it's a real sms <code>message/call</code>. Like the emulator Control does in Eclipse.</p><p>I have tried Telephonymanager over and over and the closest I have come is trying to fake it with a notification Manager.</p><hr><p>ok so Let me explain this better I need to make an activity where my program sends a real text message and phone call to the phone. any ideas? (Like someone else is sending it to the phone)</p>","608686","","750613","","2012-07-13 10:41:18","2012-07-13 10:41:18","how to send text message or phone call just like the eclipse emulator does","<android><sms><emulator><phone>","0","4","","",""
"4942753","1","4943576","","2011-02-09 08:35:30","1","724","<p>What is ActivityInfo's meta data? </p><pre><code>Bundle bundle = actInfo.metaData;</code></pre><p>What kind of data bundle contains and how to retrieve data from Bundle if no key pair known?</p><p>Thanks</p>","579875","","567929","","2011-02-09 08:45:40","2011-02-09 10:27:24","What is ActivityInfo meta data?","<android>","1","0","","",""
"4942808","1","4942881","","2011-02-09 08:44:28","4","2534","<p>I've got an idea for an android app, I want to be able to say commands and have the application listen out for these and perform some action.</p><p>For example, I want my app to sit idle and listen for my voice, when it hears me say ""start"", the app will start doing something until I say ""stop"".</p><p>The idea is to lay the phone down and not have to physically touch it in order to control my app.</p><p>Would this be possible with any current APIs? If so which ones should I look into?</p>","155695","","418183","","2011-02-09 09:06:37","2011-02-09 09:06:37","Voice recognition APIs, will Google Voice do this?","<android><android-sdk-2.2><voice-recognition><google-voice>","1","0","4","",""
"4942820","1","","","2011-02-09 08:45:55","0","1249","<p>Q/ Write an Android program to get the <code>MAC address</code> of the closest <code>WiFi</code> Access Point </p><p>is there any ready written program i can use ?</p><p>dose any body have information that might help me ?</p><p>thank you </p>","609433","","750613","","2012-07-13 10:41:47","2012-07-13 10:42:08","get the MAC address of the closest WiFi using Android","<android>","1","0","","",""
"4942821","1","4944955","","2011-02-09 08:45:56","0","508","<p>We know that we can launch an apk file, we can also listen the packages that has been installed, removed or replaced. But is there a way to listen to the package installer when the user chooses to cancel the installation? (this is when the package installer displays the permissions with install and cancel button)</p><p>Thank you.</p>","496042","","","","","2011-02-09 12:41:59","Listening to Android Package Installer","<android>","1","0","","",""
"4942879","1","5004726","","2011-02-09 08:54:28","0","1134","<p>I have to show a popupwindow. If i show it in click event of the ImageView, Then i call dismiss it hides. But when i show it in Touch event of ImageView, then dismiss event calls, but the popup not hides. What are the reasons for this error?. How can i solve it? </p><p>The code i used to show popup window is</p><pre><code>DisplayMetrics dm = new DisplayMetrics();    getWindowManager().getDefaultDisplay().getMetrics(dm);    int width = dm.widthPixels; //320           CabotMessageHandler.printConsole(""width of screen""+width);    //show Popup    LayoutInflater inflater = (LayoutInflater)       this.getSystemService(Context.LAYOUT_INFLATER_SERVICE);    popupView=inflater.inflate(R.layout.gallerytoppopup, null, false);    pw = new PopupWindow(       popupView,        width,        30,        true);    // The code below assumes that the root container has an id called 'main'    pw.setAnimationStyle(R.anim.popupanimation);    pw.showAtLocation(this.findViewById(R.id.webview), Gravity.TOP, 0, 30);</code></pre>","2311189","","","","","2011-02-15 14:15:28","PopUpWindow dismiss issue","<android><android-widget><android-layout>","1","0","","",""
"4942939","1","","","2011-02-09 09:06:55","1","1078","<p>First a bit of context: I'm developing a video game for both the Android and iPhone platforms.  The way the iPhone works, when a user hits the home button and returns to the game later, in most circumstances the game will pick up RIGHT where it left off with no hicups.  I immediately jump back into my rendering and game loop.  Setting this up on the iOS platform was absolutely easy for me to do.  Accomplishing this on the Android has left me in a fit of rage after hours of wrestling with google results :P</p><p>I have my own OpenGL setup for both the iPhone and Android, and everything has been working great.  The root of the problem, I believe, is that I need a SurfaceHolder to create an OpenGL Context.  Here's the sucky part, when the screen loses focus of the game (ie the home button was hit), Android calls surfaceDestroyed in my SurfaceView class and basically KILLS my opengl context.  I <em>could</em> recreate a new one with a new SurfaceHolder when surfaceCreated is called, but then I need to reload all of my art assets which defeats the purpose of everything I'm trying to accomplish.</p><p>Can I somehow prevent the Android OS from killing my surface holder, is there some sort of custom view I can use to get this to work?  Is there some setting in the Manifest that can help me out here (I doubt it as I have thoroughly tested most of the flags)?  I know this is possible because Angry Birds does this perfectly on the Android OS.</p><p>Thanks a bunch :D!</p>","609454","","","","","2011-02-09 09:06:55","Getting an android app to keep it's OpenGL Context after hitting the home button","<android><button><home><surfaceholder>","0","3","","",""
"4943006","1","","","2011-02-09 09:20:29","8","23391","<p>i am running a list-fragment program and at run-time i got the below error.</p><p><strong>Error:</strong></p><pre><code>**02-09 09:03:40.213: ERROR/AndroidRuntime(572): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{ni.android.Fragment/ni.android.Fragment.Fragment}: java.lang.ClassNotFoundException: ni.android.Fragment.Fragment in loader dalvik.system.PathClassLoader[/data/app/ni.android.Fragment-1.apk]**</code></pre><p>I don't know the reason.My program contains three classes- DetailsFragment.java,  FragmentsTitles.java and Shakespear.java can any one help me out please....</p>","218679","","1173341","","2012-05-21 19:41:48","2012-06-09 02:23:18","Android Runtime Exception: Unable to instantiate activity componentInfo?","<android><instantiation>","5","3","1","",""
"4943009","1","9336244","","2011-02-09 09:21:14","2","313","<p>Most people are asking about migrating from J2ME to Android. I'm not. I'd like to develop applications and have them work on both Android and J2ME. Obviously for each application I will have an Android project and a J2ME project and both will source in a shared dependent project that will have common code.</p><p>I'd like to know what do people think the right design approach should be to maximize code reuse (maximize the code in the shared project).</p><p>In my typical J2ME application there is a controller/model and a bunch of views.<br>So each view holds a reference to the controller and when the user interacts with the view, the view invokes a method of the controller and the controller decides which view should be displayed next and what data it should have in it. The views don't know about each other. I would expect the controller/model code should be mostly reusable if written properly. </p><p>The question is: How does this 1 controller to many views translate to Android where each activity performs a subset of the whole application? </p><p>One approach would be to have a single activity (the controller code in it).<br>That means the application would have to handle Back (as it would anyway for J2ME).<br>It also means that when <code>onAddContextMenu</code> is called it would have to know which kind of page is currently being displayed to add the page specific context menu.</p><p>Another approach would be the following: each application view becomes an activity and the model-controller is passed around from one activity to another.</p><p>Any opinions which is better? other approaches?</p>","604237","","839601","","2012-02-18 18:29:37","2012-02-18 18:29:37","What's the right design approach for writing an application for both Android and J2ME by maximizing code-reuse?","<java><android><design><java-me><code-reuse>","2","0","","",""
"4943016","1","4943106","","2011-02-09 09:21:47","3","8718","<pre><code>ImageButton avatarButton = (ImageButton) findViewById(R.id.ImageButton_Avatar);avatarButton.setImageResource(R.drawable.avatar);strAvatarFilename =  ""Image.jpg""; final Uri imageUriToSaveCameraImageTo = Uri.fromFile(new File(Environment.getExternalStorageDirectory()+""/Folder/""+strAvatarFilename));avatarButton.setOnClickListener(new View.OnClickListener() {    public void onClick(View v) {        Intent pictureIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);        pictureIntent.putExtra( MediaStore.EXTRA_OUTPUT, imageUriToSaveCameraImageTo );        startActivityForResult(Intent.createChooser(pictureIntent, strAvatarPrompt), TAKE_AVATAR_CAMERA_REQUEST);        Editor editor = Preferences.edit();        editor.putString(PREFERENCES_AVATAR, imageUriToSaveCameraImageTo.getPath());        editor.commit();    }});</code></pre><p>I have this code. It takes a photo and then stores it in two locations, the default location on the SDcard and the /folder/ file i want the photo to be stored in also. Once taken i refresh the screen using this...</p><pre><code>ImageButton avatarButton = (ImageButton) findViewById(R.id.ImageButton_Avatar);String strAvatarUri = Preferences.getString(PREFERENCES_AVATAR, """");Uri imageUri = Uri.parse(strAvatarUri);avatarButton.setImageURI(null);avatarButton.setImageURI(imageUri);</code></pre><p>This refreshes the image button so the user can see the image they have taken. However, this is appears very big and fills the screen. Is there any way i can compress or downsize the image so the user can see it at a reasonable size? thanks </p>","569654","","1466188","","2012-10-27 05:37:30","2013-07-16 11:13:15","Android - how to compress or downsize an image?","<android><image><compression>","2","0","1","",""
"4943033","1","","","2011-02-09 09:25:54","0","353","<blockquote>  <p><strong>Possible Duplicates:</strong><br>  <a href=""http://stackoverflow.com/questions/1485822/gmail-task-api-exist"">Gmail Task API exist?</a><br>  <a href=""http://stackoverflow.com/questions/4942551/how-to-get-to-the-gmail-tasks-programatically"">how to get to the gmail tasks programatically</a>  </p></blockquote><p>hi, i'm developing an android applications </p><p>i need to get to the gmail tasks promatically in my project.</p><p>i hope read &amp; write gmail tasks in my app ,but i couldn't find tasks api.</p><p>However, there are android applications that are possible, like Jorte or Gtasks So I would </p><p>like to know how it is possible and I would like to apply for the program. </p><p>My English is poor but I tried to explain. please help me </p>","607441","","","","","2011-02-09 09:25:54","how to get to the gmail tasks programatically","<android>","0","3","","2011-02-09 16:41:31",""
"4943198","1","","","2011-02-09 09:49:58","0","278","<p>I have a set of imageviews placed together in a row inside a grid view. If I am touching on an imageview in it and moving forward or backward through the image set, I should get which image I have touched right now(eg: its position in the grid view). How will I achieve it? Can anyone please help?</p>","504162","","","","","2011-02-09 12:38:30","how to fetch position of the image inside the grid view?","<android><gridview><imageview>","1","1","","",""
"4943234","1","","","2011-02-09 09:53:32","2","909","<p>I am trying to get MapsDemo project that is shipped with Google add-ons to work. For that I got MD5 fingerprint of the default debug certificate and using that I generated MAPS API KEY and used it in the layout file.In the manifest file I have added all the permissions that are required by it. My manifest file looks like</p><p></p><pre><code>&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;uses-sdk android:minSdkVersion=""3"" /&gt;&lt;application android:label=""@string/activity_sample_code""        android:icon=""@drawable/app_sample_code"" &gt;    &lt;uses-library android:name=""com.google.android.maps"" /&gt;   &lt;activity android:name=""com.example.android.apis.MapsDemo"" android:label=""MapsDemo""&gt;        &lt;intent-filter&gt;            &lt;category android:name=""android.intent.category.LAUNCHER""&gt;&lt;/category&gt;            &lt;action android:name=""android.intent.action.MAIN""&gt;&lt;/action&gt;        &lt;/intent-filter&gt;   &lt;/activity&gt;    &lt;!-- ************************************* --&gt;    &lt;!--      VIEW/WIDGET PACKAGE SAMPLES      --&gt;    &lt;!-- ************************************* --&gt;    &lt;activity android:name=""com.example.android.apis.view.MapViewDemo"" android:label=""MapView""&gt;        &lt;intent-filter&gt;            &lt;action android:name=""android.intent.action.MAIN"" /&gt;            &lt;category android:name=""android.intent.category.SAMPLE_CODE"" /&gt;        &lt;/intent-filter&gt;    &lt;/activity&gt;    &lt;activity android:name=""com.example.android.apis.view.MapViewCompassDemo"" android:label=""MapView and Compass""&gt;        &lt;intent-filter&gt;            &lt;action android:name=""android.intent.action.MAIN"" /&gt;            &lt;category android:name=""android.intent.category.SAMPLE_CODE"" /&gt;        &lt;/intent-filter&gt;    &lt;/activity&gt;</code></pre><p></p><p></p><p>My maps layout file looks like </p><pre><code> &lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:id=""@+id/main""    android:layout_width=""fill_parent""     android:layout_height=""fill_parent""&gt;    &lt;com.google.android.maps.MapView        android:layout_width=""fill_parent""         android:layout_height=""fill_parent""        android:enabled=""true""        android:clickable=""true""        android:apiKey=""0msDghc7PL9izft4M7VdAxRREci8JIZeBEULPvw""        /&gt;&lt;/LinearLayout&gt;</code></pre><p>But after all this, all I see is a blank gid screen. No maps are shown. Please help me in resolving this issue. What am i doing wrong here??</p>","565090","","","","","2013-02-22 00:36:47","MapsDemo not working + android","<android><google-maps>","1","1","","",""
"4943246","1","4943500","","2011-02-09 09:54:07","2","4042","<p>I have 2 methods at the moment 1 to post a file, and another to post some text, they are below</p><p>Post the data...</p><pre><code>public void postData() {      // Create a new HttpClient and Post Header      ArrayList&lt;NameValuePair&gt; nameValuePairs = new ArrayList&lt;NameValuePair&gt;();    EditText et = (EditText) findViewById(R.id.entry);    String enteredName = et.getText().toString();    gender();    category();    nameValuePairs.add(new BasicNameValuePair(""name"",enteredName));    nameValuePairs.add(new BasicNameValuePair(""gender"",radio));    nameValuePairs.add(new BasicNameValuePair(""cat"",radio2));    //http post    try{            HttpClient httpclient = new DefaultHttpClient();            HttpPost httppost = new HttpPost(""http://10.0.2.2:90/upload.php"");            httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));            HttpResponse response = httpclient.execute(httppost);    } catch (ClientProtocolException e) {          // TODO Auto-generated catch block          } catch (IOException e) {          // TODO Auto-generated catch block      }                }</code></pre><p>post the file...</p><pre><code>public void postFile(){    File file = new File(filedir2);    try {             System.out.println(filedir2);             HttpClient client = new DefaultHttpClient();               String postURL = ""http://10.0.2.2:90/mobileupload.php"";                              HttpPost post = new HttpPost(postURL);          FileBody bin = new FileBody(file);         MultipartEntity reqEntity = new MultipartEntity(HttpMultipartMode.BROWSER_COMPATIBLE);           reqEntity.addPart(""image"", bin);         post.setEntity(reqEntity);           HttpResponse response = client.execute(post);           HttpEntity resEntity = response.getEntity();           if (resEntity != null) {                       Log.i(""RESPONSE"",EntityUtils.toString(resEntity));             }    } catch (Exception e) {        e.printStackTrace();    }}</code></pre><p>I have made a php file that combines both mobileupload.php and upload.php, i was just wondering if there was a way i could get this into one method and just do one post?</p><p>Help would be appreciated </p><p>Thanks</p><p>James </p>","601915","","","","","2011-02-09 10:20:53","Android post file and text","<android>","1","0","1","",""
"4943287","1","","","2011-02-09 09:58:51","-1","600","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/3059155/android-quick-actions-ui-pattern"">Android Quick Actions UI Pattern</a>  </p></blockquote><p>how can we make submenu like android </p>","304961","","304961","","2011-03-03 11:47:07","2011-03-03 11:47:07","Android ""Share"" Submenu","<android>","1","1","2","2012-08-17 08:26:01",""
"4943329","1","","","2011-02-09 10:03:48","0","1762","<p>In my custom view I need to use the getParent method and set the visibility on some of it's child views depending on my custom view's state. The problem is that I want to instantiate the child views just once. Where is the best place to do this?</p><p>Thanks a lot,</p><p>Gratzi</p>","460611","","","","","2011-05-19 19:27:25","When to use getparent()","<android>","1","0","","",""
"4943382","1","","","2011-02-09 10:09:24","2","4267","<p>I have two ListView. And I need to place them side by side horizontally. But the problem is - Only one list is visible. (Note : The second list is in right side of the layout and can have at most 1 character. And the first list will expand to fill the rest of the screen.)</p><p>Help me please.</p><p>The layout is like this.</p><pre><code>------------|       |  ||       |  ||       |  ||       |  ||       |  ||       |  ||       |  ||       |  ||       |  |------------</code></pre><hr><p></p><pre><code>&lt;LinearLayout    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:layout_weight=""1""    android:orientation=""vertical"" &gt;    &lt;ListView        android:layout_width=""fill_parent""        android:layout_height=""fill_parent"" /&gt;&lt;/LinearLayout&gt;&lt;LinearLayout    android:layout_width=""wrap_content""    android:layout_height=""fill_parent""    android:orientation=""vertical"" &gt;    &lt;ListView        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""        android:drawSelectorOnTop=""true"" /&gt;&lt;/LinearLayout&gt;</code></pre><h2></h2><p>Shaiful</p>","595543","","1224741","","2014-03-06 01:45:25","2014-03-06 01:49:58","Two ListView Side By Side","<android><listview>","6","4","","",""
"4943448","1","4943693","","2011-02-09 10:16:07","0","519","<p>I am new to android i just want to code for splashscreen. for that i used intent but i am getting error that instrumention source not found. i have two files <code>splashscreen.java</code> and <code>myapps.java</code> where i have use threading concept and called anothe activity as </p><pre><code>finally{  finish();  startActivity(new Intent(""com.example.MyApps""));  stop();}</code></pre><p>@ startAcitivy i am getting axception please guide me do i have to modify androidmanifest file? if yes please provide me syntax for that....</p><p>Thanks in advance.</p>","573776","","567929","","2011-02-09 10:26:56","2011-02-09 10:37:47","how to link two acitivities in android project","<android>","2","3","","",""
"4943471","1","5090631","","2011-02-09 10:17:38","0","405","<p>My code for broadcast Recevier</p><pre><code>BroadcastReceiver Allapp = new BroadcastReceiver() {    @Override    public void onReceive(Context context, Intent intent) {        if (intent.getAction().equalsIgnoreCase(Intent.ACTION_ALL_APPS)){            Log.i(""appName"", ""Changes in Applications"");        }    }};</code></pre>","","Nimit ","567929","","2011-02-09 10:26:54","2011-02-23 12:02:31","Android application that display the notification for any application start or Stop. I want code for it","<android>","2","0","1","",""
"4943483","1","","","2011-02-09 10:19:10","1","1274","<p>i have a textview and an edittext inside a tablerow..my problem is when i try to write many chars in edittext then i cant see what i am writing..it seems like problem in width..Any way to make multiline row or scolling edittext while i am writting?</p><pre><code>&lt;TableLayout    android:id=""@+id/table""    android:layout_height=""wrap_content""     android:layout_width=""fill_parent""    android:paddingTop=""30dip""    android:paddingLeft=""10dip""    android:paddingRight=""10dip""    android:layout_below=""@id/banner"" &gt;    &lt;TableRow&gt;        &lt;TextView            android:id=""@+id/username_label""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:textColor=""#fff""            android:textSize=""18dip""             android:text=""Username""             /&gt;        &lt;EditText            android:id=""@+id/entry1""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content"" /&gt;    &lt;/TableRow&gt;    &lt;TableRow&gt;        &lt;TextView            android:id=""@+id/password_label""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""            android:textColor=""#fff""            android:textSize=""18dip""             android:text=""Password"" /&gt;        &lt;EditText            android:id=""@+id/entry2""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""            android:password=""true"" /&gt;    &lt;/TableRow&gt;     &lt;/TableLayout&gt;</code></pre>","579981","","","","","2013-06-06 17:57:47","edittext inside tablerow android","<android><scroll><edittext><tablerow>","2","1","","",""
"4943486","1","5181335","","2011-02-09 10:19:18","6","6087","<p>I am using DatePicket in my activity , </p><p>I want to limit the date picked by user to todays date.</p><p>They should not able to select date greater than todays date. </p><p>thank you.</p>","510491","","","","","2011-11-24 08:00:11","Android DatePicker Date Limiting","<android><datepicker><android-date>","4","0","4","",""
"4943585","1","","","2011-02-09 10:28:15","0","337","<p>How could I few layout and require to create in one Tabactivity.</p><p>I have try the code below but no luck got error.</p><pre><code>    tabHost.addTab(tabHost.newTabSpec(""Sales Order"").setIndicator(""Sales Order"").setContent(R.layout.frm_txn_so_item_list));</code></pre><p>OK let me explain clearly.</p><p>I have a code below, as you can see I have 4 tab layout page. Each of it has it own activity class. I have a button which is belong to cls_so_item_list.class, whenever I am try to call it in my cls_so it always return me null value.</p><p>So I have come out an idea, to remove all the tab page(item,product,summary,Report) activity classes then create it one standalone class which is cls_so.</p><p>My question is how do I put the layout page inside the tabHost.addTab? Thanks</p><pre><code>public class cls_so extends TabActivity implements OnClickListener {    protected TabHost tabHost;    int intSalesOrderId;    src_txn_so.cls_so_obj objSalesOrder;    static final String LIST_ID = ""list_id"";    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        tabHost = getTabHost();        newTabIntent(""Item"", null, cls_so_item_list.class);        newTabIntent(""Product"",                getResources().getDrawable(R.drawable.so_product),                cls_so_prd_list.class);        newTabIntent(""Summary"",                getResources().getDrawable(R.drawable.so_summary),                cls_so_summary.class);        newTabIntent(""Report"",                getResources().getDrawable(R.drawable.so_report),                cls_so_summary.class);        Button btnSOLineDiscount = (Button) findViewById(R.id.txn_so_btn_line_discount);        btnSOLineDiscount.setOnClickListener(this);        tabHost.setCurrentTab(0);    }    protected void newTabIntent(String label, Drawable icon, Class&lt;?&gt; pageClass) {        TabSpec tabSpec = tabHost.newTabSpec(label);        tabSpec.setIndicator(label, icon);        Intent SOIntent = new Intent().setClass(this,pageClass);        SOIntent.putExtra(LIST_ID, -1);        tabSpec.setContent(new Intent(this, pageClass));        tabHost.addTab(tabSpec);    }    @Override    public void onClick(View v) {        // TODO Auto-generated method stub    }}</code></pre>","557964","","54606","","2011-02-13 19:22:43","2011-02-13 19:22:43","Multiple layout in one Tabactivity","<android>","1","3","","",""
"4943629","1","4943771","","2011-02-09 10:32:41","32","51499","<p>I want the users of my application to delete the folder DCIM which is on the SD card and contains folders. I want them to do this when they click on a button within the application? is this possible...if so how? thanks </p>","569654","","","","","2014-01-13 07:28:02","Android - How to delete a whole folder and content?","<android><delete><folder>","7","1","15","",""
"4943772","1","4943834","","2011-02-09 10:45:02","0","1201","<p>There are views like grid view and text views which are in same activity. I want to get the focus to text view from grid view when i press the back button as i need to select another text view. All the text views are put in a linear layout.How is it possible?</p>","606335","","606335","","2011-02-09 11:50:54","2011-02-09 11:50:54","Current View Identification","<android><android-layout>","2","3","","",""
"4943839","1","4944495","","2011-02-09 10:51:22","0","1366","<p>I can successfully connect through Bluetooth my Nexus One Android Phone to another Bluetooth Android Phone. I can use the input and output streams for connection and write my requests and read their responses . My application uses real time data for processing. I was wondering is there any way to open two input/output streams on different sockets (sort of like dedicated sockets) for communication? And if yes how could i accomplish that ? Any pointers would be helpful ...</p><blockquote>  <p>mmSocket.connect();</p></blockquote><p>public void connect () Since: API Level 5 Attempt to connect to a remote device. </p><p>This method will block until a connection is made or the connection fails. If this method returns without an exception then this socket is now connected. </p><p>Creating new connections to remote Bluetooth devices should not be attempted while device discovery is in progress. Device discovery is a heavyweight procedure on the Bluetooth adapter and will significantly slow a device connection. Use cancelDiscovery() to cancel an ongoing discovery. Discovery is not managed by the Activity, but is run as a system service, so an application should always call cancelDiscovery() even if it did not directly request a discovery, just to be sure. </p><p>Now my question is : How can i connect using two sockets ... because the function above uses a socket to connect ... And after a connection it disconnects any other attempt by another socket ????</p>","435597","","435597","","2011-02-09 14:03:07","2011-02-09 14:03:07","Android -- Open multiple Sockets (Input and Output Streams) for one connection","<java><android><sockets><bluetooth><communication>","1","0","","",""
"4943865","1","4944540","","2011-02-09 10:53:44","0","639","<p>How can I run services in the background of a battery manager Android application? </p><p>How would I display or receive a notification when the battery is low or when certain criteria are met?</p><p>For example, for an alarm, when the current time equals the alarm time the alarm rings.</p>","605122","","418613","","2012-06-07 09:02:15","2012-06-07 09:02:15","Android -How to run services in background when certain criteria meets how to display the notification","<android><notifications><power-management>","1","0","","",""
"4943872","1","","","2011-02-09 10:54:15","2","5947","<p>Does anyone know a reliable way to block incoming/outgoing SMS messages through code? It's ok if the actual SMS messages are being received, but I would like to block any notifications of that SMS being received. Also, the user shouldn't be allowed to send (or prefferably even type) an SMS message. Is that possible?</p><p>Thanks</p>","359784","","","","","2012-06-25 19:57:17","Block incoming/outgoing SMS on Android","<android><sms><block>","2","1","3","",""
"4943919","1","4944412","","2011-02-09 10:58:27","1","4634","<p>I am developing and testing an android application on my Galaxy S device, which should be (according to the android dev site) a normal size screen (4 inch) with HDPI (233dpi).</p><p>For some reason, drawables that I put in drawable-mdpi are shown instead of the ones in drawable-hdpi. It seems the device ""thinks"" it's a mdpi device for some reason...</p><p>Any ideas?</p>","399103","","","","","2011-02-09 12:12:22","Galaxy S screen DPI","<android><galaxy><hdpi><mdpi>","2","1","1","",""
"4943948","1","","","2011-02-09 11:00:09","0","270","<p>HI </p><p>Geeting response From WCF service (response below)</p><p>i validate on <a href=""http://www.jsonlint.com/"" rel=""nofollow"">http://www.jsonlint.com/</a> succesfully</p><p>but when i try to turn it to  </p><pre><code>_JSONArray = new JSONArray(new String(buffer));</code></pre><p>it gave me excaption</p><blockquote>  <p>of type java.lang.String cannot be converted to JSONArray</p></blockquote><p>any IDEA ?</p><pre><code>""[{\""TaxiLocationID\"":\""1\""},{\""TaxiLocationID\"":\""2\""}]""</code></pre><p>Thanks Yanivh</p>","558740","","21234","","2011-02-10 08:50:23","2011-02-10 08:50:23","Parsing JSON failed in android","<android><json>","0","2","","",""
"4944007","1","","","2011-02-09 11:06:53","1","816","<p>I have textview in my app. I have a string which I set in the textview.The string is HTML string which has lots of html like images, bold and italics.I used code as follows:</p><pre><code>content.setText(Html.fromHtml(articledet.toString(), imgGetter, null));</code></pre><p>I just want the links should be click-able. I achieved that easily. What I want when user clicks on the link, link should be opened in browser but I also want to track what external links where clicked.i.e. On click of link, I should be able to write URL in a file.I can do that using spanned. But if I used spanned then, I have load images, that will stop working.Please help me with this.</p>","490031","","","","","2011-02-09 11:06:53","android textview links clickable using Html.fromHtml","<android><html><links><tracking><clickable>","0","0","","",""
"4944011","1","","","2011-02-09 11:07:06","2","254","<p>After getting the latest update for <strong>Honeycomb</strong> , it seems the Android emulator is crashing and not responding quite frequently.</p><p>Also observed starting emulator with AVD which has snapshot stored earlier is also causing emulator freezing .</p><p>Any workaround ?</p>","255507","","881286","","2013-08-18 02:26:12","2013-08-18 02:26:12","Android emulator is crashing frequently","<android><android-emulator><android-3.0-honeycomb>","0","2","","",""
"4944039","1","5312577","","2011-02-09 11:09:12","3","3017","<p>I have an Android application which, among other things, also publishes updates on Facebook. </p><p>I created my code according to <a href=""http://stackoverflow.com/questions/2953146/android-java-post-simple-text-to-facebook-wall"">this</a> example and it works perfectly fine. The only difference in my code and the one in the link above is that I also extended onActivityResult as mentioned on the official Facebook SDK for Android page.</p><pre><code>    @Overrideprotected void onActivityResult(int requestCode, int resultCode, Intent data) {    super.onActivityResult(requestCode, resultCode, data);    facebookClient.authorizeCallback(requestCode, resultCode, data);}</code></pre><p>Sometimes however, I get a null pointer exception on the line where I call the ""facebook.authorizeCallback()"" within the onActivityResult() method. </p><p>This has never occurred on any of my mobile phones or emulators. However, I keep getting user crash reports, mostly from Droid and T-Mobile myTouch 3G phones. I tried a lot but was unable to reproduce the problem. Any body have any idea what could be wrong ?</p>","526635","","","","","2013-02-12 12:52:00","Android Facebook SDK - Problem with authorizeCallback()","<android><facebook>","3","5","1","",""
"4944052","1","6288515","","2011-02-09 11:10:49","2","1828","<p>For the navigation in my Android app I am using a ListView and create and set a BaseAdapter for it in the onCreate method of the activity.</p><p>The BaseAdapter accesses an ArrayList to retrieve elements (cache.getNavigation()):</p><pre><code>public class NavigationAdapter extends BaseAdapter {    Context mContext;    public NavigationAdapter(Context c) {        mContext = c;    }    @Override    public int getCount() {        return cache.getNavigation() != null ? cache.getNavigation().size()                : 0;    }    @Override    public Object getItem(int position) {        return cache.getNavigation() != null ? cache.getNavigation().get(                position) : 0;    }    @Override    public long getItemId(int position) {        return cache.getNavigation() != null ? cache.getNavigation().get(                position).getId() : 0;    }    @Override    public View getView(int position, View convertView, ViewGroup parent) {        View v;        if (convertView == null) {            LayoutInflater li = getLayoutInflater();                v = li.inflate(R.layout.list_nav_icon, null);                TextView tv = (TextView) v.findViewById(R.id.list_nav_text);                tv.setText(((TemplateInstanceDto) getItem(position))                        .getName());                ImageView icon = (ImageView) v                        .findViewById(R.id.list_nav_icon);                byte[] binary = ((TemplateInstanceDto) getItem(position))                        .getIcon();                Bitmap bm = BitmapFactory.decodeByteArray(binary, 0,                        binary.length);                icon.setImageBitmap(bm);                ImageView arrow = (ImageView) v                        .findViewById(R.id.list_nav_arrow);                arrow.setImageResource(R.drawable.arrow);        } else {            v = convertView;        }        return v;    }}</code></pre><p>So the navigation is built on startup from the cache.Meanwhile I start an AsyncTask that retrieves the navigation ArrayList from a server and when it has changed it saves the new navigation into the cache:</p><pre><code>private class RemoteTask extends        AsyncTask&lt;Long, Integer, List&lt;TemplateInstanceDto&gt;&gt; {    protected List&lt;TemplateInstanceDto&gt; doInBackground(Long... ids) {        try {            RemoteTemplateInstanceService service = (RemoteTemplateInstanceService) ServiceFactory                    .getService(RemoteTemplateInstanceService.class,                            getClassLoader());            List&lt;TemplateInstanceDto&gt; templates = service                    .findByAccountId(ids[0]);            return templates;        } catch (Exception e) {            return null;        }    }    protected void onPostExecute(List&lt;TemplateInstanceDto&gt; result) {        if (result != null &amp;&amp; result.size() &gt; 0) {            cache.saveNavigation(result);            populateData();        } else {            Toast text = Toast.makeText(ListNavigationActivity.this,                    ""Server communication failed."", 3);            text.show();        }    }}</code></pre><p>When I do nothing more in <code>populateData()</code>, the ListView doesn´t update. When I call <code>((BaseAdapter) ListView.getAdapter()).notifyDataSetChanged()</code> the View is updated, but the order is inverted. The first item is the last and the last is the first and so on.</p><p>Held needed! Thanks in advance.</p>","153721","","","","","2011-06-09 05:39:21","BaseAdapter.notifyDataSetChanged inverts order of elements","<android><adapter><android-asynctask>","2","0","1","",""
"4944090","1","4944894","","2011-02-09 11:14:59","7","2760","<p>I'm writing an industry application which will be used by traffic wardens to register offences through my program using forms.</p><p>The app is using a webview so it is just a container for an external webpage. We don't want our users to exit the application so we have to disable all buttons. I succeeded in disabling them except for the home button.</p><p>I read some threads about this topic, but I don't have any solutions yet. The idea is that I am able to make the app the default home app so if the user presses the home button it launches my app and does not exit. How can I accomplish that? If we must we are able to tamper with android itself (when we install the app), but if there is some solution through configuration it would be appreciated.</p>","485337","","","","","2012-01-05 07:15:44","Disabling Android home button for industry application","<android>","2","1","4","",""
"4944102","1","4954808","","2011-02-09 11:15:37","2","5558","<p>I am supposed to display a web page in a webview in an app. The page contains a html form where one of the fields is file. So it goes something like...</p><pre><code>&lt;input type=""file"" name=""file""&gt;</code></pre><p>If I open the page in the browser and press the Choose File button, file chooser pops up and everything is good, but when I press the Choose File button in the webview nothing happens :/</p><p>Any ideas how to make this work?</p>","301525","","301525","","2011-02-09 15:05:42","2011-02-17 00:21:48","Android webview, file input field filechooser doesn't show up","<android>","1","6","1","",""
"4944123","1","","","2011-02-09 11:17:07","3","3836","<p>I'm new to Android programming. I wonder how many items a ListView can store? I search in docs but they don't talk about this. What if I put a lot (maybe 10k) items into a ListAdapter, will it affect to the performance?</p><p>Cheers,MK.</p>","609635","","","","","2014-01-31 09:55:16","How many items a ListView can store?","<android><listview><listadapter>","5","1","","",""
"4944124","1","4944200","","2011-02-09 11:17:09","0","3117","<p>I currently have an activity that does not have an xml layout file. All items are added when needed. I am not in need to add a image to it and it doesnt seem to do anything...</p><pre><code>         ImageView iv = new ImageView(this);         iv.setScaleType(ImageView.ScaleType.FIT_CENTER);         Bitmap bm = BitmapFactory.decodeFile(Environment.getExternalStorageDirectory()+""/Pics/Pic_1.jpg"");         iv.setImageBitmap(bm);         ll.addView(iv);</code></pre><p>The image is in the correct folder...11 at the end is the Linear view i am adding the image view too...am i missing something?</p>","569654","","","","","2011-02-09 11:24:10","Android - how to add a dynamic image to activity","<android><image><photo>","1","0","1","",""
"4944215","1","4944400","","2011-02-09 11:25:19","0","4169","<p>I'm using Spinner,EditText and Button in one page.The spinner has these items ... </p><p>Following:</p><pre><code> String[] Items = {            ""Alarm"",            ""Office"",            ""Meeting"",            ""Party"",            ""Lunch"",            ""Breakfast"",            ""Supper"",            ""Home"",            ""Private"",            ""Outdoor"",            ""Family"",            ""Friends"",            ""others""    };    Spinner s1;</code></pre><p>In it if I select the ""others"" in spinner items means only the Edittext has to be enable otherwise it has to be disabled.If I select some other item Edittext has to be disabled</p><p>Code snippet:</p><pre><code>s1 = (Spinner) findViewById(R.id.spinner);    ArrayAdapter&lt;String&gt; adapter = new ArrayAdapter&lt;String&gt;(this,        android.R.layout.simple_spinner_item, Items);    s1.setAdapter(adapter);    s1.setOnItemSelectedListener(new OnItemSelectedListener()    {        public void onItemSelected(AdapterView&lt;?&gt; arg0,         View arg1, int arg2, long arg3)         {            int index = s1.getSelectedItemPosition();            Toast.makeText(getBaseContext(),                 ""You have selected item : "" + Items[index],                 Toast.LENGTH_SHORT).show();                        }        public void onNothingSelected(AdapterView&lt;?&gt; arg0) {}    });</code></pre><p>Thank you, </p>","565106","","565106","","2011-02-11 10:08:08","2013-03-23 15:37:28","Edittext want to go enable from disable after select the particular item in the spinner items","<android>","2","1","1","",""
"4944220","1","4944625","","2011-02-09 11:25:47","0","1076","<p>I know how know network type with :</p><pre><code>TelephonyManager telManager = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);int network_type = telManager.getNetworkType();</code></pre><p>But I want to register when the phone switch into 2G to 3G or 3G to 2G...</p><p>Anyway to do this ?</p><p>Thanks for helping me.RegardsJim</p>","541867","","","","","2011-02-09 12:07:16","Listen/register 2G 3G change on android","<android><networking><3g><listen>","1","0","","",""
"4944253","1","","","2011-02-09 11:29:19","0","1525","<p>I am new to android. I want to display my localhost (wampserver) Page on a click of a button.</p><p>I have tried using <code>httppost</code> method but it is not displaying anything just a blank mess. If I give a wrong addres then it is throwing error message.</p><p>All help is appriciated</p>","609648","","222159","","2011-02-09 11:42:00","2011-02-09 11:44:37","connecting my application to wamp server","<android>","1","1","","",""
"4944259","1","4944659","","2011-02-09 11:29:52","0","570","<p>I am trying to implement the following functionality in my application</p><ol><li>The user selects a music file in one input field and time duration ( Seconds only ) in the other. </li><li>After the user presses ok, the count down timer starts and runs till the entered time duration expires and then the chosen music file should start playing.</li></ol><p>Can anybody please advise me on the best way to implementing this other than using the alarm manager?</p>","347783","","347783","","2011-02-09 12:02:34","2011-02-09 12:11:27","How to play a custom sound after the countdown timer ends?","<android>","1","2","","",""
"4944307","1","4945146","","2011-02-09 11:34:53","0","867","<p>How to get result from an external application's activity so that my application that has triggered it could know the change.</p><p>For e.g:</p><p>My application needs to check if user has been logged in. If not logged in, it allows to login through external app.</p><p>So current app. would call onActivityForResult() to trigger external App's activity and onActivityResult() will be called processing the exit status of external App's activity.</p><hr><p>Solved.</p><p>Sorry for my goof up.</p><p>I have realized that I made mistakes for entire session  of testing.My understanding and code were fine, but <strong><em>every time I made changes to boththe files, I never ran the external app. with updated code</em></strong>.</p><p>Even I found the solution myself, i am considering Nanne's answer as my hint to solution, thus marked as accepted answer.</p><p>Thanks and sorry for ur precious time.</p>","536379","","10936","","2011-07-27 02:10:28","2011-07-27 02:10:28","How to get result from external application's activity?","<android>","2","1","0","",""
"4944321","1","","","2011-02-09 11:36:12","3","5719","<p>I'm making an radio like application that uses streaming. Here i need to stream the audio from a link (<code>http://somedomain/some.pls</code>).    </p><p>I have created <code>MediaPlayer</code> and know how to play from an audio file. But don't know how to stream it from net.  </p><p>EDIT : logcat i got while i used the following code</p><pre><code>MediaPlayer mp = new MediaPlayer();  mp.setDataSource(http://somedomain/some.pls);mp.prepare();mp.start()</code></pre><p>By log tag <code>**MediaPlayer**</code></p><pre><code>  02-15 05:50:11.761: VERBOSE/MediaPlayer(23715): constructor    02-15 05:50:11.761: VERBOSE/MediaPlayer(23715): setListener    02-15 05:50:11.761: INFO/MediaPlayer(23715): uri is:http://some:444/sdfd.pls    02-15 05:50:11.761: INFO/MediaPlayer(23715): path is null    02-15 05:50:11.761: DEBUG/MediaPlayer(23715): Couldn't open file on client side, trying server side    02-15 05:50:11.765: VERBOSE/MediaPlayer(23715): setDataSource(http://some:444/sdfd.pls)    02-15 05:50:11.777: VERBOSE/MediaPlayer(23715): prepare    02-15 05:50:13.105: ERROR/MediaPlayer(23715): message received msg=3, ext1=0, ext2=0    02-15 05:50:13.105: VERBOSE/MediaPlayer(23715): buffering 0    02-15 05:50:13.105: ERROR/MediaPlayer(23715): callback application    02-15 05:50:13.105: ERROR/MediaPlayer(23715): back from callback</code></pre><p>By log tag <code>**PlayerDriver**</code></p><pre><code>02-15 05:50:11.765: VERBOSE/PlayerDriver(2393): constructor02-15 05:50:11.765: VERBOSE/PlayerDriver(2393): OpenCore hardware module not found02-15 05:50:11.765: VERBOSE/PlayerDriver(2393): start player thread02-15 05:50:11.765: VERBOSE/PlayerDriver(2393): startPlayerThread02-15 05:50:11.769: VERBOSE/PlayerDriver(2393): InitializeForThread02-15 05:50:11.769: VERBOSE/PlayerDriver(2393): OMX_MasterInit02-15 05:50:11.769: VERBOSE/PlayerDriver(2393): OsclScheduler::Init02-15 05:50:11.769: VERBOSE/PlayerDriver(2393): CreatePlayer02-15 05:50:11.777: VERBOSE/PlayerDriver(2393): AddToScheduler02-15 05:50:11.777: VERBOSE/PlayerDriver(2393): PendForExec02-15 05:50:11.777: VERBOSE/PlayerDriver(2393): OsclActiveScheduler::Current02-15 05:50:11.777: VERBOSE/PlayerDriver(2393): StartScheduler02-15 05:50:11.777: VERBOSE/PlayerDriver(2393): Send player code: 202-15 05:50:11.777: VERBOSE/PlayerDriver(2393): CommandCompleted02-15 05:50:11.777: VERBOSE/PlayerDriver(2393): Completed command PLAYER_SETUP status=102-15 05:50:11.777: INFO/PlayerDriver(2393): PlayerDriver::isProtectedFile(http://some:444/sdfd.pls)02-15 05:50:11.777: VERBOSE/PlayerDriver(2393): File EXT is : .pls02-15 05:50:11.777: ERROR/PlayerDriver(2393): PlayerDriver::it is a not Protected file02-15 05:50:11.781: VERBOSE/PlayerDriver(2393): Send player code: 302-15 05:50:11.781: VERBOSE/PlayerDriver(2393): handleSetDataSource02-15 05:50:11.781: VERBOSE/PlayerDriver(2393): handleSetDataSource- scanning for extension02-15 05:50:11.800: VERBOSE/PlayerDriver(2393): CommandCompleted02-15 05:50:11.800: VERBOSE/PlayerDriver(2393): Completed command PLAYER_SET_DATA_SOURCE status=102-15 05:50:11.800: VERBOSE/PlayerDriver(2393): Send player code: 602-15 05:50:11.800: VERBOSE/PlayerDriver(2393): release string is 2.2 len 302-15 05:50:13.101: VERBOSE/PlayerDriver(2393): HandleInformationalEvent: 3402-15 05:50:13.101: VERBOSE/PlayerDriver(2393): HandleInformationalEvent: 1902-15 05:50:13.124: VERBOSE/PlayerDriver(2393): HandleInformationalEvent: 2002-15 05:50:14.511: VERBOSE/PlayerDriver(2393): HandleInformationalEvent: 2002-15 05:50:16.509: VERBOSE/PlayerDriver(2393): HandleInformationalEvent: 20</code></pre><p>This <code>02-15 05:50:16.509: VERBOSE/PlayerDriver(2393): HandleInformationalEvent: 20</code> loops but no sound ..<br>What may be wrong..<br>Thank you.</p>","609646","","609646","","2011-02-15 05:00:44","2013-05-29 16:58:51","Stream an audio .pls in android","<android><streaming><media-player>","4","1","2","",""
"4944529","1","","","2011-02-09 11:56:11","0","305","<p>I'm currently working on an app that has got some face detection in it. i'm using android's FaceDetector class and one of it's methods. i'm getting the frame from the previewframe callback but the format is YuvImage. i need it to be a bitmap for the facedetection to work. The problem is when i run the program there's an error saying classnotfoundexception with regard to the yuvimage. i've imported the yuvimage class and there's no errors in the source file. why can't the yuvimage class be found?</p><p>thanks</p>","532462","","","","","2011-02-09 12:00:19","classnotfoundexception","<android><classnotfoundexception>","1","0","","",""
"4944543","1","4944578","","2011-02-09 11:57:47","0","637","<p>I have a custom dialog box displaying some text and a image underneath.</p><p>The text is made up of a few lines and despite messing around with all the XML layout stuff millions of times, the image at the bottom is always overlapping half/some of the text. How can I tweak it so it appears underneath and after the text has finished?</p><pre><code>&lt;ImageView android:id=""@+id/image""           android:layout_width=""wrap_content""            android:layout_height=""wrap_content""       android:layout_centerHorizontal=""true""           /&gt;&lt;ScrollView android:id=""@+id/ScrollView01""        android:layout_width=""wrap_content""                 android:layout_below=""@+id/image""        android:layout_height=""200px""&gt;              &lt;TextView  android:id=""@+id/text""           android:layout_width=""wrap_content""               android:layout_height=""wrap_content""               android:textColor=""#FFF""             /&gt;&lt;/ScrollView&gt;     &lt;ImageView android:id=""@+id/image2""           android:layout_height=""wrap_content""           android:layout_width=""wrap_content""            android:layout_centerHorizontal=""true""           android1:layout_alignParentBottom=""true""/&gt;</code></pre><p>Items are set inside a RelativeLayout setting.</p>","601327","","601327","","2011-02-09 12:04:08","2011-02-09 12:04:08","Android - Custom dialog boxes layout problem","<java><android><xml><layout><dialog>","1","2","","",""
"4944562","1","4944670","","2011-02-09 11:59:51","1","2725","<p>Is it possible to send a activity into background programmatically in android?</p><p>I am creating a prank application that plays funny sounds after a specified time (input by the user). And I don't want the application to be visible when playing that sound and also the display should be dark.</p>","347783","","327011","","2014-02-26 14:25:47","2014-02-26 14:25:47","Sending a running application to background programmatically","<android>","3","2","0","",""
"4944634","1","4945067","","2011-02-09 12:09:16","1","1431","<p>Here I am storing all image paths into database. In <code>TabHost</code>, If i click FIND tab all images should be displayed. At that time <code>OutOfMemoryError</code> is coming. Please help me.It is very important for me.</p><pre><code>    Image s = pictures.get(i);    TableRow imageTableRow = new TableRow(ctx);    imageTableRow.setLayoutParams(new TableLayout.LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.WRAP_CONTENT));    ImageView imageView = new ImageView(ctx);    Log.i(""NEVERFORGET"",""PICTURE IMAGE PATH is : "" + s.getimagePath());    Drawable d = Drawable.createFromPath(s.getimagePath());    imageView.setImageDrawable(d);    imageView.setId(i);    imageView.setLayoutParams(new TableRow.LayoutParams(100,100));    imageView.setPadding(0, 10, 0, 15);</code></pre>","672512","","463721","","2011-02-09 12:19:20","2011-02-09 12:51:01","How can i recycle imageView by using imagepath","<android><out-of-memory>","1","0","","",""
"4944650","1","4944911","","2011-02-09 12:10:44","1","6035","<p>I am trying to upload video from Android code to my PHP web server code but can't get success. I am referring the following <a href=""http://reecon.wordpress.com/2010/04/25/uploading-files-to-http-server-using-post-android-sdk/"" rel=""nofollow"">link</a> to perform the uploading task but I am getting the following response in my Android code, but can't found any file on PHP server.</p><p>Android response</p><pre><code>DEBUG/ServerCode(29484): 200DEBUG/serverResponseMessage(29484): OK</code></pre><p>I have checked many things like setting values in <code>php.ini</code> files.Although I can upload images from Android code to server becasue from Android I am sending a 64 bit encoded <code>ByteArray</code> and therer is a ready-made function in php which can create image from encoded <code>ByteArray</code>s.</p><p>But that code also is not working in case of any other file having type other than image.  </p><p>Please guide me if any of you have done something similar before.  </p><p>PHP code I am using: </p><pre><code>&lt;?php    $target_path  = ""./upload/"";    $target_path = $target_path . basename( $_FILES['uploadedfile']['name']);    if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path))    {        echo ""The file "".basename( $_FILES['uploadedfile']['name'])."" has been uploaded"";    }     else    {        echo ""There was an error uploading the file, please try again!"";    }?&gt;</code></pre><p>Android code I am using:</p><pre><code>public void videoUpload(){    HttpURLConnection connection = null;    DataOutputStream outputStream = null;    DataInputStream inputStream = null;    String pathToOurFile = ""/sdcard/video-2010-03-07-15-40-57.3gp"";    String urlServer = ""http://10.0.0.15/sampleWeb/handle_upload.php"";    String lineEnd = ""\r\n"";    String twoHyphens = ""--"";    String boundary =  ""*****"";    int bytesRead, bytesAvailable, bufferSize;    byte[] buffer;    int maxBufferSize = 1*1024*1024;    try    {    FileInputStream fileInputStream = new FileInputStream(new File(pathToOurFile) );    URL url = new URL(urlServer);    connection = (HttpURLConnection) url.openConnection();    // Allow Inputs &amp; Outputs    connection.setDoInput(true);    connection.setDoOutput(true);    connection.setUseCaches(false);    // Enable POST method    connection.setRequestMethod(""POST"");    connection.setRequestProperty(""Connection"", ""Keep-Alive"");    connection.setRequestProperty(""Content-Type"", ""multipart/form-data;boundary"");    outputStream = new DataOutputStream( connection.getOutputStream() );    outputStream.writeBytes(twoHyphens + boundary + lineEnd);    outputStream.writeBytes(""Content-Disposition: form-data; name=\""uploadedfile\"";filename=\"""" + pathToOurFile );    outputStream.writeBytes(lineEnd);    bytesAvailable = fileInputStream.available();    bufferSize = Math.min(bytesAvailable, maxBufferSize);    buffer = new byte[bufferSize];    // Read file    bytesRead = fileInputStream.read(buffer, 0, bufferSize);    while (bytesRead &gt; 0)    {    outputStream.write(buffer, 0, bufferSize);    bytesAvailable = fileInputStream.available();    bufferSize = Math.min(bytesAvailable, maxBufferSize);    bytesRead = fileInputStream.read(buffer, 0, bufferSize);    }    outputStream.writeBytes(lineEnd);    outputStream.writeBytes(twoHyphens + boundary + twoHyphens + lineEnd);    // Responses from the server (code and message)    int serverResponseCode = connection.getResponseCode();     String serverResponseMessage = connection.getResponseMessage();     Log.d(""ServerCode"",""""+serverResponseCode);     Log.d(""serverResponseMessage"",""""+serverResponseMessage);    fileInputStream.close();    outputStream.flush();    outputStream.close();    }    catch (Exception ex)    {        ex.printStackTrace();    }}</code></pre>","395661","","418183","","2011-02-09 12:45:04","2013-04-11 06:39:20","Code to upload Video from Android to PHP","<php><android><image-uploading>","2","4","2","",""
"4944651","1","","","2011-02-09 12:10:51","4","24478","<p>Suppose i have a class first.java(activity class) and i start another activity in this class (second.java - activity class). How can i access the instance of first.java from second.java ? Can someone give me a good explanation on this.. An example would be great... </p>","448005","","","","","2013-08-01 20:16:31","Accessing instance of the parent activity?","<android>","4","1","8","",""
"4944767","1","","","2011-02-09 12:22:19","1","984","<p>I have a very large string that wont fit in the screen if I shown it as a TextView. Could any one tell me how to select a sub string which exactly fit the screen Height and Width independently of the text size of TextView. </p>","582699","","","","","2011-02-09 12:44:18","Setting the text of TextView that fits the screen Height and Width independently of the text size of TextView","<android>","1","0","0","",""
"4944775","1","4945127","","2011-02-09 12:23:11","3","131","<p>i'm working on an app that records audio. the sample is saved on the sd card. At the moment my UI just has the buttons to record,play and reverse the sample. what i'd like is a way to specify a file name for the sample and a menu to play previously recorded samples. could someone tell me which widgets would be best for this. i'm thinking textbox/keyboard, context menu or some sort of list. not sure of the terminology.</p><p>thanks</p>","532462","","","","","2011-02-09 18:12:11","the best componenents to use in UI?","<android><widget>","2","0","","",""
"4944844","1","","","2011-02-09 12:30:55","1","969","<p>How can I programmatically notify an incomming call?</p><p>I am developing an application in which if the user is suppose to reject a call then a message should be sent automatically to the caller with a predefined text.</p>","602629","","418183","","2011-02-09 13:01:48","2011-05-02 06:40:07","Incomming call notification","<android><notifications><call>","1","2","","",""
"4944938","1","4944982","","2011-02-09 12:40:10","4","1628","<p>i am translating some text into Italian, an i got an error on this line of the XML of the strings.xml because the ' symbol on L'utente:</p><pre><code>&lt;string name=""usernotexist""&gt;L'utente non esiste&lt;/string&gt; </code></pre><p>how to solve that error?</p>","479886","","","","","2011-02-09 12:44:33","How to put this symbol: "" ' "" (simple Quotation mark) in a XMLfile of android?","<android><xml>","2","1","","",""
"4945097","1","4945650","","2011-02-09 12:53:26","2","1215","<p>I wrote a simple application and I am getting only those logs, I used <code>Log.i();</code><br>I want the core logs (for example framework logs) how the httpclient, httpget, httppost, httprequest and httpresponse logs are sending and receiving data.</p><p>Please let me know if there is any procedure.</p>","607625","","469983","","2011-11-24 13:59:26","2013-12-30 06:48:04","How to enable the HTTP logs in Android?","<android>","2","0","1","",""
"4945103","1","","","2011-02-09 12:53:56","3","1382","<p>Is there a way to change color of a ninepatch image(png) programly on android ? I know how do this with bitmap but not with ninepatch...</p><p>Thanks to helping me.</p><p>RegardsJim</p>","541867","","541867","","2011-02-09 15:23:13","2012-02-12 13:58:31","Edit android ninepatch png programly (change color)","<android><image><png><edit><nine-patch>","1","0","","",""
"4945115","1","","","2011-02-09 12:54:42","11","38070","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/4509912/is-it-possible-to-use-bitmapfactory-decodefile-method-to-decode-a-image-from-htt"">Is it possible to use BitmapFactory.decodeFile method to decode a image from http location?</a>  </p></blockquote><p>i have a problem in set url image to image view. i tried below methods </p><p>Method 1:</p><pre><code>Bitmap bimage=  getBitmapFromURL(bannerpath);image.setImageBitmap(bimage); public static Bitmap getBitmapFromURL(String src) {        try {            Log.e(""src"",src);            URL url = new URL(src);            HttpURLConnection connection = (HttpURLConnection) url.openConnection();            connection.setDoInput(true);            connection.connect();            InputStream input = connection.getInputStream();            Bitmap myBitmap = BitmapFactory.decodeStream(input);            Log.e(""Bitmap"",""returned"");            return myBitmap;        } catch (IOException e) {            e.printStackTrace();            Log.e(""Exception"",e.getMessage());            return null;        }    }</code></pre><p>Method 2:</p><pre><code>    Drawable drawable = LoadImageFromWebOperations(bannerpath);    image.setImageDrawable(drawable);     private Drawable LoadImageFromWebOperations(String url)    {         try         {             InputStream is = (InputStream) new URL(url).getContent();             Drawable d = Drawable.createFromStream(is, ""src name"");             return d;         }catch (Exception e) {             System.out.println(""Exc=""+e);             return null;         }     }</code></pre><p>i tried above two methods but are not working . both are showing DEBUG/skia(266): --- decoder->decode returned false .  i used demo url image paths that is working. but this path is not working .so please tell me what is the wrong and what i will do </p><p>Thank you in advance.</p><p>Best Regards.</p>","745367","","745367","","2011-02-09 13:02:50","2012-04-25 19:50:49","set url image to image view","<android><url><imageview>","1","1","2","2012-05-22 12:36:56",""
"4945119","1","4946004","","2011-02-09 12:54:59","44","28244","<p>I'm about to build an Android application that will use a RESTful Web Service. I don't want to write the REST client by myself, as I want it to be as effective and stable as possible (this is the first time I'm using REST).</p><p>Are there any (free) frameworks or utilities avaibale for Android/Java that I can use in my project?</p><p>/Gustav</p>","165838","","","","","2013-04-24 17:25:56","Best REST Client Framework/Utility on Android","<java><android><json><rest>","5","3","23","2013-04-25 03:23:09",""
"4945145","1","4946799","","2011-02-09 12:57:28","2","1089","<p>Something weird is happening in my application im not sure if it is worth uploading all the code...</p><pre><code> Intent pictureIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE); pictureIntent.putExtra( MediaStore.EXTRA_OUTPUT, imageUriToSaveCameraImageTo ); startActivityForResult(Intent.createChooser(pictureIntent, strAvatarPrompt), TAKE_AVATAR_CAMERA_REQUEST);</code></pre><p>I use this code to take an photo. The photo gets saved in the DCIM folder and also into imageUriSaveCameraImageto which points to sdcard/folder...The image is given the name image1.jpg..once run it works.</p><p>Then i delete the files from DCIM and sdcard/folder and run the application again and take a different photo...for some reason the old photo appears in the folder...it must be caching or storing a copy of it else where...does anyone know where and how i can delete it?thanks</p>","569654","","","","","2011-09-25 11:02:47","Android-Where does image taken get saved?","<android><image><photo>","2","0","1","",""
"4945158","1","4945309","","2011-02-09 12:58:30","2","230","<p>I need to implement UI where user will be able to easily browse large set of text articles. I consider using TextSwitcher and onTouchEvent method implemented in order to have UI similar to browsing pictures in gallery. Do you have any ideas?(besides ListView) Would be grateful for any hints.</p><p>update: I want to show these articles randomly, so I do not want to let user browse among them.</p>","577604","","577604","","2011-02-09 13:22:40","2011-02-09 13:22:40","UI ideas on managing large set of text articles","<android>","1","0","1","",""
"4945311","1","4945587","","2011-02-09 13:12:34","3","1597","<p>The title is the question.</p><p>Anybody know any solution?</p><p>Please help me.</p><hr><p>Shaiful</p>","595543","","595543","","2011-02-10 04:16:18","2011-07-13 13:49:44","Hint Not Displaying When numeric=""integer"" in EditText","<android><edittext>","3","1","1","",""
"4945321","1","","","2011-02-09 13:13:50","3","1565","<p>Not getting the response body for http post request in android.<br>I am mentioning the userid, password in the name value pairs and putting in the httppost request by   </p><pre><code>postrequest.setEntity(new UrlEncodedFormEntity(nameValuePairs));  </code></pre><p>but on executing i am getting the response as SC_OK(200), but the response body is <code>null</code>.</p><p>One more problem is if i specify header in  HTTPGet or HTTPPost's request using <code>setHeader()</code> function i am getting BAD REQUEST (404) response.   </p><p>Please help me in resolving the above issue.</p><p>Thanks &amp; Regards,<br>SSuman185</p>","607625","","512958","","2011-02-09 13:17:56","2011-02-23 19:43:08","Not getting the response body for http post request in android?","<android>","2","4","1","",""
"4945409","1","4945516","","2011-02-09 13:21:44","1","1812","<p>my problem.I create app which do preview from camera on android. For preview while im not press on button - i used Camera , camera.open. When app started - the orientation of screen is normal.. But when i try to record video - i closed camera preview and used only  SurfaceView with  recorder.setVideoSource(MediaRecorder.VideoSource.DEFAULT);It's showing me preview from camera without class Camera.All this i do becouse it's fixed for me bug with greenish screen after recorded. So... this preview(which without camera) he after start always rotated on 90 degree ( Like in mode LANDSCAPE)im try to use   </p><pre><code>setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE );</code></pre><p>and </p><pre><code>setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT );</code></pre><p>but it not fixed my problem.So, can any one tell me how to rotate my preview(without camera) in mode like SCREEN_ORIENTATION_PORTRAIT ?? </p><p>pls tell me how to fix this problem.. i can't fix it 2-3 days :(</p><p>Regards, Peterp.s. sorry for my bad english, hope u understand me.</p><p>it's code which i used for preview when i recorded video/audio</p><pre><code> preview = new SurfaceView(withPreview.this); preview.getHolder(); holder.addCallback(this); holder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS );</code></pre><p>get picture from camera</p><pre><code>recorder.setVideoSource(MediaRecorder.VideoSource.DEFAULT);</code></pre><p>now the screen rotated on 90 degree. if i set</p><pre><code>recorder.setVideoSource(MediaRecorder.VideoSource.CAMERA);</code></pre><p>than image rotated on 180 degree ?_?</p><p>and set preview</p><pre><code>recorder.setPreviewDisplay(holder.getSurface());</code></pre><p>that's all what i need for camera previewHow u can see im not using Camera.. so i can't  us camera.parameters.setOrientation(90) //example:]</p>","562592","","562592","","2011-02-09 13:44:16","2011-02-10 14:07:07","SurfaceView without camera : preview after start rotated on 90 degree","<java><android><camera>","1","0","","",""
"4945418","1","","","2011-02-09 13:22:19","0","3934","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/1248292/how-to-delete-a-file-from-sd-card"">How to delete a file from SD card?</a>  </p></blockquote><p>This should be simple for most people, I want to know how to delete a file in the SD card (<code>/sdcard/folder</code>) if it exists i.e?</p>","569654","","68805","","2011-02-09 13:43:12","2011-02-09 13:43:12","How to delete a file that exists","<android>","2","1","","2012-01-02 15:24:06",""
"4945618","1","4945691","","2011-02-09 13:40:30","11","13403","<p>I downloaded the android's facebook sdk but so far I couldn't configure properly. Eclipse doesn't recognize the facebook sdk as a project.</p><p>Does anyone got this problem?</p>","609787","","236247","","2011-06-30 14:51:53","2014-01-31 05:34:55","Android Facebook SDK configuration on Eclipse","<android><facebook><sdk><installation>","3","1","3","",""
"4945651","1","","","2011-02-09 13:43:23","0","5116","<p>I have just referred to the <a href=""http://docs.phonegap.com/phonegap_media_media.md.html"" rel=""nofollow"">PhoneGap Documentation for Media</a>, which stated:</p><blockquote>  <p>""The Media object provides the ability to record and play back audio files on a device.""</p></blockquote><p>I wonder whether video streaming (RTSP) is possible or not with PhoneGap framework? I am trying this out on Android.</p><p>Any suggestions highly appreciated.</p>","28557","","168175","","2012-07-20 07:02:05","2013-07-24 22:04:38","PhoneGap - Is online video streaming possible?","<android><video-streaming><phonegap>","2","2","2","",""
"4945697","1","4945727","","2011-02-09 13:48:04","13","16235","<p>I am using the Geocoder class to fetch multiple location objects by using the following code:</p><pre><code>Geocoder geocoder = new Geocoder(this, Locale.getDefault());   List&lt;Address&gt; addresses = geocoder.getFromLocation(LATITUDE, LONGITUDE, 3);   Address[] addresses_array = new Address[addresses.size()];    addresses.toArray(addresses_array);    for( int i = 0; i &lt; addresses_array.length; i++ ){       //create location object here       locOBJ.setLatitude(LATITUDE);       locOBJ.setLongitude(LONGITUDE);    }</code></pre><p>In addition, inside the forloop, I am trying to dymanically create location objects to add to an array;</p><p>How can I create blank location objects ?</p>","504612","","297762","","2011-02-09 13:57:27","2011-02-09 14:25:32","Creating Android Location Object","<android><location>","2","0","4","",""
"4945732","1","","","2011-02-09 13:50:01","1","2536","<p>This is my JSON: </p><pre><code>{    ""Curs"": [        {            ""ID"": ""AED"",            ""Name"": ""Dirhamul Emiratelor Arabe"",            ""Curs"": ""0.8503"",            ""Multiplier"": ""1"",            ""Data"": ""2011-02-09""        },        {            ""ID"": ""AUD"",            ""Name"": ""Dolarul australian"",            ""Curs"": ""3.1572"",            ""Multiplier"": ""1"",            ""Data"": ""2011-02-09""        }    ]}</code></pre><p>This is my class: </p><pre><code>public class Curs {@SerializedName(""ID"")public String id;@SerializedName(""Name"")public String nume;@SerializedName(""Curs"")public  double crs;@SerializedName(""Multiplier"")public  int mult;@SerializedName(""Data"")public  Date data;public String getId() {    return id;}public void setId(String id) {    this.id = id;}public String getNume() {    return nume;}public void setNume(String nume) {    this.nume= nume;}public void setCrs(double crs) {    this.crs=crs;}public double getCrs(){    return crs;}public void setMult(int mult) {    this.mult=mult;}public int getMult(){    return mult;}public void setData(Date data) {    this.data=data;}public Date getData(){    return data;}</code></pre><p>}</p><p>And this is the class that contains my list:</p><pre><code>public class CursList {public static List&lt;Curs&gt; listaCurs;public void setCursList(List &lt;Curs&gt; listaCurs) {    this.listaCurs = listaCurs;}public List&lt;Curs&gt; getCursList() {    return listaCurs;}</code></pre><p>}</p><p>I do the parsing like this:</p><pre><code>Gson gson=new Gson();    CursList listaCurs=gson.fromJson(Jsonresult,CursList.class);</code></pre><p>When i access the list i get a null pointer.What am i doing wrong?</p>","609831","","489261","","2011-02-09 13:54:05","2013-03-12 10:05:15","GSON parsing android","<android><json><parsing><null><gson>","3","3","1","",""
"4945747","1","4947647","","2011-02-09 13:50:56","0","404","<p>I am developing my first android application. I have created a relativelayout with two buttons and one autocomplete text view. The three controls display correctly on the emulator. However when I create the apk file and install it on my Samsung Galaxy 5, the buttons show jagged edges and, the top and bottom lines 'sink' a bit and the text view gets an appearance of rounded square brackets on either side with horizontal edges sunk by half milimeter or so.</p><p>Any help in understanding what is happening and how to fixt it, is highly appreciated.</p><p>Thanks in adavance.</p><p>WinCPP</p>","558919","","","","","2011-02-09 16:30:05","How to fix jagged edges of controls (buttons, autocomplete text)?","<android><button><rendering>","3","4","","",""
"4945945","1","4946476","","2011-02-09 14:09:46","0","274","<p>I have a webservice that returns a json object with a decodes image</p><p>Link to JSON:</p><p><a href=""http://surfkid.redio.de/getChannelImage?session_id=ac9892e83e10994b7de728e44450808e&amp;channel_id=1"" rel=""nofollow"">JSON OBJECT</a></p><p>My Java Code in a handler:</p><pre><code>Handler handler = new Handler(){              @Override              public void handleMessage(Message msg) {                pd.cancel();                 if (msg.obj.toString()!= null)                 {                 JSONParse json = null;                 try {                    Log.e(""XXX"",msg.obj.toString());                     json = new JSONParse(msg.obj.toString());                        String im = json.getChannelImage();                        im = im.split(""\r"")[0];                        if (!im.equals(null))                        {                            byte[] decodedString = Base64Coder.decode(im);                            Log.e(""Byte"", decodedString.toString());                            Bitmap bitmap = BitmapFactory.decodeByteArray(decodedString, 0, decodedString.length);                             iv.setImageBitmap(bitmap);                        }                        else                        {                            throw new Exception (""no image avaibale"");                        }                } catch (final Exception e) {                    // TODO Auto-generated catch block                    e.printStackTrace();                    runOnUiThread(new  Runnable() {                        public void run() {                            Toast toast ;                            toast =     Toast.makeText(getApplicationContext(), ""Error"" + e.getMessage(), 500);                            Log.e(""Error"",e.getMessage());                            toast.show();                        }                    });                }                 }                 else                 {                   runOnUiThread(new  Runnable() {                    public void run() {                        Toast toast ;                        toast =     Toast.makeText(getApplicationContext(), ""error"", 500);                        toast.show();                    }                });                 }              }              };</code></pre><p>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_height=""wrap_content"" android:layout_width=""fill_parent"" android:orientation=""vertical""&gt;&lt;TextView android:layout_height=""wrap_content"" android:id=""@+id/mainscreen"" android:layout_width=""fill_parent"" android:text=""Selected Channel"" android:gravity=""center""&gt;&lt;/TextView&gt;&lt;ImageView android:id=""@+id/ImageView01"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;&lt;/ImageView&gt;&lt;/LinearLayout&gt;</code></pre><p>The problem is that no image is shown.</p><p>LOG:</p><pre><code>02-09 14:08:05.833: ERROR/XXX(438): {""responseData"":{""image"":""iVBORw0KGgoAAAANSUhEUgAAAsUAAADMCAYAAACbW975AAAABmJLR0QA\/wD\/AP+gvaeTAAAAB3RJ\r\nTUUH1wgcFSYeymz6DQAAIABJREFUeJzt3XmgVfPi\/vFn7eHss885+wypDGmORA4qhZsh+pJK6Boi\r\nrhtCkaFuuKabeSgX+SVX6MaNKJTKPGVIiK6+yJBGiaI67bPP2fP6\/hH3Z7jSsM\/6rL3X+\/WPPy7n\r\neY66es7aa32W9V2zdrYAAIAThjZetXi8U2HD395rsiyd6lQekM98pgsAAAAApjGKAQAA4HmMYgAA\r\nAHgeoxgAAACexygGAACA5zGKAQAA4HmMYgAAAHgeoxgAAACexygGAACA5zGKAQAA4HmMYgAAAHge\r\noxgAAACexygGAACA5zGKAQAA4HmMYgAAAHgeoxgAAACexygGAACA5zGKAQAA4HmMYgAAAHgeoxgA\r\nAACexygGAACA5zGKAQAA4HmMYgAAAHgeoxgAAACexygGAACA5zGKAQAA4HmMYgAAAHgeoxgAAACe\r\nxygGAACA5zGKAQAA4HmMYgAAAHgeoxgAAACexygGAACA5zGKAQAA4HmMYgAAAHgeoxgAAACexygG\r\nAADIEz7Lr0N2Ot10jYLEKAYAAMgDrSOdNLzjVB3b8jLTVQpSwHQBAAAA\/LZIcAf1bTFCnRsfI0uW\r\n6ToFi1EMAADgQj7Lp4OaDlCv5sMU9kdM1yl4jGIAAACXaVm2j\/7Y6io1K+1guopnMIoBAABcojRQ\r\npT7NL1bXpsfL4tEvRzGKG1owKH\/L5vK3aS1fq5byN99VVqMq+SorZVVVSn6\/rEjZ\/\/\/74wnZ8bjs\r\nujrZGzbIXl+jzNdfK7t0uTLLliuzdLnsmhpz3w8AAMg5Sz4d0PQE9W5+kUoCFabreBKjOIes4mIF\r\n9q1W4MCuCnbpJH\/r1vI121ny+3OaY69br8yy5Uov\/Eipd+crPe9dZdeszWkGAABwRvPSvfTH1ler\r\neWlH01U8jVG8Pfx+BQ\/spuAfDlCw2\/7y71stq6iowWOtRlUKNKpSoNO+Kv7zaZKkzNJlSs97T6l3\r\n3lPy5Vdlr9\/Q4D0KXaBrF5WOutJ0DUfY0ajsREKqq5cdrZVdV6fMshXKrlihzIqVyq74atP\/jm3i\r\npd9LbpGY+qTiEx82XQPYrHCgXL2bX6wDm57ArRIuwCjeWpalQJdOCvXro6K+R8vXpLHpRpIkf+tW\r\n8rdupdApJ0rptJKvv6nkjNlKPv+i7NqY6Xp5yRcpU6Can9olSdmsMl8sVmr+B0q\/M1\/p+R8os2Kl\r\n6VZ5g99Lzku98ZbpCsBvsmRp\/ybHqW+L4SoNVJmugx8wireQv1VLhU49SaF+feTbtZnpOpsXCKjo\r\n8MNUdPhhsuNxpV5+TYlpTyn58mtSNmu4HPKSzyd\/+93lb7+7NHCApE2fTiRnPavkrGeV\/niR4YIA\r\nkB+alXZQ\/1ZXqVXZPqar4BcYxb8j0GlfhYcMVtFRPSVf\/n20YRUXq6hPLxX16aXMl0sVv+9BJaY9\r\nxUfh2G7+1q0UHjZE4WFDlFmyVIkp0xT\/1xTZGzeargYArhP2R9Rr1wt00I4D5LNy+6wRciP\/Vp4T\r\nLEtFRx6h8iceVcXTU1V09JF5OYh\/yd+2tUpvvV6V815TeNgQWZU83Yrc8LdprZIrRqrq3ddVet3V\r\n8rdobroSALiCJUudGx+jy\/aZqe47DWQQu1j+L70cCx7YTRXPTlfkwXsV7NbFdJ0G4WvSWCWXDVfV\r\nO68rfOFQRx4OhDdYZaUqPvNPqnz9RZXeOGrTsYMA4FE7l+ymoXtO1Kltb1Yk6I5nkPDbGMU\/8DXb\r\nRZF7x6p86r8U6Lin6TqOsEpLVHLpJap45RkV9TrSdB0UkoBfxWcMVNWcF1R8xkApwJURAN4R8pfq\r\n2JaXanjHaWoTKcwLbIXI86PYKi5WyaWXqHLO8yrqe7TpOkb4W7VU5P5xKn90kvy7tzNdBwXEalSl\r\n0htHqWL64\/K3bGG6DgA0uP12OFqX7zNLh+z0J26VyDOeHsWBfatV8dKsTbcQFBebrmNc8OCDVPnC\r\nTIUvOK8g7qGGewT2rVbFczMUOuF401UAoEHsGG6rIR0e0GntRqs82MR0HWwDby4fn0\/hYUNUMf0x\r\n+Vu1NN3GXQIBlVw+QuWPPSTfzjuZboMCYkXKVHbnbSq7\/RYpwME3AApDyF+ivi2Ga8Te09SuvJvp\r\nOtgOnhvFvl12VvnjD6vksuH8wbwZwQO7qfLFWZtO3gByKHTyH1U+6T5ZpSWmqwDAdqludKQurX5a\r\nPXY+U34raLoOtpOnRnHw0O6qfHGmggd0NV0lL1iVFYpMGKfSG0dJfu6LQu4EDz1Y5dMeka8JHzEC\r\nyD+Ni1vqnD3u0xm7\/V2VRXyqWig8M4pDA05Q+aQJsio4m3drFZ8xUJGJ93JlDzkV2HsvlT86UVYk\r\nYroKAGyRoC+ko3e9UJdWT1f7ioNM10GOFf4otiyVjLxEZWNu5naJ7VB0+GEqnzqZK3vIKf8e7VX+\r\n0ARZ4bDpKgCwWR2rDtdl1TPVs9k53CpRoAp7FAeDKrvjVoUvGmq6SUEIVHdUxcypHNuGnArs31ll\r\n4+7gFh0ArrRDcXOd3f4eDdp9rKpCu5iugwZUuKM4GFRkwjiOgMox367NVPHkFPn3aG+6CgpI0ZFH\r\nKHzBuaZrAMB\/BH0hHdlsqEbuPV0dKg8xXQcOKMxR7PcrctdoFfXsYbpJQbIqK1T+6D85zg45VTL8\r\nQgW77W+6BgCoQ+Uh+sveT+moXYcq6AuZrgOHFN4otiyV3XKdivr1Md2koPmaNOYsY+SW36+ye+6U\r\nVVVpugkAj6oK7aJBu4\/V2e3vUeNi3sLpNQU3ikuv+atCp5xkuoYn+JrtsmkY79DIdBUUCN+OTVV6\r\nxUjTNQB41Kltb1bHqsNN14AhBTWKw+eepeLBg0zX8BR\/m9aKPHy\/rBAfLyE3QiefoED13qZrAPAg\r\nS5bpCjCoYEZxsNv+KuEKkxGB6r1VesM1pmugUPh8Kr3lWslXMP95AgDkgYL4U8fXtInK7r2LI50M\r\nCp1ykkIn\/9F0DRSIQPXeKurTy3QNAICH5P8oDgRUNn4sL5VwgdIb\/qbAXh1M10CBCA89x3QFAICH\r\n5P0oLvnrXxTs1sV0DUiywmGV3ff\/ZEXKTFdBAQjsvZeCB\/MaVQCAM\/J6FAe6dFI4jx+ss+vrlV39\r\njTKLlyi98CNlFn2q7IqvZEejpqttM3\/LFir5K\/d2IzfC555lugIAwCMCpgtss0BAZbdenzcP49ix\r\nOqXefkepufOU+exzZRYvUXbV17\/591uRiPzt2sjffjcFO3dS8OCD5Nu1mYONt13xaQOUmPaU0h\/8\r\n23QV5LngId3la9pE2TVrTVcBABS4vB3F4XPPkr\/97qZrbJYdq1Ny9nNKTHtKqXffk9KZLf9no1Gl\r\nF3yo9IIPlZgyTZLkb91KRcf2UejE\/vK3dPGh4j6fSm+5XjW9j9uq7xn4FZ9PRcf0VvyBSaabAAAK\r\nXF6OYn\/LFgpfcoHpGr8ps3yF4uPuU2LGTNmxutx93aXLVH\/nONXfdY+C3fZX8ZDBKjr8UMly37mK\r\ngT33UPicM1V\/zwTTVfJG5tPPtKFnX0czrZKwrPJyWRUV8lWWy2raVIG9Oiiwf2cFO+0rBYOO9vlv\r\nQsf3YxRvpcT0maq9YLjpGgCQV\/JyFJfecI2s4mLTNX4ls2Kl6m8fq8SMmQ17hdS2lZr3rlLz3lWg\r\n454KD79QRUce0XB52yh88TAlZsze7G0iMMuuq5ddVy99861+\/B2bnPmMpE238IT69VHx202-09 14:08:06.033: ERROR/Byte(438): [B@43dc08a0</code></pre>","547995","","","","","2011-02-09 14:52:02","No image occure from JSON","<java><android><base64>","2","0","","",""
"4945970","1","","","2011-02-09 14:11:43","0","955","<p>(1)I downloaded the FBReaderJ-sources from <a href=""http://www.fbreader.org"" rel=""nofollow"">http://www.fbreader.org</a>, but I'm having a difficult time importing and compiling FBReaderJ in Eclipse as an Android Project.</p><p>I did Run ndk-build  in my project catalog from cygwin so I make  file libDeflatingDecompressor.so and libLineBreak.so in libs directory</p><p>But <code>R.java</code> is missing; why doesn't the source include it? I know <code>R.java</code> changes automatically, but even so that is possible from an existing file or by creating a new project in the workspace.</p><p>How do I fix it? Is this related to <code>local.properties</code>?In My Computer sdk and ndk and cygwin is installed And my local.properties is saved assdk.dir = /android/android-sdk_r08-windows/android-sdk-windowsndk.dir = /android/android-ndk-r5b</p><p>What Problem?</p><p>(2) I resolved above problem of missig R.java so I get gen/R.JavaBut I got Building failed.</p><p>Below ant result</p><p>What Problem in main.xml?</p><p>C:\FBReaderJ-sources>ant</p><p>Buildfile: C:\FBReaderJ-sources\build.xml...     [echo] Generating R.java / Manifest.java from the resources...</p><pre><code> [null] C:\FBReaderJ-sources\res\layout\main.xml:8: error: No resource ident</code></pre><p>ifier found for attribute 'fadeScrollbars' in package 'android'</p><p>BUILD FAILED</p><p>C:\android\android-sdk_r08-windows\android-sdk-windows\tools\ant\main_rules.xml:306: null returned: 1</p><p>Total time: 4 seconds</p><p>/res/layout/main.xml</p><pre><code>org.geometerplus.zlibrary.ui.android.view.ZLAndroidWidget    android:id=""@+id/main_view""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:focusable=""true""    android:scrollbars=""vertical""    android:scrollbarAlwaysDrawVerticalTrack=""true""    android:fadeScrollbars=""false""</code></pre><p>below is error meaasge from eclipse console</p><p>java.lang.NullPointerException    at org.geometerplus.zlibrary.ui.android.view.ZLAndroidWidget.getMainAreaHeight(ZLAndroidWidget.java:560)    at org.geometerplus.zlibrary.ui.android.view.ZLAndroidWidget.onDraw(ZLAndroidWidget.java:92)    at android.view.View.draw(View.java:6274)    at android.view.ViewGroup.drawChild(ViewGroup.java:1526)    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1256)    at android.view.ViewGroup.drawChild(ViewGroup.java:1524)    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1256)    at android.view.View.draw(View.java:6277)    at android.widget.FrameLayout.draw(FrameLayout.java:352)    at com.android.layoutlib.bridge.Bridge.computeLayout(Bridge.java:408)    at com.android.ide.eclipse.adt.internal.editors.layout.gle2.GraphicalEditorPart.computeLayout(Unknown Source)...</p><p><sub></p><p>(My English isn't great, so try to keep the answers simple)</sub></p>","610608","","1228","","2013-08-08 16:47:13","2013-08-08 16:47:13","I import and compile FBReaderJ on eclipse But many error occurred","<android><eclipse>","1","2","","",""
"4945977","1","4950819","","2011-02-09 14:12:18","1","582","<p>I'm having a problem where my application looks right on my emulator, but on my phone it only displays a fragment of my scene.</p><p>Images <a href=""https://sites.google.com/site/chrsin/stack"" rel=""nofollow"">here</a> (The emulator is the one on the right.</p><p>My renderer code is seen here. (This class is abstract but all the implementing class is doing is draw the polygons)</p><pre><code>public abstract class AbstractRenderer implements Renderer {float x = 0.5f;float y = 1f;float z = 3;boolean displayCoordinateSystem = true;public void onSurfaceCreated(GL10 gl, EGLConfig eglConfig) {    gl.glDisable(GL10.GL_DITHER);    gl.glHint(GL10.GL_PERSPECTIVE_CORRECTION_HINT, GL10.GL_FASTEST);    gl.glClearColor(.5f, .5f, .5f, 1);    gl.glShadeModel(GL10.GL_SMOOTH);    gl.glEnable(GL10.GL_DEPTH_TEST);}public void onSurfaceChanged(GL10 gl, int w, int h) {    gl.glViewport(0, 0, w, h);    float ratio = (float) w / h;    gl.glMatrixMode(GL10.GL_PROJECTION);    gl.glLoadIdentity();    gl.glFrustumf(-ratio, ratio, -1, 1, 0, 10);}public void onDrawFrame(GL10 gl) {    gl.glDisable(GL10.GL_DITHER);    gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT);    gl.glMatrixMode(GL10.GL_MODELVIEW);    gl.glLoadIdentity();    GLU.gluLookAt(gl, x, y, z, 0f, 0, 0f, 0f, 1f, 0f);    gl.glEnableClientState(GL10.GL_VERTEX_ARRAY);    if(displayCoordinateSystem) {        drawCoordinateSystem(gl);    }    draw(gl);//      gl.glFlush();}private void drawCoordinateSystem(GL10 gl) {    ByteBuffer vbb = ByteBuffer.allocateDirect(6*3*4);    vbb.order(ByteOrder.nativeOrder());    FloatBuffer vertices = vbb.asFloatBuffer();    ByteBuffer ibb = ByteBuffer.allocateDirect(6*2);    ibb.order(ByteOrder.nativeOrder());    ShortBuffer indexes = ibb.asShortBuffer();    final float coordLength = 27f;    //add point (-1, 0, 0)    vertices.put(-coordLength);    vertices.put(0);    vertices.put(0);    //add point (1, 0, 0)    vertices.put(coordLength);    vertices.put(0);    vertices.put(0);    //add point (0, -1, 0)    vertices.put(0);    vertices.put(-coordLength);    vertices.put(0);    //add point (0, 1, 0)    vertices.put(0);    vertices.put(coordLength);    vertices.put(0);    //add point (0, 0, -1)    vertices.put(0);    vertices.put(0);    vertices.put(-coordLength);    //add point (0, 0, 1)    vertices.put(0);    vertices.put(0);    vertices.put(coordLength);    for(int i = 0; i &lt; 6; i++) {        indexes.put((short)i);    }    vertices.position(0);    indexes.position(0);    gl.glColor4f(1, 1, 0, 0.5f);    gl.glVertexPointer(3, GL10.GL_FLOAT, 0, vertices);    gl.glDrawElements(GL10.GL_LINES, 2, GL10.GL_UNSIGNED_SHORT, indexes);    indexes.position(2);    gl.glColor4f(0, 1, 0, 0.5f);    gl.glDrawElements(GL10.GL_LINES, 2, GL10.GL_UNSIGNED_SHORT, indexes);    indexes.position(4);    gl.glColor4f(0, 0, 1, 0.5f);    gl.glDrawElements(GL10.GL_LINES, 2, GL10.GL_UNSIGNED_SHORT, indexes);}protected abstract void draw(GL10 gl);}</code></pre><p>My guess is that i'm not setting some value that is set by default by the emulator implementation. Only thing is i have no clue as to what that thing might be.</p><p>Hoping to hear from you dudes and dudettes!</p>","473140","","","","","2011-02-09 21:40:49","Android Emulator vs phone opengl inconsistensies","<android><opengl-es>","1","0","","",""
"4946086","1","","","2011-02-09 14:20:06","0","843","<p>How can we put a number of radio button in multiple rows and columns within single radio group. </p><p>(For example: If there are 10 radio buttons in single radio group. 5 should be in first row and the next 5 in second row because of device width is small.)</p>","516061","","68805","","2011-02-09 14:41:28","2011-02-09 15:08:31","Radio button arranging problem","<android>","1","1","","",""
"4946264","1","","","2011-02-09 14:36:12","0","186","<p>I am having trouble debugging my app that causes a pop-up ""Forced close"" message every time I try to use my android app. How can I go around it ?</p>","609884","","100988","","2011-02-09 14:50:24","2011-02-09 14:50:24","How do I deal with a forced close message on Android?","<android>","2","0","","",""
"4946295","1","13381228","","2011-02-09 14:38:11","87","47587","<p>Let's say I have a vertical linearLayout with :</p><pre><code>[v1][v2]</code></pre><p>By default v1 has visibily = GONE. I would like to show v1 with an expand animation and push down v2 at the same time.</p><p>I tried something like this:</p><pre><code>Animation a = new Animation(){    int initialHeight;    @Override    protected void applyTransformation(float interpolatedTime, Transformation t) {        final int newHeight = (int)(initialHeight * interpolatedTime);        v.getLayoutParams().height = newHeight;        v.requestLayout();    }    @Override    public void initialize(int width, int height, int parentWidth, int parentHeight) {        super.initialize(width, height, parentWidth, parentHeight);        initialHeight = height;    }    @Override    public boolean willChangeBounds() {        return true;    }};</code></pre><p>But with this solution, I have a blink when the animation starts. I think it's caused by v1 displaying full size before the animation is applied.</p><p>With javascript, this is one line of jQuery! Any simple way to do this with android?</p>","508194","","160527","","2014-03-23 21:15:48","2014-03-23 21:15:48","Android: Expand/collapse animation","<android><animation>","13","1","84","",""
"4946457","1","","","2011-02-09 14:50:34","0","479","<p>i want to create service which will upload images to server, by reading path from database. it should be upload one image at a time and after uploading to server it should update the table.</p><p>i have an activity which will take pictures and saves into database.</p><p>what is best way to do this.</p><p>thanks satty...</p>","609911","","","","","2011-02-09 14:50:34","Android service polling to database","<android><service>","0","2","","",""
"4946527","1","4946629","","2011-02-09 14:55:52","4","6806","<p>My Activity consists of GridView which holds 40+ elements. After starting activity user could see maximum 15 items (3 rows, 5 items in each row). I wrote in getView() body to pass to the LogCat number of getting View:</p><pre><code>Log.i(""getView()"", ""GETTING VIEW_POSITION["" + String.valueOf(position) + ""]"" + (convertView != null?convertView.toString():""null""));</code></pre><p>After launching my app I get such log:</p><pre><code>02-09 14:34:56.900: INFO/getView()(388): GETTING VIEW_POSITION[0]null02-09 14:34:57.300: INFO/getView()(388): GETTING VIEW_POSITION[0]android.widget.FrameLayout@44c7a9c0  02-09 14:34:57.300: INFO/getView()(388): GETTING VIEW_POSITION[1]null02-09 14:34:57.400: INFO/getView()(388): GETTING VIEW_POSITION[2]null02-09 14:34:57.510: INFO/getView()(388): GETTING VIEW_POSITION[3]null02-09 14:34:57.620: INFO/getView()(388): GETTING VIEW_POSITION[4]null02-09 14:34:57.720: INFO/getView()(388): GETTING VIEW_POSITION[5]null02-09 14:34:57.840: INFO/getView()(388): GETTING VIEW_POSITION[6]null02-09 14:34:57.930: INFO/getView()(388): GETTING VIEW_POSITION[7]null02-09 14:34:58.273: DEBUG/dalvikvm(388): GC freed 3530 objects / 322744 bytes in 270ms02-09 14:34:58.280: INFO/getView()(388): GETTING VIEW_POSITION[8]null02-09 14:34:58.300: INFO/getView()(388): GETTING VIEW_POSITION[9]null02-09 14:34:58.320: INFO/getView()(388): GETTING VIEW_POSITION[10]null02-09 14:34:58.340: INFO/getView()(388): GETTING VIEW_POSITION[11]null02-09 14:34:58.360: INFO/getView()(388): GETTING VIEW_POSITION[12]null02-09 14:34:58.380: INFO/getView()(388): GETTING VIEW_POSITION[13]null02-09 14:34:58.400: INFO/getView()(388): GETTING VIEW_POSITION[14]null02-09 14:34:59.220: INFO/getView()(388): GETTING VIEW_POSITION[0]null02-09 14:34:59.490: INFO/getView()(388): GETTING VIEW_POSITION[0]android.widget.FrameLayout@44c69ef0</code></pre><p>I also red <a href=""http://code.google.com/p/android/issues/detail?id=12889"" rel=""nofollow"">this</a> post about such kind of issue. But My GridView's height in XML  description set as fill parent:</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/grid""                android:layout_width=""fill_parent""                 android:layout_height=""fill_parent""                android:numColumns=""auto_fit""                android:horizontalSpacing=""10dp""                android:verticalSpacing=""10dp""                android:columnWidth=""140dp""                android:gravity=""center""                android:scrollbars=""none""                /&gt; </code></pre><p>And finally to remove all doubts, here is my Adapter code:</p><pre><code>public class ImageAdapter extends BaseAdapter    {        private Activity activity;        private LayoutInflater inflater = null;        private ArrayList&lt;Photo&gt; photoes;        public ImageAdapter(Activity a, ArrayList&lt;Photo&gt; pictures)        {            photoes = pictures;            activity = a;            inflater = (LayoutInflater)activity.getSystemService(Context.LAYOUT_INFLATER_SERVICE);        }        @Override        public View getView(int position, View convertView, ViewGroup parent)        {            Log.i(""getView()"", ""GETTING VIEW_POSITION["" + String.valueOf(position) + ""]"" + (convertView != null?convertView.toString():""null""));                View mViewSlice = convertView;                if(convertView == null) {                    mViewSlice = inflater.inflate(R.layout.photo_preview, null);                    ((TextView) mViewSlice.findViewById(R.id.name_of_photo)).setText(photoes.get(position).getName());                    mViewSlice.setPadding(5, 5, 5, 5);                    mViewSlice.setLayoutParams(new GridView.LayoutParams(-2, -2));                }               return mViewSlice;        }        @Override        public int getCount() {            return photoes.size();        }        @Override        public Object getItem(int position) {            return photoes.get(position);        }        @Override        public long getItemId(int position) {            return position;        }       }</code></pre><p>I hope somebody will respond at my problem and will help me to solve it.</p><p>Waiting for your suggestions. Alex.</p>","556337","","","","","2013-03-02 10:32:48","Multiple calling of getView() in GridView","<android>","3","1","2","",""
"4946705","1","4946725","","2011-02-09 15:10:39","3","2184","<p>My application is using bitmaps and every time the user come to the specific activity where it shows an image the second time it stops working.</p><pre><code>Bitmap bm = BitmapFactory.decodeFile(Environment.getExternalStorageDirectory()+""//Pics/""Image.jpg"");</code></pre><p>I have tried using things like...</p><pre><code>BitmapFactory.Options options = new BitmapFactory.Options();     options.inTempStorage = new byte[16*1024];</code></pre><p>Not sure what to set it too. But this doesnt help. Once the user leaves this activity is there not a way to clear the bitmap etc? thanks</p>","569654","","","","","2012-03-13 14:26:30","Android - how to avoid memory over load using bitmaps?","<android><image><bitmap><photo>","3","0","3","",""
"4946722","1","4973508","","2011-02-09 15:12:18","2","1287","<p>Is there any way to make Eclipse + Android SDK + ADT Plugin offer some sort of auto-complete in XML files if I hit CTRL+Space when my cursor is in a spot such as the ones marked with an * below. </p><pre><code>&lt;LinearLayout id* ... lay*&gt;</code></pre><p>The thing is that I think that the above was actually working already directly after the initial install - even though it of course never worked within style files.</p><pre><code>&lt;style name=""ActionBarWrapper"" parent=""Fill_Parent.Vertical""&gt;        &lt;item name=""android:layout_height""&gt;36dp&lt;/item&gt;            &lt;item name=""a*""&lt;/style&gt; </code></pre><p>Thanks a lot for any kind of lead in the right direction.</p>","358114","","358114","","2012-10-21 22:30:23","2012-10-28 06:51:52","Any possiblity to get autocompletion / type-ahead / intellisense in Android XML Files (Eclipse)","<android><xml><autocomplete><intellisense><type-ahead>","5","0","2","",""
"4946729","1","","","2011-02-09 15:12:30","4","2039","<p>I get an error message when I attempt to bind from the onReceive() of a receiver to a local service before I drive a bespoke API on it.</p><p>""IntentReceiver components are not allowed to bind to services""</p><p>What is the best way of getting a piece of data from a service while in a broadcast reciever.</p><p>Many thanks.</p><p>P.S. I need to get the answer synchronously i.e. I have wait on the answer from the service so a callback may not be possible.</p>","606339","","","","","2011-02-09 16:12:54","Driving a service API from a BroadcastReceiver","<android>","1","0","","",""
"4946781","1","","","2011-02-09 15:17:23","2","501","<p>I'm developing an application using the Android SDK in Eclipse. In some specific cases when I go to the settings screen and then go back to the main Activity, the screen stays black. The application is still fully functional, the buttons are still working. I know it because there is a ""play"" button that starts audio and I can also click on a web link from the black screen that opens in the browser. The log of the OS shows some errors that seems to be related to the OS and not the application:</p><pre><code>02-09 09:22:20.571: WARN/GraphicBufferMapper(25297): registerBuffer(0x12aad0) failed -14 (Bad address)02-09 09:22:20.571: WARN/Surface(25297): registerBuffer(...) failed -14 (Bad address)02-09 09:22:20.571: ERROR/Surface(25297): getBufferLocked(0, 00000033) failed (Bad address)02-09 09:22:20.571: ERROR/Surface(25297): dequeueBuffer failed (Bad address)02-09 09:22:20.586: ERROR/ViewRoot(25297): IllegalArgumentException locking surface02-09 09:22:20.586: ERROR/ViewRoot(25297): java.lang.IllegalArgumentException02-09 09:22:20.586: ERROR/ViewRoot(25297):     at android.view.Surface.lockCanvasNative(Native Method)02-09 09:22:20.586: ERROR/ViewRoot(25297):     at android.view.Surface.lockCanvas(Surface.java:314)02-09 09:22:20.586: ERROR/ViewRoot(25297):     at android.view.ViewRoot.draw(ViewRoot.java:1341)02-09 09:22:20.586: ERROR/ViewRoot(25297):     at android.view.ViewRoot.performTraversals(ViewRoot.java:1163)02-09 09:22:20.586: ERROR/ViewRoot(25297):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1727)02-09 09:22:20.586: ERROR/ViewRoot(25297):     at android.os.Handler.dispatchMessage(Handler.java:99)02-09 09:22:20.586: ERROR/ViewRoot(25297):     at android.os.Looper.loop(Looper.java:123)02-09 09:22:20.586: ERROR/ViewRoot(25297):     at android.app.ActivityThread.main(ActivityThread.java:4627)02-09 09:22:20.586: ERROR/ViewRoot(25297):     at java.lang.reflect.Method.invokeNative(Native Method)02-09 09:22:20.586: ERROR/ViewRoot(25297):     at java.lang.reflect.Method.invoke(Method.java:521)02-09 09:22:20.586: ERROR/ViewRoot(25297):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:858)02-09 09:22:20.586: ERROR/ViewRoot(25297):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)02-09 09:22:20.586: ERROR/ViewRoot(25297):     at dalvik.system.NativeStart.main(Native Method)</code></pre><p>Anyone has encountered this issue before?</p>","578668","","","","","2011-09-09 05:34:15","Android application stays black but continues to work","<android><android-layout>","1","1","1","",""
"4946814","1","4947474","","2011-02-09 15:19:58","0","438","<p>I wanted to display a progress bar in an appwidget that displays playback progress from a background service. I know the appwidget supports that control, but I am wondering how I might go about updating the progress bar in a way that is consistent with good widget design (e.g. low battery consumption). The way I would normally do it in an activity would be by polling the playback on a timer. I haven't implemented this yet, so I am not even sure if it would work in an appwidget. Anyone know better than me?</p>","415422","","","","","2011-02-09 16:13:56","progress bar in appwidget for a playback service","<android><service><appwidget>","1","0","","",""
"4946824","1","","","2011-02-09 15:21:07","1","1365","<p>I want to take a photo with an Intent on android.provider.MediaStore.ACTION_IMAGE_CAPTURE,</p><p>next crop the result with:</p><pre><code>Intent intent = new Intent(""com.android.camera.action.CROP"");intent.setClassName(""com.android.camera"", ""com.android.camera.CropImage"");</code></pre><p>I follow the sugestions made at:<a href=""http://stackoverflow.com/questions/1973359/android-crop-an-image-after-taking-it-with-camera-with-a-fixed-aspect-ratio"">Android: Crop an Image after Taking it With Camera with a Fixed Aspect Ratio</a></p><p>However when calling the crop activity I get (already checked the LogCat output) a permission error, saying something like:</p><p>Permission denial on a Intent to access the temporary image created by the camera activity on my SDcard.</p><p>Can you please suggest a solution for Android 2.2 ?</p><p>Thank you</p>","609955","","449449","","2011-02-09 15:23:12","2011-02-13 19:06:51","Permission errors when cropping after taking a photo","<android>","2","1","","",""
"4946909","1","4947196","","2011-02-09 15:28:50","1","3627","<p>Hy!!</p><p>I have a thread class and want to set a timeout inside after 10 sec.</p><p>How is this been made?</p><p>Class:</p><pre><code>public class HttpConnection extends Thread{    List&lt;NameValuePair&gt; list;    String url;    Handler handler;public HttpConnection(List&lt;NameValuePair&gt; params, String url, Handler handler) {    this.list = params;    this.url = url;    this.handler = handler; }@Overridepublic void run() {    try    {        HttpClient httpclient = new DefaultHttpClient();        HttpPost httppost = new HttpPost(url);        String result;        BufferedReader in = null;                httppost.setEntity(new UrlEncodedFormEntity(this.list));            // Execute HTTP Post Request            HttpResponse response = httpclient.execute(httppost);            if(response != null){                in = new BufferedReader(new InputStreamReader(response.getEntity().getContent()));                StringBuffer sb = new StringBuffer("""");                String line = """";                String NL = System.getProperty(""line.separator"");                while ((line = in.readLine()) != null) {                    sb.append(line + NL);                }                in.close();                Message msg = Message.obtain();                if ((result = sb.toString()) != null)                {                    msg.obj = result;                   }                else                {                    msg.obj = null;                    throw new Exception(""ERROR"");                }                handler.sendMessage(msg);             }    }    catch (Exception e)    {      Log.e(""XXX"", e.getMessage());    }    super.run();}}</code></pre>","547995","","","","","2011-02-09 19:18:29","Set a Timeout to a Thread Class","<java><android><multithreading>","4","0","","",""
"4946919","1","10857237","","2011-02-09 15:29:35","45","42606","<p>I'm trying to explore the posibilities with running a native web-app on different platforms using HTML5. Currently, an <code>&lt;input type=""date""&gt;</code>field just opens the standard soft keyboard on Android and iOS. I suppose that in the future the mobile OS's soft keyboards will include date pickers and such - just as <code>&lt;select&gt;</code> invokes the native select today.</p><p>Since this isn't implemented on either Android or iOS, but is implemented in native UI, is it possible for a web-app to invoke the native date picker, i.e. when clicked on?</p><p>This would make it possible for us to stop using JavaScript libraries like jQuery mobile and YUI.</p><p>If my question is in any way unclear, please tell me. Thank you in advance :-)</p>","281889","","846480","","2014-02-28 14:14:20","2014-02-28 14:14:20","Invoke native date picker from web-app on iOS/Android","<javascript><iphone><android><ios><html5>","6","1","23","",""
"4946936","1","","","2011-02-09 15:30:32","1","1931","<p>I am trying to lock my screen in whatever orientation the user is in when the application launches a dialog and then unlocking it when the dialog dismisses.  Here is my lock and unlock code:</p><pre> <code>  // Sets screen rotation as fixed to current rotation setting     private void mLockScreenRotation() {         Log.d(""####################"", ""screen orientation is "" + mContext.getResources().getConfiguration().orientation);         // Stop the screen orientation changing during an event         if (mContext.getResources().getConfiguration().orientation == 1)              ((Activity) mContext).setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);                 else ((Activity) mContext).setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);//       switch (mContext.getResources().getConfiguration().orientation)//       {//          case Configuration.ORIENTATION_PORTRAIT://              ((Activity) mContext).setRequestedOrientation(//                  ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);//              break;//          case Configuration.ORIENTATION_LANDSCAPE://              ((Activity) mContext).setRequestedOrientation(//                  ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);//              break;//       }     }     // allow screen rotations again     private void mUnLockScreenRotation()  {         this.setRequestedOrientation(                 ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED);         mIsScreenRotationLocked = false;     } </code></pre><p>I call mLockScreenRotation() when I launch any dialogs and I call mUnlockScreenRotation() in my handler and in my DialogInterface.OnClickListener's.  </p><p>Sometimes my screen remains locked, but it is not consistent. Any suggestions or ideas why or how to handle this?</p><p>Thanks in advance for any help!</p><p>Ammendment:  code where I am locking my screen:</p><pre> public void displayProgressDialog(){        mLockScreenRotation();        // Get local handle on class progress dialog for optimization purposes        ProgressDialog temp = mProgressDialog = new ProgressDialog(this);        // Get message string (for some reason this dialog can't handle res IDs for messages)        String message = getString(R.string.downloading);        // Set some paramaters        temp.setIndeterminate(true);        temp.setTitle(R.string.weather_data);        temp.setMessage(message);        temp.setCancelable(false);        temp.getWindow().setFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND,                 WindowManager.LayoutParams.MEMORY_TYPE_PUSH_BUFFERS /*WindowManager.LayoutParams.FLAG_BLUR_BEHIND*/);         temp.show();    }    public void displayLocationSearchDialog(){        mLockScreenRotation();        // Get local handle on class progress dialog for optimization purposes        ProgressDialog temp = mCoordinateSearchDialog = new ProgressDialog(this);        // Get message string (for some reason this dialog can't handle res IDs for messages)        String message = getString(R.string.searching);        // Set some paramaters        temp.setIndeterminate(true);        temp.setTitle(R.string.location_search);        temp.setMessage(message);        temp.setCancelable(false);        temp.getWindow().setFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND,                 WindowManager.LayoutParams.FLAG_BLUR_BEHIND);        temp.show();    }    public void showDatafeedFailedDialog(){        mLockScreenRotation();        new AlertDialog.Builder(this)            .setTitle(R.string.network_error)            .setMessage(R.string.weather_data_failed)            .setPositiveButton(R.string.try_again, mTryAgainListener)            .setNegativeButton(R.string.dismiss, null)            .create()            .show();    }    public void showCoordinateSearchFailedDialog(){        mLockScreenRotation();        new AlertDialog.Builder(this)        .setTitle(R.string.network_error)        .setMessage(R.string.location_search_failed)        .setPositiveButton(R.string.try_again, mCoordTryAgainListener)        .setNegativeButton(R.string.dismiss, null)        .create()        .show();    }    private void showGpsAlertDialog(){        mLockScreenRotation();        new AlertDialog.Builder(this)            .setTitle(R.string.gps_error)            .setMessage(R.string.gps_error_details)            .setNeutralButton(R.string.dismiss, null)            .setPositiveButton(R.string.go_to_settings, mToSettingsListener)            .create()            .show();    }    private void showGpsSearchingDialog(){        mLockScreenRotation();        ProgressDialog temp = mGpsSearchAlertDialog = new ProgressDialog(this);        String message = getString(R.string.location_services_details);        String btnText = getString(R.string.cancel);        temp.setIndeterminate(true);        temp.setTitle(R.string.location_services);        temp.setMessage(message);        temp.setButton(btnText, mCancelGpsSearchListener);        temp.setCancelable(true);        temp.getWindow().setFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND,                 WindowManager.LayoutParams.FLAG_BLUR_BEHIND);        temp.show();    }    private void showGpsTimeoutAlertDialog(){        mLockScreenRotation();        new AlertDialog.Builder(this)        .setTitle(R.string.gps_error)        .setMessage(R.string.gps_timeout_message)        .setPositiveButton(R.string.try_again, mGpsTimeoutListener)        .setNegativeButton(R.string.dismiss, mGpsTimeoutListener)  // check this line with free if still no good        .create()        .show();    }    private void showWeatherAlertDialog(){        Log.d(""############"", ""weather alert dialog"");        mLockScreenRotation();        String message = null;        if(mWD.getWarningTypes() == null) return;        int cnt = 0;        int size = mWD.getWarningTypes().size() - 1;        for(String warningType : mWD.getWarningTypes()){            if(cnt == 0) message = warningType;            else if(cnt == size) message += "" and "" + warningType;            else message += "", "" + warningType;            cnt++;        }        new AlertDialog.Builder(this)            .setTitle(R.string.watches_and_warnings)            .setMessage(message)            .setPositiveButton(R.string.go_to_accuweather, mToAlertWebListener)            .setNeutralButton(R.string.dismiss, null)            .create()            .show();    }    private void showNeedLocationAlertDialog() {        mLockScreenRotation();        new AlertDialog.Builder(this).setTitle(R.string.error).setMessage(        R.string.add_location).setNeutralButton(R.string.dismiss, null)        .setPositiveButton(R.string.okay, mToLocationSearchListener)        .create().show();    }    private void showConnectivityAlertDialog() {        mLockScreenRotation();        new AlertDialog.Builder(this).setTitle(R.string.network_error)        .setMessage(R.string.no_connection).setNeutralButton(        R.string.dismiss, null).create().show();    }    private void showCurrentUrlInBrowser(){        // Show current conditions web page        if(mWD.getURL() == null || mWD.getURL().length() </pre>","2186261","","2186261","","2011-02-09 17:44:59","2012-01-20 09:07:57","Trying to lock screen rotation when displaying dialogs","<android>","2","2","","",""
"4946965","1","4947007","","2011-02-09 15:32:59","0","1079","<p><a href=""http://code.google.com/p/apps-for-android/source/browse/#svn%2Ftrunk%2FTranslate"" rel=""nofollow"">Android Translate Application</a></p><p>How can I download all file in this trunk link?Can I load it into eclipse IDE, Windows7 64-bit?</p>","480716","","480716","","2011-02-09 15:40:49","2011-02-09 15:45:58","How to download this source code file?","<android><download><source-code><translate>","3","0","","",""
"4946978","1","4947065","","2011-02-09 15:34:25","0","296","<p>What I am trying to do is copy files from one folder to another. However, the twist is i was to copy all files from one folder which begin with say 123 and anything can follow.</p><p>For example i have a folder with 3 files, 123__sdf.jpg, 123034.jpg and 321.jpg.I only want to copy the first two but how do I select them only. Because this application is dynamic the files can change thats why i only want to be able to select all files which begin with 123.</p>","569654","","244296","","2011-02-10 03:34:12","2011-02-10 03:34:12","Copy all files beginning with a certain letter","<android>","1","0","","",""
"4947079","1","4947166","","2011-02-09 15:43:49","2","1361","<p>I'm working on an exiting Android code written by someone else and it has several memory issues. One issue which i'm not able to understand is this. In the main Activity class it has a static method called getReference(). This method basically returns reference to a variable called <strong>mThis</strong>. Now, in <strong>onCreate</strong> method </p><pre><code>class MyActivity extends Activity {     private static MyActivity mThis;         public MyActivity getReference(){           return mThis;    }     public onCreate(Bundle savedInstanceState){       mThis = this;     }    ...}</code></pre><p>Now in Content provider or class extending from Dialog class, it uses this static method to get reference to context. </p><p>I'm pretty sure this is not correct and is one of reason for memory leak. But is there a way to get the current context without actually passing the context object in every class. There is an application context but  i don't think it has any method to get the current context.</p><p>I can remove this method and then pass reference to context object to these classes. But is there any other way to fix this. </p>","260298","","","","","2011-02-09 15:50:41","Activity having static reference","<android>","2","0","","",""
"4947155","1","","","2011-02-09 15:49:37","0","181","<p>i am a newbie for this kind of development. i am creating a mobile application which involves tracking, and where to download the source codes of iLOCi2 mobile application for my references. pls help me.</p>","597954","","3098","","2011-02-09 16:37:21","2011-02-09 16:37:21","Where can i download the iLOCOi2 mobile app source code?","<java><iphone><android>","1","4","","",""
"4947217","1","4949211","","2011-02-09 15:54:45","1","1107","<p>I built a JSON consumer in android for 1.6 (thought it was good practice to build on the oldest version for max support). I was able to successfully retrieve the json under 1.5-1.6. However I just threw the app on my droid (2.x) and now I receive ""org.json.jsonexception: expected literal value at character ...."". Why the difference in versions? How can I deal with this?</p>","623334","","","","","2012-10-21 05:47:42","How to deal with version issues in android 1.6 to 2.x","<android><json>","3","1","","",""
"4947242","1","4948416","","2011-02-09 15:56:43","0","729","<p>Using the Gingerbread source, I compiled the code and loaded the ROM onto my Nexus One, but after starting the phone, the Home, Menu, Back, and Search buttons don't work anymore. Does anyone know how to resolve this error?</p>","548852","","","","","2011-05-02 02:41:04","Android: Home, Menu, Back, and Search Button don't work","<android><open-source>","2","2","","",""
"4947333","1","4947469","","2011-02-09 16:02:40","2","1208","<p>I understand you can create a service in Android and start it up on boot, which can then be used to get location updates, communicate with a server, etc.</p><p>However what I wanted to find out is if this possible to do in AIR. AIR runs on Android, but can it be set a 'service' and start up on boot (<code>sitting in the background</code>)?</p><p>Thank you!</p>","237760","","750613","","2012-07-13 11:38:45","2013-07-02 17:36:05","Can a Flex AIR app on Android start up as a service on boot?","<android><flex><service><air>","2","1","1","",""
"4947352","1","4947408","","2011-02-09 16:03:58","1","2468","<p>How do you get the first list item in a listView? I want to get at a TextView in the first list item.I am currently doing this:</p><pre><code>View listItem=(View)myList.getChildAt(0);TextView txtDep=(TextView)listItem.findViewById(R.id.txtDepart);txtDep.setText(""Hello!"");</code></pre><p>But this is not only changing the text in the first item but in every 8th, 16th and so on items. I would like to change the text in the first(top) item only.Thank you.</p>","329034","","","","","2012-12-17 10:58:23","get first item only in a Android ListView?","<android><listview>","4","1","","",""
"4947359","1","4947924","","2011-02-09 16:04:45","0","555","<p>Hy!</p><p>I download a picture from the internet and want to display it. The height should be 1/6 of the max screen height (for multi phone support)</p><p><strong>Code:</strong></p><pre><code>final ImageView iv = (ImageView) findViewById(R.id.ImageView01);iv.setMaxHeight(getWindowManager().getDefaultDisplay().getHeight()/6);</code></pre><p>Please help!</p>","547995","","750613","","2012-07-13 11:38:34","2012-07-13 11:38:34","Imageview.setMaxHeight is working wrong","<android>","1","1","","",""
"4947512","1","4947911","","2011-02-09 16:18:26","0","1592","<p>I'm having a weird issue with a button that is being shown on screen, but that I can't click. It is not that the <code>onClick</code> event is not firing, it seems that physically it does not react to clicks, as if it had a transparent layer on top of it.</p><p>The main <code>Activity</code> where it is built on:</p><pre><code>public class MusicList extends Activity implements OnClickListener {...@Override    public void onCreate(Bundle bundle)    {        super.onCreate(bundle);             setContentView(R.layout.mymusic);        this.myTabHost = (TabHost)this.findViewById(R.id.th_set_menu_tabhost);         this.myTabHost.setup();         TabSpec ts = myTabHost.newTabSpec(""TAB_TAG_1"");        ts.setIndicator(""Media Item"",getResources().getDrawable(R.drawable.music));                     ts.setContent(R.id.media_item_tab);        try {            relativeLayout = (RelativeLayout) myTabHost.findViewById(android.R.id.tabcontent).findViewById(R.id.media_item_tab);        } catch (NullPointerException e) {            Log.e(this.getClass().getSimpleName(),""Layout is not correct"",e);        }            Button button = (Button)relativeLayout.findViewById(R.id.play_button);            // button.setClickable(true);            button.setOnClickListener(this);                    myTabHost.addTab(ts);    }    @Override    public void onClick(View v) {        startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(itemData.get(""ITEM_URL""))));    }}</code></pre><p>The layout, which is shown perfect on screen is like this:</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/th_set_menu_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=""fill_parent""/&gt;     &lt;FrameLayout           android:id=""@android:id/tabcontent""           android:layout_width=""fill_parent""           android:layout_height=""fill_parent""           android:paddingTop=""65px""&gt;            &lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""                android:id=""@+id/media_item_tab""                android:layout_width=""fill_parent""                android:layout_height=""fill_parent""&gt;                &lt;TextView                android:id=""@+id/media_title""                android:layout_width=""fill_parent""                android:layout_height=""wrap_content""                android:textSize=""30sp""                android:textColor=""#40A5D9""                android:gravity=""center""                android:layout_alignParentTop=""true""                android:singleLine=""true""                android:ellipsize=""marquee""                android:text=""Title""                &gt;                &lt;/TextView&gt;                &lt;ImageView                android:id=""@+id/media_cover""                android:layout_width=""fill_parent""                android:layout_height=""180px""                android:gravity=""center""                android:layout_below=""@+id/media_title""                android:src=""@drawable/geniocover""                              &gt;                &lt;/ImageView&gt;                &lt;TextView                android:id=""@+id/media_author""                android:layout_width=""fill_parent""                android:layout_height=""wrap_content""                android:textSize=""20sp""                android:textColor=""#86CCF3""                android:gravity=""center""                android:singleLine=""true""                android:ellipsize=""marquee""                android:layout_below=""@+id/media_cover""                 android:text=""Author""                &gt;                &lt;/TextView&gt;                &lt;TextView                android:id=""@+id/media_album""                android:layout_width=""fill_parent""                android:layout_height=""wrap_content""                android:textSize=""18sp""                android:textColor=""#DAFFFF""                android:gravity=""center""                android:singleLine=""true""                android:ellipsize=""marquee""                android:layout_below=""@+id/media_author""                    android:text=""Album (Year)""                &gt;                &lt;/TextView&gt;                &lt;Button                android:id=""@+id/play_button""                android:layout_width=""fill_parent""                android:layout_height=""wrap_content""                android:text=""Play""                android:textColor=""#003983""                android:textStyle=""bold""                android:textSize=""20sp""                android:gravity=""center""                android:layout_below=""@+id/media_album""                android:clickable=""true""                    &gt;                &lt;/Button&gt;            &lt;/RelativeLayout&gt;          &lt;ListView          android:id = ""@+id/tablist""          android:layout_width=""fill_parent""           android:layout_height=""fill_parent""          /&gt;      &lt;/FrameLayout&gt; &lt;/TabHost&gt;</code></pre><p>Any suggestions?</p><p>Thanks!</p>","259425","","259425","","2011-02-09 16:29:55","2011-02-09 16:53:07","Not possible to click a Button","<android><button><relativelayout>","2","4","","",""
"4947587","1","","","2011-02-09 16:24:19","1","1282","<p>I'm trying to connected to Bluetooth with Socket SPP using my Samsung Galaxy Tablet using UUID of <code>""00001101-0000-1000-8000-00805F9B34FB""</code>, but that doesn't not work for me.</p><p>And I have tried using the following:</p><pre><code>Method m = device.getClass().getMethod(""createRfcommSocket"", new Class[] { int.class });sock = (BluetoothSocket) m.invoke(device, Integer.valueOf(1));sock.connect();</code></pre><p>This is working fine, but everytime I try to connect, it's asking for pairing request PIN, failing of that is leading to failure of bluetooth connection.</p><p>How can I set/save the pair information so that it should not prompt pairing request every time I connect.</p>","610061","","750613","","2012-07-13 11:36:45","2012-11-01 14:45:36","Asking for 'Pairing Request' in android 2.1 when connecting to Bluetooth Socket SPP on Samsung Galaxy","<android><bluetooth>","2","1","","",""
"4947591","1","","","2011-02-09 16:24:37","2","20991","<p>I have an app where I've button on a webpage that is rendered inside a webview.</p><p>Now on click of button , a pdf file gets downloaded , and the same would then need to be opened inside the same webview.</p>","423639","","646806","","2012-06-11 08:46:47","2012-07-13 11:36:26","Open a pdf file inside a webview.","<android><pdf>","4","0","2","",""
"4947660","1","5056180","","2011-02-09 16:28:56","1","327","<p>I'm working on a project which generates Java code on-the-fly, and compiles it for Android. Funny thing is that sometimes <strong>dx.bat</strong> generates a broken DEX file while finishing successfully.</p><p>When I try to dexdump the DEX, I get: <strong>ERROR: bad checksum (deadbeef vs deadc0de)</strong></p><p>Manually playing around with <em>--no-optimize</em> or <em>--no-locals</em> will solve the issue for this specific compilation. But you can never know what will happen with the next one and this is a process that should be reliable.</p><p>BTW, manually fixing the checksum doesn't fix the problem (dexdump will crash after dumping some data) so I figure it isn't a dx checksum calculation bug.</p><p>Is there a known issue? How can I further debug?</p><p>Thanks!</p>","610068","","","","","2012-07-13 11:35:15","Android dx generates bad checksum dex files","<android>","1","0","","",""
"4947699","1","","","2011-02-09 16:32:04","1","1110","<p>Is there a method to identify if the device the app is running on is a phone or a tablet? We want to implement different behavior depending of the device type. </p>","406812","","","","","2011-03-31 13:11:12","Android - how to find out from within running app if device it is running on is phone or tablet","<android><device><tablet>","1","0","","",""
"4947706","1","4948588","","2011-02-09 16:32:41","0","1123","<p>I'm feeling kind of dumb here. I am storing sets of data that are always organized at a top level by Chapter > Scene > Dialogue. Dialogue always has several attributes and sometimes has additional data that is also always stored in an organized hierarchy (Sets of conditions, or sets of choices, each with attributes of their own to be read). Imagine a choose-your-own-adventure book and all of its rules being stored in an XML document. This seemed like the best way to store it, I'd welcome a contradiction.</p><p>I will always start on Chapter 1, Scene 1, Dialogue 1. Each dialogue, either through attributes or conditions, will always direct me to a single new node, for example, Chapter 3, Scene 2, Dialogue 8. I will never have to parse the entire document looking for chapter, scene, or dialogue tags. However, I do want to parse the given Dialogue node to look at its included sets of conditions or choices.</p><p>I can not for the life of me find how to specify, in Android, the equivalent of:</p><pre><code>XMLResourceParser parser = getResources().getXml((R.xml.script).getChild[CHAPTER][SCENE][DIALOGUE]);</code></pre><p>And while I could parse the entire document every time and iterate off to match my indexes and know where I am, that seems completely uncalled for. Any thoughts? Everywhere I look people are looking for solutions to problems that require reading the entire document and the answer is always on how to use the parser.</p>","610077","","","","","2011-02-09 17:55:21","Android: Reading specific nodes from XML without parsing entire document","<android><xml>","1","0","","",""
"4947720","1","","","2011-02-09 16:34:09","11","3988","<p>I have a theme that refuses to be applied to activities - none of the styles are applied. If I don't supply the <code>layout_width</code>/<code>layout_height</code> attributes for <code>&lt;Button&gt;</code> it also gets a runtime error, showing that the <code>Button</code> class isn't being applied.</p><p><strong>/res/values/themes.xml</strong>:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;resources&gt;    &lt;style name=""Theme"" parent=""android:style/Theme.Black""&gt;        &lt;item name=""android:windowNoTitle""&gt;true&lt;/item&gt;        &lt;item name=""android:buttonStyle""&gt;@style/Button&lt;/item&gt;        &lt;item name=""android:windowBackground""&gt;@color/page_background_light&lt;/item&gt;        &lt;item name=""android:textAppearance""&gt;@style/TextAppearance&lt;/item&gt;    &lt;/style&gt;&lt;/resources&gt;</code></pre><p><strong>/res/values/styles.xml</strong>:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;resources&gt;    &lt;style name=""TextAppearance"" parent=""@android:style/TextAppearance""&gt;        &lt;item name=""android:textSize""&gt;12sp&lt;/item&gt;        &lt;item name=""android:textColor""&gt;@color/darkblue&lt;/item&gt;    &lt;/style&gt;    &lt;style name=""Button"" parent=""@android:style/Widget.Button""&gt;        &lt;item name=""android:layout_width""&gt;fill_parent&lt;/item&gt;         &lt;item name=""android:layout_height""&gt;wrap_content&lt;/item&gt;        &lt;!--&lt;item name=""android:textColor""&gt;#3C2F4F&lt;/item&gt;        &lt;item name=""android:textSize""&gt;20dip&lt;/item&gt;--&gt;    &lt;/style&gt;&lt;/resources&gt;</code></pre><p>and the relevant <strong>manifest setting</strong>:</p><pre><code>&lt;application android:icon=""@drawable/icon""    android:label=""@string/app_name""    android:theme=""@style/Theme""&gt;</code></pre><p>What's the obvious mistake I'm missing?</p>","2025","","","","","2012-11-18 20:26:04","Android theme not being set","<android><themes><android-manifest><android-styles>","5","2","2","",""
"4947903","1","4947960","","2011-02-09 16:49:23","4","901","<p>The Android system has a flag called ""Unknown Sources"" that allows it to install applications from non-market sources.</p><p>If I sign my application as described on the android developer website (i.e. with a certificate that is created using the private keys I got from google), and decide not to publish my application on the android market, but host it on my own site.</p><p>Will this application be considered a non-market by the android system ? Will it still install with the ""Unknown Sources"" option turned off ?</p>","517940","","244296","","2011-02-09 16:57:21","2012-05-16 09:25:09","Signing an app, but not publishing on Android market","<android><publishing><google-play><signing>","3","0","1","",""
"4947919","1","6652048","","2011-02-09 16:51:29","1","6986","<p>Hello how i can add page loading progress in it . when the page load completely then the prgress bar should up .i want to put the code in case statement . Thanks in advance . here is the code</p><pre><code>package com.menu;import android.app.Activity;import android.os.Bundle;import android.view.Menu;import android.view.MenuInflater;import android.view.MenuItem;import android.webkit.WebView;import android.webkit.WebViewClient;import android.widget.Toast;public class MenuActivity extends Activity {WebView mWebView;/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    mWebView = (WebView) findViewById(R.id.webview);    mWebView.getSettings().setJavaScriptEnabled(true);    mWebView.loadUrl(""http://www.google.com"");    mWebView.setWebViewClient(new WebViewClient());}public boolean onCreateOptionsMenu(Menu menu) {    new MenuInflater(getApplication())            .inflate(R.layout.menu, menu);    return(super.onPrepareOptionsMenu(menu));}public boolean onOptionsItemSelected(MenuItem item) {     switch (item.getItemId()) {        case R.id.Menu1:            WebView myWebView = (WebView) findViewById(R.id.webview);            myWebView.loadUrl(""http://...........com"");                myWebView.setWebViewClient(new WebViewClient());            break;        case R.id.Menu2:            WebView myWebView2 = (WebView) findViewById(R.id.webview);            myWebView2.loadUrl(""http://.................com/notice.php"");            break;        case R.id.Menu3:            WebView myWebView3 = (WebView) findViewById(R.id.webview);            myWebView3.loadUrl(""http://...........com/original/services.php"");                myWebView3.setWebViewClient(new WebViewClient());            break;        case R.id.submenu:            Toast.makeText(this, ""Sub menu"", Toast.LENGTH_SHORT).show();            break;        default:             Toast.makeText(this, ""Sub menu"", Toast.LENGTH_SHORT).show();            ;     }    return(super.onOptionsItemSelected(item));}}</code></pre>","592344","","512958","","2011-02-09 16:53:52","2011-07-11 14:53:14","dynamic progress bar in android web view","<android>","2","0","","",""
"4947967","1","4947997","","2011-02-09 16:55:43","1","2590","<p>I would be very grateful if someone could explain if it is possible to enter text into an EditText. (This would be done with  <code>android:text=""""</code>)</p><p>But then the text would disappear when user clicks inside it.</p><p>Thanks </p>","608658","","750613","","2012-07-13 11:33:52","2012-07-13 11:34:14","Enter text into an EditText which then disappears when user clicks inside it","<android>","3","0","","",""
"4948037","1","","","2011-02-09 17:01:25","14","5841","<p>I my app I want to use a https connection to a user-specified server which uses a self-signed certificate. What I gathered by now is, that</p><ul><li>self signed certificates are rejected (as expected)</li><li>the android keystore/truststore is not used for apps, so apps have to build and use their own truststore,</li><li>there's a ""keytool"" in the JDK to build a truststore that can be supplied to the app as a resource, which however is not a solution since I do not know the server (and its certificate beforehand)</li></ul><p>Since the https server is user specified, I do not know the server's certificate beforehand and thus want to add the server certificate programmatically to the app's truststore (by showing the certificate to the user and have him accept it). Once added to the truststore, the app shall use that truststore to authenticate the server.</p><p>I do NOT want to simply accept every self-signed certificate without the user checking the fingerprint as some examples on the web suggest.</p><p>Now the problem is that I'm completely new to Java and Android and am struggling to understand the inner workings of the AndroidHttpClient or DefaultHttpClient. I have basic HTTP working in my app, but haven't found any example on how to actually ADD certificates to a truststore inside the app on demand of the user.</p><p>Does anybody know how to achieve that or knows a working example that I can look at?</p><p>Any hints are appreciated. Thanks.</p><p>EDIT: Found the Solution in the <a href=""https://github.com/k9mail/k-9/blob/master/src/com/fsck/k9/mail/store/TrustManagerFactory.java"">TrustManagerFactory.java class of K9 Mail</a>. I suggest to have a look at it if you're having the same question.</p>","580482","","326597","","2011-07-17 06:00:25","2013-03-27 13:19:07","How to programmatically add certificates to a truststore and use that also for verifying server authentication","<android><ssl><ssl-certificate>","2","1","7","",""
"4948094","1","","","2011-02-09 17:07:03","0","1110","<p>Is the below code sufficient to get lat &amp; long value for an address.</p><pre><code>List&lt;Address&gt; addressList = geoCoder.getFromLocationName(cityName, 1);Address address = addressList.get(0);if(address.hasLatitude() &amp;&amp; address.hasLongitude()){       double selectedLat = address.getLatitude();   double selectedLng = address.getLongitude();}</code></pre><p>Please tell me proper method to use <code>Geocoder</code></p>","569938","","750613","","2012-07-13 11:33:02","2012-07-13 11:33:02","How to get use Geocoder in android?","<android><geolocation><location><geocoding>","0","6","","",""
"4948098","1","4948170","","2011-02-09 17:07:36","0","2710","<p>I want to make a simple program with 2 Radiobutton (<code>rd1 and rd2</code>), what can change background to picture s1, or s2, depend on what was selected. How I can make it? I tried background.setBackground (background is my RadioGroup's name), but it didn't work. </p>","590898","","750613","","2012-07-13 11:32:24","2012-07-13 11:32:32","How I can change the Background in runtime in Android?","<android><eclipse>","1","1","","",""
"4948152","1","7646483","","2011-02-09 17:13:13","54","26629","<p>I want to build a REST Client on an android phone.</p><p>The REST server exposes several resources, e.g. (GET)</p><pre><code>http://foo.bar/customer      List of all customerhttp://foo.bar/customer/4711    The customer with id 4711http://foo.bar/customer/vip     List of all VIP customerhttp://foo.bar/company           List of all companyshttp://foo.bar/company/4711     The company with the ID 4711http://foo.bar/company/vip      List of all VIP companys</code></pre><p>I (think) I know how to talk to the REST server and get the information I need. I would implement a REST Client class with an API like this</p><pre><code>public List&lt;Customer&gt; getCustomers();public Customer getCustomer(final String id);public List&lt;Customer&gt; getVipCustomer();public List&lt;Company&gt; getCompanies();public Customer getCompany(final String id);public List&lt;Customer&gt; getVipCompanies();</code></pre><p>Referred to the presentation ""<a href=""http://dl.google.com/googleio/2010/android-developing-RESTful-android-apps.pdf"">Developing Android REST client applications</a>"" from Virgil Dobjanschi I learned that it is no good idea to handle the REST request in an Worker Thread of the Activity. Instead I should use the <a href=""http://developer.android.com/reference/android/app/Service.html"">Service</a> API.</p><p>I like the idea of having a Singleton ServiceHelper which binds to a (Local) Service but I am afraid that I did not understand the Service concept correct.</p><p>For now I do not understand how to report a REST call result (done asynchrounous in a Service) back to the caller Activity. I also wonder if I need ONE Service which handles all REST requests (with different return types) or if I need a dedicated service for each REST request.</p><p>Probably I have many other understanding problems so the best thing for me would be a <strong>sample application</strong> which meets my needs. My use case is not unusual and I hope there is in example application out there.</p><p><strong>Would you please let me know!</strong></p><p>Any other suggestions which points me in the correct implementation direction are also helpful (Android API-Demo does not match my use case).</p><p>Thanks in advance.</p><p>Klaus</p><p><strong>EDIT</strong>: Similar Topics found on SO (after posting this) which lead me in the direction I need (minimizing the complex ""Dobjanschi pattern""):</p><ul><li><a href=""http://stackoverflow.com/questions/3197335/android-restful-api-service"">Android: restful API service</a></li></ul>","367285","","382920","","2011-11-13 23:49:50","2014-04-13 22:56:43","Need sample Android REST Client project which implements Virgil Dobjanschi REST implementation pattern","<java><android><design-patterns><rest>","8","3","56","",""
"4948219","1","","","2011-02-09 17:20:47","1","6604","<p>I would be very grateful if someone could explain how to create a simple timer in a game which starts off at 30 seconds and then goes back until 0. At  0 I would then stop the game and invoke a method which would allow the next player to take a turn.</p><p>Any advice would be appreciated. Thanks</p><p><em>Edit:</em></p><pre><code>import android.os.CountDownTimer;import android.widget.TextView;public class MyCount extends CountDownTimer {    static TextView timeDisplay;    public MyCount(long millisInFuture, long countDownInterval) {        super(millisInFuture, countDownInterval);    }    public void onFinish() {        timeDisplay.setText(""Done!"");    }    public void onTick(long millisUntilFinished) {        timeDisplay.setText(""Left: "" + millisUntilFinished / 1000);    }}</code></pre><p>In a seperate class I have created a method:</p><pre><code>public void setTimer() {     timeDisplay = new TextView(this);    this.setContentView(timeDisplay);    MyCount counter = new MyCount(30000, 1000);    counter.start();}</code></pre><p>Within an onClick method I have called the method above:</p><pre><code>public void onClick(View v) {    setTimer();}</code></pre><p>I'd appreciate any advice on this. </p>","608658","","774691","","2012-08-18 18:44:30","2012-11-10 22:30:40","Create a simple timer in a game","<android><timer>","0","3","3","",""
"4948270","1","4948473","","2011-02-09 17:26:27","0","1684","<p>I have an application which upon start request around 10-12KB of data from server (in onResume, I have a thread which starts to get data from server) and then paints it in tabular form on the view. Each row of view consist of 5 <code>TextView</code>s and 2 <code>Drawable</code>s.</p><p>Now, the application works perfectly fine on 2.2 and previous version of OS, but crashes on 2.3.2 with out of memory error in onCreate method (while setting the layout from R.main).The way to recreate the error is to keep on rotating the device (around 20-25 times), so that app keeps on switching from portrait to landscape mode. I looked at the DDMS output and I see a pattern. If I switch between portrait and landscape mode pretty fast ... system tries to run GC... showing messages such as </p><pre><code>02-09 12:20:08.617: DEBUG/dalvikvm(109): GC_EXPLICIT freed 426K, 47% free 6201K/11655K, external 4752K/5934K, paused 122ms</code></pre><p>But just before crashing it prints out lot of GC messages </p><pre><code>02-09 12:20:12.875: DEBUG/dalvikvm(184): GC_EXTERNAL_ALLOC freed 112K, 52% free 3022K/6215K, external 5127K/5136K, paused 110ms 02-09 12:20:12.933: DEBUG/dalvikvm(28163): GC_EXTERNAL_ALLOC freed 108K, 34% free 7894K/11847K, external 20252K/20560K, paused 155ms 02-09 12:20:13.007: INFO/dalvikvm-heap(28163): Clamp target GC heap from 32.031MB to32.000MB 02-09 12:20:13.007: DEBUG/dalvikvm(28163): GC_FOR_MALLOC freed 2K, 34% free 7891K/11847K, external 20254K/20560K, paused 47ms 02-09 12:20:13.074: DEBUG/dalvikvm(28163): GC_EXTERNAL_ALLOC freed 0K, 34% free ....</code></pre><p>more such lines. and then crash.</p><p>I'm unable to understand why it crashes in one OS and not other. My device is a Samsung Nexus S. Any ideas? I ran the MAT tool on the Heap dump and I see 5-6 instances of main activity class all with some retained memory. Sshouldn't the memory be garbage collected?</p>","260298","","418183","","2011-02-09 17:34:10","2011-02-09 17:43:23","Out of memory in Android 2.3.2","<android><out-of-memory>","2","0","1","",""
"4948281","1","16106052","","2011-02-09 17:27:12","4","2652","<p>I want any easy open source android twitter client application.Thank You</p>","480716","","1104926","","2011-12-19 13:47:46","2013-04-19 13:41:33","Android : Any open source Android twitter client application?","<android><open-source><twitter><twitter-client>","5","0","1","",""
"4948513","1","","","2011-02-09 17:47:48","0","133","<p>To give you some context:I am successfully using aspectJ with android projects, and I've written a <code>@Background</code> annotation that I apply to methods that cannot block the main UI thread.This annotation is being intercepted by a pointcut and an around advice that takes care of running the code in a background thread and dealing with network errors and user notification.</p><p>What I would like to do next is to automatically provide a reload button on the menu to all activities that have such background methodsThis has to be done by overriding a method with the following signature:public boolean onCreateOptionsMenu(Menu menu);</p><p>Activities that don't do background stuff don't need to have menu, and thus, don't override that method.</p><p>So, is there a way to make aspectJ override a method in just those classes that have (at least) a method with a particular annotation ?</p><p>Or is there a more elegant solution ?</p><p>Thanks,Carlos.</p>","610096","","750613","","2012-07-13 11:31:41","2012-07-13 11:31:41","How to do an inter-type injection on classes that have methods with a certain annotation?","<android><aspectj>","1","0","","",""
"4948631","1","","","2011-02-09 17:59:26","0","281","<p>How to gathering 2 rows of list to be 1 row for call Context Menu </p><p>Does anybody have some demo?</p><p>Thanks in advance.</p>","605358","","750613","","2012-07-13 11:31:15","2012-07-13 11:31:15","How to gathering 2 rows of list to be 1 row for call ContextMenu","<android><listview><contextmenu><listactivity>","1","4","","",""
"4948693","1","","","2011-02-09 18:06:11","0","479","<p>I am planning to develop an diminished reality application for Android phone. If theres any existing <code>frameworks</code>, that is. Could anyone tell me where to start? Thanks</p>","597192","","750613","","2012-07-13 11:31:00","2012-07-13 11:31:00","Android 2.2: diminished reality","<android><augmented-reality>","1","5","","",""
"4948757","1","","","2011-02-09 18:11:45","1","453","<p>I know you can do this with a regular Java project, but I can't select the Android project from the ""Runnable Jar File Specification"" menu in Eclipse (which would allow me to export the referenced libraries).  Is there an easy way to do this without going through each local folder the Jars are in?</p>","375566","","","","","2011-02-09 18:11:45","Android 2.2 SDK / Eclipse - Export referenced libraries as .jar?","<java><android><eclipse><eclipse-plugin><android-sdk-2.2>","0","0","","",""
"4948773","1","4948907","","2011-02-09 18:13:14","0","584","<p>Everything is working fine in 3g mode the advertisement is correctly shown but as you can see from the Title when I connect my phone via wifi a got always the same response:</p><pre><code>02-09 18:58:47.790: INFO/AdMobSDK(10151): No fill.  Server replied that no ads are available (315ms)02-09 18:58:47.790: DEBUG/AdWhirl SDK(10151): AdMob failure</code></pre>","538092","","750613","","2012-07-13 11:30:41","2012-07-13 11:30:41","adwhirl, admob failure over wifi","<android><admob><adwhirl>","1","0","","",""
"4948796","1","","","2011-02-09 18:15:57","2","525","<p>I've been reading up on Parcelables and the more I read the more I'm getting confused about it.</p><p>What I'm trying to is the following</p><ol><li>Hook up to an external API to get JSON data (currently working).</li><li>I'm parsing the JSON objects just fine into strings that I place in a HashMap.  I'm using a ListView to display the data which is scrollable (currently working)</li><li>I've setup an onClickListener which sets up a new intent (currently working)</li><li>Here's where I'm getting confused - my goal is to allow the user to click on an item in the Listview that will take them to a new screen with more detail information about the item they clicked. </li></ol><p>Questions to point number 4:</p><ol><li>Do I use a Parcelable class to pass in JSON object into the intent?  Is it the best option in my case?</li><li>If Parcelable is the right choice, would I create a new class that implements Parcelables for the JSON Object to be passed in?  I guess I'm really not sure how to proceed.  All the examples I've seen just have a few strings that they pass into the writeToParcel() method.  Not sure how that translates to objects with multiple properties.</li></ol><p>Thank you for taking the time to read.</p>","473737","","","","","2011-05-03 22:14:57","How to use Parcelable and onClickListeners?","<android><json><parcelable>","1","0","","",""
"4948914","1","","","2011-02-09 18:28:05","3","10788","<p>I am making an application in which I have to change the UI programmaticaly.I needed to change the <code>layout_height</code> and <code>layout_width</code> XML attributes.</p><p>But when I use the <code>setLayoutParams</code> method, the app runs and then I give a message that it has unexpectedly stopped working and I have to force close.</p><p>I have tried setting the LayoutParams as <code>ViewGroup.LayoutParams</code> as well.But nothing works. Kindly check the attached code and guide.</p><p>This is the Java Code.</p><pre><code>private void fixLayoutVmain(){    ListView lv;    ImageButton rev,stop,play,forw;    lv=(ListView)findViewById(R.id.ListMain);    rev=(ImageButton)findViewById(R.id.rev);    stop=(ImageButton)findViewById(R.id.stop);    play=(ImageButton)findViewById(R.id.plpa);    forw=(ImageButton)findViewById(R.id.forw);    Log.d(""DEV1"",""ID's have been assigned"");    LayoutParams lp=new LayoutParams(W, ((75*H)/100));          Log.d(""DEV1"",""param object created"");           lv.setLayoutParams(lp);         Log.d(""DEV1"",""ListView param set"");         lp.height=(int)(10*H)/100;    lp.width=(int)(10*H)/100;    Log.d(""DEV1"",""Changes to param made"");    rev.setLayoutParams(lp);        Log.d(""DEV1"",""Reverse Button param applied"");    stop.setLayoutParams(lp);    Log.d(""DEV1"",""Stop button param applied"");    play.setLayoutParams(lp);    Log.d(""DEV1"",""forward button param applied"");    forw.setLayoutParams(lp);    Log.d(""DEV1"",""All imagebutton changes have been made"");}</code></pre><p>This is the XML File</p><pre><code>&lt;LinearLayout    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""&gt;    &lt;ListVieW        android:id=""@+id/ListMain""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content"" /&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=""bottom""&gt;            &lt;ImageButton                android:id=""@+id/rev""                android:src=""@drawable/reverseimg""                android:background=""@null""                android:scaleType=""fitXY"" /&gt;            &lt;ImageButton                android:id=""@+id/stop""                android:src=""@drawable/stopimg""                android:background=""@null""                android:scaleType=""fitXY"" /&gt;            &lt;ImageButton                android:id=""@+id/plpa""                android:src=""@drawable/playimg""                android:background=""@null""                android:scaleType=""fitXY"" /&gt;            &lt;ImageButton                android:id=""@+id/forw""                android:src=""@drawable/forwardimg""                android:background=""@null""                android:scaleType=""fitXY"" /&gt;    &lt;/LinearLayout&gt;&lt;/LinearLayout&gt;</code></pre>","610230","","418183","","2011-02-10 18:26:18","2012-07-13 11:30:23","Problem with setLayoutParams method in android UI","<android><android-layout>","3","3","","",""
"4948957","1","","","2011-02-09 18:31:23","2","861","<p>I'm working on an Android and iPhone app. I'm rendering lots of smallish (about 32 pixels) billboards to the screen for a particle system and want to give a glitter-like sparkle to each billboard e.g. as the particles are falling, random ones will briefly light up and sparkle as they catch the light. Is there a simple way to achieve this effect? As a limitation, I cannot use pixel/vertex shaders.</p><p>I was thinking something along the lines of a giving each billboard metal-like lighting effect (although I'm not sure how to do this part) coupled with giving each billboard a random and constantly rotating normal with flat shading so that each billboard would randomly light up. I'm having trouble making it look nice.</p>","590099","","44729","","2011-02-09 19:41:48","2011-02-09 20:23:21","Metallic sparkle effect in OpenGL ES?","<iphone><android><graphics><opengl-es>","1","2","1","",""
"4948966","1","4949231","","2011-02-09 18:32:32","0","1915","<p>Typical way to reference android control is something like this:</p><pre><code>TextView tv = (TextView)findViewById(R.id.tv);</code></pre><p>Where R.id.tv is integer referencing my xml control.</p><p>The thing is I would like to make reference using string ""R.id.tv"". Is that possible?</p><p>Let's say I have multiple controls: </p><pre><code>tv1,tv2,tv3,tv4,tv5,</code></pre><p>How would I put this into some sort of loop and interate through controls. I am thinking I would use loop counter to reference different controls. How's that to be done? Thanks.</p>","507153","","750613","","2012-07-13 11:29:55","2012-07-13 11:29:55","Reference control using string instead ID","<android><reference><control>","4","0","","",""
"4949066","1","","","2011-02-09 18:41:05","1","6538","<p>New to Android and trying to implement Broadcast communication between two Activities.  I've looked at many examples in books, web sites, and have followed several threads here, but I am still missing something.  Most samples have an Activity which extends from BroadcastActivity, which I believe this NOT what is needed for my app.  I put together a straight forward sample to test.</p><p>What am I missing?? The entire code is below.</p><p>Thanks for your help.</p><pre><code>package com.dialogtest.dt;import android.app.Activity;import android.app.AlertDialog;import android.app.Dialog;import android.content.DialogInterface;import android.os.Bundle;import android.text.Editable;import android.util.Log;import android.view.LayoutInflater;import android.view.View;import android.widget.EditText;import android.widget.TextView;public class DialogActivity extends Activity {        public static final String DTAG = ""ADebug"";        public static String strDia = ""declr"";        public static String BroadMess = ""com.dialogtest.dt.Restart"";        public static TextView tv;    }import android.app.Activity;import android.app.AlertDialog;import android.app.Dialog;import android.content.BroadcastReceiver;import android.content.Context;import android.content.DialogInterface;import android.content.Intent;import android.content.IntentFilter;import android.os.Bundle;import android.util.Log;import android.view.LayoutInflater;import android.view.View;import android.widget.Button;import android.widget.TextView;public class MainActivity extends DialogActivity {    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);                setContentView(R.layout.main);        strDia = ""One"";        tv = (TextView) findViewById(R.id.TextView_Main);        final Button diaButton = (Button) findViewById(R.id.Button_A);        diaButton.setOnClickListener(new View.OnClickListener() {                      @Override           public void onClick(View v) {              startActivity(new Intent(MainActivity.this, TestActivity.class));                                         }        });                                        }    BroadcastReceiver receiver = new BroadcastReceiver() {        @Override        public void onReceive(Context context, Intent intent) {                     tv.setText(""SUCCESS - RECEIVED!"");            Log.e(DTAG, ""in Main - RECEIVED BROADCAST - str: "" + strDia);        }    };    @Override    protected void onResume() {        IntentFilter filter = new IntentFilter();        filter.addAction(BroadMess);        registerReceiver(receiver, filter);        super.onResume();    }    @Override    protected void onPause() {        unregisterReceiver(receiver);        super.onPause();    }        }public class TestActivity extends DialogActivity {    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);                setContentView(R.layout.two_dialog);       final Button dB = (Button) findViewById(R.id.ButtonDone);              dB.setOnClickListener(new View.OnClickListener() {                  @Override       public void onClick(View v) {           finish();       }         });         }    @Override    public void onStart() {        super.onStart();        EditText dET = (EditText) findViewById(R.id.EditText01);               dET.setText(strDia);    }    @Override    public void onPause() {        super.onPause();        EditText dET = (EditText) findViewById(R.id.EditText01);        strDia = dET.getText().toString();        Intent broadcast = new Intent();        broadcast.setAction(BroadMess);        sendBroadcast(broadcast);        Log.e(DTAG, ""in Test onPause Sending Broadcast - strDia: "" + strDia);    }}&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;manifest xmlns:android=""http://schemas.android.com/apk/res/android""      package=""com.dialogtest.dt""      android:versionCode=""1""      android:versionName=""1.0""&gt;    &lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;        &lt;activity android:label=""@string/app_name"" android:name=""MainActivity""&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=""DialogActivity""&gt;&lt;/activity&gt;&lt;activity android:name=""TestActivity"" android:theme=""@android:style/Theme.Dialog""&gt;&lt;/activity&gt;&lt;/application&gt;    &lt;uses-sdk android:minSdkVersion=""3"" /&gt;&lt;/manifest&gt;</code></pre>","578960","","147306","","2011-08-18 23:44:20","2012-07-13 11:29:26","Broadcast Send/Receive between Activities","<android>","1","0","","",""
"4949173","1","4950225","","2011-02-09 18:54:35","1","1382","<p>I have an app that hits a REST service, gets some json and then places it into a listview. My main activity extends Activity and not ListActivity. I can scroll through the list items, but I cannot select any (at least by touch). I get to the listview through findViewBYId and have an adapter that extends SimpleAdapter. I have set the convertView inside the adapter's getVIew() as clickable. However when I do this, I can no longer click on the list items in the listView? Did I do this wrong? </p><pre><code>public class App extends Activity {    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        jobsListView = (ListView) findViewById(R.id.jobs_list);        jobsListView.setAdapter(new JobItemAdapter(jobsListView.getContext(),                 jobsList,                 R.layout.list_item,                 new String[] {""title"",""location""},                new int[] {R.id.job_title, R.id.job_location}));        jobsListView.setOnItemClickListener(new AdapterView.OnItemClickListener() {            @Override            public void onItemClick(AdapterView&lt;?&gt; arg0, View arg1, int arg2,                    long arg3) {                // TODO Auto-generated method stub                Log.i(""jobsListView.setOnItemClickListener()"","" item clicked: "" + arg0.getSelectedItemPosition());            }        });    }    public class JobItemAdapter extends SimpleAdapter {        private List&lt;HashMap&lt;String,String&gt;&gt; jobsList;        public JobItemAdapter(Context context, List&lt;HashMap&lt;String,String&gt;&gt; jobs, int resource, String[] from, int[] to)        {               super(context, jobs, resource, from, to);            jobsList = jobs;                    }        public View getView(int position, View convertView, ViewGroup parent){            Log.i(TAG,"" in  JobItemAdapter getView() "");            if (convertView == null) {                //no previous views, inflate views                convertView = getLayoutInflater().inflate(R.layout.list_item, parent, false);            }            //update textviews in layout            TextView title = (TextView)convertView.findViewById(R.id.job_title);            title.setText(jobsList.get(position).get(""title""));            TextView location = (TextView)convertView.findViewById(R.id.job_location);            location.setText(jobsList.get(position).get(""location""));            //make the view clickable            convertView.setClickable(true);            return convertView;        }    }}</code></pre>","623334","","750613","","2012-07-13 11:28:16","2012-07-13 11:28:16","Can't get my ListView items to be highlighted when they are selected","<android><listview><clickable>","2","0","","",""
"4949189","1","4949294","","2011-02-09 18:56:12","0","281","<p>I am developing an android server-client application which will draw the user requested interfaces dynamically. The interfaces will transfered to the client from the server according to the requirement. To access the fields of the interface file, and manage it well, can I use css file format?</p>","610225","","","","","2011-02-09 19:05:56","Will android mobile OS support css file format?","<android><mobile><operating-system><client-server>","1","0","","",""
"4949202","1","4949300","","2011-02-09 18:57:06","1","407","<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=""#444548""&gt;  &lt;ImageView  android:layout_width=""wrap_content""  android:layout_height=""wrap_content""  android:id=""@+id/image""    &gt;    &lt;/ImageView&gt;  &lt;TextView android:id=""@+id/TextView01""android:textColor=""#ffffff""android:layout_width=""wrap_content""android:text=""@+id/TextView01"" android:layout_height=""wrap_content""&gt; &lt;/TextView&gt;&lt;/LinearLayout&gt;</code></pre><p>i m calling my textview in my .java class like this:</p><pre><code>TextView tv1 = (TextView) findViewById(R.id.TextView01);    tv1.setText(""Welcome to Schogini!"");</code></pre><p>is there any way to do this for an image too?thanks</p>","519526","","","","","2011-02-09 19:25:27","call an imageView inside my .java class","<android><imageview>","1","0","","",""
"4949216","1","","","2011-02-09 18:58:18","6","10506","<p>I want to develop an android application using <code>Honey Comb 3.0</code> in which I want to display a list , clicking on any item in a list should display another list  beside that list item in the form of Fragment. Can any one provide me sample code in sorting out this issue?</p><p>Thanks in Advance,</p>","429501","","750613","","2012-07-13 11:27:50","2012-07-13 11:27:50","Using Multiple Fragments in an single activity","<android><android-3.0-honeycomb>","1","1","2","",""
"4949271","1","","","2011-02-09 19:04:10","2","886","<p>On my app I have a webview that loads a webpage which contains an online broadcast. The problem is that once I exit the app it seems to keep getting data since my free memory continues to decrease. It comes back to normal only if I close the app manually.</p><p>I have found this topic here as well:</p><p><a href=""http://stackoverflow.com/questions/3431351/how-do-i-pause-flash-content-in-an-android-webview-when-my-activity-isnt-visible"">How do I pause Flash content in an Android WebView when my activity isn&#39;t visible?</a></p><p>I also had the problem described there: my flash content kept working even if the app wasn't on the screen (I could hear it). Now it's fixed with the code shown there, but as I said, it keeps draining memory anyway.</p>","568288","","720507","","2012-05-03 17:07:34","2012-05-03 17:07:34","WebView onPause method. Memory leak.","<android><flash><memory><webview>","0","0","","",""
"4949427","1","4951477","","2011-02-09 19:19:51","0","2093","<p>How do you scroll a webView w/ the volume hard keys? ...and can it be done with easing?  If so, how?  I'm a nooB to Android - Coming over from ActionScript and any help will be greatly appreciated.</p><pre><code>my R.id.webPg001 is a WebView id.</code></pre><p>This is where I'm at now:</p><pre><code>@Override  public boolean dispatchKeyEvent(KeyEvent event) {      int action = event.getAction();      int keyCode = event.getKeyCode();      ScrollView scrollView;      scrollView = (ScrollView) findViewById(R.id.webPg001);                  switch (keyCode) {          case KeyEvent.KEYCODE_VOLUME_UP:              if (action == KeyEvent.ACTION_UP) {                  scrollView.pageScroll(ScrollView.FOCUS_UP);                  scrollView.computeScroll();               }              return true;          case KeyEvent.KEYCODE_VOLUME_DOWN:              if (action == KeyEvent.ACTION_UP) {          scrollView.pageScroll(ScrollView.FOCUS_DOWN);                  scrollView.computeScroll();               }              return true;          default:              return super.dispatchKeyEvent(event);          }      }</code></pre>","742030","","750613","","2012-07-13 11:27:04","2012-07-13 11:27:04","Scroll webView with volume keys","<android><webview><scroll><keyevent>","3","1","2","",""
"4949449","1","4949502","","2011-02-09 19:21:58","1","501","<p>Very simple task. I want to reformat a timestamp sent to me from a service with the format of <em>Wed, 26 Jan 2011 22:27:09 +0000</em>.</p><pre><code>String format = ""EEEE; MMMM d, yyyy"";String timestamp = ""Wed, 26 Jan 2011 22:27:09 +0000"";Date date = new SimpleDateFormat(format).parse(timestamp);Log.d(""Test"", date.toString());</code></pre><p>I haven't been able to find what formats <code>.parse()</code> method will allow but this one throws a <code>ParseException</code>.</p>","53653","","","","","2011-02-09 19:30:41","How can I parse a seemingly standard Timestamp in Java?","<java><android><date>","1","0","","",""
"4949509","1","4963069","","2011-02-09 19:28:28","6","13910","<p>I need UUID of a bluetooth device to connect to it, but i don't know much about uuid. Is it specific to each device and how to know what is <code>device's uuid</code>. Can it be done using code?</p>","560365","","944657","","2012-11-05 08:02:31","2012-11-05 08:02:31","Android: obtaining uuid of a bluetooth device","<android><bluetooth><uuid>","2","0","5","",""
"4949539","1","","","2011-02-09 19:31:11","0","249","<p>I am working on my final year project which is based on Android.I am working on an Android 2.1 emulator.I want to fetch the contacts from the emulator.I have written following code as per developer.android.com but I am facing some problems with Cursor.</p><p>If I comment this line:</p><pre><code>Cursor managedcursor=managedQuery(contacts, projection, null, null);</code></pre><p>the code goes well and displays the toast. And if the comment is removed, it asks for force close.</p><p>Can anyone please help me to get out of this problem so that I can move further in my app?</p><p>Thanks and Regards,PrajaktaS.</p><p>The code is as follows:</p><pre><code>package com.readcontact;import android.app.Activity;import android.net.Uri;import android.os.Bundle;import android.provider.ContactsContract;import android.provider.ContactsContract.Contacts;import android.widget.Toast;import android.content.ContentProvider;import android.database.Cursor;public class ReadContacts extends Activity {       @Override      public void onCreate(Bundle savedInstanceState)    {         super.onCreate(savedInstanceState);                 setContentView(R.layout.main);           readcontact();    }    private void readcontact()     {        // TODO Auto-generated method stub        String[] projection=new String[]        {            ContactsContract.Contacts._ID,            ContactsContract.Contacts.DISPLAY_NAME        };        Uri contacts=ContactsContract.Contacts.CONTENT_URI;//      Cursor managedcursor=managedQuery(contacts, projection, null, null);        Toast.makeText(this, ""data retrieved"", 40).show();    }    }       </code></pre>","563042","","13531","","2011-02-09 19:49:20","2011-02-09 19:49:20","Content Providers Related Problem","<android><android-contentprovider>","0","2","","",""
"4949712","1","","","2011-02-09 19:49:29","0","499","<p>I'm working and an app based on the Notepad tutorial...In the tutorial you click on a note in the listview and you are taken to edit were the corresponding information is shown, you then make your changes select confirm..and are taken back to Main.</p><p>I added a second activity to the app ""contact"" now when you click on a note in the listview and you are taken to contact were the corresponding information is shown including a button............ you click the button and are taken to edit.........And this is were my problem pops its ugly head. When i ckick the button a get a blank screen and a forced close popup........</p><p>Here is the code from the main taking you to contact....This works the information is shown</p><pre><code>protected void onListItemClick(ListView l, View v, int position, long id) {    super.onListItemClick(l, v, position, id);    Intent i = new Intent(this, Contact.class);    i.putExtra(NotesDbAdapter.KEY_ROWID, id);    startActivityForResult(i, ACTIVITY_EDIT);}</code></pre><p>Here is the code that takes you from contact to edit.....This gives me the error, I'm sure it has to do with ""intent.putExtra(NotesDbAdapter.KEY_ROWID, id);"" needing to be recoded to work with a onClick compared to a onListitemClick........I'm thinking the id is not being passed over</p><pre><code>public void onClick(View v) {String id = null;switch (v.getId()) {case R.id.admin: // doStuff    Intent intent = new Intent(this, Contact.class);    intent.putExtra(NotesDbAdapter.KEY_ROWID, id);    startActivity(intent);     break;</code></pre><p>Could someone show me how to do this from a button????</p><p>Here is the code from Main, Contacts and Edit..........If you need it .......Thanks</p><p>Main.class</p><pre><code>public class Main extends ListActivity {private static final int ACTIVITY_CREATE=0;private static final int ACTIVITY_EDIT=1;private static final int INSERT_ID = Menu.FIRST;private static final int DELETE_ID = Menu.FIRST + 1;private static final int ABOUT = Menu.FIRST + 2;private static final int TESTBUTTON = Menu.FIRST + 3;private static final int CONTACT_ID = Menu.FIRST + 4;private static final int CANCEL_ID = Menu.FIRST + 5;private NotesDbAdapter mDbHelper;/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    mDbHelper = new NotesDbAdapter(this);    mDbHelper.open();    fillData();    registerForContextMenu(getListView());}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_NAME, NotesDbAdapter.KEY_RANK};    // 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, R.id.text2};    // Now create a simple cursor adapter and set it to display    SimpleCursorAdapter notes =         new SimpleCursorAdapter(this, R.layout.mainlistrow, notesCursor, from, to);    setListAdapter(notes);}@Overridepublic boolean onCreateOptionsMenu(Menu menu) {    super.onCreateOptionsMenu(menu);    menu.add(0, INSERT_ID, 0, R.string.menu_insert);    menu.add(0, ABOUT, 0, R.string.menu_about);    menu.add(0, TESTBUTTON, 0, R.string.menu_test);    return true;}@Overridepublic boolean onMenuItemSelected(int featureId, MenuItem item) {    switch(item.getItemId()) {        case INSERT_ID:            createNote();            return true;        case ABOUT:                    menuabout();                    return true;        case TESTBUTTON:                    menutest();                    return true;        }    return super.onMenuItemSelected(featureId, item);}@Overridepublic void onCreateContextMenu(ContextMenu menu, View v,        ContextMenuInfo menuInfo) {    super.onCreateContextMenu(menu, v, menuInfo);    menu.add(0, CONTACT_ID, 0, R.string.menu_contact);    menu.add(0, DELETE_ID, 0, R.string.menu_delete);    menu.add(0, CANCEL_ID, 0, R.string.menu_cancel);}@Overridepublic boolean onContextItemSelected(MenuItem item) {    switch(item.getItemId()) {        case DELETE_ID:            AdapterContextMenuInfo info = (AdapterContextMenuInfo) item.getMenuInfo();            mDbHelper.deleteNote(info.id);            fillData();            return true;        case CONTACT_ID:            contact();            return true;       }    return super.onContextItemSelected(item);}private void menutest() {    Intent i = new Intent(this, Newmain.class);    startActivityForResult(i, ACTIVITY_CREATE);    Log.i(this.toString(), ""menu test"");}private void contact() {    Intent i = new Intent(this, Contact.class);    startActivityForResult(i, ACTIVITY_CREATE);    Log.i(this.toString(), ""menu contact"");}    private void createNote() {    Intent i = new Intent(this, Admin.class);    startActivityForResult(i, ACTIVITY_CREATE);}public void menuabout() {    final Dialog dialog = new Dialog(Main.this);    dialog.setContentView(R.layout.about);    dialog.setTitle(""About NCO Leaders Book"");          dialog.setCancelable(true);    Button button = (Button) dialog.findViewById(R.id.AboutButton);    button.setOnClickListener(new OnClickListener() {    @Override    public void onClick(View v) {        dialog.dismiss();    }              });              //now that the dialog is set up, it's time to show it                  dialog.show();}@Overrideprotected void onListItemClick(ListView l, View v, int position, long id) {    super.onListItemClick(l, v, position, id);    Intent i = new Intent(this, Contact.class);    i.putExtra(NotesDbAdapter.KEY_ROWID, id);    startActivityForResult(i, ACTIVITY_EDIT);}@Overrideprotected void onActivityResult(int requestCode, int resultCode, Intent intent) {    super.onActivityResult(requestCode, resultCode, intent);    fillData();}</code></pre><p>}</p><p>Contact.class</p><pre><code>    public class Contact extends Activity implements OnClickListener{        private EditText mNameText;    private EditText mRankText;    private Long mRowId;    private NotesDbAdapter mDbHelper;    protected Cursor cursor;    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        mDbHelper = new NotesDbAdapter(this);        mDbHelper.open();        setContentView(R.layout.contact);        Button adminButton = (Button) this.findViewById(R.id.admin);        adminButton.setOnClickListener(this);         mNameText = (EditText) findViewById(R.id.name);        mRankText = (EditText) findViewById(R.id.rank);        mRowId = (savedInstanceState == null) ? null :            (Long) savedInstanceState.getSerializable(NotesDbAdapter.KEY_ROWID);        if (mRowId == null) {            Bundle extras = getIntent().getExtras();            mRowId = extras != null ? extras.getLong(NotesDbAdapter.KEY_ROWID)                                    : null;}          populateFields();    };private void populateFields() {    if (mRowId != null) {        Cursor note = mDbHelper.fetchsoldiers(mRowId);        startManagingCursor(note);        mNameText.setText(note.getString(                note.getColumnIndexOrThrow(NotesDbAdapter.KEY_NAME)));        mRankText.setText(note.getString(                note.getColumnIndexOrThrow(NotesDbAdapter.KEY_RANK)));    }}//@Overridepublic void onClick(View v) {    String id = null;    switch (v.getId()) {    case R.id.admin: // doStuff        Intent intent = new Intent(this, Edit.class);        intent.putExtra(NotesDbAdapter.KEY_ROWID, id);        startActivity(intent);        Log.i(""Onclick"", ""EndingTestNext"");            break;}}}</code></pre><p>Edit.class</p><pre><code>public class Edit extends Activity {private EditText mNameText;private EditText mRankText;private EditText mSsnText;private Long mRowId;private NotesDbAdapter mDbHelper;@Overrideprotected void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    mDbHelper = new NotesDbAdapter(this);    mDbHelper.open();    setContentView(R.layout.edit);    setTitle(R.string.edit_note);    mNameText = (EditText) findViewById(R.id.name);    mRankText = (EditText) findViewById(R.id.rank);    mSsnText = (EditText) findViewById(R.id.ssn);    Button confirmButton = (Button) findViewById(R.id.confirm);    mRowId = (savedInstanceState == null) ? null :        (Long) savedInstanceState.getSerializable(NotesDbAdapter.KEY_ROWID);    if (mRowId == null) {        Bundle extras = getIntent().getExtras();        mRowId = extras != null ? extras.getLong(NotesDbAdapter.KEY_ROWID)                                : null;    }    populateFields();    confirmButton.setOnClickListener(new View.OnClickListener() {        public void onClick(View view) {            setResult(RESULT_OK);            finish();        }    });}private void populateFields() {    if (mRowId != null) {        Cursor note = mDbHelper.fetchNote(mRowId);        startManagingCursor(note);        mNameText.setText(note.getString(                note.getColumnIndexOrThrow(NotesDbAdapter.KEY_NAME)));        mRankText.setText(note.getString(                note.getColumnIndexOrThrow(NotesDbAdapter.KEY_RANK)));        mSsnText.setText(note.getString(                note.getColumnIndexOrThrow(NotesDbAdapter.KEY_SSN)));    }}@Overrideprotected void onSaveInstanceState(Bundle outState) {    super.onSaveInstanceState(outState);    saveState();    outState.putSerializable(NotesDbAdapter.KEY_ROWID, mRowId);}@Overrideprotected void onPause() {    super.onPause();    saveState();}@Overrideprotected void onResume() {    super.onResume();    populateFields();}private void saveState() {    String name = mNameText.getText().toString();    String rank = mRankText.getText().toString();    String ssn = mSsnText.getText().toString();    if (mRowId == null) {        long id = mDbHelper.createNote(name, rank, ssn);        if (id &gt; 0) {            mRowId = id;        }    } else {        mDbHelper.updateNote(mRowId, name, rank, ssn);    }}}</code></pre>","607482","","143505","","2011-02-09 20:23:27","2011-03-23 09:24:50","Need help with onClick and intents","<android>","2","0","","",""
"4949759","1","","","2011-02-09 19:53:47","2","1331","<p>How to know the idle time for an android device?</p><p>Idle time is the time where human interaction is last made with the device (touch on screen or keyboard click)</p><p>Partial or full code is very much appreciated.</p>","341405","","341405","","2011-02-10 04:27:10","2011-07-21 16:51:27","Android - Idle time?","<android>","2","4","","",""
"4949766","1","","","2011-02-09 19:54:34","2","871","<p>We are using Google Analytics to track what features of our application are being used and how, but this question could also apply to any situation where you want to know what a user did after calling the ACTION_SEND Intent.</p><p>Basically, I want to use this functionality to allow users to share content (Email, Twitter, Facebook, etc.)  This works wonderfully using the stock Android Intent functionality, allowing the user to pick their preferred email client, twitter app, ect.</p><pre><code>        Intent sharingIntent = new Intent(Intent.ACTION_SEND);        //Text seems to be necessary for Facebook and Twitter        sharingIntent.setType(""text/plain"");        sharingIntent.putExtra(Intent.EXTRA_TEXT, ""whatever I want to share"");        startActivity(Intent.createChooser(sharingIntent,""Share using""));</code></pre><p>However, I can't find any way to know what the user did upon return from the Intent.  I looked into using <code>startActivityForResult</code> instead, but this seems to only return whether or not they completed or canceled sharing (and even that seems inconsistently implemented across different applications) - it certainly doesn't give me any information on what they did.</p><p>At this point, it looks like in order to have my analytics, I would have to implement sharing via Facebook and Twitter using custom actions of my own and their respective SDKs?  </p><p>This seems a shame since it undermines one of the nice features of Android - being able to use your preferred Email, Twitter, Facebook and Browser applications....</p>","564496","","","","","2011-07-13 18:16:57","Android ACTION_SEND Intent and Google Analytics - how do I know what they picked?","<android><google-analytics><twitter-api><android-intent><facebook-java-api>","2","1","1","",""
"4949775","1","4949803","","2011-02-09 19:55:35","0","260","<p>I like this IPhonish tab but I can't figure out how to make it display at the top instead of at the bottom.</p><p><a href=""http://bakhtiyor.com/2009/10/iphonish-tabs/"" rel=""nofollow"">http://bakhtiyor.com/2009/10/iphonish-tabs/</a></p><p>Thanks.</p>","112381","","","","","2011-02-09 19:59:13","Android: IPhonish Tabs but displayed at the top","<android>","1","0","1","",""
"4949831","1","4951664","","2011-02-09 20:02:27","10","4137","<p>When I try to export my apk with Proguard I get a lot of errors (over 400) similar to:</p><pre><code>Warning: org.codehaus.jackson.jaxrs.JsonMappingExceptionMapper: can't find superclass or interface javax.ws.rs.ext.ExceptionMapper</code></pre><p>and </p><pre><code>org.codehaus.jackson.xc.DataHandlerJsonDeserializer$1: can't find superclass or interface javax.activation.DataSource</code></pre><p>I am using the <a href=""http://jackson.codehaus.org/"">Jackson Json library</a>, and the errors seem related to that.</p><p>Researching this error I found the following from <a href=""http://proguard.sourceforge.net/manual/troubleshooting.html#unresolvedclass"">Proguards FAQ</a>:</p><blockquote>  <p>If there are unresolved references to classes or interfaces, you most likely forgot to specify an essential library. For proper processing, all libraries that are referenced by your code must be specified, including the Java run-time library. For specifying libraries, use the -libraryjars option. </p></blockquote><p>Searching around on SO I found a lot of unanswered questions related to this, but the general sense was that the jar file I am using (in this case Jackon JSON) is relying on more libraries and they need to be added to Proguard's config file some how.</p><p>However, I can't figure out how to determine what jars are needed and where they are.  The warnings mention a lot of different packages such as javax.ws.rs.ext, org.joda.time, org.codehaus.stax2, javax.xml.stream, etc. </p><ol><li>How do I determine what jars contain those packages?  For example, what jar is required for the javax.ws.rs.ext.** classes?</li><li>How do I figure out where those jars are and what path would be used with -libraryjars in Proguard?</li></ol><p>Thanks much</p><hr><p><strong>Edit:</strong>  I should also mention that I am using an <a href=""http://developer.android.com/guide/developing/eclipse-adt.html#libraryProject"">Android Library Project</a> setup.  The jars are in the main Library project, and the actual working project has their build paths including the jars in the Library project.  Don't know if that makes a difference but thought I should mention it.</p><hr><p><strong>Update</strong>  Just to test, I completely removed the jackson far from the build path and from my code and now Proguard completes successfully.  The questions still remain...  What is the correct approach for handling these errors?</p><p>Does the Android export wizard in Eclipse automatically add the /lib/ jars to proguard or do they all have to be added manually in the proguard config file like this: </p><pre><code>-libraryjars C:/Project/lib/somjar.jar</code></pre><p>I did try that for the jackson one but it didn't make any difference.  Does this mean I also have to find all of the jars that are needed for the classes mentioned in the warnings and add those?  Would they be in the sdk or in the java installation?</p><p>Sorry if these are stupid questions, but I have been trying to figure this out for the last couple hours and have no idea what to do.</p><p>Thanks again</p><hr><p><strong>Update Again</strong></p><p>So more searching, combined with Benjamin's suggestion, I found some of the missing classes were in rt.jar, which is in the jdk's lib folder.  So I ended up adding </p><pre><code>-libraryjars  &lt;java.home&gt;/lib/rt.jar</code></pre><p>To the proguard.cfg file and brought the warnings from 485 down to 204.  Hey I guess that's something...  The remaining warnings describe classes that I cannot find at all.  The app works just fine without running proguard, so these classes must be somewhere right?  Or are these warnings that I should use <code>-dontwarn</code> with?</p><p>The remaining classes are in these packages:</p><pre><code>org.joda.time.org.codehaus.stax2.javax.ws.rs.</code></pre><p>So now I just need a way to figure out:</p><ol><li>What jars have these classes</li><li>Where are these jars so I can include them in the proguard config file</li></ol>","445348","","445348","","2011-02-09 22:03:08","2012-11-08 15:34:53","Proguard issues with jar files, how to find the missing jar?","<java><android><jar><proguard>","3","2","2","",""
"4949898","1","","","2011-02-09 20:09:07","3","811","<p>Suppose the current task stacks has four activity instances, A0, A1, B0, C0, with C0 at the top of the stack. A0, A1 are instances of Activity A, B0 is instance of Activity B, and C0 is instance of Activity C0.</p><p>Now C0 creates an intent with FLAG_ACTIVITY_REORDER_TO_FRONT and starts Activity A:</p><pre><code>Intent intent = new Intent(this, A.class);intent.setFlag(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);startActivity(intent);</code></pre><p>My question is, which instance will be brought to front, A0 or A1? Will the task stacks become A0, B0, C0, A1 or A1, B0, C0, A0?</p><p>Thanks. </p>","445302","","769265","","2012-11-14 15:53:43","2012-11-14 15:53:43","Multiple activity instances and FLAG_ACTIVITY_REORDER_TO_FRONT","<android><android-activity>","2","0","","",""
"4949932","1","","","2011-02-09 20:12:45","0","139","<p>I would appreciate any advice on this:</p><p>I have created a timer in my application when the user clicks on a button the  timer starts.I have done this by doing the following:</p><pre><code>import android.widget.Chronometer;</code></pre><p>within the onCreate method:</p><pre><code>this.crono = (Chronometer) findViewById(R.id.calling_crono);</code></pre><p>Then created the method:</p><pre><code>public void startCrono() { crono.setBase(SystemClock.elapsedRealtime()); crono.start();}</code></pre><p>I start this method in onclick:</p><pre><code>public void onClick(View v){    startCrono();}</code></pre><p>I want to be able to either make the timer count backwards and do something at 0 or do something when the timer reaches 10 seconds. I would appreciate any help towards solving this issue. Thanks</p>","608658","","608658","","2011-02-09 21:54:27","2012-01-30 22:33:49","Change timer in application","<android>","1","0","","",""
"4949945","1","4990212","","2011-02-09 20:14:17","1","594","<p>i need to use a classifier J48 in android. But running into heapspace problems. Is there a way to fix the same? I get an error that states. Dalvik format failed: Failed to convert dex. PermGen space.</p>","377337","","377337","","2011-02-09 23:04:39","2011-02-14 08:46:12","Dalvik format failed: Failed to convert dex. PermGen space- Android","<android><machine-learning><weka>","1","3","","",""
"4949963","1","4960011","","2011-02-09 20:16:26","3","5376","<p>I have a webservice that I am trying to authenticate with in the background using a webview.  When I initially send the request it will work appropriately (failure/success based on credentials), but after it seems like I am getting a cached response.</p><p>Here is my webview setup code:</p><pre><code>WebView browser = new WebView(this);WebSettings settings = browser.getSettings();settings.setJavaScriptEnabled(true);settings.setSavePassword(false);settings.setCacheMode(WebSettings.LOAD_NO_CACHE);settings.setAppCacheEnabled(false);browser.setWebChromeClient(new WebChromeClient() {    public void onProgressChanged(WebView view, int progress) {    Log.d(""BROWSERPROGRESS"", Integer.toString(progress));}});jsInterface = new AddAccountJSInterface();browser.addJavascriptInterface(jsInterface, ""ADDACCOUNTJSINTERFACE"");browser.setWebViewClient(new AddAccountClient(this));</code></pre><p>So as you may see I have two additional classes controlling my webView:</p><ol><li>An object that provides an interface for javascript (AddAccountJSInterface)</li><li>A WebViewClient</li></ol><p>Additionally I do have a WebChromeClient, but it's only there for debugging and I'm pretty sure that it won't interfere with anything.</p><p>The JS interface simply provides an easy way of getting the body HTML for performing analysis, so I'm confident that isn't the issue either.</p><p>The WebViewClient has the following code in it which does most of the ""custom"" work for routing based on various responses from the webservice.</p><pre><code>    @Override    public boolean shouldOverrideUrlLoading(WebView view, String url) {        if(url.contains(INSTALL_PREFIX)) {            HashMap&lt;String, String&gt; params = extractParameters(url);            verificationComplete(params);            return true;        }        return false;    }    @Override    public void onPageFinished(WebView view, String url){        if(invalidShop(view)) {            Toast.makeText(context, context.getString(R.string.no_find_shop), Toast.LENGTH_SHORT).show();            shopAddressField.requestFocus();            replaceUiElements(loadingBar, addAccountButton);        } else if(url.contains(ADMIN_AUTH_LOGIN)) {            if(invalidLogin(view)) {                Toast.makeText(context, context.getString(R.string.invalid_login),Toast.LENGTH_SHORT).show();                emailField.requestFocus();                replaceUiElements(loadingBar, addAccountButton);            } else {                String email = emailField.getText().toString();                String password = passwordField.getText().toString();                String submitJS = String.format(FORM_SUBMISSION_JS, email, password);                jsInterface.setInnerHTML("""");                browser.loadUrl(submitJS);            }        }    }</code></pre><p>In my activity I have 3 text fields that I need to fill followed by clicking a button to submit it.  The activity then takes in the data from 3 text fields (shopAddressField, usernameField, passwordField) and then executes some javascript that populates some form data (which was loaded in the invisible webView) then clicks the submit button.</p><p>It is the last part that is messing up, which appears to be caching the response from the server (perhaps using cookies?) and return that instead of asking the server if the data is correct or not.</p><p>A bit of clarification:</p><p>JSInterface is simply a Java object that allows me to execute javascript on my webview which is tied to a function within that object.  In my case my JSInterface has one function which is setInnerHtml(String html).</p><p>This is the javascript that is executed on the webview:</p><pre><code>javascript:window.ADDACOUNTJSINTERFACE.setInnerHTML(document.body.innerHTML)</code></pre><p>And this is the setInnerHtml function:</p><pre><code>public void setInnerHtml(String innerHtml) {    this.innerHtml = innerHtml;}</code></pre><p>So when I actually execute jsInterface.setInnerHtml("""") I'm just over-writing the HTML that was pulled in (to be sure I'm not getting my old data from there for some reason).</p><p>As for my submitJS it is once again some Javascript that is executed on my webView as follows:</p><pre><code>// submitJS will be something like this once all the credentials have been set// Note: I know that the server will make jQuery available// Note: Much of the Java string formatting has been removed to help clarify// the code.String submitJS =     ""javascript:(function() {        $('login-input').value='username';        $('password').value='password';        $('sign-in-form').up().submit();    })()""// I then simply get the webview to execute the javascript abovewebView.loadData(submitJS);</code></pre>","480475","","480475","","2011-02-09 21:45:06","2011-02-10 16:45:02","Disabling caching, cookies and everything else in a WebView","<javascript><android><android-webview>","1","3","2","",""
"4949975","1","","","2011-02-09 20:18:27","0","226","<p>1- I would like a function that will tell if a call or sms was received AND made (means in and out).</p><p>2- I can then use this returned value that can be true or false or an object with some extra details to some other stuff like destination, source, sms content,etc..)</p><p>you may do 1 only, doing 2 will be highly appreciated as i know many people are searching for this as well.</p>","341405","","244296","","2011-02-09 20:20:45","2011-02-09 20:20:45","SMS and phone call detector","<android>","0","2","","",""
"4950087","1","4951034","","2011-02-09 20:28:34","1","585","<p>I have a listview that I am trying to customize. The issue I am having with eclipse's android plugin is I am not quite sure how to format the text portions and wrap them around my icon. Here is a diagram with what I am trying to do:</p><p><img src=""http://i.stack.imgur.com/3ViKK.png"" alt=""toms custom row""></p><p>I need to know,</p><p><strong>1.</strong> Advice on formatting text to fit the row. for the top, i want 3 different strings to fit (what they can) into their own column and ellipsise at the end. easy enough.  </p><p><strong>2.</strong> I want to do something similar for the bottom row but give it a max length. Say each column can contain up to 20 characters, including the (...) ellipses. it may contain 1-7 columns. So I want the overflow to go to the next row and wrap under the icon.</p><p><strong>3.</strong> Perhaps someone has a war story with a custom listview they want to share? How did you fit all the information in the item, or did you use an alternate view such as GridView instead?</p><p>Thank you.</p>","457577","","","","","2011-02-09 22:00:52","android custom listview row formatting question","<android><xml><gui><layout>","1","0","","",""
"4950228","1","4965157","","2011-02-09 20:43:38","0","1476","<p>A code/simple function that will return the available and used diskspace in the main android device.</p><p>Is making a df command and parsing it the best way? What other methods can be used?</p><p>Many thanks in advance</p>","341405","","","","","2011-02-11 02:48:24","What is the diskspace free and used in android?","<android>","2","3","1","",""
"4950389","1","4950992","","2011-02-09 21:00:12","1","1994","<p>Hey guys, I'm having trouble trying to find the user's longitude and location as I run my program and set the telnet command for geo fix for the mock location. While the emulator is running, I set the mock coordinates only for the emulator to become unresponsive and have my program fail in detecting the input coordinates.</p><pre><code>import android.app.Activity;import android.content.Context;import android.location.Location;import android.location.LocationListener;import android.location.LocationManager;import android.location.LocationProvider;import android.os.Bundle;import android.widget.TextView;import android.widget.Toast;public class LBSact extends Activity{    /** Called when the activity is first created. */    public double longitude;    public double latitude;    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        longitude = 0;        latitude = 0;        //Creating the listener and manager        LocationManager LManager = (LocationManager) this.getSystemService(Context.LOCATION_SERVICE);        LocationListener createListen = new LocationListener(){            @Override            public void onLocationChanged(Location location) {                //longitude = location.getLongitude();                //latitude = location.getLatitude();                String printout1 = ""My current location is: "" + ""Latitude = "" + location.getLatitude() +                ""Longitude = "" + location.getLongitude();                    Toast.makeText(getApplicationContext(),printout1,Toast.LENGTH_LONG).show();            }            @Override            public void onProviderDisabled(String provider) {                Toast.makeText(getApplicationContext(), ""GPS disabled"", Toast.LENGTH_LONG).show();            }            @Override            public void onProviderEnabled(String provider) {                Toast.makeText(getApplicationContext(), ""GPS enabled"", Toast.LENGTH_LONG).show();            }            @Override            public void onStatusChanged(String provider, int status,                    Bundle extras) {            }        };        //Cant use Network with emulator, can only use GPS mock locations        //Toast.makeText(getApplicationContext(), ""Does this work?"", Toast.LENGTH_LONG).show();        LManager.requestLocationUpdates( LocationManager.GPS_PROVIDER, 0, 0, createListen);    }}</code></pre>","256111","","","","","2011-08-22 15:26:45","Android emulator, Finding mock user location coordinates. Having problems","<java><android><android-emulator><gps><location>","2","0","1","",""
"4950465","1","4950508","","2011-02-09 21:09:38","-2","4404","<p>I am developing a small android application in that i want find the mobile phone number used in the particular phone</p><p>I tried the following</p><pre><code>TelephonyManager tMgr =(TelephonyManager)this.getSystemService(Context.TELEPHONY_SERVICE);String mPhoneNumber = tMgr.getLine1Number();</code></pre><p>It is working fine in Emulator but It is not working in my phone</p><p>please help me anyone how to do that</p>","609050","","1318946","","2014-02-01 11:47:30","2014-02-01 11:47:30","How to find the mobile phone number in android?","<android><telephonymanager>","2","0","2","",""
"4950729","1","8369422","","2011-02-09 21:31:16","22","24329","<p>My app is using JSoup to download the HTML of a message board page (let's say in this case it is a page containing the posts of a given thread). I'd like to take this HTML, strip out unwanted items, and apply custom CSS to style it to be 'mobile' in a WebView.</p><p>Should I inject the styles into the HTML as I process it (since I will be processing it anyway) or is there a good way to add a CSS file to my app's assets and simply refer to it. I figure the latter would be ideal, but unsure how to go about it.</p><p>I see hints in WebView's <a href=""http://developer.android.com/reference/android/webkit/WebView.html#loadDataWithBaseURL%28java.lang.String,%20java.lang.String,%20java.lang.String,%20java.lang.String,%20java.lang.String%29"">loadDataWithBaseURL</a> that you can refer to local assets, but not sure how to utilize it.</p>","97120","","97120","","2011-02-09 21:36:52","2012-05-01 12:52:05","Rendering HTML in a WebView with custom CSS","<android><html><css><webview>","5","0","13","",""
"4950767","1","7007709","","2011-02-09 21:35:02","0","392","<p>I am using Helios Service Release 1, with the Android SDK 2.3.1 API 9 r2. Everytime I create a new Android project, and got to run it always gives me an error as it is trying to run it as a Javabean! In order to run it I have to either add the project as an Android app in the Run config. or right click on the Project and select run as Android App.. Anyone have this problem or can suggest something I can try to change the default?</p><p>Thanks</p>","610436","","","","","2011-08-10 08:13:15","Why does Eclipse keep defaulting my Run config as Javabean?","<android><eclipse><javabeans>","2","0","","",""
"4950839","1","4951651","","2011-02-09 21:42:03","2","1963","<p>Would like to use an Image button in my widget layout.  I want an image that is clickable, so clicking on image will change the image.  Not sure how to set this up in WidgetProvider RemoteView.  Does anyone know how to do this?  Specifically how to change the image from within onReceive in the Widget provider? Thanks</p><p>Thanks</p>","602260","","","","","2011-02-09 23:06:40","Android Widget RemoteView ImageButton setImageSource","<android><widget>","1","0","","",""
"4950885","1","4951680","","2011-02-09 21:45:48","1","656","<p>I have a remote service in android. It's binded to my list activity and sends some messages to it. The service contins scheduled task in it. I also have preference: refresh interval for my service. All I want is to restart the service when user changes refresh interval. Butif I do it in onSharedPreferenceChanged() then I loose the connection from my list activity. How can I solve it? Thanks.</p><p>I know that I can use Broadcast Reciever. Is there another way?</p>","577841","","","","","2011-02-09 23:09:01","Android: restart remote service and bind it again","<android><service><bind><restart>","1","0","","",""
"4950901","1","4960119","","2011-02-09 21:47:11","2","942","<p>I've got a custom layout I want to use as the titlebar of my android app. The technique found (linked at the bottom) works, but the system titlebar is displayed before onCreate() is called. Obviously that looks pretty jarring, as for a moment the system titlebar is shown, then my custom titlebar is shown:</p><pre><code>// styles.xml&lt;resources&gt;  &lt;style name=""MyTheme""&gt;    &lt;item name=""android:windowTitleSize""&gt;40dip&lt;/item&gt;  &lt;/style&gt;&lt;/resources&gt;// One of my activities, MyTheme is applied to it in the manifest.protected void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);    setContentView(R.layout.my_activity);    getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.my_custom_header);}</code></pre><p>I could always hide the system titlebar and display my own in-line perhaps with each and every layout, but, that's not very friendly.</p><p>Thanks</p><p><a href=""http://www.londatiga.net/it/how-to-create-custom-window-title-in-android/"" rel=""nofollow"">http://www.londatiga.net/it/how-to-create-custom-window-title-in-android/</a></p>","291701","","","","","2013-06-03 18:21:19","Custom titlebar - system titlebar being shown for a brief moment?","<android>","4","2","1","",""
"4950978","1","","","2011-02-09 21:55:04","1","1696","<p>Does anyone know how to point out a given section of the texture buffer array stored in a HW buffer? I'm drawing a triangle strip and filling it with a square image. In my texture I have two square images next to each other, so the texture coordinate buffer points out them out with a total of 16 floats.</p><p><strong>With software buffers</strong> I'm doing this to access the second image in the texture:</p><pre><code>textureCoordinateBuffer.position(8);gl.glTexCoordPointer(2, GL10.GL_FLOAT, 0, textureCoordinateBuffer);</code></pre><p><strong>With hardware buffers</strong> I assumed I do something like this:</p><pre><code>// setup HW buffers// ...// select HW buffersgl11.glBindBuffer(GL11.GL_ARRAY_BUFFER,vertexCoordinateBufferIndex);gl11.glVertexPointer(3, GL10.GL_FLOAT, 0, 0);gl11.glBindBuffer(GL11.GL_ARRAY_BUFFER, textureCoordinateBufferIndex);// Point out the first image in the texture coordinate buffergl11.glTexCoordPointer(2, GL11.GL_FLOAT, 0, 0);// Draw// ...</code></pre><p>Which works nicely if you want to point out the first image in the texture.But I would like to access the second image - so I assumed I do this in the last line:</p><pre><code>// Point out the second image in the texture coordinate buffer - doesn't work!gl11.glTexCoordPointer(2, GL11.GL_FLOAT, 0, 8);</code></pre><p>But this renders a scewed and discolored image.</p><p>Anyone who knows how to to this correctly?</p>","476711","","476711","","2011-02-10 08:37:35","2011-02-10 17:20:44","VBO's on Android: Pointing out the correct image in texture coordinate buffers","<android><opengl-es>","1","0","","",""
"4951009","1","","","2011-02-09 21:58:24","0","48","<p>I need to get all the data from web and display in the ui.currently, i did all this functionality in the activity onCreate() method.is that right? or else i can use other life cycle method like onResume(),onPause().please guide me.</p>","461972","","","","","2011-02-09 22:31:42","Activity in android","<android>","1","3","","",""
"4951019","1","4951104","","2011-02-09 21:59:33","0","887","<p>I have read alot of references from the web about android storage for images. Most of them were saying Images are stored insided sd card same as photos that was taken with camera.</p><p>Does android allow us to store them in local memory in the android phone rather than sd cards?</p>","186820","","","","","2011-02-09 23:47:03","Android sdk, Apart from saving image in sd card, are there any places i can save the photo to?","<android><image><photo><sd-card>","3","0","","",""
"4951028","1","","","2011-02-09 22:00:18","0","324","<p>I have to develop an application where i have to continuously collect the GPS, accelerometer data [esp. when user is in motion i.e traveling, else it can be relaxed). Also I have to communicate with web server and handle the response from the sever. So for this(handling response ) part application should continuously poll. </p><p>Based on response from server I have show UI to the user. </p><p>I am not very clear about the design.</p><p>Do I have to create activity from where I start service. Should service be ran as a separate thread(this always runs in background).</p><p>I am planning to create two services. One service to continuously collect GPS data.</p><p>Other service for communicating with the web server[start timer/alarm manager] for polling.ALso can these two services communicate with each other.</p><p>Also after processing the response frm server the service should be able to start user interface to show some form. I am not clear how to handle this.</p><p>Also is acquiring wakelock required if I have to collect GPS data continuously.</p><p>Please clarify.</p><p>Thanks</p>","511280","","","","","2011-12-25 08:08:38","android application design","<android>","2","0","","",""
"4951142","1","4951681","","2011-02-09 22:12:53","16","29440","<p>There is an app in the market place called Floating images. This app has one of the smoothest scrolling logic. Basically the app has a blank canvas covering whole screen and then there are some images displayed on top of the blank canvas. User can swipe and the app moves the image in the direction of swipe. Plus it does kinetic scrolling too. Plus there are no scrollbars so it seems like the developer has created a custom view implementing all smooth scrolling logic. </p><p>it would be awesome if i could get the source of it.. but anyone has any pseudo code or logic on how to implement this kind of feature. Any leads , site links would be helpful.</p>","260298","","503900","","2011-02-22 09:57:57","2011-11-15 21:34:53","Smooth scrolling in Android","<android><scrolling>","2","0","25","",""
"4951146","1","4951343","","2011-02-09 22:13:00","11","5228","<p>Is it possible to use methods with @hide annotation without recompiling the sdk? </p><p>Note: I know I am not supposed to use this methods etc.</p>","301525","","","","","2011-02-10 08:07:58","Is it possible to use Android SDK methods with @hide annotation?","<android>","2","0","","",""
"4951166","1","","","2011-02-09 22:15:18","1","1013","<p>In android 2.2, I was able to start the emulator, then run 'adb shell stop' 'adb shell start' to have the emulator come back up.  Since changing to android 2.3 the emulator will not start, and logcat hangs with these messages:</p><p>SettingsProvider   cache for settings table 'secure' rows=27; fullycached=trueqemud              fdhandler_accept_event: accepting on fd 9qemud              created client 0x11f88 listening on fd 11qemud              client_fd_receive: attempting registration for service 'hw-control'qemud              client_fd_receive:    -> received channel id 5SettingsProvider   cache for settings table 'system' rows=45; fullycached=true</p><p>I'm using eclipse, thanks for any help!</p>","610513","","","","","2011-12-27 21:22:35","android 2.3 emulator hangs after adb shell stop then start","<android><emulator><adb><logcat>","1","0","","",""
"4951333","1","5290248","","2011-02-09 22:31:30","3","6727","<p>I'm having a problem trying to send an array of ints to a .NET web service which expects an array in one of the arguments. That's at least what I understand from the API description on the web service which says this:</p><pre><code>&lt;dataIndexIDs&gt;&lt;int&gt;int&lt;/int&gt;&lt;int&gt;int&lt;/int&gt; &lt;/dataIndexIDs&gt;</code></pre><p>So when I send a single int like below I do not get any errors and I think it works fine.</p><pre><code>request.addProperty(""dataIndexIDs"", 63);</code></pre><p>But when I try to send an array of ints:</p><pre><code>request.addProperty(""dataIndexIDs"", new int[] {63, 62}); // array of ints</code></pre><p>or a ArrayList of Integers:</p><pre><code>ArrayList&lt;Integer&gt; indexes = new ArrayList&lt;Integer&gt;();    indexes.add(63);    indexes.add(62);    request.addProperty(""dataIndexIDs"", indexes); // ArrayList of Integers</code></pre><p>I get thrown a ""java.lang.RuntimeException: Cannot serialize"" exception. Any help please? What am I doing wrong? Thanks!</p>","561498","","561498","","2011-02-10 09:24:45","2014-02-05 12:36:10","Serialize an array of ints to send using KSOAP2","<java><android><web-services><ksoap2><android-ksoap2>","5","3","1","",""
"4951454","1","4951987","","2011-02-09 22:44:10","3","6705","<p>I have a class that extends <code>View</code>, and I draw everything I need inside its canvas in the <code>onDraw()</code> method, something like this:</p><pre><code>protected void onDraw(Canvas canvas) {        synchronized (this) {                float h = mHeight;                float w = mWidth;                canvas.drawColor(Color.WHITE);                float roadLine= (85.0f/100.0f)*h;                canvas.drawBitmap(mTop, 0, roadLine-mTop.getHeight(), null);                //this is what I'd like to animate                canvas.drawBitmap(mSmoke);        }    }</code></pre><p>How do I make an Animation (tween animation) draw in here?</p>","594544","","1023783","","2012-08-08 03:09:09","2012-08-08 03:09:09","Tween animation on a Canvas in a custom View","<android><animation><canvas>","1","0","5","",""
"4951474","1","","","2011-02-09 22:46:13","0","331","<p>In my app i have ListView, Adapter for it, and Filter for Adapter. This is filter:</p><pre><code>private Filter nameFilter = new Filter() {    @Override    protected void publishResults(CharSequence constraint, FilterResults results) {        List&lt;Contact&gt; resultContacts = (List&lt;Contact&gt;) results.values;        filteredContacts = resultContacts;        notifyDataSetChanged();    }    @Override    protected FilterResults performFiltering(CharSequence constraint) {        List&lt;Contact&gt; filteredContacts = new ArrayList&lt;Contact&gt;();        for(Contact c : rawContacts){            if(!c.getName().toLowerCase().contains(constraint.toString().toLowerCase())){                continue;            }            filteredContacts.add(c);        }        FilterResults filterResults = new FilterResults();        filterResults.values = filteredContacts;        return filterResults;    }};</code></pre><p>Do I understand correctly that publishResults ALWAYS invoked after performFiltering done his job? Even this job is veeeery hard and long? I have a situation when publishResults runs suddenly and of course field ""filteredContacts"" of my Adapter sets to NULL.</p><p>I tried to make easier the job of performFiltering (by removing the cycle and write something like ""filteredContacts.add(new Contact())"") and then all works fine.</p><p>And finally this code worked fine few days... I confused. Can anybody explain what is going on?)Thanks in advance!</p>","344053","","","","","2011-02-11 09:36:18","Android ListView filter fail with NPE","<android><listview><filter><null><adapter>","1","0","","",""
"4951551","1","4951704","","2011-02-09 22:54:35","1","459","<p>I cannot think of a proper way to wait for an object to appear. I am writing a camera app. After taking a picture, I am writing GPS Data into the exif tags. I have to wait for the location object to appear, before writing. My quick and dirty fix is to start a new thread and use a while loop to ""wait"" for the object:</p><pre><code>      private static class MyRunnable implements Runnable {         private final String imagePath;         private final String thumbPath;         MyRunnable(final String anImagePath, String aThumbPath) {           this.imagePath = anImagePath;           this.thumbPath = aThumbPath;         }         public void run() {             while (mCurrentLocation == null) {                 //do nothing             }             try {             writeExifTags(imagePath);             writeExifTags(thumbPath);             }             catch (NullPointerException e) {                 Log.i(TAG, ""NullPointerException"");             }         }      }</code></pre><p>This works but the empty while-loop looks very ugly. I think of some kind of handler for the object but cannot think of a way to use handlers to check for the existence of mCurrentLocation. Anyone with a flash of wit? :) (Yes the try/ catch block is obsolete now ^^)</p>","600537","","","","","2011-02-09 23:12:01","Android: Wait for object to appear","<java><android><object><null><exists>","1","0","","",""
"4951614","1","4952006","","2011-02-09 23:02:36","0","1357","<p>i have a highly data computation intensive application that has to process data received via bluetooth every 60 seconds and then stay in low power state for the next 60 seconds. i checked out the PowerManager api but i am unable to use it. is there a way i could accomplish the task?</p>","377337","","271036","","2011-02-10 22:40:21","2012-03-26 07:50:47","how to put android on low power state","<android><power-management>","2","2","","",""
"4951694","1","5041985","","2011-02-09 23:11:02","1","1395","<p>it's just a simple question:</p><p>I have a layout file which is presented as an item inside of a ListView. I set the height of the RelativeLayout to 100dp, but it does not work, it's always wrapping the content, no matter which layout I use. What can I do to set a fixed value to the layout height without having it wrapping?</p><p>Thanks for the help.</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=""100dp""&gt; &lt;!-- this attribute seems to be ignored --&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:layout_centerHorizontal=""true""&gt;        &lt;ProgressBar xmlns:android=""http://schemas.android.com/apk/res/android""                 android:layout_width=""@dimen/progressbar_small""                 android:layout_height=""@dimen/progressbar_small""                 android:layout_gravity=""center_vertical"" /&gt;        &lt;TextView xmlns:android=""http://schemas.android.com/apk/res/android""                 android:layout_width=""wrap_content""                 android:layout_height=""wrap_content""                 android:layout_marginLeft=""5dp""                 android:text=""@string/loading""                 android:layout_gravity=""center_vertical""                 style=""@style/ListItemSubtext"" /&gt;     &lt;/LinearLayout&gt; &lt;/RelativeLayout&gt;</code></pre>","595881","","","","","2011-06-30 16:06:31","layout_height always wrapping content","<android><android-layout>","4","3","","",""
"4951865","1","","","2011-02-09 23:39:18","0","1124","<pre><code>public String Encryption(String toEncrypt) throws Exception{    Security.addProvider(new org.bouncycastle.jce.provider.BouncyCastleProvider());    EditText et = (EditText) findViewById(R.id.entry);    byte[] input = toEncrypt.getBytes();    byte[] keyBytes = ""hello"".getBytes();    // et.setText(""in encryption"");    SecretKeySpec key = new SecretKeySpec(keyBytes, ""AES"");    Cipher cipher = Cipher.getInstance(""AES/ECB/PKCS7Padding"", ""BC"");    // et.setText(""in encryption"");    cipher.init(Cipher.ENCRYPT_MODE, key);    et.setText(""in encryption"");    byte[] cipherText = new byte[cipher.getOutputSize(input.length)];    int ctLength = cipher.update(input, 0, input.length, cipherText, 0);    ctLength += cipher.doFinal(cipherText, ctLength);    // et.setText(""in encryption"");    // return ""abc"";    return cipherText.toString();</code></pre><p>From the code line that I have bolded (<code>cipher.init(Cipher.ENCRYPT_MODE, key);</code>) the programme is not working- I am getting an exception. What is wrong with this line? I am trying to basically encrypt a string and return it with this function.</p>","600910","","238704","","2011-02-10 00:01:31","2011-02-10 00:05:34","what's wrong with this encryption code in android?","<android><encryption>","1","1","","",""
"4951959","1","4952324","","2011-02-09 23:58:55","2","181","<p>Related to the thread: <a href=""http://stackoverflow.com/questions/4949427/scroll-webview-with-volume-keys/4951477#4951477"">Scroll webView with volume keys</a></p><p>How can I implement this as a class (or a short-hand way) so it can be used for all WebViews w/o having to rewrite over and over again for each WebView? The nxt WebView id's are ""webPg02"", ""webPg03"", and so on... All nested within my VeiwFlipper with id ""AC4313"".</p><p>I'm sure this is really basic but once again thanks for helping this Android nooB!</p>","742030","","","","","2011-02-10 00:56:39","Scroll webView with volume keys Part II","<android><android-webview><keyevent>","1","0","","",""
"4951994","1","4952199","","2011-02-10 00:04:28","2","4490","<p>Hy!</p><p>My code:</p><pre><code>Thread thread = new Thread (){            @Override            public void run() {                while (true)                {                    Handler handler = new Handler(){                          @Override                          public void handleMessage(Message msg) {                             if (msg.obj.toString()!= null)                             {                             JSONParse json = null;                             try {                                Log.e(""Channel_State"",msg.obj.toString());                                 json = new JSONParse(msg.obj.toString());                                String state = json.getChannelState();                                id = state;                                 TextView tv2 = (TextView)findViewById(R.id.mainscreen_state);                                 tv2.setText(""Channel State: ""+ state);                                Log.e(""State"",state);                            } catch (final Exception e) {                                // TODO Auto-generated catch block                                e.printStackTrace();                                runOnUiThread(new  Runnable() {                                    public void run() {                                        Toast toast ;                                        toast =     Toast.makeText(getApplicationContext(), ""Error"" + e.getMessage(), 500);                                        Log.e(""Error"",e.getMessage());                                        toast.show();                                    }                                });                            }                             }                             else                             {                               runOnUiThread(new  Runnable() {                                public void run() {                                    Toast toast ;                                    toast =     Toast.makeText(getApplicationContext(), ""error"", 500);                                    toast.show();                                }                            });                             }                          }                          };                    List&lt;NameValuePair&gt; params = new ArrayList&lt;NameValuePair&gt;();                    params.add(new BasicNameValuePair(""session_id"", settings.getString(""session_id"",""error"")));                    params.add(new BasicNameValuePair(""channel_id"",String.valueOf(settings.getInt(""channel_id"", -1))));                    HttpConnection con = new HttpConnection(params, ""http://surfkid.redio.de/getChannelImage"", handler);                    con.start();                    try {                        Log.e(""Sleep"",""Begin"");                        this.sleep(5000);                        Log.e(""Sleep"",""End"");                    } catch (InterruptedException e) {                        // TODO Auto-generated catch block                        Log.e(""Sleep"",""Fail"");                    }                }            }        };        thread.start();</code></pre><p>Log:</p><pre><code>02-10 00:01:29.044: ERROR/AndroidRuntime(1248): Uncaught handler: thread Thread-13 exiting due to uncaught exception02-10 00:01:29.054: ERROR/AndroidRuntime(1248): java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare()02-10 00:01:29.054: ERROR/AndroidRuntime(1248):     at android.os.Handler.&lt;init&gt;(Handler.java:121)02-10 00:01:29.054: ERROR/AndroidRuntime(1248):     at android.skiptvad.MainScreen$6$1.&lt;init&gt;(MainScreen.java:258)02-10 00:01:29.054: ERROR/AndroidRuntime(1248):     at android.skiptvad.MainScreen$6.run(MainScreen.java:258)</code></pre><p>Please help!</p>","547995","","","","","2011-02-10 00:43:36","Thread exiting due uncaught exception","<java><android>","3","0","","",""
"4952004","1","4952361","","2011-02-10 00:06:40","0","155","<p>I have an android app that extends a MapActivity, so I can't extend TabActivity. I am inflating the content of the tabs dynamically, and everything <em>looks</em> good. </p><p>The problem that I'm running in to is that I get a NullPointerException when trying to bind event listeners to the views that were inflated into a tab past the first tab.</p><p><em>Example:</em></p><pre><code>myButtonInTab2 = (Button)this.findViewById(R.id.mybuttonintab2);myButtonInTab2.setOnClickListener(new OnClickListener(){    public void(View v){        ///blah blah blah    }});</code></pre>","558721","","","","","2011-02-10 01:01:32","Event listener on view in tabs when not extending TabActivity","<java><android>","1","0","","",""
"4952016","1","","","2011-02-10 00:09:25","3","2228","<p>i'm having some issues using Ksoap2 in an android project while conecting to a .net Webservice.As long as i call the Ws witouth parameters everything works just fine, but when i try to add parameters, the servers never gets them.here's my code</p><pre><code>import java.util.Vector;import org.ksoap2.SoapEnvelope;import org.ksoap2.serialization.PropertyInfo;import org.ksoap2.serialization.SoapObject;import org.ksoap2.serialization.SoapPrimitive;import org.ksoap2.serialization.SoapSerializationEnvelope;import org.ksoap2.transport.AndroidHttpTransport;import android.app.Activity;import android.os.Bundle;import android.widget.ArrayAdapter;import android.widget.ListView;import android.widget.TextView;import android.widget.Toast;public class ServicioWeb extends Activity {SoapObject response;public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);   // String NAMESPACE = ""http://tempuri.org/"";    String NAMESPACE = ""IDBN.WS"";    String METHOD_NAME = ""getClientesByName"";    //String SOAP_ACTION = ""http://tempuri.org/getClientesByName"";    String SOAP_ACTION = ""IDBN.WS/getClientesByName"";    //String URL = ""http://www.ws.idbnar2.com.ar/wsClientes.asmx"";    String URL = ""http://www.ws.idbnar2.com.ar/wsClientes.asmx"";    SoapObject Request = new SoapObject(NAMESPACE, METHOD_NAME);   PropertyInfo pi = new PropertyInfo();    pi.setName(""Nombre"");    pi.setValue(""RIQUELME"");    pi.setType(int.class);    Request.addProperty(pi);    SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);    envelope.dotNet = true;    envelope.setOutputSoapObject(Request);    AndroidHttpTransport androidHttpTransport = new AndroidHttpTransport(URL);    ListView Lista = (ListView)findViewById(R.id.Lista);    try    {        androidHttpTransport.call(SOAP_ACTION, envelope);        response = (SoapObject)envelope.getResponse();        String[] Clientes = getStringArrayResponse(response, null);        Lista.setAdapter(new ArrayAdapter&lt;String&gt;(this, android.R.layout.simple_list_item_1,Clientes));    }    catch(Exception e)    {        Toast toast = Toast.makeText(this, e.getMessage(), Toast.LENGTH_LONG);        toast.show();    }}public String[] getStringArrayResponse(SoapObject node, Vector&lt;String&gt; strings) {    boolean isFirstCall = false;    if (strings == null) {        isFirstCall = true;        strings = new Vector&lt;String&gt;();    }    int count = response.getPropertyCount();    for (int i = 0; i &lt; count; i++) {        Object obj1 = node.getProperty(i);        if (obj1 instanceof SoapObject) {            // don't recurse empty objects            if (((SoapObject)obj1).getPropertyCount() &gt; 0) {                // recurse into another node to process its nodes/primitives                getStringArrayResponse((SoapObject)obj1, strings);            }        } else if (obj1 instanceof SoapPrimitive) {            strings.add(((SoapPrimitive)obj1).toString());        }    }    // only make this for the original caller    if (isFirstCall) {        return (String[])strings.toArray(new String[strings.size()]);    }    return null;}}</code></pre><p>I harcode the server side, to return a string + the parameters i send it.. and now all i get it's the hardcoded part, seems like the parameters i add to the soap objets are never receives by the server.</p><p>Allready try :-) removing the ""http://"" from the namespace on the Webservice-) not using the      ""envelope.dotNet = true;""-) adding the Property directly into the Request</p><p>Any idea wha'ts wrong???</p>","611363","","","","","2012-01-26 17:27:33","KSoap2 + Android + .net Ws = Null","<java><android><ksoap2><android-ksoap2>","2","0","","",""
"4952121","1","4952168","","2011-02-10 00:26:40","1","3721","<p>I am trying to display pictures that I had placed in the drawable folder using a Gridview. I am getting some errors. My code and the errors I am getting are shown below.</p><pre><code>package com.newapp;import android.R;import android.R.drawable;import android.app.Activity;import android.content.Context;import android.os.Bundle;import android.view.View;import android.view.ViewGroup;import android.widget.AdapterView;import android.widget.BaseAdapter;import android.widget.GridView;import android.widget.ImageView;/*Error here: main cannot be resolved or is not a field*/import android.widget.Toast;import android.widget.AdapterView.OnItemClickListener;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);/*Error here: main cannot be resolved or is not a field*/            GridView gridview = (GridView) findViewById(R.id.photogrid);            gridview.setAdapter(new ImageAdapter(this));            gridview.setOnItemClickListener(new OnItemClickListener() {                public void onItemClick(AdapterView&lt;?&gt; parent, View v, int position, long id) {                    Toast.makeText(MainActivity.this, """" + position, Toast.LENGTH_SHORT).show();                }            });        }    }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_0, /*Error here: sample_0 cannot be resolved and is not a field*/            R.drawable.sample_1,/*Error here: sample_1 cannot be resolved and is not a field*/            R.drawable.sample_2,/*Error here: sample_2 cannot be resolved and is not a field*/            R.drawable.sample_3,/*Error here: sample_3 cannot be resolved and is not a field*/            R.drawable.sample_4,/*Error here: sample_4 cannot be resolved and is not a field*/            R.drawable.sample_5/*Error here: sample_5 cannot be resolved and is not a field*/,            R.drawable.sample_6,            /*Error here: sample_6 cannot be resolved and is not a field*/    };}</code></pre><p>So can somebody tell me what is causing these problems? Any help will be much appreciated.Thanks in advance</p>","610642","","728511","","2011-07-25 12:55:40","2014-01-02 06:21:28","Displaying pictures in a gridview","<android>","1","0","","",""
"4952169","1","5104750","","2011-02-10 00:34:28","5","26697","<p>I would like to use cURL library in my android application in native code (using NDK r5b, the latest). After researching online, it seems the only way to use cURL in android is to build the entire android source tree with curl in it, and somehow this generates a necessary config file for cURL to work on Android. I don't have any experience building the android sources from scratch and was wondering if there is a way to use cURL library in Android without having to rebuild android from source. Ideally, being able to just use cURL as a static or shared library would be perfect. I tried following the steps mentioned here...</p><p><a href=""http://curl.haxx.se/mail/lib-2009-12/0071.html"">http://curl.haxx.se/mail/lib-2009-12/0071.html</a></p><p>but end up getting errors in the file curlrules.h like <code>CURL_SIZEOF_LONG definition is missing!</code></p><p>I assume these errors are due to not having that config file I mentioned but the steps in the above link didn't mention any of that and reported success. Any ideas?</p>","418925","","","","","2012-06-15 22:29:35","Using cURL in Android","<android><curl><libcurl><android-ndk>","3","3","6","",""
"4952191","1","","","2011-02-10 00:37:36","2","579","<p>Folks,</p><p>I have a dilemma how to architect Android application that communicates with external RESTfull service (actually OData service). The service:</p><ul><li>Returns list of folders</li><li>Returns documents in a folder </li><li>Performs search based on search options and search query </li><li>etc...</li></ul><p>After the presentation ""<a href=""http://www.google.com/events/io/2010/sessions/developing-RESTful-android-apps.html"" rel=""nofollow"">Developing Android REST client applications</a>"" I was convinced to implement it using Content Provider that wrapps my HTTP calls. Basically I should synchronize local DB and remote resources. My question is how to implement search functionality. On a server side search is a function that returns objects (JSON). Should I save these objects in a local DB?  How to use pagination in this case? </p>","85128","","","","","2012-05-14 14:50:50","Content provider usage for search results","<android><android-contentprovider>","1","0","","",""
"4952197","1","4952232","","2011-02-10 00:38:07","2","125","<p>My last update on the Android Market caused my application to be no longer available to Android 1.5 devices.</p><p>I have changed the following:</p><pre><code>&lt;supports-screens android:anyDensity=""true"" /&gt;&lt;uses-sdk android:minSdkVersion=""3"" /&gt;</code></pre><p>To this:</p><pre><code>&lt;uses-sdk android:minSdkVersion=""3"" android:targetSdkVersion=""9""/&gt;&lt;!-- Support all screen types and allow resizing of the layout --&gt;&lt;supports-screens         android:anyDensity=""true""         android:smallScreens=""true""        android:normalScreens=""true""        android:largeScreens=""false""        android:xlargeScreens=""false""/&gt; </code></pre><p>I'm not sure what went wrong... Any tips will be greatly apreciated!</p><p>Thanks for the help!</p><p>-Jona</p>","398248","","","","","2011-02-10 00:42:11","Android App no longer visible by Android 1.5 on devices","<android><android-manifest>","1","0","","",""
"4952235","1","","","2011-02-10 00:42:32","1","24320","<p>I am trying to make changes to default Android Home Screen (like changing cell dimensions, number of elements per row etc) and wondering if there any way I can change apps icon sizes placed on the home screen?</p><p>I know that platform takes care of picking up the right dimension image from ldpi (36x36), mdpi (48x48) or hdpi (72x72) directory based on the screen density, but I would like to know if there is any way to increase the icon sizes when application icons are put on the Home Screen irrespective of the screen density?</p>","610654","","472495","","2013-03-06 20:34:00","2014-04-12 04:44:46","How to increase icons size on Android Home Screen?","<android><homescreen>","1","3","","",""
"4952262","1","4952598","","2011-02-10 00:46:53","0","3289","<p>FolksI have an activity that launches an embedded browser view rendering stuff that is out of my control. Now suppose the user navigates one more level by clicking on a link in the browser view. This opens a new browser window. In order for the user to go back to prior activity, the user would have to click back ""twice"". </p><p>I would like to implement a ""soft"" back button that always shows up at the top of the embedded browser view. </p><p>I found the question answered at <a href=""http://stackoverflow.com/questions/4066438/android-webview-how-to-handle-redirects-in-app-instead-of-opening-a-browser"">Android WebView, how to handle redirects in app instead of opening a browser</a></p><p>But when I use that solution, the android native button also takes you back directly to the prior activity (instead of going back in history of the page). Is there a way so that I can do both (have a custom back button that takes me back all the way but have the android native back retain the expected behavior of going back one page at a time?</p><p>Thank you!</p>","359809","","","","","2011-02-10 01:51:37","android back button in an embedded browser webview","<android><webview>","1","0","","",""
"4952396","1","4952432","","2011-02-10 01:07:35","2","612","<p>Hi everyone I'm trying to display some images using a GridView. However I'm getting an error when I import android.widget.AdapterView.OnItemClickListener that says that main cannot be resolved or is not a field. My code is below:</p><pre><code>import 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;//Error here: main cannot be resolved or is not fieldpublic class MainActivity 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.photogrid);        gridview.setAdapter(new ImageAdapter(this));        gridview.setOnItemClickListener(new OnItemClickListener() {            public void onItemClick(AdapterView&lt;?&gt; parent, View v, int position, long id) {                Toast.makeText(MainActivity.this, """" + position, Toast.LENGTH_SHORT).show();            }        });    } }package com.newapp;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 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_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>Can someone tell me why I am getting this error? Any help would much appreciated. Thanks</p>","610642","","330204","","2011-02-10 01:12:25","2011-02-10 11:56:42","Displaying pictures in a gridview","<android>","1","0","","",""
"4952435","1","4952588","","2011-02-10 01:15:48","0","1846","<p>I have a custom ListView item using RelativeLayout which looks like this...</p><pre><code>| Time | Title        ||      | Description  |</code></pre><p>NOTE: The lefthand 'Time' is a single full height TextView with 'Title' and 'Description being individual 'stacked' TextViews.</p><p>The ListView items represent TV programmes extracted from a SQLite DB with a SimpleCursorAdapter. This works fine but the next step is to indicate when a programme has been scheduled to record (the app is an Android client for a PC-based PVR application).</p><p>The SQL query selects 'start_time,title,description,is_set_to_record' the first three being text fields to bind to the TextViews and the last being boolean.</p><p>It seems I probably need to extend SimpleCursorAdapter so if 'is_set_to_record' is true then I set the background colour of all three TextViews to a different colour. The problem is that I don't know where I should be looking to do this.</p><p>Is this possible? If so, any pointers to where I should look would be appreciated.</p>","488241","","488241","","2011-02-10 01:56:28","2011-02-10 01:56:28","Change background colour of ListView item based on SimpleCursorAdapter field?","<android><android-listview><simplecursoradapter>","1","0","1","",""
"4952539","1","4952578","","2011-02-10 01:34:33","0","430","<p>I am trying to build an app that detects if a user puts their lips on the screen. How could I get an image of their lips when they put it on the screen?</p><p>Is there possibly a way to get a grid of the screen and then determine where they were placed?</p>","556935","","","","","2011-02-10 01:41:12","Android Screen Press Detection","<android><touch>","1","0","","",""
"4952541","1","5183260","","2011-02-10 01:34:55","10","10709","<p>When loading a widget if it cannot find a resource or something it says Problem Loading Widget. That's all! Amazing! This message remains on the home screen and does not even say which widget it had trouble loading. </p><p>I figured it out by trial and error but I would like to know if there are any places to find the error message when this occurs. Where will Android say what problem it had loading the widget or even which widget it failed to load?</p>","602260","","715269","","2013-04-29 06:25:13","2014-03-07 12:19:34","""_Problem Loading Widget"" message","<java><android><android-layout><android-widget><loading>","8","1","1","",""
"4952556","1","8695985","","2011-02-10 01:36:23","4","7379","<p>I am implementing a MyGestureDetector that extends a SimpleOnGestureListener.  I borrowed the class from: <a href=""http://www.codeshogun.com/blog/tag/view-flipper/"" rel=""nofollow"">http://www.codeshogun.com/blog/tag/view-flipper/</a> to allow a swipe action in a ViewFlipper.  I can not get if to function on the emulator. Any suggestions?</p><p>Below is all of the code:</p><p>The main.java</p><pre><code>import android.app.Activity;import android.os.Bundle;import android.view.GestureDetector;import android.view.KeyEvent;import android.view.MotionEvent;import android.view.View;import android.view.GestureDetector.SimpleOnGestureListener;import android.view.animation.Animation;import android.view.animation.AnimationUtils;import android.webkit.WebView;import android.widget.ViewFlipper;public class main extends Activity {private static final int SWIPE_MIN_DISTANCE = 120;private static final int SWIPE_MAX_OFF_PATH = 250;private static final int SWIPE_THRESHOLD_VELOCITY = 200;private GestureDetector gestureDetector;View.OnTouchListener gestureListener;private Animation slideLeftIn;private Animation slideLeftOut;private Animation slideRightIn;private Animation slideRightOut;private ViewFlipper viewFlipper;    @Override    public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    // ---------------------------------Sets Swipe Animation to Next View --&gt;           viewFlipper = (ViewFlipper)findViewById(R.id.AC4313);    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;        }    };     }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();            }        } catch (Exception e) {            // nothing        }        return false;    }}    @Override // ------------------------------ Catch the Gesture Event by Overriding onTouch() method: --&gt;public boolean onTouchEvent(MotionEvent event) {    if (gestureDetector.onTouchEvent(event))        return true;    else        return false;} </code></pre><p>The anim *.xml's:</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=""100%p"" android:toXDelta=""0"" android:duration=""800""/&gt;&lt;/set&gt; </code></pre>","742030","","","","","2013-02-19 05:52:05","MyGestureDetector extends SimpleOnGestureListener","<android><ontouchevent>","2","5","2","",""
"4952630","1","4952691","","2011-02-10 01:50:05","2","1035","<p>Please tell me how to protect our resource in a apk package.With a simple rename-extract process, any one can copy and thief application drawable resource like images or soundFX files.My question is, is there any way to protect drawable resource in a Android application?</p>","307480","","493939","","2012-10-14 06:04:52","2012-10-14 06:04:52","How to protect drawable resource in Android application","<android><drawable><protection>","3","0","","",""
"4952777","1","4952808","","2011-02-10 02:24:19","0","1061","<p>Trying to create a popup after every boot is completed to get some confirmation. Able to get the BOOT_COMPLETED Message but while opening Alertdialog its crashing, Below are the code lines i am using. Please suggest</p><pre><code>public class BootReceiver extends BroadcastReceiver {    private static final String TAG = ""BootReceiver"";    @Override    public void onReceive(Context context, Intent intent)         {                         String action = intent.getAction();                     Log.d(TAG, ""BroadcastReceiver:"" + action);                      if (action.equals(Intent.ACTION_BOOT_COMPLETED))             {                               Log.d(TAG, ""ACTION_BOOT_COMPLETETED Receved"" );                 CharSequence text = ""BOOT COMPLETED!"";                int duration = Toast.LENGTH_SHORT;                Toast.makeText(context,text,Toast.LENGTH_SHORT).show();                AlertDialog.Builder alertDialog = new AlertDialog.Builder(context);                alertDialog.setMessage(""Message"");                alertDialog.setTitle(""CONSENT"");                alertDialog.setIcon(android.R.drawable.ic_dialog_alert);                alertDialog.setCancelable(false);                alertDialog.setPositiveButton(""AGREE"", new DialogInterface.OnClickListener() {                public void onClick(DialogInterface dialog, int which) {                    Log.d(TAG, "" AGREE CLICKED""  );                } });                 alertDialog.setNegativeButton(""DISAGREE"", new DialogInterface.OnClickListener() {                    public void onClick(DialogInterface dialog, int which) {                        Log.d(TAG, "" DISAGREE CLICKED""  );                     } });                 alertDialog.show();            }                   }        }</code></pre><p>Back Trace :</p><pre><code>I/ActivityManager(  109): Start proc com.android.mms for broadcast com.android.mms/.transaction.MmsSystemEventReceiver: pid=311 uid=10015 gids={3003, 1015}E/AndroidRuntime(  246): FATAL EXCEPTION: mainE/AndroidRuntime(  246): java.lang.RuntimeException: Unable to start receiver com.android.settings.BootReceiver: android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an applicationE/AndroidRuntime(  246):        at android.app.ActivityThread.handleReceiver(ActivityThread.java:1862)E/AndroidRuntime(  246):        at android.app.ActivityThread.access$2400(ActivityThread.java:124)E/AndroidRuntime(  246):        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1035)E/AndroidRuntime(  246):        at android.os.Handler.dispatchMessage(Handler.java:99)E/AndroidRuntime(  246):        at android.os.Looper.loop(Looper.java:126)E/AndroidRuntime(  246):        at android.app.ActivityThread.main(ActivityThread.java:3897)E/AndroidRuntime(  246):        at java.lang.reflect.Method.invokeNative(NativeMethod)E/AndroidRuntime(  246):        at java.lang.reflect.Method.invoke(Method.java:491)E/AndroidRuntime(  246):        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:841)E/AndroidRuntime(  246):        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:599)E/AndroidRuntime(  246):        at dalvik.system.NativeStart.main(Native Method)E/AndroidRuntime(  246): Caused by: android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an applicationE/AndroidRuntime(  246):        at android.view.ViewRoot.setView(ViewRoot.java:434)E/AndroidRuntime(  246):        at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:181)E/AndroidRuntime(  246):        at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:95)E/AndroidRuntime(  246):        at android.app.Dialog.show(Dialog.java:269)E/AndroidRuntime(  246):        at android.app.AlertDialog$Builder.show(AlertDialog.java:853)E/AndroidRuntime(  246):        at com.android.settings.BootReceiver.onReceive(XtraBootReceiver.java:53)E/AndroidRuntime(  246):        at android.app.ActivityThread.handleReceiver(ActivityThread.java:1855)E/AndroidRuntime(  246):        ... 10 more</code></pre>","469119","","345717","","2011-02-10 02:27:26","2011-02-10 02:31:55","POPUP on Boot Completed","<android><alertdialog><bootcompleted>","1","0","","",""
"4952780","1","","","2011-02-10 02:25:07","0","180","<p>Fellow developers,</p><p>as you see it at Engadget, a company developed 'Alien Dalvik', a middleware enabling Dalvik runs on any other platform like Meego.  <a href=""http://www.engadget.com/2011/02/08/myriad-alien-dalvik-runs-android-apps-on-any-phone-starting/"" rel=""nofollow"">http://www.engadget.com/2011/02/08/myriad-alien-dalvik-runs-android-apps-on-any-phone-starting/</a></p><p>If the middleware got ported to other platform, let's say MeeGo, then what channel do users get application downloaded at? Android market? </p>","539982","","","","","2012-04-27 11:41:48","Some questions on Alien Dalvik","<android><mobile><jvm><google-play><dalvik>","2","0","","",""
"4952797","1","5005720","","2011-02-10 02:29:46","2","2358","<p>Is it possible to animate the transition between an <code>Activity</code> in a tab to another one? I mean, when the user clicks a tab in the <code>TabWidget</code> and the shown tab content changes to another <code>Activity</code>. With the default configuration it just changes but I would like to have a smooth transition like a left-to-right slide or something similar.</p><p>Thank you for your help.</p>","305582","","844882","","2012-03-17 08:14:27","2012-09-06 08:37:32","How to animate TabActivity change in Android?","<java><android><eclipse><animation><tabactivity>","1","0","2","",""
"4952904","1","4953143","","2011-02-10 02:52:08","0","620","<p>After installing android with eclipse it came along many versions. some people recommended to use v2.1 and v2.2 and not v2.3 since it is not supported by many devices.</p><p>Is the idea of using the latest edition (2.3) good? Which one do you recommend?</p><p>what about programming wise rather than audience wise?</p>","341405","","341405","","2011-02-11 02:50:51","2011-02-11 02:50:51","Recommended android version for development?","<android>","4","0","","",""
"4952911","1","4953019","","2011-02-10 02:54:18","0","186","<p>I'm somewhat new to Android development and I'm trying to build a very simple app which will browse my network for DLNA servers and allow me to browse each DLNA server as a directory. The thought is pretty simple: one activity displays all DLNA servers on the network, user selects one, then we redirect to another activity which browses the DLNA media server's directories.</p><p>My question is quite basic: how do I persist information like 'selected server', 'current directory' and other things like this? I just need a way for the rest of my application to know what to do. Should I build this data into a service? It seems like that violates the common understanding of what services should be. How can I/should I persist application state? </p>","128967","","","","","2011-02-10 03:19:45","Should I use a Service as a way of accessing network data?","<android><theory><upnp><dlna>","1","0","","",""
"4952941","1","4964243","","2011-02-10 03:00:46","11","889","<p>So, I've got a handful of <code>""Utility""</code> style classes in some of my projects. I'm curious if I can move them to an Android Library Project that contains all or most of my non-app specific glue code (wrappers and interfaces, mostly).</p><p>So, my question is what happens to the files I don't need in that library. I know Android Library Projects basically just copy their code into the other project, so if I say use 25% of the code in my ""general purpose"" library, will my app actually contain the bytecode for all 100%, or does it properly strip it down to only the stuff I need.</p><p>I had some issues with unused classes in Proguard in the past, so I'm just once-bitten, twice shy with the ADT now...</p>","368918","","750613","","2012-07-13 11:51:13","2013-01-31 12:20:55","How smart is Eclipse / ADT when it comes to Android Library Projects?","<android><eclipse><adt><android-library>","3","0","2","",""
"4953002","1","4953576","","2011-02-10 03:15:43","4","6042","<p>I am trying to create a link that can be sent via email which when opened on an android device with my app installed will automatically open the correct page in my app.</p><p>I have gotten this partially working in a few different ways but have found a few problems that I was wondering if anyone has solutions to.</p><p><strong>Attempt 1:</strong> Using a custom scheme: myapp://someItem. This works but some email applications do not treat this as a link as it is not http. Is there a way to force applications to treat it as a valid link? gmail for example.</p><p><strong>Attempt 2:</strong> Using a http link with a host: <a href=""http://com.myapp/someItem"" rel=""nofollow"">http://com.myapp/someItem</a>. This works as well but my app ends up registered to handle all http links which is not ideal.</p><p><strong>Attempt 3:</strong> Using a http link with host and port: <a href=""http://com.myapp:2345/someItem"" rel=""nofollow"">http://com.myapp:2345/someItem</a>. This is my current solution with the only drawback being that when the link is opened it still gives the option of opening the link in a browser. Is there a way to stop the browser attempting to open my links?</p><p>Does anyone have a way to make links that will be treated as links by all applications and also be ignored by the browser when opening them?</p>","304795","","","","","2013-02-07 12:37:52","Android deep linking into an app","<android><android-intent>","3","0","","",""
"4953077","1","4953282","","2011-02-10 03:33:51","24","10008","<p>I have been trying to duplicate the NotePad sample project such that if I tinker with the source files in order to learn through experimentation, the original sample files will not be affected.</p><p>Alas, despite following <a href=""http://stackoverflow.com/questions/4928784/how-to-duplicate-an-sdk-sample-project-into-workspace"">very clean steps</a> in a pristine environment, <strong>R</strong> turned against me, <a href=""http://stackoverflow.com/questions/4577091/com-example-helloandroid-r-id-cannot-be-resolved"">again</a>!</p><p>I got about 20 ""<strong>R</strong> cannot be resolved to a variable"" errors...</p><p>Now, this is like catch 22: I am trying to study the NotePad sample, so that I have a chance to understand what R is. But R doesn't like me so much, so it doesn't give me a chance to study the NotePad sample.</p><p>To add insult to injury, when I Google for <strong>R</strong>, I get totally irrelevant results.</p><ol><li>What is <strong>R</strong>?</li><li>Why is it so Cryptic?</li><li>Why is it always the first one thatcannot be resolved?</li></ol><p>Update: I noticed that in the HelloAndroid project (XML layout version), there is a <strong>generated</strong> Java file, named <strong>R.java</strong>. Is this the infamous <strong>R</strong> about which the project builder is complaining?</p>","418055","","418055","","2011-02-10 04:13:38","2012-03-28 12:53:32","Android: What is R? Why is it so Cryptic?","<android><android-manifest>","3","2","5","",""
"4953118","1","4954137","","2011-02-10 03:42:42","3","5250","<p>Does anyone know where I can get Royalty Free images (<code>Preferably High Quality</code>) for backgrounds? I need these for my Android App currently in development.</p>","461176","","750613","","2012-07-13 11:50:25","2013-12-03 19:24:35","Royalty Free Background Images For Android Application","<android><image><resources>","4","2","2","",""
"4953160","1","","","2011-02-10 03:50:30","1","646","<p>I am using a hidden method <code>setWifiApEnabled()</code> in HTC desire running Android 2.2 to create a hotpsot.The hotspot is created but doesn't take the name/ssid specified by me.</p><p>There is a WiFi hotspot app that comes with HTC Desire where u can create hotpsot with details you require.</p><p>Is there anyway to solve this or it is fine i know how to access this Wifi Hotspot app via intents to get AP created with specified WiFi details..</p>","550982","","750613","","2012-07-13 11:50:09","2012-07-13 11:50:09","Wifi Hotspot creation in desire","<android-wifi><android>","0","1","1","",""
"4953205","1","4953263","","2011-02-10 03:58:54","0","1697","<p>I'm trying to figure out the best way to play a tutorial video in my Opengl android application.</p><p>I tried <a href=""http://davanum.wordpress.com/2009/12/04/android-%E2%80%93-videomusic-player-sample-take-2/"" rel=""nofollow"">this</a> and it works fine.</p><p>Now my problem is how to merge this with an opengl application. If I just launch another activity I will destroy my opengl context and would have to recreate it. My best idea at the moment is to add to my existing xml layout an VideoView component and use a relative layout to overlap it on top of the opengl view.</p><p>I would like to know if this is a good option or is there a better solution.</p>","440336","","139010","","2011-02-10 04:05:16","2011-02-10 04:08:59","Android: Best way to play video in Opengl application","<android><video><opengl-es>","1","0","1","",""
"4953270","1","","","2011-02-10 04:09:29","1","5003","<p>I have a gridview, I need to do stuff on motioneven.action_down and do something for motioneven.action_up ... using onclicklistener is great but does not give me this needed functionality. </p><p>Is there anyway to easily call the gridview and get its selected item in a ontouchlistener ? I've been having limited success with making my own implementation. Its hard to get the right x,y because if i call the child it gives me the x and y relative to the child so a button would be 0,0 to 48,48 but it does not tell you the actual location on the screen relative to the gridview or the screen itself. </p><p>this is what i've been doing, its partially working so far. </p><pre><code>Grid.setOnTouchListener(new OnTouchListener() {            public boolean onTouch(View v, MotionEvent event) {                if (event.getAction() == MotionEvent.ACTION_DOWN) {                    int x = (int)event.getX();                    int y = (int)event.getY();                    int position = 0;                    int childCount = Grid.getChildCount();                    Message msg = new Message();                    Rect ButtonRect = new Rect();                    Grid.getChildAt(0).getDrawingRect(ButtonRect);                     int InitialLeft = ButtonRect.left + 10;                    ButtonRect.offsetTo(InitialLeft, ButtonRect.top);                    //                    while(position &lt; childCount){                        if(ButtonRect.contains(x,y)){break;}                        if(ButtonRect.right + ButtonRect.width() &gt; Grid.getWidth())                        { ButtonRect.offsetTo(InitialLeft, ButtonRect.bottom);}                        position++;                        ButtonRect.offsetTo(ButtonRect.right, ButtonRect.top);                    }                    msg.what = position;                    msg.arg1 = ButtonRect.bottom;                    msg.arg2 = y;                    cHandler.sendMessage(msg);                }// end if action up                if (event.getAction() == MotionEvent.ACTION_UP) {                }                return false;            }        });</code></pre>","610800","","","","","2013-02-06 07:06:14","Android How to get position of selected item from gridview without using onclicklistner, using ontouchlistner instead","<java><android><gridview><listener>","1","1","1","",""
"4953351","1","4953380","","2011-02-10 04:23:09","1","1708","<p>I want to fill the screen with a 100 different letters in random positions. On the iPhone I just created a bunch of UILabels set their x and y positions and then used animations to move them about.</p><p>On Android it doesn't look like I can add a TextView to my view and specify its X and Y. Is there a way to do this?</p><pre><code>    View gameView = findViewById(R.id.gameboard);    tv = new TextView(gameView.getContext());    tv.setText(""A"");    tv.setWidth(w); tv.setHeight(h);    // How to set the X and Y?</code></pre><p>EDIT: The solution was to use AbsoluteLayout:</p><pre><code>    AbsoluteLayout al = (AbsoluteLayout)findViewById(R.id.gb_layout);    tv = new TextView(this);    AbsoluteLayout.LayoutParams params = new AbsoluteLayout.LayoutParams(            AbsoluteLayout.LayoutParams.WRAP_CONTENT,            AbsoluteLayout.LayoutParams.WRAP_CONTENT,10,10);            params.x = 50;    params.y = 50;    al.addView(tv, params);</code></pre><p>and to move it base on MotionEvent me:</p><pre><code>    AbsoluteLayout.LayoutParams p = new AbsoluteLayout.LayoutParams(            AbsoluteLayout.LayoutParams.WRAP_CONTENT,            AbsoluteLayout.LayoutParams.WRAP_CONTENT,(int)me.getX(), (int)me.getY());    mTV.setLayoutParams (p);</code></pre>","317033","","317033","","2011-02-10 15:57:28","2012-04-27 16:32:36","Android - How to draw a letter at a specific point?","<android><textview>","4","2","1","",""
"4953402","1","","","2011-02-10 04:31:13","0","903","<p>I am trying to write an android application that runs a shell commands, or a shell script if that is preferable, and displays the output... can anyone give me in the right direction?</p><p><strong>My code is as follows:</strong></p><pre><code>void execCommandLine()    {        Runtime runtime = Runtime.getRuntime();        Process proc = null;        OutputStreamWriter osw = null;        try        {            String[] str={""/system/bin/sh"",""/data/shTest.sh""};                               System.out.println(""EXEC STRING"");                 proc = runtime.exec(str);               osw = new OutputStreamWriter(proc.getOutputStream());            //osw.write(command);            osw.flush();            osw.close();        }        catch (IOException ex)        {              Log.e(""erre"",""ioexception"");                      //Log.e(""execCommandLine()"", ""Command resulted in an IO Exception: "" + command);            return;        }        finally        {            if (osw != null)            {                try                {                    osw.close();                }                catch (IOException e){}            }        }        try         {            proc.waitFor();        }        catch (InterruptedException e){}        if (proc.exitValue() != 0)        {            Log.e(""erre"",""interruotexception"");                     //Log.e(""execCommandLine()"", ""Command returned error: "" + command + ""\n  Exit code: "" + proc.exitValue());        }    }     // **************************************</code></pre><p>Code is running successfully but I am not getting any output in adb shell logcat would anyone tell me if this script is executed successfully how to get this output in Adb shell.</p>","587090","","750613","","2012-07-13 11:48:49","2012-07-13 11:48:49","RE :How can we execute a shell script file from my Android Application","<android><shell>","1","0","","",""
"4953440","1","","","2011-02-10 04:39:49","1","1293","<p>Now I want to insert a ImageView behind the GLSurfaceView.But the GLSurfaceView always draws background color so I can't see the ImageView.I tried <code>glClearColor(0,0,0,0)</code> but it doesn't work.What should I do?Please help me!Thank you very much.</p>","610821","","750613","","2012-07-13 11:49:15","2012-07-13 11:49:15","How to stop OpenGL ES drawing background color on Android?","<android><opengl-es>","2","1","","",""
"4953451","1","","","2011-02-10 04:41:22","0","90","<p>show example when user fill the phone number  and password in edit text  and clik submit  this information stored in a database using shared prefences please answer hurry beacuse i am working in project. </p>","610824","","","","","2011-02-10 05:04:45","Using Shared prefences","<android>","1","0","","",""
"4953452","1","","","2011-02-10 04:41:50","12","21233","<p>Hi guys i have been trying to know about android driver development.. i know driver development is not an easy job but i'd like to learn.. Is there any tutorials for that or any simple examples??</p>","596317","","","","","2012-12-17 06:35:42","How to write drivers for Android?","<android><kernel><driver><native>","2","0","1","",""
"4953466","1","4955428","","2011-02-10 04:43:59","2","5306","<p>I want to store the hashmap object in global class so that it will store value even after the mobile restart. Any idea how to go about this concept.</p>","256612","","68805","","2011-02-10 10:00:43","2014-02-20 09:38:38","How to store hashmap so that it can be retained it value after a device reboot?","<android>","3","0","2","",""
"4953554","1","4953602","","2011-02-10 05:00:33","2","9202","<p>I am developing an android game application,I have implemented all the screens.Now i want to change the webview background color,Can anybody guide me.Here is my xml file </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=""@drawable/background""&gt;&lt;WebView      android:id=""@+id/webbrowser""      android:layout_width=""fill_parent""     android:layout_height=""345px""    android:layout_marginTop=""46px""/&gt; &lt;Button    android:id=""@+id/Btn""    android:background=""@drawable/back_btn""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:layout_marginLeft=""109px""    android:layout_marginTop=""37px""&gt; &lt;/Button&gt;&lt;/LinearLayout&gt;</code></pre><p>And My Java file is package com.tli.roadtripbingo;</p><pre><code>import android.app.Activity;import android.content.Intent;import android.os.Bundle;import android.view.View;import android.view.Window;import android.view.View.OnClickListener;import android.webkit.WebView;import android.webkit.WebViewClient;import android.widget.Button;public class WebView1 extends Activity {    private Button Back;    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);         requestWindowFeature(Window.FEATURE_NO_TITLE);         setContentView(R.layout.webview);         Back = (Button)findViewById(R.id.back);        WebView webView = (WebView) findViewById(R.id.webbrowser);        webView.getSettings().setJavaScriptEnabled(true);        webView.loadUrl(""http://www.vikingredning.no/skilt.aspx"");        webView.setWebViewClient(new HelloWebViewClient());        }    class HelloWebViewClient extends WebViewClient     {        @Override        public boolean shouldOverrideUrlLoading(WebView view, String url)         {            view.loadUrl(url);            return true;        }    };}</code></pre><p>Thanks in advanceRegardsTushar</p>","475349","","603744","","2011-06-17 08:08:20","2011-06-17 08:08:20","Changing the background of webview in android","<android>","2","0","2","",""
"4953620","1","4954046","","2011-02-10 05:12:01","0","342","<p>I have built a free app and a paid app. When user upgrades or buys paid app, on its first launch, i want the app to send ""unique id"" to my server so that every time the app launches, it will check with server and authenticate to prove that the user actually paid for the app. </p><p>What I am wondering about is what I should use as ""unique id."" I am aware that there is android.telephony.TelephonyManager.getDeviceId() to get IMEI or MEID and use this to check the validity.However, if I use this method, when user change the cellphone, then this would no longer work. Are there any way to get user's google id that is connected with android market or some sort of unique id that is related to android market so that when user changes the phone, as long as the id to login to market is same, the app can authenticate?</p><p>Thanks in advance</p>","584700","","","","","2011-02-10 06:27:11","Paid App Authenticating Server","<android><authentication><paid>","1","0","","",""
"4953692","1","","","2011-02-10 05:25:18","10","11387","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/1340528/how-to-trigger-an-event-when-scrollview-reach-the-bottom-with-android"">How to trigger an event when scrollView reach the bottom with Android?</a>  </p></blockquote><p>I have been trying for an hour or so to detect when my scrollView gets to the bottom of the screen.  Due to the various screen sizes and what not involved with Android, I can't simply say it's at the bottom when its Y position reaches a certain value, but there's no method that detects when it is at the bottom that I found.</p><p>I'm sure there's a simple solution to this, subtracting the height of the view by some other variable or something, but for some reason it just isn't clicking for me.  Any ideas would be appreciated, thank you.</p>","602571","","","","","2013-05-20 13:13:25","Android: Detecting When ScrollView Hits Bottom","<android><scroll><position><scrollview>","1","0","10","2012-04-02 18:58:29",""
"4953714","1","","","2011-02-10 05:30:34","0","2742","<p>i have been reading on the page and i still have no answer about that one, i mean, if it is possible, i would definitly like to know how ? or at least know if its possible ! </p><p>Another thing that i would like to know is if i could make it on Android Mobiles... Could i? </p><p>Please, some help.</p><p>i´ll apreciate it ! </p>","610844","","546999","","2011-02-10 06:52:47","2011-02-11 07:42:28","Could i make an AD-HOC network on my mobile?","<android><mobile><cellphone><adhoc>","3","3","","",""
"4953743","1","4953786","","2011-02-10 05:34:56","1","3871","<p>How can I give bold and normal styles inside our styles.xml?The code which I have given is:</p><pre><code>&lt;style name=""textbold"" parent=""@android:style/TextAppearance""&gt;    &lt;item name=""android:layout_width""&gt;wrap_content&lt;/item&gt;    &lt;item name=""android:layout_height""&gt;wrap_content&lt;/item&gt;    &lt;item name=""android:textstyle""&gt;bold&lt;/item&gt;&lt;/style&gt;&lt;style name=""textregular"" parent=""@android:style/TextAppearance""&gt;    &lt;item name=""android:layout_width""&gt;wrap_content&lt;/item&gt;    &lt;item name=""android:layout_height""&gt;wrap_content&lt;/item&gt;    &lt;item name=""android:textstyle""&gt;normal&lt;/item&gt;&lt;/style&gt;</code></pre><p>But its showing error over here: <code>&lt;item name=""android:textstyle""&gt;</code></p>","504162","","","","","2011-02-10 06:07:09","How can I give a style bold in android?","<android>","1","0","1","",""
"4953751","1","4955613","","2011-02-10 05:36:46","0","4119","<p>I am trying to create a custom dialog box that displays an image in full-view and has a Select as well as Cancel Button. This custom dialog box should be displayed when an image is clicked so as to allow the user to view the selected image in full-view. The image view should be one that is selected from a GridView. The Select Button will display a Toast message and the Cancel button will allow the user to exit the dialog. The idea is to allow the user to see the image in full-view before he or she makes a final choice on the picture they would like.</p><p>However, I am having several problems trying to do this. My code is shown below:</p><pre><code>  package com.newapp; import android.app.Activity; import android.app.Dialog; import android.content.DialogInterface; import android.content.Context; import android.os.Bundle; import android.view.View; import android.widget.AdapterView; import android.widget.BaseAdapter; import android.widget.GridView; import android.widget.ImageView; import android.widget.Toast; import android.widget.AdapterView.OnItemClickListener; import android.widget.ImageView; import android.widget.Button;public class MainActivity extends Activity {/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main); //error here: R cannot be resolved to a variable        GridView gridview = (GridView) findViewById(R.id.photogrid);        gridview.setAdapter(new ImageAdapter(this));        gridview.setOnItemClickListener(new OnItemClickListener() {            public void onItemClick(AdapterView&lt;?&gt; parent, View v, int position, long id) {                //Toast.makeText(MainActivity.this, """" + position, Toast.LENGTH_SHORT).show();                Context mContext = getApplicationContext();                Dialog dialog = new Dialog(mContext);                dialog.setContentView(R.layout.ImageDialog);                dialog.setTitle(""Full-image view"");                ImageView image = (ImageView) dialog.findViewById(R.id.image);                image.setImageResource(R.drawable.android);                Button select = (Button) findViewById(R.id.selectimage);                        buttonChangePerferences.setOnClickListener(new OnClickListener() {                            public void onClick(View v) {                            Toast.makeText(MainActivity.this, """" + position, Toast.LENGTH_SHORT).show();                            }                        });                    }                    Button cancel = (Button) findViewById(R.id.cancelselection);                        cancel.setOnClickListener(new OnClickListener()    //error here: Syntax error on tokens;AnnotationName expected instead                                        {                            public void onClick(View v) {                              dialog.cancel();                            }                        });        })                    }       package com.newapp;       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 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,        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>Can somebody help me fix these problems? Any help would much appreciated. Thanks  </p>","610642","","444277","","2011-02-10 09:28:18","2012-05-27 09:09:37","Creating a custom dialog box that displays a full view image","<android>","2","1","0","",""
"4953823","1","","","2011-02-10 05:48:42","1","47","<p>Is there any way to do a popup menu that is activated by a process within the program, such as the JPopupMenu class of Swing?  All I can find in the android literature is an options menu that can only be activated by pressing a menu button, and the context menu that can only be activated by a long press.</p>","597449","","893","","2011-02-10 05:50:22","2011-02-10 08:47:07","menu capability","<android><menu>","1","0","","",""
"4953835","1","4953951","","2011-02-10 05:49:58","0","114","<p>I have an <code>ImageView</code> on top of a <code>ListView</code> and whenever there is a long running process to populate the list I would like to hide the <code>ListView</code> and make the <code>ImageView</code> visible.</p><p>I tried some things with <code>setVisibility()</code> but I'm getting messed up scroll behavior for the list. </p><p>I'm using <code>AsyncTask</code> to manage all this but I don't think that's causing the messed up scrolling behavior. Any ideas on how I can display a busy spinner while the list is being populated and not get inconsistent scrolling behavior for the list?</p>","165198","","68805","","2011-02-10 06:54:37","2011-02-10 06:54:37","Weird list behavior in android","<android>","1","0","","",""
"4953850","1","7513894","","2011-02-10 05:52:21","1","820","<p>We implemented Android's Account Manager and Sync Manager api to create contact sync. But when user selects our account while adding contact, it only displays Name fields and all other fields disappear.</p><p>Here is what I have in my manifest</p><pre><code>&lt;activity android:name="".AuthenticatorActivity"" android:label=""iAnywhere Login""            android:theme=""@android:style/Theme.Dialog""            android:excludeFromRecents=""true""&gt;&lt;/activity&gt;        &lt;service android:name="".accounts.AuthenticationService""&gt;            &lt;intent-filter&gt;                &lt;action android:name=""android.accounts.AccountAuthenticator""&gt;&lt;/action&gt;            &lt;/intent-filter&gt;            &lt;meta-data android:name=""android.accounts.AccountAuthenticator""                android:resource=""@xml/authenticator""&gt;            &lt;/meta-data&gt;        &lt;/service&gt;        &lt;service            android:name="".accounts.SyncService""            android:exported=""true""&gt;            &lt;intent-filter&gt;                &lt;action                    android:name=""android.content.SyncAdapter"" /&gt;            &lt;/intent-filter&gt;            &lt;meta-data                android:name=""android.content.SyncAdapter""                android:resource=""@xml/syncadapter"" /&gt;        &lt;/service&gt;</code></pre><p>This is what I have in my syncadapter.xml and authenticator.xml</p>    <pre><code>&lt;sync-adapter xmlns:android=""http://schemas.android.com/apk/res/android""    android:contentAuthority=""com.android.contacts""    android:accountType=""com.rahul.utility.contacts""/&gt;</code></pre><p>Have seen people talk about this kind of issue while adding custom fields that it is a bug in Contact application. I also checked out the code of Exchange Email client in Android source code and they seems to be doing exactly same as what I did, but still when you select Add Contact for an Exchange account it shows up all the fields in the contact.</p>","473655","","","","","2011-09-22 11:18:37","Android AccountManager and SyncManager implementation caused only Name field to appear in Add/Edit Contact screen","<android><contacts><accountmanager>","1","0","","",""
"4953911","1","4954035","","2011-02-10 06:04:44","0","609","<p>hi i am a new android developer. In my app i have created a dialog box in text view which appears to be a pop up window. In that the content i type is to be in left alignment form how can i move it to be in center, just like a middle alignment form..... </p>","596364","","","","","2011-02-10 06:25:52","android text view in dialog box","<java><android><textarea>","1","1","","",""
"4953934","1","4955023","","2011-02-10 06:10:16","0","578","<pre><code>private static  String CONSUMER_KEY = ""mrnCC41nxtwkdFAmToEhtg"";private static final String CONSUMER_SECRET = ""kmmVuahEspGvdl14aCD1GSBZpeHbxvkpAez7aKaaQ"";EditText editPinCode;LinearLayout lin;              public Logger slr;LinearLayout container;public LoginT(){}/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    requestWindowFeature(Window.FEATURE_NO_TITLE);    setContentView(R.layout.twitter);    editPinCode = new EditText(this);    lin = (LinearLayout)findViewById(R.id.LinearLayout01);    handleEvent = new Handler();    twitterConnection = new TwitterFactory().getInstance();    context = this;         oHelper = new OAuthHelp(this);    getTwitter(context); }/** * Connects to twittter     * @param v                 */public void getTwitter(Context ctx) {  //updated code    handleEvent.post(new Runnable() {        //          handleEvent.postAtFrontOfQueue(new Runnable() {        public void run() {                               if (oHelper.hasAccessToken())             {                Log.e(""run if"",""run"");                oHelper.configureOAuth(twitterConnection);                try                 {                    i=i+1;                    Log.e(""run try"",""run"");                    twitterConnection.updateStatus(Calendar.MINUTE+i+""Hi this is Arun......"");                    //twitterConnection.se                    Log.e(""finish"",""start"");                    finish();                    Log.e(""finish"",""end"");                    }                 catch (TwitterException e)                 {                    Log.d(""TWEET"", ""Error Updating status "" + e.getMessage());                    e.printStackTrace();                }            }             else             {                Log.e(""run else"",""run"");                try {                            twitterConnection.setOAuthConsumer(CONSUMER_KEY,CONSUMER_SECRET);                    requestToken = twitterConnection.getOAuthRequestToken("""");                    Log.e(""REQUEST_TOKEN"",requestToken+"""");                    webViewDialog(requestToken.getAuthorizationURL(), 0);                }                 catch (TwitterException e)                 {                                 e.printStackTrace();                }                }        }});}           /** * Shows Dialog for authentications * * @param authorizationURL * @param type */private void webViewDialog(final String authorizationURL, final int type) {    Log.e(""webViewDialog"",""webViewDialog"");    container = new LinearLayout(this);    container.setMinimumWidth(200);    container.setMinimumHeight(320);    webView = new WebView(this);    webView.setMinimumWidth(200);    webView.setMinimumHeight(380);    webView.getSettings().setJavaScriptEnabled(true);    //      webView.dispatchWindowFocusChanged(true);    webView.setWebViewClient(new MyWebViewClient(this,LoginT.this));    webView.loadUrl(authorizationURL);    container.addView(webView);     lin.addView(container);    //      Builder webDialog = new AlertDialog.Builder(this);    //      webDialog.setView(container).setTitle(""Twitter Client"").setCancelable(true)    //      .show();}/**     * Pin code dialog Requests the user to enter pin shown on twitter */public void twitterPinCodeDialog() {    try {                         //                       accessToken = twitterConnection.getOAuthAccessToken(requestToken,ss);        try{            accessToken = twitterConnection.getOAuthAccessToken(requestToken);        }        catch(Exception e1){            Log.w(""Excep  e1"",e1+"""");        }        oHelper.storeAccessToken(accessToken);         Log.w(""ohelper"",oHelper.toString());        twitterConnection.updateStatus(""Tweeted Successfully""+new Date().toString());         Log.e("" "",""2    ""+accessToken);        Log.e("" "",""3"");        webView.destroy();        webView.removeAllViews();        container.removeAllViews();        this.finish();        //                      Log.i(""Access Token:"", accessToken.getToken());        //                      Log.i(""Access Secret:"", accessToken.getTokenSecret());    } catch (TwitterException te) {          oHelper.storeAccessToken(accessToken);                                              try {            twitterConnection.updateStatus(""HI.... "");        } catch (TwitterException e) {            e.printStackTrace();        }         }  }@Overrideprotected Dialog onCreateDialog(int id){       switch (id) {    //      case DIALOG_LOADING:     //      {    //          //              dialog = new ProgressDialog(this);    //          dialog.setMessage(""Please wait while loading..."");    //          dialog.setIndeterminate(true);    //          dialog.setCancelable(true);    //          return dialog;    //      }    }       return null;             } //      //      @Overridepublic void dismiss() {    Log.w(""dismiss"",""dismiss"");    try{        //          webView.destroy();        //          webView.removeAllViews();        //          container.removeAllViews();        //          this.finish();        System.exit(0);    }catch(Exception e){        e.printStackTrace();    }}//      @Overridepublic boolean onSearchRequested() {    Log.e(""Search"",""Search"");    return super.onSearchRequested();}</code></pre><p>I use the above Code for making connection for twitter but it only works for one time if I want another time for connection then it never provide me second time connection.</p><p>Thankx</p>","584040","","512958","","2011-02-10 08:47:05","2011-02-10 08:55:21","Oauth Connectivity for twitter","<android><twitter><oauth>","1","1","","",""
"4953942","1","10718051","","2011-02-10 06:11:37","0","1596","<p>How to work with the <code>GestureOverlayView</code> control, Please explain with some example.</p>","563593","","119895","","2012-10-31 14:56:33","2012-10-31 14:56:33","GestureOverlayView","<android>","1","2","1","",""
"4953971","1","4954128","","2011-02-10 06:18:04","0","506","<p>I had to manually turn on the network adapters in my program, and on Android this takes a while for the hardware to power up, up to a second.</p><pre><code>//turn on network adapterswifiManager.setWifiEnabled(true);bluetoothAdapter.enable();while(wifiManager.getWifiState()!=WifiManager.WIFI_STATE_ENABLED | bluetoothAdapter.getState!=BluetoothAdapter.STATE_ON)   ; //no code here, just waiting for adapters to enable//continue executiongetDeviceInfo();</code></pre><p>The above method I'm using now is not elegant at all, the CPU is locked-up in the while loop. Any ideas how to implement this in a better way?</p>","610907","","","","","2012-07-13 20:27:42","How to stop code execution while waiting for Wifi and Bluetooth adapters to enable in Android?","<android>","1","0","","",""
"4954028","1","4954096","","2011-02-10 06:24:43","0","169","<p>I am getting stuck with making android screen layout same like i have in my iPhone application. The iPhone screen layout is given in below image. Please anyone can help me out to make same screen for android. You can give me some idea with having some code snippet please.</p><p>Thanks in advance.</p>","610861","","610861","","2011-02-16 02:09:36","2011-02-16 02:09:36","Want help to make Android layout same like attachd image","<android><layout><screen>","2","0","","",""
"4954079","1","4954168","","2011-02-10 06:32:30","0","1234","<p>I have made a bottom tab bar in the application.What I want is that when I click on that tab bar. A new Menu Type List should be <code>Opened/PopUp</code> and when i click on any of the list it should pop down Back.</p><p>I know how to create seperate activity but dont know how to create the Menu Type Pop-Up list. </p>","521015","","750613","","2012-07-13 11:47:03","2012-07-13 11:47:25","Bottom Tab Bar in Android","<android>","2","0","1","",""
"4954089","1","4955120","","2011-02-10 06:33:46","4","2378","<p>I want to show the progress bar during web service call. I called progress bar before calling the service, but it is being called after the service call is finished and i have received the response.</p><pre><code>ProgressDialog dialog = ProgressDialog.show(LogIn.this,"""",""Loading. Please wait..."", true); status=Loginvalid(method,username,psword); //calling the method for making service call</code></pre><p>But, progress dialog is starting after the response is received from the service.Please how can i fix this problem..</p>","610921","","447156","","2011-02-10 06:38:12","2012-07-13 11:46:50","showing progress bar during network call","<android>","3","1","1","",""
"4954102","1","","","2011-02-10 06:36:11","39","52295","<p>I have a button. When I press the button I have to make text as bold otherwise normal. So I wrote styles for bold &amp; normal.</p><pre><code>&lt;style name=""textbold"" parent=""@android:style/TextAppearance""&gt;&lt;item name=""android:layout_width""&gt;wrap_content&lt;/item&gt;&lt;item name=""android:layout_height""&gt;wrap_content&lt;/item&gt;&lt;item name=""android:textStyle""&gt;bold&lt;/item&gt;&lt;/style&gt;&lt;style name=""textregular"" parent=""@android:style/TextAppearance""&gt;&lt;item name=""android:layout_width""&gt;wrap_content&lt;/item&gt;&lt;item name=""android:layout_height""&gt;wrap_content&lt;/item&gt;&lt;item name=""android:textStyle""&gt;normal&lt;/item&gt;&lt;/style&gt;</code></pre><p>Now I have a button_states.xml as:</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=""true""    style=""@style/textbold"" /&gt;&lt;item android:state_focused=""false"" android:state_pressed=""true""    style=""@style/textregular"" /&gt;&lt;item style=""@style/textregular"" /&gt;&lt;/selector&gt; </code></pre><p>In my layout for this button, I have to make the background as transparent too...How will I do it? My layout code is :</p><pre><code>&lt;Button android:id=""@+id/Btn"" android:background=""@drawable/button_states"" /&gt;</code></pre><p>How will I include background as transparent in my style?</p>","504162","","","","","2013-01-09 05:18:34","Button background as transparent","<android>","3","0","6","",""
"4954130","1","4954275","","2011-02-10 06:41:04","27","29776","<p>i want the message text of my dialog box to be center aligned</p>","596364","","68805","","2011-02-10 08:00:25","2013-09-26 11:24:08","Message text in android dialog box","<java><android>","5","0","5","",""
"4954142","1","","","2011-02-10 06:43:06","7","2027","<p>I am developing app in which I have to implement live tv streaming.  My Google search has lead me to believe that live streaming is not possible till 2.1 android.</p><p>Is it right?</p><p>As I get code of straming music of mediaplayer and i can use type of it by setting below method:</p><p><code>mp.setAudioStreamType(2)</code>;</p><p>But i want to know is it sufficient for streaming just code like that and save file like below method:</p><pre><code>private void setDataSource(String path) throws IOException {        if (!URLUtil.isNetworkUrl(path)) {            mp.setDataSource(path);        } else {            Log.i(""enter the setdata"",""enter the setdata"");            URL url = new URL(path);            URLConnection cn = url.openConnection();            cn.connect();            InputStream stream = cn.getInputStream();            if (stream == null)                throw new RuntimeException(""stream is null"");            File temp = File.createTempFile(""mediaplayertmp"", ""dat"");            String tempPath = temp.getAbsolutePath();            FileOutputStream out = new FileOutputStream(temp);            byte buf[] = new byte[128];            do {                int numread = stream.read(buf);                if (numread &lt;= 0)                    break;                out.write(buf, 0, numread);            } while (true);            mp.setDataSource(tempPath);            try {                stream.close();                Log.i(""exit the setdata"",""exit the setdata"");            }            catch (IOException ex) {                Log.e(TAG, ""error: "" + ex.getMessage(), ex);            }        }    }</code></pre><p>Is there any extra stuff needed for live tv streaming?  Pls guide to me.</p>","544537","","2961","","2011-03-10 12:17:28","2014-03-18 21:04:11","android live streaming of tv","<android><streaming><live>","1","3","3","",""
"4954205","1","4954259","","2011-02-10 06:50:33","-1","3379","<p>I want to use the web service in Android Application. I have already built web service using SOAP. </p>","610940","","","","","2011-02-10 07:06:19","Use Web Service in Android","<android>","2","1","1","2013-03-01 10:11:50",""
"4954286","1","4954375","","2011-02-10 07:02:26","0","468","<p>I'm trying to port a <code>Java ME</code> application to Android.<br>Since I'm not a Java developer I'm having some issues to resolve.</p><ol><li><p>Working with files</p><pre><code>FileConnection fconn = null;fconn = (FileConnection)Connector.open(fileName, Connector.READ);InputStream inputStream = null;inputStream = fconn.openInputStream();return inputStream;</code></pre></li></ol><p>How can I do this in Android?</p>","281092","","839601","","2012-07-16 02:42:21","2012-07-16 02:42:21","Porting Java ME to Android (working with files)","<java><android><java-me>","1","0","","",""
"4954316","1","","","2011-02-10 07:06:57","115","66923","<p>I am developing simple android application. But when I run eclipse tell me the error:</p><blockquote>  <p>Your project contains error(s), please fix it before running it.</p></blockquote><p>I can't find any error in my project or there is not have error in my application.There have red cross under the application name but it's no under the another file name.</p><p>Does some guys meet this issue?</p>","610967","","34088","","2012-07-03 12:52:09","2014-04-03 17:13:22","Your project contains error(s), please fix it before running it","<android><eclipse>","23","4","31","",""
"4954413","1","4954451","","2011-02-10 07:20:40","0","3875","<p>I dont know how to use <code>getDrawingCache()</code> method.please give me any example.Please explain me the method,its use and advantages.</p>","537819","","750613","","2012-07-13 11:43:27","2012-07-13 11:43:27","What is the use of getDrawingCache() method","<android>","2","0","","2013-05-21 11:20:06",""
"4954415","1","","","2011-02-10 07:20:51","0","287","<p>I have four <code>EditText</code> and two buttons namely, save and review button.</p><p>If I press the save button <code>EditText</code> value should be stored in the database and on clicking the review button, saved value in the database should be appeared in <code>ListView</code>. </p><p>How can this be done? Please let me know in detail about this.</p>","555910","","1479511","","2013-05-05 14:39:14","2013-05-05 14:39:48","EditText value to be stored in a database","<android><sqlite><android-listview><android-edittext>","0","3","","",""
"4954464","1","","","2011-02-10 07:29:13","1","3891","<p>I just started a project that wants to listen to all <code>incoming / outgoing SMS</code> events and send the content of SMS to a WebServer. </p><p>I can easily register to all incoming SMS alert. However I can't find any way to register to outgoing SMS events. </p><p>Can someone please provide me some hint of how to do this? </p>","321098","","750613","","2012-07-13 11:42:13","2012-07-13 11:42:13","How to listen/subscribe to Outgoing SMS notifications?","<android><sms>","0","1","","2014-04-08 12:40:29",""
"4954527","1","","","2011-02-10 07:38:52","0","645","<p>My Java code will invoke native code. When the native code crashes, I want to write the crash log to my own file. How can I achieve this? I have used ACRA, but it won't work for native code.Thanks very much.</p>","554861","","741249","","2012-05-07 07:54:02","2012-05-07 07:54:02","How do I create crash log when the Android process crashes","<android><logging><crash><acra>","1","2","1","",""
"4954528","1","4954573","","2011-02-10 07:38:59","2","8328","<p>I am building an application where the mobile (where i install the app) will act as the access point and another wifi hardware that has to pair to this device(<code>network/access point</code>). </p><p>Could someone give me an input on how to go about it ?</p><p>Can you give samples ..it would be really helpful...</p>","448005","","750613","","2012-07-13 11:41:51","2012-07-13 11:41:51","Android device as wifi access point","<android><wifi>","1","0","","",""
"4954589","1","5037307","","2011-02-10 07:49:04","0","327","<p>I was wondering whether it's possible to get list of all  applications listening to <code>android.provider.Telephony.SMS_RECEIVED</code> intent ?</p>","192901","","750613","","2012-07-13 11:41:28","2012-07-13 11:41:37","how to check who is listening to android.provider.Telephony.SMS_RECEIVED?","<android><sms><broadcastreceiver>","1","0","","",""
"4954673","1","4954834","","2011-02-10 08:02:47","0","3903","<p>If on a textview I set <code>onLongClick</code> event or a touch listener, it works ok, but if I set both, the <code>TextView</code> doesn't react on a long click event.</p><p>Do you know hot to set both events? I need to change <code>TextView</code>'s background on touch (Action down and action up) and to show a context menu on long click event. </p>","517558","","68805","","2011-02-10 08:28:38","2011-02-10 08:28:38","Android TextView touch events","<android><events>","1","0","","",""
"4954740","1","4954828","","2011-02-10 08:14:31","0","306","<p>I'm having a strange problem here. Here's the code, I'm using to fetch a url content:</p><pre><code>URL u = new URL(url);InputStream is = new BufferedInputStream(u.openStream());</code></pre><p>I've got two urls, I want to fetch with this code. Both contain xml data. To be specific, the first one is <code>http://www.berlingske.dk/unwire/latest/news_article/2/10</code>, the second one is <code>http://www.bt.dk/mecommobile/latest/news_article/1368/10?output_type=xml</code>. The first one gets fetched correctly, the second one does not. I added some logging, and found out, that for the second url some weird html page gets fetched, instead of the expected xml. How can that be even possible?</p>","163423","","","","","2012-07-13 11:41:03","Android weird URL fetching","<android><urlfetch>","1","0","","",""
"4954743","1","","","2011-02-10 08:15:06","0","503","<p>Wow... that is a pretty long title. But here's the gist of my question. </p><p>I return a cursor that contains data from an SQLiteDatabase table called Budget. One of the columns in the database stores the currency amount for an item. </p><p>The table looks something like this. </p><pre><code>_id   Item   Amount1     Book   299.99</code></pre><p>Right, so I return the cursor, make use of my own custom adapter which inherits from SimpleCursorTreeAdapter and then load the data into an ExpandableListView. </p><p>Now the question is, how do I go about formatting how the Amount is displayed. I know how to do the actual formatting (NumberFormat to local currency), but I want to know how to gain access to the cursor's value to modify it, before it pushes into the ExpandableListView. </p><p>Do I access the cursor or should I be dabbling in the SimpleCursorTreeAdapter methods?</p><p>I would appreciate any advice and direction as I'm completely stumped on this one. </p>","594874","","","","","2012-07-13 11:40:23","How to format a Cursor value in a SimpleCursorTreeAdapter for an ExpandableListView","<android><cursor><expandablelistview><simplecursoradapter>","2","2","","",""
"4954807","1","4960030","","2011-02-10 08:23:31","0","393","<p>I am using CRest to deserialize a JSON stream on Android. My first steps looks very promising.</p><p>To get the JSON stream from the server and not the XML one I use the following construct:(<code>Accept: application/json</code>)</p><pre><code>@EndPoint(""http://localhost:8080/myserver/rest"")@Param(name = ""Accept"", value = ""application/json"", dest = Destination.HEADER)    public interface VersionService {    @ConnectionTimeout(10000)    @Path(""/version"")    VersionTO getVersion();}</code></pre><p>This works but it's a bit annoying to copy the ""Param thing"" for every service. Is there a better way to configure all Services at one place only to return JSON?</p>","504184","","750613","","2012-07-13 11:40:10","2012-07-13 11:40:10","CRest / How to configure to accecpt only JSON responce","<java><android><rest>","2","0","1","",""
"4954812","1","4954826","","2011-02-10 08:24:06","1","431","<p>Do Android Market test the developer application before publishing?</p>","536091","","","","","2011-02-10 08:25:40","Do android market test the developer application before publishing?","<android><google-play>","1","1","","",""
"4954841","1","4965456","","2011-02-10 08:28:22","1","746","<p>I want to tweet a message with hyperlink to some website from my android application.I am using twitter 4j api in my android app.</p><p>i.e. For example if i post a message ""hello"" in twitter, when i click hello it should redirect to some other website. Is this possible? </p>","489762","","68805","","2011-02-10 08:48:21","2011-02-11 03:50:34","hyperlink message in twitter in android","<android><twitter-api>","1","2","","",""
"4954905","1","","","2011-02-10 08:37:03","1","478","<p>Im trying to build aosp for my devkit, and i'd like to know whereshould i look to for :</p><ol><li><ul><li>to changing font size of textsin settings section ( i've replaceddroid fonts with another one but thenew font kind large) or global fontsetting.</li></ul></li><li><ul><li>to change position of texts insettings section ( usually all textsarein left side, i want to try and put it in right side for example).</li></ul></li><li><ul><li>the language locale names  thatshowed in settings/language &amp;keyboards.. where are they stored .i looked into <code>LocalePicker.java</code> butcould not figure it out.</li></ul></li></ol><p>For example i want to change a locale name from english to it's nativelanguage (In some android builds i've seen arabic locale was in english, andsome other builds it was shown in native arabic ???????).</p>","86169","","1108213","","2012-02-06 16:34:48","2012-02-06 16:34:48","How to : customize AOSP settings?","<android><localization><android-source>","0","0","","",""
"4955061","1","4955510","","2011-02-10 09:00:43","3","904","<p>I'm working on implementing picking for an OpenGL game I'm writing for android. It's using the ""unique color"" method of drawing each touchable object as a solid color that is unique to each object. The user input then reads glReadPixels() at the location of the touch. I've gotten the coloring working, and glReadPixels working, but I have been unable to separate the ""color"" rendering from the main actual rendering, which complicated the use of glReadPixels.</p><p>Supposedly the trick to working with this is to render the second scene (for input) into an offscreen buffer, but this seems to be a bit problematic. I've investigated using OpenGL ES1.1 FBO's to act as an offscreen buffer, but it seems my handset (Samsung Galaxy S Vibrant (2.2)) does not support FBO's. I'm at a loss for how to correctly render this scene (and run glReadPixels on it) without the user witnessing it.</p><p>Any ideas how offscreen rendering of this sort can be done?</p>","408424","","44729","","2011-02-10 14:17:13","2011-03-25 15:00:06","Options for offscreen rendering on Android with OpenGL ES 1.0?","<android><opengl-es>","1","0","","",""
"4955070","1","5674756","","2011-02-10 09:01:48","2","1026","<p>I am trying to replace my default <code>arm-eabi-ld</code> with installed from <code>binutils-gold</code> <code>ld</code>, however during linking I have got</p><pre><code>(..../*.o) requires unsupported dynamic reloc; recompile with -fPIC</code></pre><p><code>LOCAL_CFLAGS := -fPIC</code> in Android.mk doesn't help very much. Is there any chance to use gold linker?</p>","338581","","422353","","2013-02-22 01:50:21","2013-02-22 01:50:21","Does binutils-gold has support for arm/Android?","<android><linux><ld><binutils><gold-linker>","1","0","5","",""
"4955105","1","","","2011-02-10 09:06:03","2","1592","<p>I want to change the background of a single item from a list. My code changes the background to all items. can you help, please? here is the code:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;RelativeLayoutxmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_height=""wrap_content""    android:layout_width=""fill_parent""    android:layout_marginRight=""95dp""    android:background=""@drawable/friend_bubble""    android:layout_below=""@id/tv_message_date""    &gt;&lt;TextView        android:id=""@+id/tv_message_text""        android:layout_height=""wrap_content""        android:layout_width=""fill_parent""        android:focusable=""true""        android:clickable=""true""        /&gt;&lt;/RelativeLayout&gt;</code></pre><p>and my java code is:</p><pre><code>@Override    public boolean onTouch(View view, MotionEvent event) {        RelativeLayout rlBubble = (RelativeLayout)view.findViewById(R.id.tv_message_text).getParent();        Drawable backgroundImage = rlBubble.getBackground();        if (event.getAction() == MotionEvent.ACTION_DOWN) {            if (backgroundImage == friendBubble ) {                rlBubble.setBackgroundDrawable(friendBubbleSelected);            } else {                rlBubble.setBackgroundDrawable(userBubbleSelected);            }        } else if (event.getAction() == MotionEvent.ACTION_UP) {            if (backgroundImage == friendBubbleSelected) {                rlBubble.setBackgroundDrawable(friendBubble);            } else {                rlBubble.setBackgroundDrawable(userBubble);            }        }        return false;    }</code></pre>","517558","","","","","2011-02-10 09:06:03","android listview item background image","<android><listview>","0","5","","",""
"4955141","1","","","2011-02-10 09:09:50","0","5798","<p><br>i'm trying to use the method setMobileDataEnabled of the ConnectivityManager class, using SDK 2.2.According to <a href=""http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/2.2.1_r1/android/net/ConnectivityManager.java/?v=source"" rel=""nofollow"">http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/2.2.1_r1/android/net/ConnectivityManager.java/?v=source</a>  this method is declared public but with @hide is not available in the SDK and in Eclipse.</p><p>In order to bypass the hiding I wrote the following function to toggle the mobile data connection on/off.</p><pre><code>public void setMobileData(boolean toBeEnabled){        Object myObj= getSystemService(CONNECTIVITY_SERVICE);         ConnectivityManager cm = (ConnectivityManager) myObj;        Class c = null;        try {            c = Class.forName(cm.getClass().getName());        } catch (ClassNotFoundException e2) {            // TODO Auto-generated catch block            e2.printStackTrace();        }        Method m = null;        try {            m = c.getDeclaredMethod(""getMobileDataEnabled"");        } catch (SecurityException e2) {            // TODO Auto-generated catch block            e2.printStackTrace();        } catch (NoSuchMethodException e2) {            // TODO Auto-generated catch block            e2.printStackTrace();        }        Object mobileDataEnabled=null;        if (m!=null){            m.setAccessible(true);            Type res_of_m=  m.getGenericReturnType();            Type[] pars_of_m=  m.getGenericParameterTypes();            try {                mobileDataEnabled = (m.invoke(cm));                if (mobileDataEnabled!=null)                    if (mobileDataEnabled.equals(!toBeEnabled)){                        Method m2 = null;                        try {                            int index=0;                            boolean method_found=false;                            Method[] available_methods= c.getDeclaredMethods();                            for (Method method : available_methods) {                                // following line doesn't work                                // method.getName()==""setMobileDataEnabled""                                 if (method.getName().contains(""setMobileDataEnabled""))                                 {                                    method_found=true;                                }                                if (method_found==false)                                     index++;                            }                            // following line doesn't work                            //m2 = c.getDeclaredMethod(""setMobileDataEnabled"");                             m2 = (c.getDeclaredMethods())[index];                            if (m2!=null){                                m2.setAccessible(true);                                m2.invoke(cm,toBeEnabled);                            }                        } catch (SecurityException e2) {                            // TODO Auto-generated catch block                            e2.printStackTrace();                        } catch (InvocationTargetException e2) {                            // TODO Auto-generated catch block                            e2.printStackTrace();                        }                    }            } catch (IllegalArgumentException e) {                // TODO Auto-generated catch block                e.printStackTrace();            } catch (IllegalAccessException e) {                // TODO Auto-generated catch block                e.printStackTrace();            } catch (InvocationTargetException e) {                // TODO Auto-generated catch block                e.printStackTrace();            }        }    }</code></pre><p>To make it working I also added the android.permission.WRITE_SECURE_SETTINGS"" in the manifest and installed in /system/app according to <a href=""http://stackoverflow.com/questions/3632449/android-add-app-to-firmware-use-write-secure-settings"">Android: Add app to firmware, use WRITE_SECURE_SETTINGS</a>.</p><p>Does anyone know a better way?</p>","601866","","","","","2012-10-27 04:39:03","Android - public method setMobileDataEnabled in ConnectivityManager not available in SDK","<android><manager><connectivity>","2","0","1","",""
"4955151","1","","","2011-02-10 09:10:41","0","677","<p>I am using the following code to enable wfi hotspot in HTC desire running Android 2.2.</p><p>Access Point(Hotspot) is created but the access point name/hotspot name/SSID is not what I specified in the code(MyWifiAP).</p><p>Anyhelp on this?</p><p><strong>CODE :</strong></p><pre><code>WifiManager wifi = (WifiManager) getSystemService(Context.WIFI_SERVICE);Method[] wmMethods = wifi.getClass().getDeclaredMethods();Log.d(TAG, ""enableMobileAP methods "" + wmMethods.length);for(Method method: wmMethods){    Log.d(TAG, ""enableMobileAP method.getName() "" + method.getName());    if(method.getName().equals(""setWifiApEnabled"")) {        WifiConfiguration netConfig = new WifiConfiguration();        netConfig.SSID = ""MyWifiAP"";        netConfig.allowedAuthAlgorithms.set(WifiConfiguration.AuthAlgorithm.OPEN);        netConfig.allowedProtocols.set(WifiConfiguration.Protocol.RSN);        netConfig.allowedProtocols.set(WifiConfiguration.Protocol.WPA);        netConfig.allowedKeyManagement.set(WifiConfiguration.KeyMgmt.NONE);        try {            Log.d(TAG, ""enableMobileAP try: "");            method.invoke(wifi, netConfig, enabled);            if (netConfig.wepKeys!=null &amp;&amp; netConfig.wepKeys.length&gt;=1)            Log.d(TAG, ""enableMobileAP key : "" + netConfig.wepKeys[0]);            Log.d(TAG, ""enableMobileAP enabled: "");            mIsWifiEnabled = enabled;        } catch (Exception e) {            Log.e(TAG, ""enableMobileAP failed: "", e);        }    }}.</code></pre>","550982","","246246","","2013-11-15 18:26:28","2013-11-15 18:26:28","Wifi hotspot name not updated on hotspot creation in desire","<android><networking><wifi>","1","1","1","",""
"4955163","1","","","2011-02-10 09:11:53","0","651","<p>My task is to clear/delete market history programmatically. I searched and found that  deleting <strong>""/data/data/com.android.vending/databases/suggestions.db""</strong> will do the task but no access to this location.</p><p>Please let me know is there any way to grant access to this location or any other way to clear market history programmatically. I dont have a rooted device.</p><p>Thanks</p>","579875","","20402","","2011-02-10 09:15:01","2012-05-03 03:29:32","Delete market history","<android>","1","2","1","",""
"4955206","1","","","2011-02-10 09:16:57","2","1925","<p>I found a solution to this somewhat at <a href=""http://stackoverflow.com/questions/3636052/html-book-like-pagination?tab=active#tab-top"">HTML book-like pagination</a> I am not being able to implement the same on the android using eclipse 3.6. The code I am using is as follows:</p><pre><code>    mWebView.setWebViewClient(new WebViewClient() {          public void onPageFinished(WebView view, String url) {                 // Column Count is just the number of 'screens' of text. Add one for partial 'screens'                int columnCount = Math.floor(view.getHeight() / view.getWidth())+1;                 // Must be expressed as a percentage. If not set then the WebView will not stretch to give the desired effect.                int columnWidth = columnCount * 100;                 String js = ""var d = document.getElementsByTagName('body')[0];"" +              ""d.style.WebkitColumnCount="" + columnCount + "";"" +              ""d.style.WebkitColumnWidth='"" + columnWidth + ""%';"";                mWebView.loadUrl(""javascript:(function(){"" + js + ""})()"");          }    });          mWebView.loadUrl(""file:///android_asset/chapter.xml""); </code></pre><p>The LogCat shows that the width and height displayed to me are 0. Am I putting it at the wrong place? Any help would be appreciated.</p><p>Thanks</p>","609497","","380579","","2011-02-10 09:20:59","2014-02-03 21:04:17","Implementing HTML book-like pagination","<android><html><xml><pagination><epub>","1","1","3","",""
"4955209","1","4955335","","2011-02-10 09:17:28","0","5364","<p>I have four EditText and two buttons namely, save and review button.</p><p>If i press the save button EditText value is stored in to the database and on clicking the review button saved value in the database is listed in ListView.</p><p>How is this done please anybody explain to me.</p><pre><code>import android.content.Context;import android.database.sqlite.SQLiteDatabase;import android.database.sqlite.SQLiteOpenHelper;import android.provider.BaseColumns;public class DatabaseHelper extends SQLiteOpenHelper {    public DatabaseHelper(Context context) {        super(context, ""MedicinePill"", null, 1);    }    @Override    public void onCreate(SQLiteDatabase db) {        db.execSQL(""CREATE TABLE IF NOT EXISTS names3 (""                + BaseColumns._ID                + "" INTEGER PRIMARY KEY AUTOINCREMENT, first VARCHAR, last VARCHAR ,dose2 VARCHAR ,dose3 VARCHAR)"");    }    @Override    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {        // Steps to upgrade the database for the new version ...    }}//this is my database class in this where i add the insert data from the databaseimport android.app.Activity;import android.os.Bundle;import android.view.View;import android.widget.Button;import android.widget.EditText;public class Medical extends Activity{    Button AddMedicine,ReviewMedicine;    EditText dose1,dose2,dose3;    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        AddMedicine = (Button)findViewById(R.id.add);        ReviewMedicine = (Button)findViewById(R.id.rev);        dose1 = (EditText)findViewById(R.id.Edit1);        AddMedicine.setOnClickListener(new View.OnClickListener() {            @Override            public void onClick(View v)            {                String s1 = dose1.getText().toString();                // TODO Auto-generated method stub            }        });    }}</code></pre><p>//and this is my activity class</p><p>how i add edittext value in to database pls any body help me!!!!!!!!</p>","555910","","567929","","2011-02-10 09:42:39","2013-01-14 05:43:22","press the save button EditText value is stored in to the database","<android><sqlite><textview><edittext>","2","0","","",""
"4955248","1","","","2011-02-10 09:20:45","0","3330","<pre><code>static final int frequency = 8000;static final int channelConfiguration = AudioFormat.CHANNEL_CONFIGURATION_MONO;  static final int audioEncoding = AudioFormat.ENCODING_PCM_16BIT;recBufSize = AudioRecord.getMinBufferSize(frequency,                   channelConfiguration, audioEncoding);  audioRecord = new AudioRecord(MediaRecorder.AudioSource.MIC, frequency,                   channelConfiguration, audioEncoding, recBufSize);File file = new File(Environment.getExternalStorageDirectory().getAbsolutePath()                      +""/reverseme.pcm"");OutputStream os = new FileOutputStream(file);BufferedOutputStream bos = new BufferedOutputStream(os);DataOutputStream dos = new DataOutputStream(bos);short[] buffer = new short[recBufSize];  audioRecord.startRecording();             while (isRecording) {                   int bufferReadResult = audioRecord.read(buffer, 0,                           recBufSize);                 for(int i = 0; i &lt; bufferReadResult;i++) {                     dos.writeShort(buffer[i]);                 }             }               audioRecord.stop();             dos.flush();             dos.close();</code></pre><p>but, open the save file(reverseme.pcm), can not play.Help me, thanks.</p>","611088","","1534123","","2012-10-26 15:53:50","2012-10-26 15:53:50","How do AudioRecord save a file (PCM.WAV)?","<android><android-audiorecord>","1","0","2","",""
"4955268","1","4955305","","2011-02-10 09:23:46","73","60171","<p>This seems simple, i am trying to set a bitmap image but from the resources i have within the application in the drawable folder.</p><pre><code> bm = BitmapFactory.decodeResource(null, R.id.image);</code></pre><p>Is this correct ?  </p>","569654","","1402846","","2013-06-30 08:33:14","2014-04-04 12:20:23","How to set a bitmap from resource","<android><bitmap>","4","0","13","",""
"4955375","1","4955423","","2011-02-10 09:36:45","2","2617","<p>I am creating an application in Android. Originally i was making it only for smartphones but now i want that same app to uspport for Android Tablet. The problem is of scaling. It is not getting scaled to the size of Tablet screen. I have used LinearLayout with height and width as fill_parent.</p>","544313","","321731","","2014-03-23 20:30:52","2014-03-23 20:30:52","Android smartPhone app support for Android Tablet","<android><tablet>","2","0","","",""
"4955549","1","4955823","","2011-02-10 09:55:03","0","2725","<p>I want to get the image from gallery.For this I used </p><pre><code>  View v= mGallery.childAt(index);   ImageView img = (ImageView) v.findViewById(R.id.img);</code></pre><p>But sometimes if that indexed images is not visible that time it is giving </p><blockquote>  <p>NullPointerException.</p></blockquote><p>How to get the non-visible image from gallery?</p>","486216","","486216","","2011-02-10 10:13:12","2012-03-14 12:23:34","how to get child Items from gallery android?","<android><image-gallery>","3","0","0","",""
"4955576","1","4955665","","2011-02-10 09:57:26","2","1453","<p>I'm new to java with C family background. I'm unable to dissect this code. If only you could help me by identifying what are the inner classes and interfaces in this block:</p> <pre><code>startButton.setOnClickListener(new View.OnClickListener(){        public void onClick(View view)        {                                               usrnameobj = (EditText)findViewById(R.id.et_usename);           usrpassobj = (EditText)findViewById(R.id.et_password);         String username = usrnameobj.getText().toString();         String password = usrpassobj.getText().toString();                 Intent i=new Intent(getApplicationContext(),AndroidXmlResource.class);        i.putExtra(""entry"",username.toString() + password.toString());        startActivityForResult(i,REQ_CODE);              }         });</code></pre><p>I can only imagine up to:</p><pre><code>startButton.setOnClickListener(new View.OnClickListener());</code></pre><p>but nothing between { }</p>","286094","","","","","2012-03-08 13:37:57","what is the parameter passing to the OnClickListener()?","<java><android>","6","2","","",""
"4955604","1","4955962","","2011-02-10 10:00:41","0","951","<p>I am building design for business app and I am stuck at layout on opening screen. Here is the source code. Here is the screen my screen <a href=""http://img121.imageshack.us/img121/3485/aaamu.jpg"" rel=""nofollow"">looks like now</a>, and <a href=""http://img163.imageshack.us/img163/1995/aaakopie.jpg"" rel=""nofollow"">here</a> I want it to look like. Still I can't find solution for this. Any help would be appreciated.</p><p></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/background""android:padding=""40dip""&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:background=""@color/background""        &gt;            &lt;ImageView                android:id=""@+id/test_image""               android:src=""@drawable/user_lock""               android:layout_width=""wrap_content""               android:layout_height=""wrap_content""             /&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/background""&gt;            &lt;EditText                android:layout_width=""fill_parent""                android:layout_height=""wrap_content""                android:hint=""@string/username""                android:maxLines=""1""                /&gt;            &lt;EditText                android:layout_width=""fill_parent""                 android:layout_height=""wrap_content""                android:hint=""@string/password""                android:password=""true""                /&gt;     &lt;TableLayout xmlns:android=""http://schemas.android.com/apk/res/android""android:layout_height=""fill_parent"" android:layout_width=""fill_parent""android:background=""@color/background""&gt;&lt;TableRow&gt;     &lt;Button    android:id=""@+id/login_button""    android:layout_width=""fill_parent""     android:layout_height=""wrap_content""    android:text=""@string/login""    android:layout_weight=""2""    /&gt;&lt;Button    android:id=""@+id/exit_button""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:text=""@string/exit""    android:layout_weight=""2""    /&gt;    &lt;/TableRow&gt;     &lt;/TableLayout&gt;    &lt;/LinearLayout&gt;    &lt;/LinearLayout&gt;&lt;/LinearLayout&gt;</code></pre><p></p>","513956","","","","","2011-02-10 10:31:35","Android - app logging screen with picture (propably layout problem)","<android>","2","4","","",""
"4955637","1","","","2011-02-10 10:03:42","0","884","<p>I'm trying to perform autocomplete with Cyrillic and English data.</p><p>If I type some search text in English everything is fine (except overall speed of jQuery  on Android), but when I try to search for something in Russian or Ukrainian the phone sticks.</p>","274577","","68805","","2011-02-10 10:23:46","2012-04-20 06:01:09","Jquery Mobile on Android - trouble with Cyrillic auto-complete","<android><autocomplete><jquery-mobile>","1","2","","",""
"4955658","1","","","2011-02-10 10:05:20","0","379","<p>HI i am developing password manager application in android......How can i generate auto user id and password for particular websites account in android for password manger application?    IN .details.... first i created database which is contain id,websites names,user id and passwordso when i enter websites names in edit text it ll save to database then how can i created auto id and password for single website name in database</p><p>so if any one  know source code for this above statement let me know..</p>","611149","","611149","","2011-02-10 12:56:22","2011-02-10 12:56:22","Password manager-auto id and password in java","<java><android>","1","0","","",""
"4955717","1","","","2011-02-10 10:10:04","0","415","<p>I want to know if there is any solution available in Android that will allow me to define an Animation by entering a set of frames to it (images), And then allow me to play from frame number x to y.</p><p>I'm currently using <strong>AnimationDrawable</strong> for frame by frame animations and it seems to lack that functionality.</p><p>Is there maybe a different Class that could help me here?</p><p>Thanks a lot!</p><p>Ita</p>","189319","","","","","2011-04-20 23:50:03","How to draw a frame by frame Animation from frame x to frame y","<android><animation>","1","0","","",""
"4955905","1","","","2011-02-10 10:26:17","7","2295","<p>First of all, I would like to refer to this <a href=""http://code.google.com/p/zxing/issues/detail?id=178"" rel=""nofollow"">Issue</a> on the google groups. </p><p>My problem is i want the landscape-native app to work in portrait mode. The way of getting the app into portrait mode is no problem at all, but when you display the app in portrait mode, my problem occurs.</p><p>When the Barcode Scanner is starting op, its camera view is (pr. default) at a +90 degree angle. When viewing the app in portrait mode the Barcode Scanner is (naturally) still at a +90 degree angle. </p><p>In the referred Issue-page there is displayed a hack to get around the problem, but this does not seem to work on most devices. This does also not work on my targeted devices.</p><p>I would like to hear if some of you have got a work around, or found the place in the source where you can 'undo' the 90 degree flipping? </p><p>A usable answer will be utmost appriciated :D Unfortunately i can't make progress in the project before this is solved. It is demanded to run in portrait mode ;)</p><p>In advance ... Thanks :)</p>","587566","","499702","","2011-09-23 08:25:01","2011-09-23 11:48:21","Zxing - Changing camera view -90 degrees","<android><zxing><android-camera>","1","0","4","",""
"4955948","1","","","2011-02-10 10:30:12","0","1875","<p>I am building an application which performs 3 tasks concurrently.-></p><ol><li><p>Listening to new devices.</p></li><li><p>A proxy to interact with the device in real-time.</p></li><li><p>A set of business Logic to be run on the data provided by the device proxies.</p></li><li><p>And of couse a Main UI (thread)</p></li></ol><p>I want task 1,2 and 3 to run even when the application is in the <strong>background</strong>.</p><p>What should be done?</p><ol><li><p>Using 3 services, one for each.. (apparently not practical).</p></li><li><p>Can a single service support all the tasks.( one service with multiple threads sort of design)?</p></li></ol><p>Please help.</p><p>Basically, What i intend to ask is that is a model available to perform all 3 tasks even if the application is in the <strong>background</strong>? If service is the answer, how can it be implemented in an efficient way without putting too much load on the system i.e. using 3 services?</p>","611190","","611190","","2011-02-14 05:13:42","2012-02-20 15:38:58","Android: Single service with multiple threads","<android><service>","3","0","","",""
"4955968","1","","","2011-02-10 10:32:19","2","372","<p>I am using media player to play the sound in the pacman game. whenever it plays the sound then it will give following error.</p><p><strong>Unable to resync. Signalling end of stream</strong></p><p>I want to ask why this type of error comes. Is there any memory problem regarding this and how can i solve this problem. when i do volume up or down then device is restarted whenever sound is played i don't know why. Please help</p><p>Thanks and RegardsAmit Thaper</p>","339116","","","","","2011-02-10 10:32:19","Syncronisation problem in android","<android><exception-handling><media-player>","0","2","","",""
"4956077","1","","","2011-02-10 10:44:04","1","1517","<p>I'm developing a android application for a customer which involves capturing data on the handset and then synchronizing it later to a server. They want me to use Funambol server and client to sync data. I have tried looking up on the www.funambol.com website for any api and documentation, but am not able to find any library for android.</p><p>Has anyone done any similar work using funambol? I need to sync a list of customers and their related data which will be entered by a salesman.</p><p>Thanks</p>","161633","","","","","2011-02-11 11:46:32","How does Funambol work?","<android><funambol>","2","0","","",""
"4956112","1","","","2011-02-10 10:48:37","1","1649","<p>Hi I want to post a ArrayList with the namevaluepairs from my androidapp. </p><p>It seems that the only way to this is to post a String. Whats the solution?</p><pre><code>public JsonUpdateBrands(ArrayList&lt;Integer&gt; selectedIds, String userid,        String webpage) {    super();    ArrayList&lt;NameValuePair&gt; nameValuePairs = new ArrayList&lt;NameValuePair&gt;();           nameValuePairs.add(new BasicNameValuePair(""serviceId"", selectedIds));    nameValuePairs.add(new BasicNameValuePair(""userId"", userid));    nameValuePairs.add(new BasicNameValuePair(""action"", ""Subscription""));    progress(nameValuePairs, webpage);}</code></pre>","511895","","","","","2011-02-10 11:00:18","basicnamevaluepairs with arraylist","<android>","1","0","","",""
"4956116","1","4964366","","2011-02-10 10:49:14","1","680","<p>i am integrating the twitter in to my android application. and it logins me successfully on twitter but i do not know how to get the tweets and statuses from that so i can show it in my application. here is my code.</p><pre><code>String CONSUMER_KEY = ""XXXXXXXXXXXXXXX"";           String CONSUMER_SECRET = ""YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY"";           try {               twitter = new TwitterFactory().getInstance();               twitter.setOAuthConsumer(CONSUMER_KEY, CONSUMER_SECRET);               requestToken = twitter.getOAuthRequestToken();               AccessToken accessToken = null;               String url = requestToken.getAuthorizationURL();               Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));               startActivity(intent);                                            }           catch (TwitterException e){               e.printStackTrace();           }  </code></pre><p>any help will be appreciated.</p>","397901","","","","","2011-02-11 00:28:35","integrating twitter in my android application","<android><twitter><tweets>","2","0","1","",""
"4956118","1","4956344","","2011-02-10 10:49:34","1","744","<p>I have a sample program for paint.</p><pre><code>          package deck_flight.com;          import android.app.Activity;          import android.content.Context;          import android.graphics.*;          import android.os.Bundle;          import android.view.Menu;          import android.view.MenuItem;          import android.view.MotionEvent;          import android.view.View;      public class paint extends  Activity      {      @Override   protected void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(new MyView(this));    mPaint = new Paint();    mPaint.setAntiAlias(true);    mPaint.setDither(true);    mPaint.setColor(0xFFFF0000);    mPaint.setStyle(Paint.Style.STROKE);    mPaint.setStrokeJoin(Paint.Join.ROUND);    mPaint.setStrokeCap(Paint.Cap.ROUND);    mPaint.setStrokeWidth(12);    mEmboss = new EmbossMaskFilter(new float[] { 1, 1, 1 },                                   0.4f, 6, 3.5f);    mBlur = new BlurMaskFilter(8, BlurMaskFilter.Blur.NORMAL);}private Paint       mPaint;private MaskFilter  mEmboss;private MaskFilter  mBlur;private Canvas  mCanvas;private Path    mPath;private Bitmap  mBitmap;private Paint   mBitmapPaint;public void colorChanged(int color) {    mPaint.setColor(color);}public class MyView extends View {    private static final float MINP = 0.25f;    private static final float MAXP = 0.75f;    public MyView(Context c) {        super(c);        mBitmap = Bitmap.createBitmap(800, 480, Bitmap.Config.ARGB_8888);        mCanvas = new Canvas(mBitmap);        mPath = new Path();        mBitmapPaint = new Paint(Paint.DITHER_FLAG);    }    @Override    protected void onSizeChanged(int w, int h, int oldw, int oldh) {        super.onSizeChanged(w, h, oldw, oldh);    }    @Override    protected void onDraw(Canvas canvas) {        canvas.drawColor(0xFFAAAAAA);        canvas.drawBitmap(mBitmap, 0, 0, mBitmapPaint);        canvas.drawPath(mPath, mPaint);    }    private float mX, mY;    private static final float TOUCH_TOLERANCE = 4;    private void touch_start(float x, float y) {        mPath.reset();        mPath.moveTo(x, y);        mX = x;        mY = y;    }    private void touch_move(float x, float y) {        float dx = Math.abs(x - mX);        float dy = Math.abs(y - mY);        if (dx &gt;= TOUCH_TOLERANCE || dy &gt;= TOUCH_TOLERANCE) {            mPath.quadTo(mX, mY, (x + mX)/2, (y + mY)/2);            mX = x;            mY = y;        }    }    private void touch_up() {        mPath.lineTo(mX, mY);        // commit the path to our offscreen        mCanvas.drawPath(mPath, mPaint);        // kill this so we don't double draw        mPath.reset();    }    @Override    public boolean onTouchEvent(MotionEvent event) {        float x = event.getX();        float y = event.getY();        switch (event.getAction()) {            case MotionEvent.ACTION_DOWN:                touch_start(x, y);                invalidate();                break;            case MotionEvent.ACTION_MOVE:                touch_move(x, y);                invalidate();                break;            case MotionEvent.ACTION_UP:                touch_up();                invalidate();                break;        }        return true;    }}private static final int COLOR_MENU_ID = Menu.FIRST;private static final int EMBOSS_MENU_ID = Menu.FIRST + 1;private static final int BLUR_MENU_ID = Menu.FIRST + 2;private static final int ERASE_MENU_ID = Menu.FIRST + 3;private static final int SRCATOP_MENU_ID = Menu.FIRST + 4;@Overridepublic boolean onCreateOptionsMenu(Menu menu) {    super.onCreateOptionsMenu(menu);    menu.add(0, COLOR_MENU_ID, 0, ""Color"").setShortcut('3', 'c');    menu.add(0, EMBOSS_MENU_ID, 0, ""Emboss"").setShortcut('4', 's');    menu.add(0, BLUR_MENU_ID, 0, ""Blur"").setShortcut('5', 'z');    menu.add(0, ERASE_MENU_ID, 0, ""Erase"").setShortcut('5', 'z');    menu.add(0, SRCATOP_MENU_ID, 0, ""SrcATop"").setShortcut('5', 'z');    /****   Is this the mechanism to extend with filter effects?    Intent intent = new Intent(null, getIntent().getData());    intent.addCategory(Intent.CATEGORY_ALTERNATIVE);    menu.addIntentOptions(                          Menu.ALTERNATIVE, 0,                          new ComponentName(this, NotesList.class),                          null, intent, 0, null);    *****/    return true;}@Overridepublic boolean onPrepareOptionsMenu(Menu menu) {    super.onPrepareOptionsMenu(menu);    return true;}@Overridepublic boolean onOptionsItemSelected(MenuItem item) {    mPaint.setXfermode(null);    mPaint.setAlpha(0xFF);    switch (item.getItemId()) {        case COLOR_MENU_ID:           // new ColorPickerDialog(this, this, mPaint.getColor()).show();            return true;        case EMBOSS_MENU_ID:            if (mPaint.getMaskFilter() != mEmboss) {                mPaint.setMaskFilter(mEmboss);            } else {                mPaint.setMaskFilter(null);            }            return true;        case BLUR_MENU_ID:            if (mPaint.getMaskFilter() != mBlur) {                mPaint.setMaskFilter(mBlur);            } else {                mPaint.setMaskFilter(null);            }            return true;        case ERASE_MENU_ID:            mPaint.setXfermode(new PorterDuffXfermode(                                                    PorterDuff.Mode.CLEAR));            return true;        case SRCATOP_MENU_ID:            mPaint.setXfermode(new PorterDuffXfermode(                                                PorterDuff.Mode.SRC_ATOP));            mPaint.setAlpha(0x80);            return true;    }    return super.onOptionsItemSelected(item);  }    @Override     public void onResume(){   super.onResume();   mCanvas.drawPath(mPath, mPaint);    }}</code></pre><p>the sample program is working good.Once I draw it draws the line.What I want is once I come out of the application the content which I have drawn should be there in the canvas.But I amnot able to get the content which I drawn previously.What is the error in this code.Help me Please.Thanks in advance.</p>","366916","","","","","2011-02-10 11:35:13","Android-onResume() in Paint","<android>","1","0","","",""
"4956124","1","5006137","","2011-02-10 10:50:33","0","1214","<p>I have an expandable list with groups and childrens. Each child is of TableRow class holding image, text and another image. Its width is less than group width which leads to offset before and after child row.The problem is when touching the child, offset area turns to selected and actual child area stays untouched. I need an opposite effect when only child area being selected.</p>","611206","","","","","2011-02-15 16:08:02","Expandable list child selection problem in Android","<android><expandablelistadapter>","1","0","1","",""
"4956262","1","5023672","","2011-02-10 11:05:12","1","584","<p>I’ve been googling for a couple of days now! I’m looking at a way of integrating simple mail functions into my android app. A few people have suggested looking at K9 which I have done. This is obviously a fully featured mail client and has far more functionality than I need. I wanted to know whether there was a way using Android API's to connect and retrieve mail?</p><p>Any responses greatly appreciated!</p>","571611","","","","","2012-12-08 07:19:14","How to retrive email from MS Exchange server on Android","<exchange-server><android>","2","0","","",""
"4956263","1","4956668","","2011-02-10 11:05:15","0","66","<p>Database is created in Iphone using SQLite.Now I want to use same database file in Android and insert the data into tables.How to do that?</p><p>Android Developer</p>","486216","","","","","2011-02-10 11:45:39","how to open Iphone's database(created) in Android?","<android>","1","2","0","",""
"4956269","1","4959704","","2011-02-10 11:05:43","1","916","<p>Doubtless this is caused by my decidedly unorthodox layout - I have buttons in a LinearLayout in an Activity which is placed by an ActivityGroup into a Gallery. The ActivityGroup is also the adapter implementation and the over-all effect is full-screen sliding, snapping panels.</p><p>This is working (a treat, actually) except that a touch event on the parent layout puts all the buttons into the pressed state (and any release removes the state). A touch on an individual button is only delivered to that button.</p><p>The buttons are not receiving any events, they're only changing state.</p><p>Have I done something obviously wrong? Is this a known bug and is there a work-around?</p><p>Any insights would be very much appreciated.</p>","597013","","","","","2011-05-13 09:18:22","One touch event puts all child views into pressed state","<android><events><view><touch>","1","0","","",""
"4956274","1","","","2011-02-10 11:06:02","0","567","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/4951865/whats-wrong-with-this-encryption-code-in-android"">what&#39;s wrong with this encryption code in android?</a>  </p></blockquote><pre><code>public String Encryption(String toEncrypt) throws Exception{        Security.addProvider(new org.bouncycastle.jce.provider.BouncyCastleProvider());        EditText et = (EditText) findViewById(R.id.entry);        byte[] input = toEncrypt.getBytes();        byte[] keyBytes = ""hello"".getBytes();        //et.setText(""in encryption"");        SecretKeySpec key = new SecretKeySpec(keyBytes, ""AES"");        Cipher cipher = Cipher.getInstance(""AES/ECB/PKCS7Padding"", ""BC"");        //et.setText(""in encryption"");        cipher.init(Cipher.ENCRYPT_MODE, key);        et.setText(""in encryption"");        byte[] cipherText = new byte[cipher.getOutputSize(input.length)];        int ctLength = cipher.update(input, 0, input.length, cipherText, 0);        ctLength += cipher.doFinal(cipherText, ctLength);        //et.setText(""in encryption"");        //return ""abc"";        return cipherText.toString();}</code></pre><p>There appears to be some kind of an error at the line <code>(cipher.init(Cipher.ENCRYPT_MODE, key);)</code>. </p><p>Can somebody tell me what's wrong with this line of code?</p>","600910","","68805","","2011-02-10 11:12:59","2011-02-10 11:12:59","what's wrong with this encryption code in android?","<android><encryption>","0","5","","2011-02-10 12:18:14",""
"4956357","1","","","2011-02-10 11:14:16","3","2878","<p>I am working on an android application where i need to show many offices of an organization on map. I am using web service to bring this data and populate place markers on map. I have used MapActivity , MapView and Itemized overlays and its all working good.</p><p>The disadvantage of this approach is that i don't get additional useful menu options which comes when i use map inbuilt application. I know how to invoke and use Intent to launch goggle maps from application but facing some constraints regarding adding multiple markers using my location's data. I use following code to add a place marker on specific latitude and longitude.</p><pre><code> Intent searchAddress = new Intent(Intent.ACTION_VIEW,                    Uri.parse(""geo:0,0?q=48.19858,16.37164 (My Place)"")); startActivity(searchAddress);</code></pre><p>I have more than once location data (latitude , longitude and description) which i need to add as place marker or pin on the map. GEO URI scheme used to invoke maps inbuilt app doesn't give enough flexibility to add more than one marker.following are possible geo URIs.</p><pre><code>a) geo:latitude,longitudeb) geo:latitude,longitude?z=zoomc) geo:0,0?q=my+street+addressd) geo:0,0?q=business+near+city</code></pre><ol><li><p>None of these URI schemes allows me to add more than once location pin or marker on the map. Can anybody share their experience on how they added multiple place markers on invoked inbuilt map application using application data ?</p></li><li><p>Is is true that MapActivity is the more efficient solution for such situations ? I believe it would be better to use inbuilt apps allowing more options to user of android and flexibility.</p></li></ol>","611248","","68805","","2011-02-10 11:24:21","2013-03-13 12:29:01","How to use built-in google map application to display many place markers based on data","<android><google-maps>","1","0","","",""
"4956440","1","","","2011-02-10 11:22:34","3","655","<p>We all <a href=""http://stackoverflow.com/questions/4637309/android-sqlite-leaving-connection-open"">learn</a> that resources, such as database connections, should be acquired late and released early. </p><p>Yet applying this principle to SQLite database connections on Android have caused me some headache. </p><p>I have an app that download updates from a backend server in a service working in the background, writing updates to the database at a regular basis. The problem I experience arise when the following sequence occurs:</p><ol><li>Service opens a writable database connection</li><li>Some activity opens a readable database connection</li><li>Service closes its database connection <strong>concurrently</strong> with the activity reading data</li><li>Activity fails due to its database connection was closed</li></ol><p>Both the service and the activity uses the same <a href=""http://developer.android.com/reference/android/database/sqlite/SQLiteOpenHelper.html"" rel=""nofollow""><code>SQLiteOpenHelper</code></a> class, though different instances, to open their connections. My initial assumption was that this should work just fine, but somehow it seems that the underlying connection is shared between the two database instances.</p><p>To work around the problem I ended up <strong>not closing</strong> the database objects, only closing any opened cursors. This seems to work, though I'm not sure that I'm not leaking memory here.</p><p>Is there something obvious I am missing here?</p>","35245","","135152","","2011-05-25 02:57:00","2011-05-25 02:57:00","Closing an SQLite database on one thread breaks the database opened on another thread","<android><multithreading><sqlite>","1","7","2","",""
"4956472","1","","","2011-02-10 11:25:45","0","230","<p>I have two types of views namely, Text View and Grid View, in an activity. When i'm in Grid View and if i press 'back' button i have to get the focus in text view and continue the functions so that i can again access grid view. Again if i press 'back ' button when i'm in text view i need to finish my activity. I'm able to do this when i give .setOnKeyListener() to my gridview. But the focus in grid view is lost when this is done.So, how is it possible to exit from grid view and be in text view? </p>","606335","","","","","2011-02-10 11:45:49","Finishing of an activity","<android><android-layout><android-custom-view><android-gridview><android-textview>","1","0","","",""
"4956485","1","","","2011-02-10 11:26:43","0","168","<p>This is a very general question, i would solve it myself if i had a device on me.Does the facebook app (for IPhone and similar question regarding the Android platform) has non-native features in it, or is it completely local, meaning operating entirely on the device?</p>","611269","","","","","2011-02-10 16:32:40","Does the Facebook application has non-native features?","<iphone><android><facebook><native>","1","4","","",""
"4956555","1","","","2011-02-10 11:31:59","1","882","<p>I'm playing around with HTML5 canvas and bumped into something which I believe is a performance issue on Android browser (and/or JavaScript implementation).</p><p>I'm implementing a freehand sketch web application where user can draw using his finger - have a look at draft on <a href=""http://www.matkakuume.net/freehand.html"" rel=""nofollow"">http://www.matkakuume.net/freehand.html</a>. The implementation itself works fine but it doesn't seem to keep up when finger is moved rapidly. For example when drawing a circle the end result looks more like a polygon (which it effectively is supposed to be, but I was kinda hoping there would be more angles...)</p><p>As mentioned, this is an Android related problem as the implementation works fine on desktop and on iPhone. I've explained to myself that when user moves the finger on screen the ontouchmove events are not triggered rapidly enough to render the path smoothly.</p><p>Can someone guarantee that this is the case or am I on the wrong tracks here?</p>","611281","","","","","2012-01-20 08:15:30","Low ontouchmove interval on Android browser?","<javascript><android><html5><canvas>","1","0","","",""
"4956559","1","4956628","","2011-02-10 11:33:02","2","4766","<p>I want to play YouTube video in WebView or</p><p>When user click on youtube video I have to forward it to real YouTube app because in WebView I am not able to play YouTube video.</p><p>Is there any way to play a YouTube video in our WebView?</p>","510491","","469983","","2012-05-02 11:09:49","2012-05-02 11:09:49","Android play youtube video in webview","<android><youtube><webview><android-webview>","2","0","2","",""
"4956604","1","4962358","","2011-02-10 11:38:59","0","897","<p>I'm trying to do a ajax loader but it's not working in Android 1.5, this version doesn't support gif files.</p><p>Any sugestion? Thanks.</p>","574419","","881229","","2013-12-12 06:03:58","2013-12-12 06:03:58","Android ajax loader","<android><jquery><animation><android-canvas><loader>","2","0","","",""
"4956671","1","","","2011-02-10 11:46:00","0","400","<p>I have a scoring app. Scores are added to rows and it has been up and going for months now. I have a new feature which screen captures and uploads to facebook. The problem is, the dialog is too fast and the notifyDataSetChanged() has not updated the UI yet before the screen capture.</p><p>Anyone have input on the delay of notifyDataSetChanged() and how to get around this? Thanks!</p>","491044","","","","","2011-02-10 11:46:00","notifyDataSetChanged() not fast enough before dialog","<android><listview>","0","2","0","",""
"4956677","1","","","2011-02-10 11:46:37","2","511","<p>I'm going to create an activity that shows statistic. I planned to have a TabHost with two tabs, the first one displays data in a table and the second tab displays a js diagram of the same data using a webview.So, since they share the same data and everything, I thought the easist way would be to create one activity/class and then play with the views. However, I would be delighted to get some good examples for how to do this. All I find is how it's done the opposite way, with separate activities.</p><p>Regards</p>","498112","","","","","2011-09-22 16:49:55","android tabhost same activity","<android><android-tabhost>","1","0","","",""
"4956699","1","4956798","","2011-02-10 11:49:31","54","18801","<p>I want to know how to parse the AndroidManifest.xml file in order to get the Application Version Number through code. <strong><em>android:versionName</em></strong></p>","548218","","592025","","2013-04-22 08:51:40","2014-01-08 14:24:04","Get AndroidManifest.xml Content in code","<android><android-manifest>","3","0","15","",""
"4956749","1","4959944","","2011-02-10 11:54:31","2","532","<pre><code>zipalign -v 4 input.apk output.apk</code></pre><p>several times for my changing application and the corresponding md5 from both input and output has always been the same, so they're the very same file. Isn't this tool suppose to perform certain optimizations, hence modify the file ?</p>","253944","","","","","2011-02-10 16:38:37","zipalign doesn't change the apk file","<android><optimization>","1","0","","",""
"4956813","1","","","2011-02-10 12:02:52","2","1987","<p>I'm trying to show rtsp stream from an Axis camera into a mediaplayer object, here the code:</p><pre><code>public class Rtsp extends Activity {String PATH_TO_STREAM = ""rtsp://192.168.131.21/mpeg4/1/media.3gp"";private VideoView video;private MediaController ctlr;@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    video=(VideoView)findViewById(R.id.video);    ctlr=new MediaController(this);    ctlr.setAnchorView(video);    Uri videoUri = Uri.parse(PATH_TO_STREAM);    video.setMediaController(ctlr);    video.setVideoURI(videoUri);    video.start();}}</code></pre><p>I can correctly stream with the VLC but I get this error with Android:</p><pre><code>02-10 11:58:07.071: ERROR/PlayerDriver(31): Command PLAYER_PREPARE completed with an error or info PVMFErrResourceConfiguration02-10 11:58:07.101: ERROR/MediaPlayer(432): error (1, -16)02-10 11:58:07.101: ERROR/MediaPlayer(432): Error (1,-16)02-10 11:58:07.101: DEBUG/VideoView(432): Error: 1,-1602-10 11:58:07.121: WARN/PlayerDriver(31): PVMFInfoErrorHandlingComplete02-10 11:58:07.711: WARN/InputManagerService(60): Starting input on non-focused client com.android.internal.view.IInputMethodClient$Stub$Proxy@43bfce30 (uid=10007 pid=106)02-10 11:58:12.902: DEBUG/dalvikvm(106): GC freed 2635 objects / 150552 bytes in 314ms</code></pre><p>Any hint? Thanks</p>","479096","","","","","2012-03-07 09:53:29","Get rtsp stream from Axis camera on Android","<android><rtsp><ip-camera>","1","1","1","",""
"4956834","1","5598423","","2011-02-10 12:04:55","2","477","<p>I am trying to port an app from javaME to Android.I have a part where graphics class is used.</p><p>I have used J2ME Android bridge (<a href=""http://www.assembla.com/wiki/show/j2ab/Converting_From_J2ME/8"" rel=""nofollow"">http://www.assembla.com/wiki/show/j2ab/Converting_From_J2ME/8</a>) to gain access to Graphics class. Im still missing some of the methods such as:</p><ul><li>getStrokeStyle()</li><li>setStrokeStyle()</li><li>drawRGB()</li><li>fillTriangle()</li></ul><p>Also how do i use Vector?</p><p>example: <code>Vector polylines = g.getPolylines();</code></p>","281092","","996493","","2012-04-18 03:53:22","2012-04-18 03:53:22","Porting JavaME to Android","<java><android><java-me><j2ab>","2","0","1","",""
"4956869","1","","","2011-02-10 12:08:06","0","1114","<p>I have a <code>ListView</code> that displays all my phone numbers.I have a search filter capability that simply re-queries and attaches a new adapter to my list view.</p><p>The trouble I'm having is that the old list is still visible on the screen and my new result seems to overlay on it. If I leave the screen and come back everything is fine.</p><p>I've tried calling <code>lv.invalidate()</code>, <code>lv.refreshDrawableState</code>, <code>adapter.notifyDataStateChanged()</code>, <code>adapter.notifyDataSetInvalid()</code> and nothing seems to work. I don't think I have this issue when i was using a <code>ListActivity</code>.</p><p>Does anyone know whats going on here?Below is my code that run the query and sets the adapter to the <code>ListView</code></p><pre><code>            public void onTextChanged(CharSequence s, int start, int before,                                  int count) {            Cursor c = query(Data.DATA1 + "" IS NOT NULL AND "" + Data.MIMETYPE + ""=? AND "" + Phone.DISPLAY_NAME + "" LIKE ?"",                    new String[]{String.valueOf(Phone.CONTENT_ITEM_TYPE), ""%"" + search.getText().toString() + ""%""},                    Data.TIMES_CONTACTED + "" DESC""            );            startManagingCursor(c);            mAdapter = new EfficientAddressBookAdapter(WaddleAddressBook.this, c);            lv.setAdapter(mAdapter);        }</code></pre><p>The query method is as follows:</p><pre><code>    private Cursor query(String query, String[] params, String order) {    lastQuery = query;    lastOrder = order;    lastParams = params;    return getContentResolver().query(Phone.CONTENT_URI,            new String[]{Data.DISPLAY_NAME, Data._ID, Data.DATA1, Data.TIMES_CONTACTED, Data.LOOKUP_KEY, Data.CONTACT_ID, Phone.TYPE},            query,            params,            order);}</code></pre><p>Any help will be appreciated.The code for the address book and adapter are below:</p><p>Address Book:</p><pre><code>public class WaddleAddressBook extends Activity {/** * Called when the activity is first created. */protected static final int CONTEXT_ADD = 0;protected static final int CONTEXT_EDIT = 1;protected static final int CONTEXT_DELETE = 2;private ListAdapter mAdapter;private static final int PICK_CONTACT = 3;private static final int DELETE_CONTACT = 4;private static final int ADD_CONTACT = 5;private static final int EDIT_CONTACT = 6;private static final int DIAL_CONTACT = 7;private static final int SMS_CONTACT = 8;private GestureDetector gestureDetector;private View.OnTouchListener gestureListener;ListView lv;LinearLayout ll;EditText search;int textlength = 0;/** * Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    lv = (ListView) findViewById(R.id.contacts);    ll = (LinearLayout) findViewById(R.layout.main);    Cursor c = query(Data.DATA1 + "" IS NOT NULL AND "" + Data.MIMETYPE + ""=?"",            new String[]{String.valueOf(Phone.CONTENT_ITEM_TYPE)},            Data.TIMES_CONTACTED + "" DESC""    );    startManagingCursor(c);    mAdapter = new EfficientAddressBookAdapter(this, c);    lv.setAdapter(mAdapter);    lv.setOnItemClickListener(new AdapterView.OnItemClickListener() {        public void onItemClick(AdapterView&lt;?&gt; adapterView, View view, int i, long l) {            Toast.makeText(WaddleAddressBook.this, ""This should select item"", Toast.LENGTH_SHORT).show();            onListItemClick(adapterView, view, i, l);        }    });    gestureDetector = new GestureDetector(new ListItemGestureDetector(this));    gestureListener = new View.OnTouchListener() {        public boolean onTouch(View v, MotionEvent event) {            if (gestureDetector.onTouchEvent(event)) {                return true;            }            return false;        }    };    lv.setOnTouchListener(gestureListener);    lv.setOnCreateContextMenuListener(new View.OnCreateContextMenuListener() {        public void onCreateContextMenu(ContextMenu contextMenu, View view, ContextMenu.ContextMenuInfo contextMenuInfo) {            contextMenu.setHeaderTitle(""Actions"");            contextMenu.add(0, CONTEXT_ADD, 0, ""Add New Contact"");            contextMenu.add(0, CONTEXT_EDIT, 0, ""Edit Selected Contact"");            contextMenu.add(0, CONTEXT_DELETE, 0, ""Delete Selected Contact"");            /* Add as many context-menu-options as you want to. */        }    });    search = (EditText) findViewById(R.id.search);    search.addTextChangedListener(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) {            Cursor c = query(Data.DATA1 + "" IS NOT NULL AND "" + Data.MIMETYPE + ""=? AND "" + Phone.DISPLAY_NAME + "" LIKE ?"",                    new String[]{String.valueOf(Phone.CONTENT_ITEM_TYPE), ""%"" + search.getText().toString() + ""%""},                    Data.TIMES_CONTACTED + "" DESC""            );            startManagingCursor(c);            mAdapter = new EfficientAddressBookAdapter(WaddleAddressBook.this, c);            lv.setAdapter(mAdapter);        }    });}// ===========================================================// Methods from SuperClass/Interfaces// ===========================================================@Overridepublic boolean onContextItemSelected(MenuItem aItem) {    AdapterView.AdapterContextMenuInfo menuInfo = (AdapterView.AdapterContextMenuInfo) aItem.getMenuInfo();    Intent intent = null;    Cursor c = (Cursor) lv.getAdapter().getItem(menuInfo.position);    /* Switch on the ID of the item, to get what the user selected. */    switch (aItem.getItemId()) {        case CONTEXT_ADD:            intent = new Intent(Intent.ACTION_INSERT);            intent.setType(Contacts.CONTENT_TYPE);            startActivityForResult(intent, ADD_CONTACT);            break;        case CONTEXT_EDIT:            intent = new Intent(Intent.ACTION_EDIT);            intent.setType(Contacts.CONTENT_TYPE);            intent.setData(Uri.withAppendedPath(Contacts.CONTENT_URI, c.getString(CONTACT_ID)));            startActivityForResult(intent, EDIT_CONTACT);            break;        case CONTEXT_DELETE:            getContentResolver().delete(Data.CONTENT_URI, Data._ID + ""=?"", new String[]{c.getString(DATA_ID)});            refresh();            break;        default:            break;    }    return false;}//@Overrideprotected void onListItemClick(AdapterView l, View v, int position, long id) {    //    super.onListItemClick(l, v, position, id);    Intent i = null;    Cursor c = (Cursor) mAdapter.getItem(position);    //int columnIndex = c.getColumnIndex(ContactsContract.Contacts._ID);    if (false) {        i = new Intent(Intent.ACTION_CALL);        String phoneNumber = c.getString(DATA_ID);        i.setData(Uri.withAppendedPath(ContactsContract.CommonDataKinds.Phone.CONTENT_URI, phoneNumber));        startActivity(i);    } else {        //if no primary number selected then show contact and let them select.        i = new Intent(Intent.ACTION_VIEW);        i.setData(Uri.withAppendedPath(ContactsContract.Contacts.CONTENT_URI, c.getString(CONTACT_ID)));        startActivityForResult(i, PICK_CONTACT);    }}@Overridepublic 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, new String[]{Contacts.DISPLAY_NAME}, null, null, null);                if (c.moveToFirst()) {                    // other data is available for the Contact.  I have decided                    //    to only get the name of the Contact.                    String name = c.getString(0);                }                refresh();            }            break;        case (DIAL_CONTACT):        case (SMS_CONTACT):        case (EDIT_CONTACT):        case (ADD_CONTACT):        case (DELETE_CONTACT):            if (resultCode == Activity.RESULT_OK) {                refresh();            }    }}String lastQuery = null;String lastOrder = null;String[] lastParams = null;private Cursor query(String query, String[] params, String order) {    lastQuery = query;    lastOrder = order;    lastParams = params;    return getContentResolver().query(Phone.CONTENT_URI,            new String[]{Data.DISPLAY_NAME, Data._ID, Data.DATA1, Data.TIMES_CONTACTED, Data.LOOKUP_KEY, Data.CONTACT_ID, Phone.TYPE},            query,            params,            order);}private void refreshQuery() {    Cursor c = query(lastQuery, lastParams, lastOrder);    startManagingCursor(c);    mAdapter = new EfficientAddressBookAdapter(WaddleAddressBook.this, c);    lv.setAdapter(mAdapter);}private void refresh() {    ((EfficientAddressBookAdapter) mAdapter).requery();    ((EfficientAddressBookAdapter) mAdapter).notifyDataSetChanged();    lv.refreshDrawableState();}public static final int DISPLAY_NAME = 0;public static final int DATA_ID = 1;public static final int PHONE_NO = 2;public static final int TIMES_CONTACTED = 3;public static final int LOOKUP_KEY = 4;public static final int CONTACT_ID = 5;public static final int CONTACT_TYPE = 6;///////////////////////////////////////////////////////////////InnerClass CLASS GestureDetector LISTENER////////////////////////////////////////////////////////////class ListItemGestureDetector extends GestureDetector.SimpleOnGestureListener {    private static final int SWIPE_MIN_DISTANCE = 120;    private static final int SWIPE_MAX_OFF_PATH = 250;    private static final int SWIPE_THRESHOLD_VELOCITY = 200;    private Context context;    public ListItemGestureDetector(Context context) {        this.context = context;    }    @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) {                Toast.makeText(context, ""Swipe Left Detected: SMSing"", Toast.LENGTH_SHORT).show();                Cursor c = (Cursor) mAdapter.getItem(lv.pointToPosition((int) e1.getX(), (int) e1.getY()));                String phoneNumber = c.getString(PHONE_NO);                Intent intent = new Intent(Intent.ACTION_VIEW);                intent.putExtra(""address"", phoneNumber);                intent.setType(""vnd.android-dir/mms-sms"");                startActivityForResult(intent,SMS_CONTACT);            } else if (e2.getX() - e1.getX() &gt; SWIPE_MIN_DISTANCE &amp;&amp; Math.abs(velocityX) &gt; SWIPE_THRESHOLD_VELOCITY) {                Toast.makeText(context, ""Swipe Right Detected: Calling"", Toast.LENGTH_SHORT).show();                Cursor c = (Cursor) mAdapter.getItem(lv.pointToPosition((int) e1.getX(), (int) e1.getY()));                Intent i = new Intent(Intent.ACTION_CALL);                String phoneNumber = c.getString(DATA_ID);                i.setData(Uri.withAppendedPath(ContactsContract.CommonDataKinds.Phone.CONTENT_URI, phoneNumber));                startActivityForResult(i,DIAL_CONTACT);            }        } catch (Exception e) {            // nothing        }        return true;    }}</code></pre><p>}</p><p>Adapter:</p><pre><code>class EfficientAddressBookAdapter extends BaseAdapter {private LayoutInflater mInflater;private Bitmap mIcon1;private Cursor c;private Context context;public EfficientAddressBookAdapter(Context context, Cursor c) {    // Cache the LayoutInflate to avoid asking for a new one each time.    mInflater = LayoutInflater.from(context);    this.context = context;    // Icons bound to the rows.    mIcon1 = BitmapFactory.decodeResource(context.getResources(), R.drawable.icon);    this.c = c;}/** * 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 c.getCount();}/** * 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) {    if (c.moveToPosition(position)) {        return c;    }    return null;}/** * Use the array index as a unique id. * * @see android.widget.ListAdapter#getItemId(int) */public long getItemId(int position) {    Cursor c = (Cursor) getItem(position);    return c.getLong(1);}@Overridepublic boolean areAllItemsEnabled() {    return true;}public void requery() {    c.requery();}public void close(){    notifyDataSetInvalidated();    notifyDataSetChanged();    c.close();}/** * 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.search, null);        // Creates a ViewHolder and store references to the two children views        // we want to bind data to.        holder = new ViewHolder();        holder.name = (TextView) convertView.findViewById(R.id.firstLine);        holder.phone = (TextView) convertView.findViewById(R.id.secondLine);        holder.call = (ImageButton) convertView.findViewById(R.id.btnCall);        holder.sms = (ImageButton) convertView.findViewById(R.id.btnSms);        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.    final Cursor temp = (Cursor) getItem(position);    //int index = temp.getColumnIndex(ContactsContract.Contacts.DISPLAY_NAME);    int ct = temp.getInt(WaddleAddressBook.CONTACT_TYPE);    String numberType = ""Other"";    switch (ct) {        case ContactsContract.CommonDataKinds.Phone.TYPE_HOME:            numberType = ""Home"";            break;        case ContactsContract.CommonDataKinds.Phone.TYPE_MOBILE:            numberType = ""Mobile"";            break;        case ContactsContract.CommonDataKinds.Phone.TYPE_WORK:            numberType = ""Work"";            break;    }    holder.name.setText(temp.getString(WaddleAddressBook.DISPLAY_NAME));    holder.phone.setText(numberType + "": "" + temp.getString(WaddleAddressBook.PHONE_NO) + "" ("" +            temp.getString(WaddleAddressBook.TIMES_CONTACTED) + "")"");    //holder.icon.setImageBitmap(mIcon1);    holder.call.setClickable(true);    holder.call.setFocusable(true);    holder.call.setTag(""call"");    final int pos = position;    holder.call.setOnClickListener(new View.OnClickListener() {        public void onClick(View view) {            Toast.makeText(context, ""CALL"", Toast.LENGTH_SHORT).show();            Cursor c = (Cursor) getItem(pos);            Intent i = new Intent(Intent.ACTION_CALL);            String phoneNumber = c.getString(WaddleAddressBook.DATA_ID);            i.setData(Uri.withAppendedPath(ContactsContract.CommonDataKinds.Phone.CONTENT_URI, phoneNumber));            context.startActivity(i);        }    });    holder.sms.setClickable(true);    holder.sms.setFocusable(true);    holder.sms.setTag(""sms"");    holder.sms.setOnClickListener(new View.OnClickListener() {        public void onClick(View view) {            Toast.makeText(context, ""SMS"", Toast.LENGTH_SHORT).show();            Cursor c = (Cursor) getItem(pos);            String phoneNumber = c.getString(WaddleAddressBook.PHONE_NO);            Intent intent = new Intent(Intent.ACTION_VIEW);            intent.putExtra(""address"", phoneNumber);            intent.setType(""vnd.android-dir/mms-sms"");            context.startActivity(intent);        }    });    return convertView;}public static Bitmap loadContactPhoto(ContentResolver cr, long id) {    Uri uri = ContentUris.withAppendedId(ContactsContract.Contacts.CONTENT_URI, id);    InputStream input = ContactsContract.Contacts.openContactPhotoInputStream(cr, uri);    if (input == null) {        return null;    }    return BitmapFactory.decodeStream(input);}static class ViewHolder {    TextView name, phone;    ImageButton call, sms, other;    //ImageView icon;}</code></pre><p>}</p><p><img src=""http://i.stack.imgur.com/nUzPV.png"" alt=""The Address Book Displayed""><img src=""http://i.stack.imgur.com/Alymz.png"" alt=""The Bug when I try to filter""></p><p>Above you can see the result when I try to filter.Note that clicking on the first item shows the correct result and while the other items are visible, they are not clickable. If I open an other activity (by clicking the first item for example) and then hit back, then the list displays as expected.</p><p>Edit: Bumping up this one time since I would really like to get an answer, it will keep me from having to re-write the entire UI.</p><p>Regards,</p>","611323","","3205","","2011-12-01 16:10:13","2011-12-01 16:10:13","Android: ListView with Custom EfficientAdapter Not Updating Screen","<android><listview><refresh><addressbook>","0","3","0","",""
"4956876","1","4956986","","2011-02-10 12:08:37","1","744","<p>i'm reposting this question because i'm not sure if i asked it correctly before.:) i'm working on an app that includes face detection. the camera boots up ok. within the preview frame callback i instantiate a faceview object (this class handles the detection). this class can only detect faces in a bitmap, but the image from the callback is a YuvImage. i've compressed the image to jpeg then called a method to convert that jpeg to a bitmap, so the detection will work. </p><p>The problem i'm having is that eclipse is saying that there's a classnotfoundexception regarding the YuvImage that i'm using. i've downloaded the api8 which yuvimage is part of. there are no errors in the source code and it compiles ok. is there a reason why ecilipse can't load the yuvimage class? here's a snippet, thanks.</p><p>'code'</p><pre><code>BitmapFactory.Options bfo = new BitmapFactory.Options();bfo.inPreferredConfig = Bitmap.Config.RGB_565;Rect rectangle = new Rect(0, 0, width, height);ByteArrayOutputStream bos = new ByteArrayOutputStream(imageData.length);try{    img = new YuvImage(imageData,ImageFormat.NV21,width,height,null);}catch(Exception e){    e.printStackTrace();}img.compressToJpeg(rectangle, 100, bos);byte[] array = bos.toByteArray();sourceImage = BitmapFactory.decodeByteArray(array, 0, array.length);</code></pre><p>Exception trace:</p><pre><code>02-10 11:53:07.298: ERROR/dalvikvm(2364): Could not find class 'android.graphics.YuvImage', referenced from method com.tecmark.FaceView.&lt;init&gt;02-10 11:53:07.468: ERROR/AndroidRuntime(2364): Uncaught handler: thread main exiting due to uncaught exception02-10 11:53:07.473: ERROR/AndroidRuntime(2364): java.lang.NoClassDefFoundError: android.graphics.YuvImage02-10 11:53:07.473: ERROR/AndroidRuntime(2364):     at com.tecmark.FaceView.&lt;init&gt;(FaceView.java:60)02-10 11:53:07.473: ERROR/AndroidRuntime(2364):     at com.tecmark.cameraView$1.onPreviewFrame(cameraView.java:111)02-10 11:53:07.473: ERROR/AndroidRuntime(2364):     at android.hardware.Camera$EventHandler.handleMessage(Camera.java:395)02-10 11:53:07.473: ERROR/AndroidRuntime(2364):     at android.os.Handler.dispatchMessage(Handler.java:99)02-10 11:53:07.473: ERROR/AndroidRuntime(2364):     at android.os.Looper.loop(Looper.java:123)02-10 11:53:07.473: ERROR/AndroidRuntime(2364):     at android.app.ActivityThread.main(ActivityThread.java:4363)02-10 11:53:07.473: ERROR/AndroidRuntime(2364):     at java.lang.reflect.Method.invokeNative(Native Method)02-10 11:53:07.473: ERROR/AndroidRuntime(2364):     at java.lang.reflect.Method.invoke(Method.java:521)02-10 11:53:07.473: ERROR/AndroidRuntime(2364):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)02-10 11:53:07.473: ERROR/AndroidRuntime(2364):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)02-10 11:53:07.473: ERROR/AndroidRuntime(2364):     at dalvik.system.NativeStart.main(Native Method)</code></pre>","532462","","","user166390","2011-02-10 14:20:41","2011-02-10 14:20:41","NoClassDefFoundError: android.graphics.YuvImage (compiles but doesn't run)","<android><noclassdeffounderror>","2","2","","",""
"4956884","1","","","2011-02-10 12:09:05","0","685","<p>Have some problems with client side validation (using RequiredFieldValidator, RegularExpressionValidator, CustomValidator with client side validation logic). It seems that WebForm_DoPostBackWithOptions is not fired or causes unhandled exception that makes the form to do the postback regardless it's valid or not.</p><p>I tried using a ValidationSummary, hiding it if javascript is supported:</p><pre><code>&lt;script&gt;   $(document).ready(function() {      $(""#javascriptDisabled"").hide();   }&lt;/script&gt;...&lt;div id=""javascriptDisabled""&gt;   &lt;asp:ValidationSummary runat=""server"" ...&gt;&lt;/div&gt;...&lt;asp:Button runat=""server"" OnClick=""SendMessage"" ...&gt;</code></pre><p>My .cs code is:</p><pre><code>protected void SendMessage(object sender, EventArgs e){   if(!Page.IsValid) return;}</code></pre><p>Every thing works fine on Chrome with disabled javascript on my laptop, but not on my Android phone. The problem is that on the phone Javascript is not disabled, it's enabled, and correctly hides the ValidationSummary, but does not perform client side validation for some reason that i can't understand (no developers tools on Android browser :(( ).This is very frustrating! :(</p><p>Someone can help?</p><p>Thanks!</p><p>EDIT: I found the cause (but not the solution, if one exists). I'm using in my page a Telerik RadEditor control that, if the client is Android default browser, does not correctly render all the embedded scripts that are required, causing javascript exceptions and (probably) the disactivation of javascript runtime by the browser. This causes the client side validation not working anymore. Will investigate with Telerik if there is a solution to this issue.</p>","582792","","582792","","2011-02-12 10:35:50","2011-02-12 10:36:28","Client side validation not working on Android browser","<asp.net><android><form-validation><cross-browser>","2","2","","",""
"4956934","1","4957003","","2011-02-10 12:14:55","0","1089","<p>I am trying to create an OCR app for android. I want to be able to do it on the device itself rather than sending it to a server and then see the results. Is there a library available for it? I can consider buying as well.</p><p>Thanks.</p>","","PrincessP","","","","2011-02-10 16:22:20","on-board ocr library for android app","<android><ocr>","2","0","","",""
"4956958","1","4957026","","2011-02-10 12:17:22","2","1026","<p>I have a web service which returns an xml as responce. This xml has some special characters like (&amp;, ' , "" ) etc. </p><p>While parsing in android with dom parser the value string terminates as soon as it encounters any of these special characters, and I have no experience with SAX parser. I have also tried to get the string from this xml and process it before parsing it in xml but there was no luck. </p><p>Is there any way to get the whole string from xml without any loss because of these special characters. </p><p>(P.S. : This is a general question, I face it with third party xml as well as an xml developed by a fellow team member, I can change it in later case but I asked this question keeping third party xml web services in mind.)</p>","246942","","","","","2011-02-10 13:35:57","Android : detecting and replacing special characters in xml web service","<android><xml><web-services><special-characters><third-party-api>","2","0","","",""
"4956965","1","4957099","","2011-02-10 12:18:09","0","264","<p>I try to receive latitude &amp; longitude on android phone.Is location on android receive directly from satellite?Why it dynamic all the time, while I standing though?So, anyone know how to make it stable ?</p><p>Thanks</p>","538788","","","","","2011-02-10 12:31:27","how to make location stable on android","<android><geolocation><gps>","1","0","1","",""
"4956978","1","5202056","","2011-02-10 12:19:26","0","192","<p>I'm trying to make motion controller using the values from android sensors. Currently sending/receiving data to/from PC is almost done, and also already gone a trial to rotate cube using orientation sensor values, and it seemed usable.</p><p>The problem is, as orientation sensor uses magnetic sensor to calculate orientation, the actual values islikely to different from the desired values. For instance, one will expect the cube stays unrotated when he or she directs the controller straight to the PC monitor. Actually, cube will be rotated for such as (27, 59, 107), unless the PC is strictly placed on the north poll.</p><p>I've already searched for some references, but only I could found was remapping the reference by predefined constants, such as ROTATE_X_90.</p><p>Is there any way to remap reference coordinate by custom values? </p>","582352","","","","","2011-03-05 06:05:07","Remaping reference coordinate of sensors using custom values","<android><math><3d><sensor>","2","0","","",""
"4956993","1","4957178","","2011-02-10 12:21:12","1","240","<p>I am making an app that supports all versions of android (just in case it is relevant), but when the user clicks on an app, the keyboard pops up and moves the tabs with it. Is there anyway to stop the tabs from doing this?</p>","348261","","","","","2012-12-15 17:31:20","Is there any way to stop the tabs coming up with the keyboard in android?","<android><keyboard><tabs><move>","2","0","","",""
"4957009","1","4957197","","2011-02-10 12:22:36","29","42098","<h3>Background</h3><p>I have an Android project that has a database with two tables: <code>tbl_question</code> and <code>tbl_alternative</code>.</p><p>To populate the views with questions and alternatives I am using cursors. There are no problems in getting the data I need until I try to join the two tables. </p><pre>    Tbl_question      -------------    _id      question      categoryid  </pre><pre>    Tbl_alternative    ---------------    _id     questionid     categoryid     alternative</pre> <p>I want something like the following:</p><pre><code>SELECT tbl_question.question, tbl_alternative.alternative where categoryid=tbl_alternative.categoryid AND tbl_question._id = tbl_alternative.questionid.` </code></pre><p>This is my attempt: </p><pre><code>public Cursor getAlternative(long categoryid) {            String[] columns = new String[] { KEY_Q_ID, KEY_IMAGE, KEY_QUESTION, KEY_ALT, KEY_QID};             String whereClause = KEY_CATEGORYID + ""="" + categoryid +"" AND ""+ KEY_Q_ID +""=""+ KEY_QID;             Cursor cursor = mDb.query(true, DBTABLE_QUESTION + "" INNER JOIN ""+ DBTABLE_ALTERNATIVE, columns, whereClause, null, null, null, null, null);             if (cursor != null) {                  cursor.moveToFirst();             }             return cursor;</code></pre><p>I find this way to form queries harder than regular SQL, but have gotten the advice to use this way since it is less error prone. </p><h3>Question</h3><p>How do I join two SQLite tables in my application?</p>","455479","","426671","","2013-07-17 14:02:52","2013-07-17 14:02:52","How do I join two SQLite tables in my Android application?","<android><sqlite>","3","5","18","",""
"4957032","1","","","2011-02-10 12:24:51","0","93","<p>Hi all:i am making an application in which i am using Tab-bars</p><p>i have a class named HomeScreen where i m making all the tab bars and i have 3 tab bars.1 with the name of Settings, other with Add and the last with Viewso the thing is when i start my application View comes First and then i made a check that if file does not exist then show a message that file does not exist. and i did this in the onCreate method of View Activity... now i go to Add tab and showed a dialog there. now it in both of these Tabs the The MESSAGE and DIALOG appears only once. when i start the application .. how can i set that whenever i click on the tab it should display the MESSAGE or DIALOG according to the condition rather True Or False.. please guys Guide me in this... </p><p>Thnx a bunch in advancewaiting anxiously for ur kind help and positive response...</p>","521015","","","","","2011-02-10 12:24:51","My Activity is not Called Again in Tab-Bars in android","<android>","0","2","1","",""
"4957060","1","4957663","","2011-02-10 12:27:57","0","276","<p>I am creating a dynamic list in which has 2 buttons (Accept and Reject) and one TextView (Email ID which is unique).</p><p>I have to accept/reject the email Id on button click event. My problem is I am not able to get the Id or any other reference to point which accept button i had clicked.</p>","437833","","68805","","2011-02-10 13:04:33","2011-09-26 14:42:34","How to handle button in dynamic list having same Text?","<android>","2","0","","",""
"4957062","1","4957127","","2011-02-10 12:28:00","0","1653","<p>I don't know is this the right place to ask. Because I need to know the concept about NFC. From the Android 2.3 Platform reference. And i googled it. But i didn't get the correct concept. Can anyone please provide me good links and tutorials for that. And how to implement it in android.<br>Thanks in andvance. </p>","609646","","","","","2013-11-13 17:45:40","What is nfc and its implementation","<android><nfc>","4","0","2","",""
"4957077","1","","","2011-02-10 12:29:05","0","201","<p>Is it possible to clear Android Market History programmatically ? </p>","603112","","68805","","2011-02-10 12:52:44","2011-02-10 12:52:44","Android Market History","<android>","0","3","","",""
"4957094","1","6916553","","2011-02-10 12:31:17","3","5147","<p>As I debugged, I found that the GetCacheDir return <code>/data/data/yourapp/cache/</code></p><p>But as I store files, I found nothing in that path(with shell),but in <code>/sdcard/Android/data/yourapp/cache/</code>  I found the cache file?who can tell me why?</p>","316286","","512958","","2011-02-10 12:34:15","2011-08-02 18:09:39","where is the file when use getCacheDir","<android>","1","2","","",""
"4957168","1","5077922","","2011-02-10 12:37:59","11","11494","<p>I need to write an application that can run on both Android and Apple devices. At this point I have found a couple of solutions:</p><ul><li><p>Use a framework such as Appcelerator Titanium or PhoneGap,</p></li><li><p>Use C++, and then write the UI parts both in Java and Objective-C (as C++ can be run on both platform),</p></li><li><p>Write everything twice...</p></li></ul><p>What are your experiences and suggestions regarding this problem?</p>","318557","","","","","2013-12-17 11:10:08","Best way to write an app for both Android and iOS?","<android><ios><phonegap><appcelerator>","9","4","6","2013-12-17 13:05:30",""
"4957223","1","","","2011-02-10 12:43:03","0","1698","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/5164211/use-ffmpeg-on-android"">Use FFMPEG on Android</a>  </p></blockquote><p>i want to create a android app which can merge audio images to form video i am prefering ffmpeg for that ,please guide me how can i use ffmpeg functions and libraries to do so</p>","611353","","350685","","2011-02-10 13:09:38","2012-05-01 12:47:54","video editing using FFMPEG in android project","<android><ffmpeg><libraries>","1","0","","2012-05-01 12:52:10",""
"4957225","1","4957782","","2011-02-10 12:43:31","1","928","<p>How to use gallery.getItemAtPosition(position)to get the view object like below.</p><pre><code>Object obj = gallery.getItemAtPosition(position);View v = (View)object;ImageView imgview = (ImageView)v.findViewById(R.id.imageId);</code></pre><p>But if i use like that it is giving class cast exception.</p>","486216","","486216","","2011-02-10 12:59:26","2011-02-10 13:41:12","How to get View/Widget from getItemAtPostion method, android?","<android><gallery>","2","0","","",""
"4957280","1","","","2011-02-10 12:48:30","0","528","<p>I have an application that contains a couple of listviews. The listviews contains items that consist of imageviews and textviews.</p><p>All images are thumbnail sized on a server and the pattern used for loading them is like this:</p><ul><li>Instanciate a DrawableManager</li><li>in the getView method i do the following1 ) Pass the thumb uri and the ImageView instance to the drawablemanagers getImageAsync method1.2 ) The method will first look on sd card if the image exists if so load it from SD card and save a softreference + update imageview drawable1.2 ) If not exists on sd. Fetch from HTTP and save on SD (if there is enough space) put as softreference and update imageview drawable.</li></ul><p>When the images exists on sd card everything works fine. But first time (or when using the app without sd card) the images seems to be populated into the wrong listviews rows when scrolling. When i stop scroll the problem fixes it self after a couple of seconds.</p><p>Its almost like if the ImageView references are pooled or something.</p><p>Any ideas?</p><p>I also include the getView method:</p><pre><code>public View getView(int position, View convertView, ViewGroup parent) {                    ViewHolder vh;                    if (convertView == null) {                        convertView = inflater.inflate(R.layout.informationrow, null);                        vh = new ViewHolder();                        vh.imageView = (ImageView) convertView.findViewById(R.id.rowInformationIcon);                        vh.textView = (TextView) convertView.findViewById(R.id.rowInformationTitleLine);                        convertView.setTag(vh);                    }                    else                    {                        vh = (ViewHolder) convertView.getTag();                    }                    CustomCategory cc = items.get(position);                    if (cc != null) {                        vh.textView.setText(cc.get_name());                        if (cc.getMediaUrl() != null) {                            _drawMgr.fetchDrawableOnThread(cc.getMediaUrl(), vh.imageView);                            vh.imageView.setBackgroundDrawable(getResources().getDrawable(R.drawable.imageframe));                        }                        else {                            vh.imageView.setImageDrawable(getResources().getDrawable(R.drawable.trans4040));                            vh.imageView.setBackgroundDrawable(null);                        }                    }                    return convertView;            }</code></pre><p>Thanks!</p>","611368","","","","","2011-03-07 22:43:01","Android ListView mixes up images while loading over internet","<java><android><asynchronous><imageview><listactivity>","1","0","","",""
"4957370","1","4957458","","2011-02-10 12:57:59","0","285","<p>I want to solve next problem and hope for your help. I have got AbsListView with a set of images. Images are inflated by background thread which download it from the internet. I make this thread, because I don't want to impede the UI thread. So when user scrolls AbsListView I want to destroy the background thread and start it after stop scrolling.</p><p>To do it I need at least override <strong><em>onScroll</em></strong> method, but I don't know what should I write in it's body, because when I try to use <strong><em>Thread.destroy()</em></strong> method (which is deprecated) I got <strong><em>NoSuchMethodError</em></strong>. </p><p>When I define it as null if onScroll, It set the downloaded images into scrolling items. </p><p>Please, I need your advice how to cope with this situation.</p>","556337","","","","","2011-06-11 03:41:51","Destroying thread, during scrolling AbsListView","<android>","3","0","","",""
"4957385","1","","","2011-02-10 13:00:17","5","12426","<p>I am trying to execute a shell script from my Android application.</p><p>First I tried to run Shell script from Java ,and it working fine for all commands like <code>pwd</code>, <code>cd</code> , <code>netstat</code>. moving the file ,copying the file.</p><p>Than I've tried it from an Android application and I'm getting output for <code>cd</code> ,<code>pwd</code>, <code>netstat</code> and for echo statements that are in script, but for moving and copying the file are not working.</p><p>Are any Permissions needed to execute these commands from the script file while these commands are working fine from adb shell?</p><p>my code look like this:</p><pre><code>void execCommandLine()    {       //***********************        try        {            Runtime rt = Runtime.getRuntime();            Process proc = rt.exec(""ls -all"");            proc = rt.exec(""sh /data/shTest.sh"");            InputStream is = proc.getInputStream();            InputStreamReader isr = new InputStreamReader(is);            BufferedReader br = new BufferedReader(isr);            String line;       while ((line = br.readLine()) != null) {         System.out.println(line);       }           } catch (Throwable t)          {            t.printStackTrace();          }</code></pre><p>and my script file is as follows:</p><pre><code>#!/bin/shecho ""Knowledge is Power""echo ""I am a script""echo $PATHnetstatpwdcd /datapwdcd /system/binpwd  mv  /data/local/hello.txt /data/  cp  /data/local/hello1.txt /data/cd /data/local/tmpcd /system/bin</code></pre><p>Only the <code>cp</code> and <code>mv</code> commands are not showing expected result.Please give me some guidance.</p><p>First thing I am trying and testing it into Emulator. In /system/bin have mv commond and I have also tried with busybox but I didnt get expected result. For root privilage how to proceed..Give some idea to proceed.</p>","587090","","587090","","2011-02-11 04:02:05","2012-09-01 11:56:09","How can we execute a shell script file from my Android Application?","<android><permissions>","3","4","6","",""
"4957416","1","4957719","","2011-02-10 13:03:32","0","2197","<p>i want to play a mp4 video. so i tried below method</p><pre><code> private void playVideo() {        try {            final String path = s;            Log.v(TAG, ""path: "" + path);            if (path == null || path.length() == 0) {            Toast.makeText(VideoPlay1.this, ""File URL/path is empty"",                        Toast.LENGTH_LONG).show();            } else {                // If the path has not changed, just start the media player                if (path.equals(current) &amp;&amp; mVideoView != null) {                    MediaController mediaController = new MediaController(this);                    mediaController.setAnchorView(mVideoView);                    Uri video = Uri.parse(getDataSource(path));                    Log.e(""Uri video"",video.toString());                    mVideoView.setMediaController(mediaController);                    mVideoView.setVideoURI(video);                         mVideoView.setVideoPath(getDataSource(path));                    mVideoView.setOnPreparedListener(new OnPreparedListener() {                        public void onPrepared(MediaPlayer arg0) {                            dialog.dismiss();                            mVideoView.start();                        }                    });                    mVideoView.requestFocus();                return;            }            current = path;            MediaController mediaController = new MediaController(this);            Uri video = Uri.parse(getDataSource(path));            Log.e(""Uri video"",video.toString());            mVideoView.setMediaController(mediaController);            mVideoView.setVideoURI(video);                 mVideoView.setVideoPath(getDataSource(path));                mVideoView.setOnPreparedListener(new OnPreparedListener() {                    public void onPrepared(MediaPlayer arg0) {                        dialog.dismiss();                        mVideoView.start();                    }                });            mVideoView.requestFocus();   }        } catch (Exception e) {            Log.e(TAG, ""error123: "" + e.getMessage(), e);            if (mVideoView != null) {                mVideoView.stopPlayback();            }        }    }    @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 super.onKeyDown(keyCode, event);    }    public void onBackPressed() {        Log.d(""CDA"", ""onBackPressed Called"");        mVideoView.stopPlayback();        Intent setIntent = new Intent(VideoPlay1.this,VideoPage.class);        startActivity(setIntent);         finish();        return;    }    private String getDataSource(String path) throws IOException {        if (!URLUtil.isNetworkUrl(path)) {            return path;        } else {            URL url = new URL(path);            URLConnection cn = url.openConnection();            cn.connect();            InputStream stream = cn.getInputStream();            if (stream == null)                throw new RuntimeException(""stream is null"");            File temp = File.createTempFile(""mediaplayertmp"", ""dat"");            temp.deleteOnExit();            String tempPath = temp.getAbsolutePath();            FileOutputStream out = new FileOutputStream(temp);        byte buf[] = new byte[128];            do {            int numread = stream.read(buf);                if (numread &lt;= 0)                    break;                out.write(buf, 0, numread);            } while (true);            try {                stream.close();            } catch (IOException ex) {                Log.e(TAG, ""error: "" + ex.getMessage(), ex);            }            return tempPath;        }    }</code></pre><p>the above is working it takes more time to play the video so please tell me if there is another way. </p><p>Thank you.</p><p>Best Regards.</p>","745367","","745367","","2011-02-10 13:21:38","2012-08-01 20:31:53","streaming and playing mp4 video","<android><video-streaming>","2","0","","",""
"4957461","1","4983406","","2011-02-10 13:07:50","10","19447","<p>I have a <code>BroadcastReceiver</code> for one time use. </p><p>I'm registering it in an Activity. I can't put the <code>unregisterReceiver()</code> in <code>onPause</code> because it has to stay running even when the activity is paused or destroyed. </p><p>I want the BroadcastReceiver to unregister itself when it is done, something like this:</p><pre><code>public class SmsReceiver extends BroadcastReceiver {    public void onReceive(Context context, Intent intent) {           // do some code..           context.unregisterReceiver(this)        }}</code></pre><p>But it causes an Exception: <code>Receiver not registered.</code> </p>","178016","","1765530","","2014-02-21 10:55:24","2014-02-21 10:55:24","Unregister Broadcast Receiver - Android","<android><broadcastreceiver>","7","0","5","",""
"4957486","1","","","2011-02-10 13:11:07","1","601","<p>How can i change spinner title bar style.</p><p><img src=""http://i.stack.imgur.com/ROo96.png"" alt=""enter image description here""></p><p>I wish to change the title bar for the following items:</p><pre><code>icontitle stylebackground color</code></pre><p>How can i do this?</p>","309990","","68805","","2011-02-10 13:33:14","2011-02-10 14:41:35","Change spinner list title-bar style","<android>","0","1","2","",""
"4957492","1","4957668","","2011-02-10 13:11:41","0","206","<p>I want to play the audio of a video file without video display. Can anyone help in this regard?</p>","525004","","366313","","2011-02-10 13:17:22","2011-02-10 13:30:16","Play video without display","<android><video><audio>","1","0","0","",""
"4957558","1","","","2011-02-10 13:20:01","3","3607","<p>I've been reading that Android (like most of mobile OS's) doesn't ""exit"" applications.</p><p>When we press the back button, the application is still in the background (like an iddle state). </p><p>So, I'd like to know, what doees it do when there's too many apps running in the background? </p>","611411","","68805","","2011-02-10 13:32:21","2011-02-10 13:33:45","What happens in the Android OS when there's too many applications ""sleeping"" in the background?","<android><operating-system>","7","0","","",""
"4957652","1","4957775","","2011-02-10 13:28:22","0","245","<p>I need a little help in View modes.. After launching my Activity, when i press CTL+11 to change view mode from Portrait to Landscape. all activites are called again and they are restarted. A few dialogs are shown again. </p><p>Similar behaviour is seen when i change from Landscape to Portrait. </p><p>What do i need to do that my main activity does not start again when i change the orientation.</p>","521015","","68805","","2011-02-10 13:44:12","2011-02-10 13:44:12","Activity restart when the View Mode is changed","<android><emulator>","2","0","","",""
"4957730","1","","","2011-02-10 13:36:13","5","8672","<p>Not used to using Eclipse for java, mainly used jEdit but with the Android dev along comes Eclipse. I've switched to the debug window and pressed the debug button which starts my app, It crashes however I can't find the stack trace. I can see in the 'Debug' pane that it has crashed with a '' exception however I can't see any more information. Not sure if you can get it but I'm a little used to Visual Studio with line numbers and a bit more information saying what went wrong. As I said all I'm getting is - </p><pre><code> 'Thread [&lt;1&gt; main](Suspended (exception RuntimeException))'</code></pre><p>in the debug window. Can anyone shed some light as to where I can find more information?</p>","611438","","202229","","2012-02-01 22:14:31","2012-02-01 22:14:31","Finding Stack Trace in Eclipse with Android","<java><android><eclipse><debugging><stack-trace>","4","0","1","",""
"4957756","1","","","2011-02-10 13:39:03","0","327","<p>I have used a lot of asynctask class in my application. Is it possible to write common class and update the user interface value?</p>","426344","","68805","","2011-02-10 13:49:14","2011-02-10 13:49:14","A common class for asynctask UI handling","<android>","2","0","","",""
"4957810","1","4957977","","2011-02-10 13:43:38","0","868","<p>I use IntelliJ IDEA to write Android apps, and use the DDMS Windows application to view the Android logs (separate from the IDE). It works fine, but after a seemingly random period of time, the logs vanish, except for one line of log, which gets overwritten with incoming logs. I have to shut it down and restart it, which combined with the delays of deploying an app to a device over ADB to debug and test is pretty tiresome.</p><p>Is this a known issue with DDMS? Is there anything I can do to make it work consistently without breaking itself?</p><p>Are there any other Android log viewing applications for Windows that work better? I'm not very fond of the IntelliJ IDEA one. My favourite is actually CatLog on Android itself, but on a small-screen device it's not a great experience.</p>","477415","","","","","2011-02-10 18:36:34","Why does Android DDMS show logs for a few hours, but then fail?","<android><ddms>","2","3","","",""
"4957877","1","4957922","","2011-02-10 13:49:44","1","181","<p>I'm Working on android, So i want to know where the database will be stored? how to check it  stored or not?</p>","611446","","","","","2014-02-24 08:25:20","Android Database","<android><data>","5","1","","",""
"4957967","1","4958708","","2011-02-10 13:57:28","-3","1057","<pre><code>public Cursor getSen_List(long id_thsen ) {    String strTmp = ""select ""                    +SENS_TABLE+"".""+KEY_SEN_ID+"",""
                    +SENS_TABLE+"".""+KEY_SEN_ID_TH_SEN+"",""
                    +SENS_TABLE+"".""+KEY_SEN_ID_LANG+"",""
                    +SENS_TABLE+"".""+KEY_SEN+"",""
                    +SENS_TABLE+"".""+KEY_SEN_READING+"",""
                    +"" from ""+SENS_TABLE+ "",""
                    +"" where ""+SENS_TABLE+"".""+KEY_SEN_ID_TH_SEN + ""="" +id_thsen+"",""
                    +null+"","" +null+"","" +null+"","" +null;                    return db.rawQuery(strTmp,null);}</code></pre><p>This is the way I get Sentence list but if I want to change the way to write like this instead</p><pre><code>public Cursor getSen_List(long id_thsen ) {    String strTmp = ""select ""                    +SENS_TABLE+"".""+KEY_SEN_ID+"",""
                    +SENS_TABLE+"".""+KEY_SEN_ID_TH_SEN+"",""
                    +SENS_TABLE+"".""+KEY_SEN_ID_LANG+"",""
                    +SENS_TABLE+"".""+KEY_SEN+"",""
                    +SENS_TABLE+"".""+KEY_SEN_READING+"",""                                         +"" from ""+SENS_TABLE+"",""
                    +"" where ""+SENS_TABLE+"".""+KEY_SEN_ID_TH_SEN + id_thsen+"",""
                    +null+"","" +null+"","" +null+"","" +null+"","";                    return db.rawQuery(strTmp,null);}</code></pre><p>Is anything wrong? because it doesn't work </p><p>please help........</p><p>and This is my logcat........</p><blockquote>  <p>02-10 20:48:18.050: ERROR/AndroidRuntime(818): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.android.proj/com.android.proj.Sens_Show}: android.database.sqlite.SQLiteException: near ""from"": syntax error: , while compiling: select Sentences._id,Sentences.id_thsen,Sentences.id_lang,Sentences.sen,Sentences.reading, from Sentences, where Sentences.id_thsen1,null,null,null,null,  02-10 20:48:18.050: ERROR/AndroidRuntime(818):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)  02-10 20:48:18.050: ERROR/AndroidRuntime(818):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)  02-10 20:48:18.050: ERROR/AndroidRuntime(818):     at android.app.ActivityThread.access$2300(ActivityThread.java:125)  02-10 20:48:18.050: ERROR/AndroidRuntime(818):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)  02-10 20:48:18.050: ERROR/AndroidRuntime(818):     at android.os.Handler.dispatchMessage(Handler.java:99)  02-10 20:48:18.050: ERROR/AndroidRuntime(818):     at android.os.Looper.loop(Looper.java:123)  02-10 20:48:18.050: ERROR/AndroidRuntime(818):     at android.app.ActivityThread.main(ActivityThread.java:4627)  02-10 20:48:18.050: ERROR/AndroidRuntime(818):     at java.lang.reflect.Method.invokeNative(Native Method)  02-10 20:48:18.050: ERROR/AndroidRuntime(818):     at java.lang.reflect.Method.invoke(Method.java:521)  02-10 20:48:18.050: ERROR/AndroidRuntime(818):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)  02-10 20:48:18.050: ERROR/AndroidRuntime(818):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)  02-10 20:48:18.050: ERROR/AndroidRuntime(818):     at dalvik.system.NativeStart.main(Native Method)  02-10 20:48:18.050: ERROR/AndroidRuntime(818): Caused by: android.database.sqlite.SQLiteException: near ""from"": syntax error: , while compiling: select Sentences._id,Sentences.id_thsen,Sentences.id_lang,Sentences.sen,Sentences.reading, from Sentences, where Sentences.id_thsen1,null,null,null,null,  02-10 20:48:18.050: ERROR/AndroidRuntime(818):     at android.database.sqlite.SQLiteCompiledSql.native_compile(Native Method)  02-10 20:48:18.050: ERROR/AndroidRuntime(818):     at android.database.sqlite.SQLiteCompiledSql.compile(SQLiteCompiledSql.java:91)  02-10 20:48:18.050: ERROR/AndroidRuntime(818):     at android.database.sqlite.SQLiteCompiledSql.(SQLiteCompiledSql.java:64)  02-10 20:48:18.050: ERROR/AndroidRuntime(818):     at android.database.sqlite.SQLiteProgram.(SQLiteProgram.java:80)  02-10 20:48:18.050: ERROR/AndroidRuntime(818):     at android.database.sqlite.SQLiteQuery.(SQLiteQuery.java:46)  02-10 20:48:18.050: ERROR/AndroidRuntime(818):     at android.database.sqlite.SQLiteDirectCursorDriver.query(SQLiteDirectCursorDriver.java:42)  02-10 20:48:18.050: ERROR/AndroidRuntime(818):     at android.database.sqlite.SQLiteDatabase.rawQueryWithFactory(SQLiteDatabase.java:1345)  02-10 20:48:18.050: ERROR/AndroidRuntime(818):     at android.database.sqlite.SQLiteDatabase.rawQuery(SQLiteDatabase.java:1315)  02-10 20:48:18.050: ERROR/AndroidRuntime(818):     at com.android.proj.DBAdapter.getSen_List(DBAdapter.java:875)  02-10 20:48:18.050: ERROR/AndroidRuntime(818):     at com.android.proj.Sens_Show.listData(Sens_Show.java:91)  02-10 20:48:18.050: ERROR/AndroidRuntime(818):     at com.android.proj.Sens_Show.onCreate(Sens_Show.java:63)  02-10 20:48:18.050: ERROR/AndroidRuntime(818):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)  02-10 20:48:18.050: ERROR/AndroidRuntime(818):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)  02-10 20:48:18.050: ERROR/AndroidRuntime(818):     ... 11 more</p></blockquote>","605358","","605358","","2011-02-10 15:17:44","2011-02-10 15:17:44","How to query data from SQLite","<android><sqlite>","2","4","","",""
"4957981","1","","","2011-02-10 13:58:27","5","429","<p>I have a service that is doing some background staff, then I need to start a Activity showing some results that the Service processed. But there is possibility that the activity is started many times from the service. Now, I want to start this Activity only if it is not active already. </p><p>What is the possibility and how to do this? And sample code would be nice if you don't mind.</p><p>Thanks!!</p>","584513","","","","","2011-04-12 08:49:53","Check if Activity is started in Service","<java><android>","1","0","","",""
"4958003","1","4958068","","2011-02-10 14:00:15","0","865","<p>I want to play the mediaplayer for just 10 sec. How to control it?</p>","525004","","","","","2011-02-10 14:07:44","Play mediaplayer for certain duration","<android><video><audio><media-player>","2","1","","",""
"4958032","1","4958190","","2011-02-10 14:02:38","2","474","<p>I am due to make an android application which sends and recieves data from a .Net web service . I have implemented the HttpGet method in the android and was able to get data in the JSON format . </p><p>I will now be implementing the HttpPost method where in i will be sending JSON data to the server. </p><p>I was also going through ksoap libary which i think does the soap parsing in the android phone . </p><p>Could anyone please tell me why i should/shouldnt be using ksoap and HttpGet and HttpPost methods ?????</p><p>As in which amongst this is a better solution KSOAP or (HttpGet/HttpPost)  ???Thanks </p>","581157","","","","","2011-02-10 14:17:30","Why should one chose the HttpGet/HttpPost method's over kSoap?","<android>","1","0","","",""
"4958043","1","","","2011-02-10 14:04:07","1","282","<p>I use Mobclix in android app for advertising.How I can remove empty space when AD does not showing? </p>","499393","","","","","2013-01-25 06:53:09","Empty space in Android app when using Mobclix","<android><advertising><mobclix>","1","0","","",""
"4958063","1","4958125","","2011-02-10 14:05:44","1","796","<p>I would like to imitate the behavior of the default android browser - The EditText (the address bar) on top will start to ""disappear"" once the user scrolls down. The only thing I can think of right now is to put the EditText and the WebView in a ScrollView but that would create other problems, and is not recommended.</p><p>What do you think?</p>","171911","","","","","2011-07-15 20:21:16","Android: EditText on top of WebView?","<android><webview><scroll><edittext><scrollview>","2","0","","",""
"4958103","1","4958919","","2011-02-10 14:09:29","8","2837","<p>I have a <code>ListView</code> with an <code>EditText</code> in each row. I have set <code>windowSoftInputMode</code> to <code>adjustPan</code> in the manifest for this activity, so when I tap on an <code>EditText</code> the layout pans so that it is visible above the keyboard.</p><p>This works the first time I tap on an <code>EditText</code>. But if I hit the back button to dismiss the keyboard, then tap the same EditText again (without tapping anything else, so the cursor remains in the first <code>EditText</code>), the keyboard comes back up but the layout does not pan this time. The result of this is that the <code>EditText</code> is obscured behind the keyboard.</p><p>Has anyone experienced this behaviour / knows how to solve it?</p><p>Thanks</p>","2099158","","","","","2011-02-10 15:19:48","EditText in ListView with windowSoftInputMode adjustPan","<android><listview><edittext><android-softkeyboard>","1","1","4","",""
"4958146","1","","","2011-02-10 14:13:17","6","834","<p>Hey! (Apologies for the long post here)</p><p>I am writing a few applications which will be based off of essentially the same code.</p><p>Each application will have its differences, some will have new activities, all will have different resources assigned.</p><p>I am attempting to use an Android Library project so that I can place all of the common code in one place, so manjor changes only have to be made once and all projects will be updated.</p><p>Now, the resources are an easy solution, as I can just define each resouce in the main application and these will override the ones in the library project as long as naming conventions stay the same.</p><p>Now, my question is how do I do the same but for classes? For example, ill have a base view as a wrapper for common code across all views. in this, i launch various activities. What if all three applications need to launch a different activity as they will contain different UI and features? How would I go about this? The library project will never know that the main project wants to use a different activity, as its already been compiled.</p><p>I have a couple of solutions I have thought up, but I want to know if anyone else has some ideas? It would be of great help for any feedback here:</p><ol><li><p>The Activity in the Library Project that is to be launched stores a reference to the class to be loaded, which will be defined in the main application at its launch. This was when the library project calls this activity, it can load what its been told to.</p></li><li><p>I leave all functionality that will not change inside the library projects activity. I then extend this activity, and override the onCreate to do what I need here (such as loading different layouts, setting up views, etc). Now this has a drawback, as I have to define most of the entry points in my main application rather than in the library project.</p></li></ol><p>I hope you follow what my issue is here. Please ask if I have explained this poorly.</p><p>Thanks,</p><p>Adam</p>","478537","","375209","","2011-02-10 16:07:29","2012-01-05 11:15:41","Android Library Project - Defining Classes","<android><design-patterns><android-library>","1","2","1","",""
"4958235","1","","","2011-02-10 14:20:54","1","15645","<p>Why does <code>ArrayIndexOutOfBoundsException</code> occur and how to avoid it in Android?</p>","562237","","1268895","","2012-05-06 04:01:46","2012-05-06 04:01:46","Why does ArrayIndexOutOfBoundsException occur and how to avoid it in Android?","<java><android><arrayindexoutofbounds>","4","5","","2011-02-10 15:49:13",""
"4958249","1","4958291","","2011-02-10 14:22:10","1","2401","<p>I have a RelativeLayout which has a LinearLayout as a child containing TextViews.    </p><p>I would like to place ImageViews at the right side of the TextViews with layout_alignRight=""@id/userdetail_tv_special"" but somehow this is not working.</p><p>Can't I ""link"" a child of a RelativeLayout to a child of a LinearLayout? Any ideas how i could achieve this without creating another RelativeLayout for each Button?</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;LinearLayout        android:id=""@+id/userdetail_lin_btncontainer""        android:layout_width=""fill_parent""        android:layout_height=""50dp""        android:layout_below=""@id/userdetail_lin_divider""         android:padding=""6dp"" &gt;        &lt;TextView            android:id=""@+id/userdetail_tv_special""            android:layout_width=""fill_parent""            android:layout_height=""fill_parent""            android:layout_weight=""1""            android:text=""Special""            android:background=""#cccccc"" /&gt;        &lt;!-- here are more TextViews like this one --&gt;    &lt;/LinearLayout&gt;    &lt;ImageView        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:layout_alignRight=""@id/userdetail_tv_special""        android:src=""@drawable/ic_detail_special"" /&gt;        &lt;!-- much more views and stuff --&gt;&lt;/RelativeLayout&gt;</code></pre>","405615","","","","","2011-02-10 14:54:20","RelativeLayout: can't use layout_below with link to a LinearLayout child?","<android><android-linearlayout><relativelayout>","2","0","1","",""
"4958262","1","4958712","","2011-02-10 14:23:17","0","1382","<p>How to handle the positions in Gallery.I need to change the background of image at perticular position.Iam able to change the background image of selected image successfully within the onItemClick method.But i need to change the old selected background image also as non-selected one.</p><pre><code>public void onItemClick(AdapterView&lt;?&gt; arg0, View view, int position, long arg3) {        //previouse selected image  //here sometimes it is changing background of another image(which is not a old selected image)          if(mSelectedItemIndex!=-1 &amp;&amp; mSelectedItemIndex!=position){ //              Object v =mGallery.getItemAtPosition(mSelectedItemIndex);//              View v =imageAdapter.getDropDownView(mSelectedItemIndex,null,null);//          View v =mGallery.getChildAt(mSelectedItemIndex);                View v = (View)view.getChildAt(mSelectedItemIndex);            ImageView imgView = (ImageView) v.findViewById(R.id.adsimage);//          ImageView imgView = (ImageView)v;//          ImageView imgView = (ImageView)arg0.findViewById(R.id.adsimage);            imgView.setBackgroundResource(R.drawable.gallery_unselected_default);//current selected image//always this code is working fine.ImageView imgView = (ImageView)view.findViewById(R.id.adsimage);        imgView.setBackgroundResource(R.drawable.gallery_selected_focused);}</code></pre><p>I used getItemBackground theme in base adapter but no use.Please give me how to persist image positions if gallery is scrolling form left to right and right to left.If i select one by one it is working fine.But when i select alternate image.It is not working.</p>","486216","","","","","2011-07-13 06:46:16","How to handle the positions in Gallery android?","<android><image-gallery>","1","2","1","",""
"4958303","1","4958489","","2011-02-10 14:26:54","0","613","<p>I want a widget that behaves like a togglebutton and can have its background color changed from code in runtime. Is there such a widget out there?</p><p>Or can someone put me in the right direction of how to develop av widget with the desired features? Samples? </p>","162003","","","","","2011-02-10 14:44:43","Android Togglebutton with changeable backgroundcolor?","<android><widget><togglebutton>","1","0","","",""
"4958498","1","","","2011-02-10 14:45:29","8","4640","<p>We are developing an application where we need to capture MotionEvents from multiple views simultaneously. When we try to do so, Android only dispatches events to the first touched view and, when touching another view simultaneously, it gives us an ACTION_POINTER_DOWN on the first view only, even if the pointer coordinates are outside its bounds and inside the other views'.</p><p>Is there any way we can get events dispatched to every touched view (in separate calls to OnTouch)?</p><p>We believe intercepting the touch events from a parent view and then manually dispatching them to each view might work, but even if it does, it would not be practical for what we are trying to achieve. Is there an easier way?</p>","611557","","114066","","2012-06-15 08:15:20","2014-02-20 07:55:05","Multiple Views OnTouch Events","<android>","3","0","3","",""
"4958520","1","","","2011-02-10 14:47:36","4","986","<p>i have a set of activities on my stack Say A-->B-->C. when i launchthe activity named 'D' it should get fired as the root activity of myapplication and all the other activities(A,B,C) should get clearedfrom my stack once Activity D is launched.Can any one tell me as howto do this </p>","586484","","","","","2013-03-27 23:10:43","Make a particular activity as a root activity in stack","<android><activity><stack><android-intent>","1","0","2","",""
"4958543","1","4958578","","2011-02-10 14:49:33","1","1146","<p>Have you noticed a significant battery drain when debugging Android application on the phone? </p><p>Also, does a lot of Log.d() messages drains the battery?</p>","437039","","418613","","2012-06-08 12:34:40","2012-06-08 12:34:40","Android debugging -> battery drains","<android><debugging><power-management>","3","1","","",""
"4958557","1","","","2011-02-10 14:50:46","1","1941","<p>I am trying to achieve from code the following: (can't post images unfortunatelly)</p><p>A rectangle with rounded corners, with an emboss effect (the light comes from top left corner).In the middle there is a circle engraved in the rectangle. Imagine a water surface, and a drop of water hits the surface. It creates a dent in the surface. That circle is also painted with some linear gradient.</p><p>The problem is I could only use the EmbossMaskFilter from Android to raise the surface, to make it closer to the user eye, but I don't know how to implement the opposite.Anyone can help me with that?</p><p>Thank you very much.</p>","526451","","","","","2013-02-04 04:08:42","Android gradient emboss effect","<android>","2","0","","",""
"4958596","1","5039076","","2011-02-10 14:54:08","0","637","<p>Stuck on an issue with http post data.</p><p>So we've created a webview to work in.</p><p>Then called a third party webservice this ask's to provide a postback url and some parameters, the webservice then processes the paramaters and redirects the user (our app) to the postback url we provided, with some data as a http post.</p><p><strong>We want to get the post data from this postback url but within the webview or within our app.</strong></p><p>Tried intercepting the url load with this code:</p><pre><code>   final WebView webview = new WebView(this);   webview.setWebViewClient(new WebViewClient() {   @Override        public boolean shouldOverrideUrlLoading(WebView view, String url) {            // Grab data here...            return super.shouldOverrideUrlLoading(view, url);        }    }); </code></pre><p>However can't seem to find any objects or methods to gain access to the data within this method.</p><p>The other attempt was to give them the postback url as an intent within our app like:</p><pre><code>   myscheme://someText/someParam</code></pre><p>this would have started a new activity when the postback is called (as we have set up an intent-filter within our android-manifest), this intent fires up our app activity within a browser but not within our webview, but anyway again we can't see how to access the post data from this.</p><p>Thanks for looking,</p><p>Any ideas?</p>","413127","","413127","","2011-02-10 15:34:47","2011-02-18 08:26:56","Receive post data from a 3rd party within a webview","<android><post><httpwebrequest><postback><android-intent>","1","0","","",""
"4958606","1","","","2011-02-10 14:54:37","1","519","<p>i want to customize DatePickerDialog. My core objective is to change the theme of whole DatePickerDialog. </p><p>is this possible to customize the theme of DatePickerDialog.</p><p>if this not possible then i want the sample code for any date picker.</p>","309990","","","","","2011-02-10 14:54:37","how to customize DatePickerDialog?","<android>","0","1","","",""
"4958607","1","4958646","","2011-02-10 14:54:45","0","218","<p>I'm having an application with different views, and when I'm ""flinging"" at right or left another view pops in and the other slides out. Most of the application is based in that activity.</p><p>Since every view has buttons and lists (which you are supposed to interact with), the activity class is getting rather big and I was thinking of separating it. But which is the best way to do that?</p><p>Should I create classes that gets the activity context so I can declare the buttons value (findviewbyid()) etc. or is there another way to do this.</p><p>Is there a danger in sending the activity context? Is getApplicationContext() better to use for a time like this?, or should I just keep working on the class which is getting quite big?</p><p>Maybe there is a better way to do this?</p>","525016","","","","","2011-02-10 14:58:42","Sending context/activity? Leaks? - Android","<android>","1","0","","",""
"4958609","1","4990625","","2011-02-10 14:54:58","1","462","<p>In my app I locate the location of the user and give them the option to send it through email.The only thing i send is the Maps url. Now i want 'spice' the email up and add a little picture of the map (with a marker for the location) to the mail.</p><p>I googled but couldn't find a way to do this.</p><p>Can you help me?</p>","517460","","","","","2011-04-05 10:44:41","Send a picture of a map through email in Android","<java><android><email><google-maps>","3","0","1","",""
"4958628","1","4958665","","2011-02-10 14:56:49","2","7222","<p>I want that a new activity should start with some delay on pressing a button.Is it possible to do that , and whats the procedure.</p>","569938","","","","","2013-05-30 06:47:51","How to start a different activity with some delay after pressing a button in android?","<android>","4","0","2","",""
"4958703","1","4959338","","2011-02-10 15:03:22","0","1130","<p>I have a app that gets a string from a database and it sets to a label. Now i want that label to underline one word such as ""This word should be underlined."" and i want to be able to click on that underline word and get its value. So do i set it up before i send it to the database or after. Thanks for any help. I tried code below and each line is highlighted because of the for loop. please help</p><pre><code>SpannableStringBuilder builder = new SpannableStringBuilder();            for(int i=0;i&lt;ListClass.getLatestActivity().size();i++){                String myString  = ListClass.getLatestActivity().get(i);                builder.append(myString);                String substringThatShouldBeClickable = myString.substring(0,myString.indexOf(' ')).trim();                MySpan span = new MySpan(substringThatShouldBeClickable);                span.setOnMySpanClickListener(mySpanOnClickListener);                int start = 0;                int end = builder.length();                builder.setSpan(span, start, end, 0);                builder.append(""\n"" + ""\n"") ;            }            RAInfo.setText(builder);                RAInfo.setMovementMethod(LinkMovementMethod.getInstance());</code></pre>","516883","","527702","","2013-02-08 12:40:15","2013-02-08 12:40:15","android dev how to underline and change color of word in string like a link color","<android><text-formatting>","1","2","","",""
"4958860","1","4959362","","2011-02-10 15:14:44","14","2848","<p>I have an application that uses a lot of Log.d() or Log.e() calls for debugging. Now I want to create my final package for release. The Android Export feature from Eclipse mentions to remove the ""Debuggable"" flag in the manifest, which I have done. Should I also comment all the Log calls to improve the performance of my application or these calls will do nothing in the non debuggable final version package ?</p>","578668","","","","","2011-02-10 15:53:28","Should I comment my log calls when creating my final package?","<android>","3","0","9","",""
"4958973","1","4959048","","2011-02-10 15:24:28","0","337","<p>Would you please tell me about any good third party xml parsing library that can be used in Android</p><p>thanks</p>","235123","","","","","2011-07-29 08:32:42","3rd party Android XML parser?","<android>","2","4","","",""
"4959107","1","4959214","","2011-02-10 15:35:14","2","1349","<p>What size should Android pre-Gingerbread HDPI notification bar icons be?</p><p>In the documentation it says for MDPI 25x25 with a 2-pixel safeframe, i.e. 21x21:</p><p><a href=""http://developer.android.com/guide/practices/ui_guidelines/icon_design_status_bar.html"" rel=""nofollow"">http://developer.android.com/guide/practices/ui_guidelines/icon_design_status_bar.html</a></p><p>Using the standard 50% upscaler for HDPI, 21*1.5 = 31.5. So should they be 32x32 + 3 + 3 = 38x38, or 31x31 + 3 + 3 = 37x37? I want a value that won't get auto-scaled :-)</p>","408227","","","","","2013-07-26 11:25:21","What size should Android pre-Gingerbread HDPI notification bar icons be?","<android><android-layout>","3","0","","",""
"4959475","1","","","2011-02-10 16:02:35","0","3213","<p>I created an app icon on <code>GIMP</code> with transparent background and double checked the transparency by pasting the icon image on colored pages in word editors. I went ahead and used the icon image and created the apk file. However, after installation, the icon background is not transparent on the device(LG Optimus S) screen. Has anyone ever had this issue? Thanks in advance for any suggestions or ideas.</p>","611656","","750613","","2012-07-13 11:51:44","2012-07-13 11:51:44","App Icon with transparent background doesn't appear transparent on device","<android><icons>","1","3","","",""
"4959485","1","4959900","","2011-02-10 16:03:13","19","13329","<p>AFAIK on Android, it is recommended to reference Bitmap objects as WeakReferences in order to avoid memory leaks. When no more hard references are kept of a bitmap object, the garbage collector will automatically collect it.</p><p>Now, if I understand correctly, the method Bitmap.recycle() must always be called to free a Bitmap. I think this is because Bitmap objects have special memory management.</p><p>Is that correct?</p><p>If this is true, when using WeakReferences, there must be memory leaks because Bitmap.recycle() is never called when the WeakReferences are freed. Or, somehow, are WeakReferences sufficient to avoid memory leaks?</p><p>Thanks</p>","590392","","379482","","2013-04-02 01:19:46","2013-04-02 01:19:46","Bitmap, Bitmap.recycle(), WeakReferences, and Garbage Collection","<android><memory-leaks><garbage-collection><bitmap><weak-references>","1","0","10","",""
"4959495","1","4964543","","2011-02-10 16:03:53","5","5994","<p>In my android application I make extensive use of a native method that returns some data.</p><p>However after a number of calls I obtain a crash.</p><p>The native called method is :</p><pre><code>static jbyteArray JNIGetIcon(JNIEnv* e, jclass clazz){    ByteBuffer buff;    buff.Write(*icon, 48, 32, r66Api::IBitmap::TEncoding::EEnc_Rgba8888);    jbyteArray result = GetEnv()-&gt;NewByteArray(buff.Size());    GetEnv()-&gt;SetByteArrayRegion(result, 0, buff.Size(), (jbyte*)  buff.GetData());    return result;     }</code></pre><p>Could someone point me to what I'm doing wrong ?</p><p>the crash log is:</p><pre><code>02-10 18:33:32.075 W/dalvikvm(10644*10644): ReferenceTable overflow (max=1024)02-10 18:33:32.075 W/dalvikvm(10644*10644): Last 10 entries in JNI pinned array reference table:02-10 18:33:32.075 W/dalvikvm(10644*10644): 1014: 0x2fc77de0 cls=[C (28 bytes)02-10 18:33:32.075 W/dalvikvm(10644*10644): 1015: 0x2fc79b88 cls=[C (28 bytes)02-10 18:33:32.075 W/dalvikvm(10644*10644): 1016: 0x2fc79c38 cls=[C (28 bytes)02-10 18:33:32.085 W/dalvikvm(10644*10644): 1017: 0x2fc79ef8 cls=[C (28 bytes)02-10 18:33:32.085 W/dalvikvm(10644*10644): 1018: 0x2fc79fa8 cls=[C (28 bytes)02-10 18:33:32.085 W/dalvikvm(10644*10644): 1019: 0x2fc7a050 cls=[C (28 bytes)02-10 18:33:32.085 W/dalvikvm(10644*10644): 1020: 0x2fc7a0f0 cls=[C (28 bytes)02-10 18:33:32.105 W/dalvikvm(10644*10644): 1021: 0x2fc7a190 cls=[C (28 bytes)02-10 18:33:32.105 W/dalvikvm(10644*10644): 1022: 0x2fc7a240 cls=[C (28 bytes)02-10 18:33:32.105 W/dalvikvm(10644*10644): 1023: 0x2fc7a2e8 cls=[C (28 bytes)02-10 18:33:32.115 W/dalvikvm(10644*10644): JNI pinned array reference table summary (1024 entries):02-10 18:33:32.115 W/dalvikvm(10644*10644): 6 of [C 20B (5 unique)02-10 18:33:32.115 W/dalvikvm(10644*10644): 1013 of [C 28B (237 unique)02-10 18:33:32.125 W/dalvikvm(10644*10644): 2 of [C 36B (2 unique)02-10 18:33:32.125 W/dalvikvm(10644*10644): 1 of [C 52B02-10 18:33:32.125 W/dalvikvm(10644*10644): 1 of [C 68B02-10 18:33:32.125 W/dalvikvm(10644*10644): 1 of [C 92B02-10 18:33:32.125 W/dalvikvm(10644*10644): Memory held directly by native code is 7020 bytes02-10 18:33:32.135 E/dalvikvm(10644*10644): Failed adding to JNI pinned array ref table (1024 entries)02-10 18:33:32.135 I/dalvikvm(10644*10644): ""main"" prio=5 tid=3 RUNNABLE02-10 18:33:32.135 I/dalvikvm(10644*10644): | group=""main"" sCount=0 dsCount=0 s=N obj=0x2aaca308 self=0xbe0802-10 18:33:32.135 I/dalvikvm(10644*10644): | sysTid=10644 nice=0 sched=0/0 cgrp=unknown handle=187722411602-10 18:33:32.135 I/dalvikvm(10644*10644): at android.graphics.Canvas.drawText(Native Method)02-10 18:33:32.145 I/dalvikvm(10644*10644): at android.text.BoringLayout.draw(BoringLayout.java:363)02-10 18:33:32.145 I/dalvikvm(10644*10644): at android.widget.TextView.onDraw(TextView.java:4052)02-10 18:33:32.155 I/dalvikvm(10644*10644): at android.view.View.draw(View.java:6535)02-10 18:33:32.155 I/dalvikvm(10644*10644): at android.view.ViewGroup.drawChild(ViewGroup.java:1531)02-10 18:33:32.155 I/dalvikvm(10644*10644): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1258)02-10 18:33:32.165 I/dalvikvm(10644*10644): at android.view.View.draw(View.java:6538)02-10 18:33:32.165 I/dalvikvm(10644*10644): at android.view.View.buildDrawingCache(View.java:6297)02-10 18:33:32.165 I/dalvikvm(10644*10644): at android.view.View.getDrawingCache(View.java:6086)02-10 18:33:32.165 I/dalvikvm(10644*10644): at android.view.ViewGroup.drawChild(ViewGroup.java:1456)02-10 18:33:32.175 I/dalvikvm(10644*10644): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1258)</code></pre>","304866","","851498","","2013-05-03 13:08:44","2013-05-03 13:08:44","Jni Reference Table overflow","<c++><android><jni>","1","0","2","",""
"4959586","1","4959960","","2011-02-10 16:10:41","0","1663","<p>I have a couple of dialogs inside a dialog that are throwing the exception:</p><pre><code>02-10 15:52:45.592: ERROR/AndroidRuntime(321): java.lang.IllegalArgumentException: Activity#onCreateDialog did not create a dialog for id 2</code></pre><p>The code is :</p><pre><code>dialog.setButton(DialogInterface.BUTTON_POSITIVE, ""Yes"",            new DialogInterface.OnClickListener() {                public void onClick(DialogInterface dialog, int which) {                ....           showDialog(ID_DIALOG_SEND);</code></pre><p>The dialog is defined as follows:</p><pre><code> @Override protected Dialog onCreateDialog(int id) {        switch (id) {    case ID_DIALOG_SEND:        ProgressDialog loadingDialog = new ProgressDialog(this);        loadingDialog.setMessage(""Sending..."");        loadingDialog.setIndeterminate(true);        loadingDialog.setCancelable(false);        return null;      ....</code></pre><p>And it doesn't work for this dialog either:</p><pre><code>Builder b = new AlertDialog.Builder(this);case ID_DIALOG_ERR:b.setMessage(""Error"")        .setCancelable(false)        .setPositiveButton(""OK"",            new DialogInterface.OnClickListener() {                    public void onClick(DialogInterface dialog, int which) {                    }                });        return null;</code></pre><p>Any hints?</p><p>Thanks</p>","253944","","","","","2012-02-21 10:40:46","Exception creating dialog inside a dialog in android","<android><dialog>","2","0","","",""
"4959628","1","4960971","","2011-02-10 16:14:01","14","9182","<p>I've an AsyncTask that I shut down in the Activity's onPause lifecycle event, so it doesn't run when someone leaves the app, but it keeps going despite this. I added some tracing and this snippet shows the problem. </p><pre><code>    Trace.d(TAG,""Task state: "" + myTask.getStatus() );    myTask.cancel(true);    Trace.d(TAG,""Task state: "" + myTask.getStatus() );</code></pre><p>Outputs:</p><pre><code>Task state: RUNNINGTask state: RUNNING</code></pre><p>Why is the cancel() method not having any effect on the state of the task? I notice the docs say the cancel method will ""attempt"" to stop the task, but under what circumstances will it fail? The task is definitely running as it is outputting log output every ten seconds, and as you can see above its status is returned as running.</p><p>Update: I added tracing to show me the isCancelled() state as well and that DOES change. So the call to cancel(true) is changing the cancelled state from false to true, but apparently having no effect on the Status, or stopping the thread.</p>","477415","","477415","","2011-02-10 16:19:23","2013-12-24 19:01:36","Android AsyncTask won't stop when cancelled, why?","<android><android-asynctask>","5","5","1","",""
"4959864","1","4959963","","2011-02-10 16:30:41","0","2016","<p>How do I implement image scrolling like in motors.co.uk app?<a href=""https://market.android.com/details?id=com.motors.activities"" rel=""nofollow"">https://market.android.com/details?id=com.motors.activities</a></p>","468311","","","","","2011-02-10 16:40:10","Android scrolling images","<android>","1","0","1","",""
"4959994","1","4961562","","2011-02-10 16:43:16","0","306","<p>the following Android layout is a custom row for my listactivity. The second textview in the tablerow does not stretch to fit the column like I want it to. Note that there is only one tablerow because I took the others out for brevity.</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:padding=""6dip""&gt;    &lt;ImageView         android:id=""@+id/DocTypeIcon""         android:layout_width=""wrap_content""         android:layout_height=""wrap_content""         android:src=""@drawable/icon""         android:layout_gravity=""center_vertical"" /&gt;    &lt;TableLayout         android:id=""@+id/tableLayout1""         android:layout_toRightOf=""@id/DocTypeIcon""         android:layout_height=""wrap_content""         android:layout_width=""fill_parent""         android:stretchColumns=""1""&gt;        &lt;TableRow             android:id=""@+id/tableRow1""             android:layout_width=""fill_parent""             android:layout_height=""wrap_content""&gt;                &lt;TextView                     android:id=""@+id/textView1""                     android:layout_width=""wrap_content""                     android:layout_height=""wrap_content""                     android:text=""Pages""                     android:textStyle=""bold""                     android:layout_marginRight=""10dp"" /&gt;                &lt;TextView                     android:id=""@+id/DynamicTextHere""                     android:layout_height=""wrap_content""                     android:layout_width=""fill_parent"" /&gt;        &lt;/TableRow&gt;        &lt;!-- Other rows stripped for brevity --&gt;    &lt;/TableLayout&gt;&lt;/RelativeLayout&gt;</code></pre><p>When I put stretchColumns=""1"" in, I see nothing but a couple of artifacts on the screen.When stretchColumns is not there the layout only goes to a fixed width. I believe it might be the RelativeLayout screwing me up. However, that is more of a drastic change than I want. Can I do something small to make this row fit to my screen (both portrait and landscape)?</p>","457577","","457577","","2011-02-10 17:03:34","2011-02-10 19:16:51","android tableview issue","<android><xml><design><layout><tablelayout>","1","0","","",""
"4960051","1","","","2011-02-10 16:47:55","0","45","<p>This is my senteces table</p><pre><code>private static final String CREATE_TABLE_7 =    "" create table "" + SENS_TABLE +    "" (_id integer primary key autoincrement,"" +    "" id_thsen integer REFERENCES Thai_sentences(_id),"" +    "" id_lang integer REFERENCES Languages(_id),"" +    "" sen text not null,"" +    "" reading text not null);"";</code></pre><p>and this is my languages table</p><pre><code>private static final String CREATE_TABLE_3 =    "" create table "" + LANGS_TABLE +    "" (_id integer primary key autoincrement,"" +    "" lang text not null,"" +    "" active_status integer not null);"";</code></pre><p>I want to query sentence (from sentence table) and show only the sentence which language is active (=1 , 0= don't active) because in my application user can select what language of sentence people want to see   </p><p>for example</p><p>sentences table</p><pre><code>initialValues6.put(KEY_SEN_ID_TH_SEN,""7"");        initialValues6.put(KEY_SEN_ID_LANG,""1"");        initialValues6.put(KEY_SEN,""I lost my travelers cheques."");        initialValues6.put(KEY_SEN_READING,""??-????-???-???????????-???"");        db.insert(SENS_TABLE, null, initialValues6);        initialValues6.put(KEY_SEN_ID_LANG,""2"");        initialValues6.put(KEY_SEN,""Ho perso il mio travellers cheques."");        initialValues6.put(KEY_SEN_READING,""??-????-?????-???????????-???????"");        db.insert(SENS_TABLE, null, initialValues6);</code></pre><p>languages table </p><pre><code>initialValues3.put(KEY_LANG, ""ENGLISH"");        initialValues3.put(KEY_ACT, ""1"");        db.insert(LANGS_TABLE, null, initialValues3);        initialValues3.put(KEY_LANG, ""THAI"");        initialValues3.put(KEY_ACT, ""0"");        db.insert(LANGS_TABLE, null, initialValues3);</code></pre><p>you can see that ""ENGLISH"" have active key = 1 ""THAI"" have active key = 0</p><p>so if it shoule show only<strong>I lost my travelers cheques.??-????-???-???????????-???</strong></p><p>Please help...........THANKS</p>","605358","","","","","2011-02-10 16:47:55","about query database","<android><sqlite>","0","2","","",""
"4960054","1","","","2011-02-10 16:48:08","0","591","<p>Hii´m a beginner in android, </p><p>I have a textView that has the value 2:00 that is representing 2 minutes and 00 seconds to go.</p><p>i have a stopwatch function that will count up.i have integratet them to work upwars </p><p>what i trying to do is to for every seconds that pass i will show 1:591:58 1:57and so on until reaching 0:00 </p><p>The help i need is to reformat the textview text to time and than for every go seconds - 1 </p><p>in c# I would probably use 2:00.addseconds(-1) 2:00 is representing the reformatted textview.</p><p>i am not very familiar with java at all :(</p><p>thanx</p>","611737","","","","","2011-02-11 13:39:37","Getting a countdown from string 02:00 minutes android","<android><datetime><time><format>","4","0","","",""
"4960073","1","5250178","","2011-02-10 16:49:20","5","7851","<p>I'm trying to get a row of text which will be something like</p><p>foofoofoo - barbarbar</p><p>but I want it to ellipse foo and bar if it won't fit on one line.i.e. I'm trying to shorten them down.</p><pre><code>&lt;LinearLayout    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""&gt;    &lt;TextView android:id=""@+id/text_1""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:adjustViewBounds=""true""        android:maxWidth=""0dip""        android:layout_weight=""1""        android:textColor=""#ffffff""        android:singleLine=""true""        android:ellipsize=""true""        android:text=""foofoofoofoo"" /&gt;    &lt;TextView        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:textColor=""#ffffff""        android:text="" - "" /&gt;    &lt;TextView        android:id=""@+id/text_2""        android:layout_width=""wrap_content""                                 android:layout_height=""wrap_content""        android:maxWidth=""0dip""        android:layout_weight=""1""        android:textColor=""#ffffff""        android:singleLine=""true""        android:ellipsize=""true""        android:text=""barbarbarbar"" /&gt;&lt;/LinearLayout&gt;</code></pre><p>Bear with me this works partially.</p><p>Setting the <code>TextView</code>'s <code>layout_width</code> to be <code>0dip</code> and <code>layout_weight</code> to be <code>1</code> means they will take up 50% of the available space each.</p><p>Setting the <code>singleLine</code> to <code>true</code> and <code>ellipsize</code> to <code>true</code> means they will look like <em>foofoo...</em> if the text is larger than the container.</p><p>Therefore my outcome (if the text is longer) should be</p><blockquote>  <p><em>foofoo.. - barbar..</em></p></blockquote><p>Which it is! So this works.</p><p><strong>Now the case I'm trying to fix is</strong>, if the first <code>TextView</code> (id:text_1) has text that is less than the 50% given by <code>layout_width=""0dip""</code> and <code>layout_weight=""1""</code> I want it to <code>wrap_content</code>. Otherwise it looks like:</p><blockquote>  <p><em>foo</em>        <strong>blank space</strong>   <em>- barbar..</em></p></blockquote><p>and I want</p><blockquote>  <p><em>foo - barbarbar</em></p></blockquote><p>This is why I have changed <code>layout_width=""wrap_content""</code> and added <code>android:maxWidth=""0dip""</code> but this doesn't work! It seems to be ignoring me saying <code>wrap_content</code> and still giving this view 50%!</p><p>I read that you need to add <code>android:adjustViewBounds=""true""</code> for <code>maxWidth</code> to work but this had no affect.</p>","413127","","413127","","2011-02-10 20:20:17","2011-03-09 18:12:34","Android layout using layout_weight, layout_width and maxWidth","<android><layout><textview><weight>","2","0","","",""
"4960125","1","4960272","","2011-02-10 16:53:33","2","2105","<p>I have recorded using the Mic in my android app and this plays perfectly well when using the AudioPlayer class having streamed the data in. My problem is I want to append a wav header to this data so it can be played outside of the application. I am pretty sure the methods to create the header work after playing around in a hex editor with other audio files, which leads to the pcm data recorded to not being useful as raw data in a wav file?</p><p>Can anybody shed any light on this? I can import the pcm/wav file into audacity as a raw file and it plays perfectly but when I try it as just opening the wav I just get noise, again hinting the pcm data is at fault.</p><p><strong>Recording Settings:</strong></p><pre><code>int frequency = 22050;int channelConfiguration = AudioFormat.CHANNEL_CONFIGURATION_MONO;int audioEncoding = AudioFormat.ENCODING_PCM_16BIT;</code></pre><p><strong>Header Variables:</strong></p><pre><code>byte[] clipData = data;long myDataSize = clipData.length;long mySubChunk1Size = 16;int myBitsPerSample= 16;int myFormat = 1;long myChannels = 1;long mySampleRate = 22050;long myByteRate = mySampleRate * myChannels * myBitsPerSample/8;int myBlockAlign = (int) (myChannels * myBitsPerSample/8);long myChunk2Size =  myDataSize * myChannels * myBitsPerSample/8;long myChunkSize = 36 + myChunk2Size;try        {            File audioDirectory = new File(Environment                    .getExternalStorageDirectory().getAbsolutePath()                    + ""/Directory/"");            audioDirectory.mkdir();            File file = new File(audioDirectory, ""test.wav"");            if (file.exists())                file.delete();            // Create the new file.            try {                file.createNewFile();            } catch (IOException e) {                throw new IllegalStateException(""Failed to create ""                        + file.toString());            }            OutputStream os = new FileOutputStream(file);            BufferedOutputStream bos = new BufferedOutputStream(os);            DataOutputStream outFile = new DataOutputStream(bos);            // write the wav file per the wav file format            outFile.writeBytes(""RIFF"");                 // 00 - RIFF            outFile.write(intToByteArray((int)myChunkSize), 0, 4);      // 04 - how big is the rest of this file?            outFile.writeBytes(""WAVE"");                 // 08 - WAVE            outFile.writeBytes(""fmt "");                 // 12 - fmt             outFile.write(intToByteArray((int)mySubChunk1Size), 0, 4);  // 16 - size of this chunk            outFile.write(shortToByteArray((short)myFormat), 0, 2);     // 20 - what is the audio format? 1 for PCM = Pulse Code Modulation            outFile.write(shortToByteArray((short)myChannels), 0, 2);   // 22 - mono or stereo? 1 or 2?  (or 5 or ???)            outFile.write(intToByteArray((int)mySampleRate), 0, 4);     // 24 - samples per second (numbers per second)            outFile.write(intToByteArray((int)myByteRate), 0, 4);       // 28 - bytes per second            outFile.write(shortToByteArray((short)myBlockAlign), 0, 2); // 32 - # of bytes in one sample, for all channels            outFile.write(shortToByteArray((short)myBitsPerSample), 0, 2);  // 34 - how many bits in a sample(number)?  usually 16 or 24            outFile.writeBytes(""data"");                 // 36 - data            outFile.write(intToByteArray((int)myDataSize), 0, 4);       // 40 - how big is this data chunk            outFile.write(clipData);                        // 44 - the actual data itself - just a long string of numbers        }</code></pre><p><strong>Convertors</strong></p><pre><code>public static int byteArrayToInt(byte[] b)    {        int start = 0;        int low = b[start] &amp; 0xff;        int high = b[start+1] &amp; 0xff;        return (int)( high &lt;&lt; 8 | low );    }    // these two routines convert a byte array to an unsigned integer    public static long byteArrayToLong(byte[] b)    {        int start = 0;        int i = 0;        int len = 4;        int cnt = 0;        byte[] tmp = new byte[len];        for (i = start; i &lt; (start + len); i++)        {            tmp[cnt] = b[i];            cnt++;        }        long accum = 0;        i = 0;        for ( int shiftBy = 0; shiftBy &lt; 32; shiftBy += 8 )        {            accum |= ( (long)( tmp[i] &amp; 0xff ) ) &lt;&lt; shiftBy;            i++;        }        return accum;    }// ===========================// CONVERT JAVA TYPES TO BYTES// ===========================    // returns a byte array of length 4    private static byte[] intToByteArray(int i)    {        byte[] b = new byte[4];        b[0] = (byte) (i &amp; 0x00FF);        b[1] = (byte) ((i &gt;&gt; 8) &amp; 0x000000FF);        b[2] = (byte) ((i &gt;&gt; 16) &amp; 0x000000FF);        b[3] = (byte) ((i &gt;&gt; 24) &amp; 0x000000FF);        return b;    }    // convert a short to a byte array    public static byte[] shortToByteArray(short data)    {        return new byte[]{(byte)(data &amp; 0xff),(byte)((data &gt;&gt;&gt; 8) &amp; 0xff)};    }</code></pre>","400406","","400406","","2011-02-10 17:28:09","2011-03-06 14:15:59","AudioRecord PCM data of no use?","<java><android><pcm>","2","0","","",""
"4960215","1","4960387","","2011-02-10 17:01:29","0","1341","<p>I'm about to publish my first application. I created all the necessary icons, in my case the launcher icons and the status icons (which I only created for my app next versions updates).</p><p>But I am wondering where the status icons names are set. I mean, the launcher icon name is set in the Manifest file this way :</p><pre><code>android:icon=""@drawable/ic_launcher""</code></pre><p>so is there a similar place to set the status icon name?</p><p>Thanks in advance!</p>","544659","","1292730","","2012-05-01 15:46:45","2012-05-01 15:46:45","Set status bar icon names","<android><icons><manifest><statusbar>","1","0","","",""
"4960235","1","4960473","","2011-02-10 17:02:50","12","1838","<p>I'm new to Android dev and I'm almost ready to release a first version of my app :)</p><p>While testing the signed release apk on my phone, it refuse to install because the debug version is installed with the debug signature.</p><p>So I have to uninstall the debug version but it delete all my database (and it will do it to my friends who are testing it).</p><p>Is there a way to manage a debug and a release version of the same app without losing data?</p>","600351","","","","","2014-04-02 17:30:32","how to manage debug and release version on android device?","<android><device><conflict><signature>","3","1","3","",""
"4960425","1","4986181","","2011-02-10 17:19:54","6","1409","<p>I have an activity that may have threads running when the user presses back and finish()es the activity. What happens to those threads at that point? Will they all attempt to complete unless I interrupt them in onDestroy()?</p><p>For example, is the below code unsafe, because my views and cursor may be destroyed if the activity finishes before the thread?</p><p>The reason I ask is that I have occasional crashes when finishing activities that I haven't successfully debugged yet, because they happen rarely and never while I've been in debug mode. I have since started checking if my view objects are null before doing anything to them in runOnUIThread(). Not sure if that's the cleanest solution, or if that is the problem at all.</p><pre><code>new Thread()(public void run(){    crunchOnSomethingForAwhile(mCursor);    MyActivity.this.runOnUIThread(new Runnable(){        public void run(){            mTextView.setText(""thread complete"");            mCursor.close();        }    }}).start();</code></pre>","506796","","","","","2011-02-13 19:02:16","What happens to an activity's threads and views when it's destroyed?","<android>","2","2","2","",""
"4960474","1","4960623","","2011-02-10 17:23:44","0","944","<p>I want to add x Files to a folder resources in Eclipse</p><p>Now I want to get a List with the unknown number and names of Files in the specified Folder like:</p><pre><code>File directory = new File(""resources/"");String[] dirArray = directory.list();</code></pre><p>Where do I put the Files in Eclipse and where are they once my app is started?I can get the directory Info for / but that's about it.</p><p>Thanks in advance! Taber</p>","611785","","512958","","2011-02-10 17:28:32","2011-02-10 23:43:26","How can I get a Directory Listing of Files i gave my Android App with Eclipse","<android><eclipse><file-io>","3","0","","",""
"4960499","1","","","2011-02-10 17:25:45","1","7934","<p>I'm building a hunting application for which I need weather information in form of a RSS feed from <a href=""http://www.meteo.si/uploads/probase/www/fproduct/text/sl/fcast_si-region_latest.rss"" rel=""nofollow"">this</a> site.</p><p>I've used the code from <a href=""http://www.warriorpoint.com/blog/2009/07/19/android-simplified-source-code-for-parsing-and-working-with-xml-data-and-web-services-in-android/"" rel=""nofollow"">this</a> site and it list the feeds, but when I click on an item it doesn't connect it to the site for more information. I would like to get temperture and wind information but I don't know how to because I'm a beginer to programming.</p><p>I would very much appreciate any help especially in form of a code that would solve my problem.</p>","555058","","418183","","2011-02-10 17:29:08","2013-09-11 02:49:28","Parsing RSS feed to android application","<android><parsing><rss>","2","4","","",""
"4960538","1","","","2011-02-10 17:29:01","0","333","<p>In my activity class I have a for loop that parses a XML script and dumps that data into an  <code>EditText</code> (that is scrollable).</p><p>I am writing the contents on to this <code>EditText</code> console on a UI thread. For some reason, the console wont print all of the commands in my XML script.</p><p>It stops after a while. So I am wondering if there is any limit for <code>EditText</code> and is there a way to come over it so that I can dump in loads of text into an <code>EditText</code>?</p>","611795","","418183","","2011-02-10 17:35:04","2011-04-21 21:47:30","Is there a max buffer size for EditText?","<android><edittext>","1","2","","",""
"4960753","1","4961480","","2011-02-10 17:50:41","8","3426","<p>I'm successfully converting a ViewGroup (RelativeLayout) into Bitmap using a Canvas. However, when the draw happens I only see the ViewGroup with its background drawable and not its children (two TextViews) who should be laid out within the RelativeLayout using rules like FILL_PARENT.</p><p>The RelativeLayout is created using the following static function:</p><pre><code>public static RelativeLayout createProgrammeView(Context context, int width, int height, String title, String time) {    RelativeLayout.LayoutParams params;    // Layout Root View (RelativeLayout)    RelativeLayout rlv = new RelativeLayout(context);    params = new RelativeLayout.LayoutParams(width, height);    rlv.setLayoutParams(params);    rlv.setPadding(3, 3, 3, 3);    rlv.setBackgroundResource(R.drawable.background);    // Layout Title    TextView tv = new TextView(context);    params = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.FILL_PARENT, RelativeLayout.LayoutParams.WRAP_CONTENT);    params.addRule(RelativeLayout.ALIGN_PARENT_TOP);    params.addRule(RelativeLayout.ALIGN_PARENT_LEFT);    params.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);    tv.setId(R.id.title);    tv.setLayoutParams(params);    tv.setGravity(Gravity.CENTER_VERTICAL);    tv.setSingleLine(true);    tv.setEllipsize(TruncateAt.END);    tv.setTextColor(Color.parseColor(""#fff""));    tv.setTextSize(11);    tv.setText(title);    rlv.addView(tv);    // Layout Start Time    tv = new TextView(context);    params = new RelativeLayout.LayoutParams(16, RelativeLayout.LayoutParams.WRAP_CONTENT);    params.addRule(RelativeLayout.BELOW, R.id.title);    params.addRule(RelativeLayout.ALIGN_PARENT_LEFT);    params.setMargins(0, 4, 0, 0);    tv.setId(R.id.time);    tv.setLayoutParams(params);    tv.setGravity(Gravity.CENTER_VERTICAL);    tv.setSingleLine(true);    tv.setEllipsize(null);    tv.setTextColor(Color.parseColor(""#fff""));    tv.setTextSize(10);    tv.setText(time);    rlv.addView(tv);    }    return rlv;}</code></pre><p>I then use the following to turn the RelativeLayout into a Bitmap:</p><pre><code>public static Bitmap loadBitmapFromView(RelativeLayout v) {    Bitmap b = Bitmap.createBitmap(v.getLayoutParams().width, v.getLayoutParams().height, Bitmap.Config.RGB_565);    Canvas c = new Canvas(b);    v.draw(c);    return b;}</code></pre><p>As expected this gives me a nice Bitmap in the dimensions that I require with the background drawable, but the children are not in the bitmap. I call these functions quite a lot to build a large image which then gets drawn onto a custom view in my activity.</p><p>This is the loop which calls the static function:</p><pre><code>public static void renderViews(final Context context) {    largeBitmap = Bitmap.createBitmap(largeWidth, largeHeight, Bitmap.Config.RGB_565);    Canvas largeCanvas = new Canvas(largeBitmap);    for (int i = 0; i &lt; items.size(); i++) {        int leftMargin = ...SOME CALCULATIONS...;        RelativeLayout newView = createProgrammeView(context, width, rowHeight, ""Title"", ""21:00"");        Bitmap newViewBitmap = loadBitmapFromView(newView);        largeCanvas.drawBitmap(newViewBitmap, leftMargin, 0, new Paint());    }    myCustomView.invalidate();}</code></pre><p>My custom view overrides the onDraw() function:</p><pre><code>@Overrideprotected void onDraw(Canvas canvas) {    super.onDraw(canvas);    canvas.drawBitmap(largeBitmap, 0, 0, null);}</code></pre><p>From what I can see I believe this is because Android doesn't call a measure() on the child Views. I have tried calling this manually, but this doesn't solve the problem.</p><p>So, I guess what I would like to know is, how can I achieve converting a RelativeLayout with children into a Bitmap and get Android to measure the children so they respect their relative layout rules.</p><p>Many thanks to anyone who can help me work this out.</p><p>Rob</p>","611833","","611833","","2011-02-10 18:03:51","2013-08-27 13:40:22","Android Problems Converting ViewGroup with Children into Bitmap","<android><layout><bitmap><children><relativelayout>","2","0","6","",""
"4960758","1","","","2011-02-10 17:51:07","0","2320","<p>I'm not sure if this always happened within my application and just now that I realized that. </p><p>I have an activity that is always in Landscape Mode I have a thread to read messages from a socket runnin too. </p><p>For some reason when I lock my screen using my phone locking button I got a ""Unable to start activity ComponentInfo"". The activity that triggers the error is the same activity that was running when I locked the screen.</p><p>It looks like the activity is recreating itself when I lock the screen.</p><p>I'm out of ideas on how to figure a solution for this... first I thought it had something to the WakeLock that I putted inside the activities code but after removal of that snippet i</p>","214562","","","","","2011-02-10 18:45:34","""Unable to start activity ComponentInfo"" When locking screen","<android><locking><activity>","1","1","","",""
"4960827","1","4960874","","2011-02-10 17:57:09","0","260","<p>The button is hidden...why?</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:padding=""15dp""    android:orientation=""vertical""&gt;    &lt;ListView        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:id=""@+id/feed_list""/&gt;    &lt;Button        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:text=""More""        android:id=""@+id/feed_more""/&gt;&lt;/LinearLayout&gt;</code></pre>","420259","","418183","","2011-02-10 18:03:05","2011-02-10 18:28:33","Why is my button hidden?","<android><layout>","2","0","","",""
"4960871","1","","","2011-02-10 18:00:20","1","540","<p>In any programming language, but preferably JAVA, I am trying to do screen captures from various browsers. I would like to capture the ""whole"" page, even the parts that one has to scroll to see. </p><p>A common method of achieving this is to capture the displayed, visible portion of the screen, then scroll to the next portion and capture it, and so on. One would then take these ""tiles"" and stitch them together in photoshop.</p><p>How can I capture the ""whole"" rendered page without scrolling? Is this possible. Is the page fully rendered but sitting in a video buffer somewhere? For example, let's say a page ends up rendering at 4000 x 4000 pixels. I want to capture the whole mess without scrolling.</p><p>I will want to do this for android, btw.</p>","611825","","","","","2013-12-17 11:43:41","Screen capture when larger than display without scrolling","<java><android><plugins><screen><capture>","1","2","0","",""
"4960940","1","4961010","","2011-02-10 18:08:31","0","33","<p>I've got 2 tabs in my app, one grabs my contacts and geocodes their postcodes, the other tab plots them on a map.</p><p>The geocoding process can be quite time consuming. What is the best practice for handling such length processes?</p><p>Should I have a loading bar when the app starts and do all of the geocoding then or should I force users to click a button to do the geocoding?</p>","155695","","418183","","2011-02-10 18:16:25","2011-02-10 18:17:22","When should a (potentially) longer tasks take place?","<android><geocoding>","1","0","","",""
"4960954","1","4996231","","2011-02-10 18:09:36","6","1232","<p>I have an Android Project where I need to build multiple versions of the same application from the same sources.</p><p>To do this, I use the <a href=""http://code.google.com/p/maven-android-plugin/"">android plugin for Maven</a></p><p>Each version must be able to include ads from admob. So in my POM I added this dependancy </p><pre><code>&lt;dependency&gt;   &lt;groupId&gt;com.admob.android&lt;/groupId&gt;   &lt;artifactId&gt;ads&lt;/artifactId&gt;   &lt;version&gt;20101109-ANDROID-3312276cc1406347&lt;/version&gt;   &lt;scope&gt;system&lt;/scope&gt;   &lt;systemPath&gt;THE_PATH\libs\admob-sdk-android.jar&lt;/systemPath&gt; &lt;/dependency&gt;</code></pre><p>I don't get any errors at build time but, when I execute the application I get this exception</p><pre><code>java.lang.ClassNotFoundException: com.admob.android.ads.AdView</code></pre><p>So apparently the package is not properly included ?</p>","271395","","","","","2014-01-14 16:53:28","Android AdMob and Maven","<android><maven><admob>","2","0","1","",""
"4961119","1","","","2011-02-10 18:29:29","1","13926","<p>Right now, I have a 2x3 table of image buttons and I need to include a <code>TextView</code> at the bottom of the window this is what I have for the <code>TextView</code>:</p><pre><code>&lt;TextView    android:layout_height=""wrap_content""    android:layout_width=""match_parent""     android:layout_gravity=""center_horizontal|bottom""    android:text = ""Hello Connor""    android:textColor = ""#000000""    android:background = ""@drawable/back""/&gt;     &lt;/LinearLayout&gt;&lt;/LinearLayout&gt;&lt;/LinearLayout&gt;</code></pre><p>Right now it creates a <code>TextView</code> at the bottom of the screen, however I need the text inside the box to be centered, and I need the name, ""Connor"" to be bold.  How do I go about doing this in 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=""@color/all_white""&gt;&lt;LinearLayout     android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:orientation=""vertical""&gt;    &lt;LinearLayout        android:orientation=""vertical""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""        android:layout_weight=""1""&gt;        &lt;LinearLayout            android:orientation=""horizontal""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""            android:layout_weight=""1""&gt;            &lt;ImageButton                android:background = ""@android:color/transparent""                android:id=""@+id/imagebutton1""                android:src=""@drawable/button""                android:layout_width = ""wrap_content""                android:layout_height = ""wrap_content""                android:scaleType = ""fitXY""                android:layout_marginTop = ""50px""                android:layout_marginLeft = ""40px""                android:layout_marginRight = ""20px""                android:layout_marginBottom = ""50px""                android:layout_weight=""1""/&gt;            &lt;ImageButton                android:background = ""@android:color/transparent""                android:id=""@+id/imagebutton2""                android:src=""@drawable/button""                android:layout_width = ""wrap_content""                android:layout_height = ""wrap_content""                android:scaleType = ""fitXY""                android:layout_marginTop = ""50px""                android:layout_marginLeft = ""20px""                android:layout_marginRight = ""40px""                android:layout_marginBottom = ""50px""                android:layout_weight=""1""/&gt;        &lt;/LinearLayout&gt;            &lt;LinearLayout            android:orientation=""horizontal""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""            android:layout_weight=""1""&gt;            &lt;ImageButton                android:background = ""@android:color/transparent""                android:id=""@+id/imagebutton3""                android:src=""@drawable/button""                android:layout_width = ""wrap_content""                android:layout_height = ""wrap_content""                android:scaleType = ""fitXY""                android:layout_marginLeft = ""40px""                android:layout_marginRight = ""20px""                android:layout_marginBottom = ""50px""                android:layout_weight=""1""/&gt;            &lt;ImageButton                 android:background = ""@android:color/transparent""                android:layout_height=""wrap_content""                android:id=""@+id/imagebutton4""                 android:src=""@drawable/button""                 android:scaleType = ""fitXY""                android:layout_marginLeft = ""20px""                android:layout_marginRight = ""40px""                android:layout_marginBottom = ""50px""                 android:layout_width=""wrap_content""                 android:layout_weight=""1""/&gt;        &lt;/LinearLayout&gt;         &lt;LinearLayout            android:orientation=""horizontal""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""            android:layout_weight=""1""&gt;            &lt;ImageButton                 android:background = ""@android:color/transparent""                android:layout_height=""wrap_content""                 android:id=""@+id/imagebutton5""                 android:src=""@drawable/button""                 android:scaleType = ""fitXY""                android:layout_marginLeft = ""40px""                android:layout_marginRight = ""20px""                android:layout_marginBottom = ""50px""                android:layout_width=""wrap_content""                android:layout_weight=""1""/&gt;            &lt;ImageButton                android:background = ""@android:color/transparent""                android:id=""@+id/imagebutton6""                android:src=""@drawable/button""                android:layout_width = ""wrap_content""                android:layout_height = ""wrap_content""                android:scaleType = ""fitXY""                android:layout_marginLeft = ""20px""                android:layout_marginRight = ""40px""                android:layout_marginBottom = ""50px""                android:layout_weight=""1""/&gt;        &lt;/LinearLayout&gt;        &lt;TextView        android:layout_height=""wrap_content""         android:layout_gravity=""center_horizontal|bottom""        android:text = ""Powered by Alarm.com""        android:textColor = ""#000000""        android:background = ""@drawable/back"" android:layout_width=""match_parent""/&gt;         &lt;/LinearLayout&gt;&lt;/LinearLayout&gt;&lt;/LinearLayout&gt;</code></pre>","611884","","611884","","2011-02-10 18:45:24","2011-02-10 19:07:16","How do I center text in a TextView and make a part of the text bold","<android><textview>","5","1","1","",""
"4961151","1","4961249","","2011-02-10 18:32:12","95","44640","<p>I just setup the NotePad sample project as described here, but when I try to launch it (Ctrl+F11) I received the following error message box:</p><blockquote>  <p>Path for project must have only one  segment.</p></blockquote><p><img src=""http://i.stack.imgur.com/iBurr.png"" alt=""enter image description here""></p><p>What does this error mean and why is it happening?</p><p>(I tried to consult <a href=""http://dushi.co.uk/09/07/2009/error-path-for-project-must-have-only-one-segment/"">this article</a>, but it seems irrelevant to my problem because I have no getProject anywhere in this copied-verbatim sample project)</p>","418055","","","","","2014-02-04 09:06:11","Android: ""Path for project must have only one segment""","<android>","5","1","18","",""
"4961210","1","","","2011-02-10 18:38:00","0","5859","<p>imagine a list of products (food dishes for a restaurant) you can order, to the right is a minus button, text view showing the quantity and a plus button. I have used a for loop because i dont know how many products. I have used a series of arrays....</p><pre><code>public class menuActivity    extends Activity    implements OnClickListener{    String[] dishes = { ""one"", ""two"", ""three"", ""four"", ""five"", ""six"", ""seven"", ""eight"", ""nine"", ""ten""};    int dishQuantity =10;    LinearLayout linear;    LinearLayout L1, L2;    TableLayout table;    Button[] plus = new Button[dishQuantity];    Button[] minus = new Button[dishQuantity];    TextView[] text = new TextView[dishQuantity];    TableRow[] row = new TableRow[dishQuantity];    TextView[] quantityArray = new TextView[dishQuantity];    int[] quantityValue = new int[dishQuantity];    // declares import of widgets    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        linear = new LinearLayout(this);        table = new TableLayout(this);        linear.setOrientation(LinearLayout.VERTICAL);        // declares Layouts and sets Properties        for (int i =0; i&lt;dishQuantity; i++){            quantityValue[i]=0;        }        // sets quantityValue for each dish to 0        for (int i=0; i&lt;dishQuantity; i++) {             row[i] = new TableRow(this);             text[i] = new TextView(this);             plus[i] = new Button(this);              minus[i] = new Button(this);             quantityArray[i] = new TextView(this);             // declares import arrays             plus[i].setText(""+"");             minus[i].setText(""-"");                       text[i].setText(dishes[i]);             quantityArray[i].setText(String.valueOf(quantityValue[i]));             // sets values             plus[i].setOnClickListener(this);             minus[i].setOnClickListener(this);             row[i].addView(text[i]);             row[i].addView(minus[i]);             row[i].addView(quantityArray[i]);             row[i].addView(plus[i]);             // adds all widgets to corresponding row             table.addView(row[i]);             // adds current row to TableLayout        }         linear.addView(table);        // adds current table to parent Linear Layout - linear        setContentView(linear);        // sets parent Linear Layout - linear to content    }    public void onClick(View arg0) {    // TODO Auto-generated method stub}}</code></pre><p>Obviously if they click the plus button for product 2 i need the the quantityValue for product 2 to increment, but i cannot work out how to set this up in the onClick part and separate out the buttons</p><p>Also how do i change the gravity of the buttons so  they are right aligned</p><pre><code>plus[0].setGravity(RIGHT);</code></pre><p>Any help is greatly appreciated</p>","616546","","299924","","2011-02-10 18:49:00","2012-01-03 20:34:32","Android Application - Array of Buttons, Cannot Implement OnClick Listener","<android>","3","0","","",""
"4961211","1","4961807","","2011-02-10 18:38:03","0","564","<p>I have a small offline web that at some point my application will show through a webview. </p><p>Where should I put the website in my android resources folder in order to be able to load all the javascripts, css etc? </p><p>Thanks in advance. </p>","217527","","189950","","2011-02-10 18:41:14","2011-02-10 19:42:16","Include a website inside android project","<android><webview>","2","0","","",""
"4961355","1","4961467","","2011-02-10 18:54:53","157","142361","<p>I am working on a form layout for a Login Activity in my Android App. The image below is how I want it to look like:</p><p><img src=""http://i.stack.imgur.com/5mrcx.png"" alt=""enter image description here""></p><p>I was able to achieve this layout with the following XML. The problem is, it's a bit hackish. I had to hard-code a width for the host EditText. Specifically, I had to specify:</p><pre><code>android:layout_width=""172dp"" </code></pre><p>I'd really like to give a percentage width to the host and port EditText's . (Something like 80% for the host, 20% for the port.) Is this possible? The following XML works on my Droid, but it doesn't seem to work for all screens. I would really like a more robust solution. </p><pre><code>&lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""android:id=""@+id/main""android:layout_width=""fill_parent""android:layout_height=""fill_parent""&gt;&lt;TextViewandroid:id=""@+id/host_label""android:layout_width=""wrap_content""android:layout_height=""wrap_content""android:layout_below=""@+id/home""android:paddingTop=""0dp""android:paddingLeft=""15dp""android:textSize=""25sp""android:textColor=""#a5d4e2""android:text=""host""android:textStyle=""normal""/&gt;&lt;TextViewandroid:id=""@+id/port_label""android:layout_width=""wrap_content""android:layout_height=""wrap_content""android:layout_below=""@+id/home""android:layout_toRightOf=""@+id/host_input""android:paddingTop=""0dp""android:textSize=""25sp""android:textColor=""#a5d4e2""android:text=""port""android:textStyle=""normal"" /&gt;&lt;EditText android:id=""@+id/host_input"" android:inputType=""textEmailAddress""android:layout_width=""172dp"" android:layout_height=""wrap_content"" android:background=""@android:drawable/editbox_background""android:layout_below=""@id/host_label""android:layout_marginTop=""4dp"" android:layout_marginLeft=""15dp"" android:layout_marginRight=""15dp"" /&gt;&lt;EditText android:id=""@+id/port_input"" android:inputType=""number""android:layout_width=""100dp"" android:layout_height=""wrap_content"" android:background=""@android:drawable/editbox_background""android:layout_below=""@id/host_label""android:layout_toRightOf=""@id/host_input""android:layout_marginTop=""4dp"" /&gt;&lt;TextViewandroid:id=""@+id/username_label""android:layout_width=""wrap_content""android:layout_height=""wrap_content""android:layout_below=""@+id/host_input""android:paddingTop=""15dp""android:paddingLeft=""15dp""android:textSize=""25sp""android:textColor=""#a5d4e2""android:text=""username""android:textStyle=""normal""/&gt;&lt;EditText android:id=""@+id/username_input"" android:inputType=""textEmailAddress""android:layout_width=""fill_parent"" android:layout_height=""wrap_content"" android:background=""@android:drawable/editbox_background""android:layout_below=""@id/username_label""android:layout_marginTop=""4dp"" android:layout_marginLeft=""15dp"" android:layout_marginRight=""15dp"" /&gt;&lt;TextViewandroid:id=""@+id/password_label""android:layout_width=""wrap_content""android:layout_height=""wrap_content""android:layout_below=""@+id/username_input""android:paddingTop=""15dp""android:paddingLeft=""15dp""android:textSize=""25sp""android:textColor=""#a5d4e2""android:text=""password""android:textStyle=""normal""/&gt;&lt;EditText android:id=""@+id/password_input"" android:inputType=""textPassword""android:layout_width=""fill_parent"" android:layout_height=""wrap_content"" android:background=""@android:drawable/editbox_background""android:layout_below=""@id/password_label""android:layout_marginTop=""4dp""android:layout_marginLeft=""15dp"" android:layout_marginRight=""15dp"" /&gt;&lt;ImageViewandroid:src= ""@drawable/home"" android:id=""@+id/home""android:paddingTop=""15dp""android:paddingLeft=""15dp""android:paddingRight=""15dp""android:layout_centerHorizontal=""true""android:layout_centerVertical=""false""android:layout_alignParentTop=""true""android:layout_width=""wrap_content"" android:layout_height=""wrap_content""android:scaleType=""fitStart""/&gt;&lt;Buttonandroid:id=""@+id/login_button""android:text=""   login   ""android:textSize=""18sp""android:layout_width=""wrap_content""android:layout_height=""wrap_content""android:layout_below=""@+id/password_input""android:layout_marginTop=""15dp""android:layout_marginLeft=""15dp""&gt;&lt;/Button&gt;&lt;/RelativeLayout&gt;</code></pre>","611921","","244296","","2011-02-10 19:03:16","2014-03-03 21:52:07","Percentage width in a RelativeLayout","<android><layout><width><relativelayout><percentage>","7","2","79","",""
"4961376","1","","","2011-02-10 18:56:33","2","3610","<p>First, some background:</p><p>I have an application which presents a search page (html form) to the user. Once criteria have been filled out and the Search button is clicked, results appear beneath the criteria section. In the list of results, you can view the detail of an individual result by clicking a link which takes you to a new page. Within the detail page, I have included a Back to Results link like so:</p><pre><code>&lt;a href=""#"" onclick=""history.go(-1);return false""&gt;Back to Results&lt;/a&gt;</code></pre><p>This works great in IE8/9, Safari, Firefox and Chrome on the desktop. However, it does not work on my Android phone, my Android emulator or the iPhone 3G. I should note that when I use the link on the desktop I am immediately returned to what seems to be a cached copy of my search page with results, and I'm placed at the same scroll position within the results. On the mobile devices, it appears as though the page reloads from the server, my search criteria disappear, and there are no results.</p><p>If anyone has any ideas on where to start looking for a solution, I would really appreciate it! I can also provide more detail as necessary.</p><p>Thank you and regards,CN</p>","524193","","248058","","2012-04-29 17:03:19","2012-10-29 06:50:21","Why is javascript:history.go(-1); not working on mobile devices?","<javascript><android><iphone><browser-history>","3","1","","",""
"4961407","1","","","2011-02-10 19:00:00","0","312","<p>I have made a service to handle my onClick intents in a widget. But it force closes when added to the screen, and I can't figure out why.</p><p>This is the method causing it to FC:</p><pre><code>    public void onClick() {    RemoteViews top=new RemoteViews(context.getPackageName(), layoutID);    RemoteViews bottom=new RemoteViews(context.getPackageName(), layoutID);    Intent clickintenttop=new Intent(""android.tristan.widget.digiclock.CLICK1"");    Intent clickintentbottom=new Intent(""android.tristan.widget.digiclock.CLICK2"");    PendingIntent pendingIntentClickTop=PendingIntent.getBroadcast(context, 0, clickintenttop, 0);    PendingIntent pendingIntentClickBottom=PendingIntent.getBroadcast(context, 0, clickintentbottom, 0);    bottom.setOnClickPendingIntent(R.id.BottomRow, pendingIntentClickBottom);    top.setOnClickPendingIntent(R.id.TopRow, pendingIntentClickTop);    int Top = appWidgetIds.length;    int Bottom = appWidgetIds.length;    for (int i=0; i&lt;Top; i++)    {    appWidgetManager.updateAppWidget(appWidgetIds[i], top);    }    for (int j=0; j&lt;Bottom; j++)    {    appWidgetManager.updateAppWidget(appWidgetIds[j], bottom);    }}</code></pre><p>The method is getting called from the onCreate(). Anyone who can push me in the right direction?</p><p>EDIT: Taken from LogCat:</p><p>W/dalvikvm(22312): threadid=1: thread exiting with uncaught exception (group=0x400259f8)</p><p>E/AndroidRuntime(22312): FATAL EXCEPTION: main</p><p>E/AndroidRuntime(22312): java.lang.RuntimeException: Unable to create service android.tristan.widget.digiclock.IntentService: java.lang.NullPointerException</p><p>E/AndroidRuntime(22312):    at android.app.ActivityThread.handleCreateService(ActivityThread.java:3140)</p><p>E/AndroidRuntime(22312):    at android.app.ActivityThread.access$3300(ActivityThread.java:135)</p><p>E/AndroidRuntime(22312):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2202)</p><p>E/AndroidRuntime(22312):    at android.os.Handler.dispatchMessage(Handler.java:99)</p><p>E/AndroidRuntime(22312):    at android.os.Looper.loop(Looper.java:144)</p><p>E/AndroidRuntime(22312):    at android.app.ActivityThread.main(ActivityThread.java:4937)</p><p>E/AndroidRuntime(22312):    at java.lang.reflect.Method.invokeNative(Native Method)</p><p>E/AndroidRuntime(22312):    at java.lang.reflect.Method.invoke(Method.java:521)</p><p>E/AndroidRuntime(22312):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)</p><p>E/AndroidRuntime(22312):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)</p><p>E/AndroidRuntime(22312):    at dalvik.system.NativeStart.main(Native Method)</p><p>E/AndroidRuntime(22312): Caused by: java.lang.NullPointerException</p><p>E/AndroidRuntime(22312):    at android.tristan.widget.digiclock.IntentService.onClick(IntentService.java:58)</p><p>E/AndroidRuntime(22312):    at android.tristan.widget.digiclock.IntentService.onCreate(IntentService.java:40)</p><p>E/AndroidRuntime(22312):    at android.app.ActivityThread.handleCreateService(ActivityThread.java:3125)</p>","525720","","525720","","2011-02-10 19:50:32","2011-02-10 21:42:39","Method with intents in service causes widget to FC","<android><service><widget>","1","18","","",""
"4961432","1","4961509","","2011-02-10 19:02:36","0","3595","<p>I need to get my title bar to be orange instead of the standard gray and I can't figure out how to edit it's settings.  I also need to align the text so its on the right side of the title bar instead of the left.  Any ideas on how to do this?</p>","611884","","244296","","2011-02-10 19:13:28","2012-03-26 10:00:15","How do you edit title bar?","<android><text><alignment><titlebar><android-titlebar>","3","0","","",""
"4961436","1","4961568","","2011-02-10 19:03:02","0","2085","<p>I would like to draw a separator between two views.  I am aware that I can draw a line between the views with the xml below, but it's pretty ugly.  I'd like it to be more like the menu separator used in java; beveled and rounded and such.  Any advice on how to achieve this effect?</p><pre><code>&lt;View    android:layout_width=""3dip""    android:layout_height=""fill_parent""    android:background=""#FF000000""&gt; &lt;/View&gt;</code></pre>","426493","","244296","","2011-02-10 19:13:16","2011-02-10 19:17:23","How to draw a menu separator?","<android>","1","0","","",""
"4961446","1","4961813","","2011-02-10 19:04:10","0","552","<p>Can I query from 2 tables like this?</p><pre><code>public Cursor getSen_List(long id_thsen ) {    String strTmp = ""select ""        +SENS_TABLE+"".""+KEY_SEN_ID+"",""
        +SENS_TABLE+"".""+KEY_SEN_ID_TH_SEN+"",""
        +SENS_TABLE+"".""+KEY_SEN_ID_LANG+"",""
        +SENS_TABLE+"".""+KEY_SEN+"",""
        +SENS_TABLE+"".""+KEY_SEN_READING+"",""            +LANGS_TABLE+"".""+KEY_LANG        +"" from ""+SENS_TABLE+ "",""+LANGS_TABLE        +"" where ""+SENS_TABLE+"".""+KEY_SEN_ID_TH_SEN + ""="" + id_thsen+ "" and ""         +SENS_TABLE+"".""+KEY_LANG+""=  "" +(""select""                                    +LANGS_TABLE+"".""+KEY_LANG                                    +""from""+LANGS_TABLE                                    +""where""+LANGS_TABLE+"".""+KEY_ACT+""=1"");                    return db.rawQuery(strTmp,null);}</code></pre><p>This is my logcat</p><pre><code>02-11 02:45:02.814: ERROR/AndroidRuntime(625): FATAL EXCEPTION: main02-11 02:45:02.814: ERROR/AndroidRuntime(625): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.android.proj/com.android.proj.Sens_Show}: android.database.sqlite.SQLiteException: no such column: Sentences.lang: , while compiling: select Sentences._id,Sentences.id_thsen,Sentences.id_lang,Sentences.sen,Sentences.reading,Languages.lang from Sentences,Languages where Sentences.id_thsen=1 and Sentences.lang=  (select Languages.lang from Languages where Languages.active_status=1)02-11 02:45:02.814: ERROR/AndroidRuntime(625):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)02-11 02:45:02.814: ERROR/AndroidRuntime(625):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)02-11 02:45:02.814: ERROR/AndroidRuntime(625):     at android.app.ActivityThread.access$2300(ActivityThread.java:125)02-11 02:45:02.814: ERROR/AndroidRuntime(625):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)02-11 02:45:02.814: ERROR/AndroidRuntime(625):     at android.os.Handler.dispatchMessage(Handler.java:99)02-11 02:45:02.814: ERROR/AndroidRuntime(625):     at android.os.Looper.loop(Looper.java:123)02-11 02:45:02.814: ERROR/AndroidRuntime(625):     at android.app.ActivityThread.main(ActivityThread.java:4627)02-11 02:45:02.814: ERROR/AndroidRuntime(625):     at java.lang.reflect.Method.invokeNative(Native Method)02-11 02:45:02.814: ERROR/AndroidRuntime(625):     at java.lang.reflect.Method.invoke(Method.java:521)02-11 02:45:02.814: ERROR/AndroidRuntime(625):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)02-11 02:45:02.814: ERROR/AndroidRuntime(625):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)02-11 02:45:02.814: ERROR/AndroidRuntime(625):     at dalvik.system.NativeStart.main(Native Method)02-11 02:45:02.814: ERROR/AndroidRuntime(625): Caused by: android.database.sqlite.SQLiteException: no such column: Sentences.lang: , while compiling: select Sentences._id,Sentences.id_thsen,Sentences.id_lang,Sentences.sen,Sentences.reading,Languages.lang from Sentences,Languages where Sentences.id_thsen=1 and Sentences.lang=  (select Languages.lang from Languages where Languages.active_status=1)02-11 02:45:02.814: ERROR/AndroidRuntime(625):     at android.database.sqlite.SQLiteCompiledSql.native_compile(Native Method)02-11 02:45:02.814: ERROR/AndroidRuntime(625):     at android.database.sqlite.SQLiteCompiledSql.compile(SQLiteCompiledSql.java:91)02-11 02:45:02.814: ERROR/AndroidRuntime(625):     at android.database.sqlite.SQLiteCompiledSql.&lt;init&gt;(SQLiteCompiledSql.java:64)02-11 02:45:02.814: ERROR/AndroidRuntime(625):     at android.database.sqlite.SQLiteProgram.&lt;init&gt;(SQLiteProgram.java:80)02-11 02:45:02.814: ERROR/AndroidRuntime(625):     at android.database.sqlite.SQLiteQuery.&lt;init&gt;(SQLiteQuery.java:46)02-11 02:45:02.814: ERROR/AndroidRuntime(625):     at android.database.sqlite.SQLiteDirectCursorDriver.query(SQLiteDirectCursorDriver.java:42)02-11 02:45:02.814: ERROR/AndroidRuntime(625):     at android.database.sqlite.SQLiteDatabase.rawQueryWithFactory(SQLiteDatabase.java:1345)02-11 02:45:02.814: ERROR/AndroidRuntime(625):     at android.database.sqlite.SQLiteDatabase.rawQuery(SQLiteDatabase.java:1315)02-11 02:45:02.814: ERROR/AndroidRuntime(625):     at com.android.proj.DBAdapter.getSen_List(DBAdapter.java:881)02-11 02:45:02.814: ERROR/AndroidRuntime(625):     at com.android.proj.Sens_Show.listData(Sens_Show.java:89)02-11 02:45:02.814: ERROR/AndroidRuntime(625):     at com.android.proj.Sens_Show.onCreate(Sens_Show.java:64)02-11 02:45:02.814: ERROR/AndroidRuntime(625):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)02-11 02:45:02.814: ERROR/AndroidRuntime(625):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)02-11 02:45:02.814: ERROR/AndroidRuntime(625):     ... 11 more</code></pre><p>sentence table </p><pre><code>private static final String CREATE_TABLE_7 =    "" create table "" + SENS_TABLE +    "" (_id integer primary key autoincrement,"" +    "" id_thsen integer REFERENCES Thai_sentences(_id),"" +    "" id_lang integer REFERENCES Languages(_id),"" +    "" sen text not null,"" +    "" reading text not null);"";</code></pre><p>language table`</p><pre><code>private static final String CREATE_TABLE_3 =    "" create table "" + LANGS_TABLE +    "" (_id integer primary key autoincrement,"" +    "" lang text not null,"" +    "" active_status integer not null);"";</code></pre><hr><p>correct language but occur 5 time like amount of languages`</p><pre><code>public Cursor getSen_List(long id_thsen ) {    String strTmp = ""select ""        +SENS_TABLE+"".""+KEY_SEN_ID+"",""
        +SENS_TABLE+"".""+KEY_SEN_ID_TH_SEN+"",""
        +SENS_TABLE+"".""+KEY_SEN_ID_LANG+"",""
        +SENS_TABLE+"".""+KEY_SEN+"",""
        +SENS_TABLE+"".""+KEY_SEN_READING+"",""            +LANGS_TABLE+"".""+KEY_LANG        +"" from ""+SENS_TABLE+ "",""+LANGS_TABLE        +"" where ""+SENS_TABLE+"".""+KEY_SEN_ID_TH_SEN + ""="" + id_thsen+ "" and ""         +SENS_TABLE+"".""+KEY_LANG_ID+""=  "" +(""(select ""                                    +LANGS_TABLE+"".""+KEY_LANG_ID                                    +"" from ""+LANGS_TABLE                                    +"" where ""+LANGS_TABLE+"".""+KEY_ACT+""=1)"");                    return db.rawQuery(strTmp,null);}</code></pre>","605358","","605358","","2011-02-10 20:21:43","2011-02-10 20:21:43","Can I query from 2 tables like this?","<android><sqlite><sqlite3>","1","4","","",""
"4961514","1","4971275","","2011-02-10 19:11:24","2","2516","<p>I'm working on an app that actually works fine if the device is rooted, but now I'm doing something for non rooted device. At this point I need to use the following (or something like it) in order to download the xtra.bin and unpack in the device ></p><pre><code>    public static void downloadGPSXtra(Context context){        LocationManager locationmanager = (LocationManager)context.getSystemService(""location"");        Bundle bundle = new Bundle();        locationmanager.sendExtraCommand(""gps"", ""force_xtra_injection"", bundle);        locationmanager.sendExtraCommand(""gps"", ""force_time_injection"", bundle);}</code></pre><p>Then I use the following to ""execute"" it ></p><pre><code>        lto_downloader.downloadGPSXtra(lto_downloader.this);</code></pre><p>Ok, I don't know why (obviously), but it didn't work. In only got some reply from logcat about the time injection ></p><pre><code>    D/GpsLocationProvider( 3131): NTP server returned: 1297364952086 (Thu Feb 10 19:09:12 GMT+00:00 2011) reference: 9750010 certainty: 337 system time offset: -48380</code></pre><p>I know that the ""force_xtra_injection"" it's not working due to I don't see any changes at <code>/data/gps/lto.dat</code> </p>","611912","","68805","","2011-02-11 09:16:11","2012-10-21 09:16:37","Problems with sendExtraCommand and force_xtra_injection","<android><locationmanager>","3","1","2","",""
"4961586","1","4961781","","2011-02-10 19:20:01","3","2915","<p>I parse XML data and put it into an object. This takes fairly long and I have decided to run it in the background using AsyncTask. My code is almost exactly like this example:<a href=""http://stackoverflow.com/questions/2021880/how-to-get-xml-using-asynctask-and-timer"">How to get XML using AsyncTask and Timer?</a></p><p>The difference being that I want to PublishProgress as I go long. The relevant part of the code where I want to publish progress:</p><pre><code>@Override   public void endElement(String namespaceURI, String localName, String qName) throws SAXException {               if (localName.equalsIgnoreCase(""client"")) {                     clients.addClient(mClient);            // Publish Progress            RotationAwareTask.publishProgress();            mClient = null;        }           }</code></pre><p>By now you would have deduced that I am a novice. The closest research that matches what I want to do states:</p><p><a href=""http://www.mail-archive.com/android-developers@googlegroups.com/msg79275.html"" rel=""nofollow"">http://www.mail-archive.com/android-developers@googlegroups.com/msg79275.html</a></p><blockquote>  <p>Yes, that is a bit more complex... Two  approaches:</p>    <p>1) Make AsyncTask implement  org.sax.ContentHandler. That way the  SAX callbacks have direct access to  AsyncTask.publishProgress().</p>    <p>2) Create a delegate so that the  parser has a handle back to AsyncTask  for posting progress updates.</p></blockquote><p>When I try the above I get:</p><blockquote>  <p>The method  publishProgress(Progress...) from the  type AsyncTask is  not visible</p></blockquote><p>Alas, how can I call publicProgress from endElement? Or could someone give me some how to do this properly? To recap:</p><p>I have XML data.Reading the data is a long operation.I use the SAXParser to get the data.On the endElement method the data is added to an object which will eventually be used elsewhere.Most research indicates I have to use AsyncTask and I am using that now because I have a good example from Commonsware for screen rotation.The question is how to update progress as I go along.</p><p>Edit:@Cristian here is the async task:</p><pre><code>static class RotationAwareTask extends AsyncTask&lt;Void, Void, Void&gt; {                RotationAsync activity = null;              int progress = 0;               private SaxClientsHandler saxClientsHandler;        RotationAwareTask(RotationAsync activity) {            attach(activity);        }            @Override        protected Void doInBackground(Void... unused) {                     try {                SAXParserFactory spf = SAXParserFactory.newInstance();                SAXParser sp = spf.newSAXParser();                XMLReader xr = sp.getXMLReader();                saxClientsHandler = new SaxClientsHandler();                xr.setContentHandler(saxClientsHandler);                InputSource mSource = new InputSource( new StringReader( Whmcs.getClientsXml() ) );                xr.parse(mSource);                      } catch (Exception e) {                Log.e(TAG, e.getMessage(), e);            }                       return(null);               }        @Override        protected void onProgressUpdate(Void... unused) {            if (activity==null) {                Log.w(""RotationAsync"", ""onProgressUpdate() skipped – no activity"");            }            else {                progress += 5;                activity.updateProgress(progress);            }        }        @Override        protected void onPostExecute(Void unused) {            if (activity == null) {                Log.w(""RotationAsync"", ""onPostExecute() skipped – no activity"");            }            else {                activity.markAsDone();            }        }        void detach() {            activity = null;        }        void attach(RotationAsync activity) {            this.activity = activity;        }        int getProgress() {                     return(progress);        }    }</code></pre><p>This is almost an exact duplicate of this Commonsware example:<a href=""https://github.com/commonsguy/cw-android/blob/master/Rotation/RotationAsync/src/com/commonsware/android/rotation/async/RotationAsync.java"" rel=""nofollow"">https://github.com/commonsguy/cw-android/blob/master/Rotation/RotationAsync/src/com/commonsware/android/rotation/async/RotationAsync.java</a></p><p>As you can see:</p><blockquote>  <p>saxClientsHandler = new  SaxClientsHandler();</p></blockquote><p>calls the SaxClientHandler() where the endElement method exists. I am trying to publish the progress from there.</p><p>@Mayra, are you suggesting that I migrate all the saxClientHandler code into the AsyncTask?</p>","150398","","21234","","2011-03-07 21:44:28","2011-03-07 21:44:28","How to get XML using AsyncTask and PublishProgress","<android><xml><multithreading><saxparser><android-asynctask>","1","1","2","",""
"4961627","1","","","2011-02-10 19:24:18","2","3251","<p>I have two apks on my <a href=""http://origamiapp.blogspot.com/p/downloads.html"" rel=""nofollow"">website</a>.  I can click the link and download them to my computer and it works fine.  When I download them on my phone, the first one works fine, but the second downloads as a .txt instead of an .apk.  I can go on my phone and rename the file as an apk and then it works fine.  But why is it showing up as .txt and how do I make it stop?  Thanks!</p>","584786","","","","","2013-10-19 06:14:03","downloading .apk turns into .txt on phone","<android><html><download>","2","0","","",""
"4961706","1","","","2011-02-10 19:32:38","2","752","<p>My app is really progressing now, much of it due to you guys and your willingness to help out so thanks alot.As to my problem, I want my app to email a user each day as a kind of reminder additional to notifications.  However I can't find a way to do this without user intervention, I am aware I can use a send intent but I want it to be automated without the user needing to do anything other then select the option in the settings to enable email reminders.I don't actually know if this is even possible but I'm hoping that is.  If it isn't maybe there's a way i can hack it together to achieve the desired outcome?</p>","597334","","244296","","2011-02-10 19:38:04","2011-02-10 19:39:37","Automatically send an email from an app","<java><android>","1","1","","",""
"4961725","1","4962178","","2011-02-10 19:33:45","0","184","<p>Ok, my problem is that when I open up the app I made it forces closes when I try to click some of the songs. It is weird bc it works good on Galaxy Tab but not for Galaxy S, droid 2, vibrant, etc. Here is the code I use for the thing:</p><pre><code>import android.app.Activity;import android.media.MediaPlayer;import android.os.Bundle;import android.view.View;import android.widget.Button;public class MyMain extends Activity {    /** Called when the activity is first created. */    MediaPlayer mpButtonClick;    MediaPlayer pButtonClick;    MediaPlayer oButtonClick;    MediaPlayer tButtonClick;    MediaPlayer sButtonClick;    MediaPlayer aButtonClick;    MediaPlayer dButtonClick;    MediaPlayer cButtonClick;    MediaPlayer lButtonClick;    MediaPlayer himButtonClick;    MediaPlayer herButtonClick;    MediaPlayer hellButtonClick;    MediaPlayer mocButtonClick;    MediaPlayer rasButtonClick;    MediaPlayer raseButtonClick;    MediaPlayer dalekButtonClick;    MediaPlayer sharButtonClick;    MediaPlayer godButtonClick;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);      //set up the button sounds  mpButtonClick = MediaPlayer.create(this, R.raw.money);        Button bmoney = (Button) findViewById(R.id.money);        bmoney.setOnClickListener(new View.OnClickListener() {            @Override            public void onClick(View v) {                // TODO Auto-generated method stub                mpButtonClick.start();            }        });      pButtonClick = MediaPlayer.create(this, R.raw.pants);        Button bpants = (Button) findViewById(R.id.pants);        bpants.setOnClickListener(new View.OnClickListener() {            @Override            public void onClick(View v) {                // TODO Auto-generated method stub                pButtonClick.start();            }               });   oButtonClick = MediaPlayer.create(this, R.raw.oath);        Button oath = (Button) findViewById(R.id.oath);        oath.setOnClickListener(new View.OnClickListener() {            @Override            public void onClick(View v) {                // TODO Auto-generated method stub                oButtonClick.start();            }               });     tButtonClick = MediaPlayer.create(this, R.raw.tardis);        Button tardis = (Button) findViewById(R.id.tardis);        tardis.setOnClickListener(new View.OnClickListener() {            @Override            public void onClick(View v) {                // TODO Auto-generated method stub                tButtonClick.start();            }               });     sButtonClick = MediaPlayer.create(this, R.raw.screwdriver);        Button screwdriver = (Button) findViewById(R.id.screwdriver);        screwdriver.setOnClickListener(new View.OnClickListener() {            @Override            public void onClick(View v) {                // TODO Auto-generated method stub                sButtonClick.start();            }               });      aButtonClick = MediaPlayer.create(this, R.raw.alarm);        Button alarm = (Button) findViewById(R.id.alarm);        alarm.setOnClickListener(new View.OnClickListener() {            @Override            public void onClick(View v) {                // TODO Auto-generated method stub                aButtonClick.start();            }               });     dButtonClick = MediaPlayer.create(this, R.raw.kame);        Button kame = (Button) findViewById(R.id.kame);        kame.setOnClickListener(new View.OnClickListener() {            @Override            public void onClick(View v) {                // TODO Auto-generated method stub                dButtonClick.start();            }                   });     cButtonClick = MediaPlayer.create(this, R.raw.card);        Button card = (Button) findViewById(R.id.card);        card.setOnClickListener(new View.OnClickListener() {            @Override            public void onClick(View v) {                // TODO Auto-generated method stub                cButtonClick.start();            }                   });    lButtonClick = MediaPlayer.create(this, R.raw.laugh);        Button laugh = (Button) findViewById(R.id.laugh);        laugh.setOnClickListener(new View.OnClickListener() {            @Override            public void onClick(View v) {                // TODO Auto-generated method stub                lButtonClick.start();            }                   });himButtonClick = MediaPlayer.create(this, R.raw.him);        Button him = (Button) findViewById(R.id.him);        him.setOnClickListener(new View.OnClickListener() {            @Override            public void onClick(View v) {                // TODO Auto-generated method stub                himButtonClick.start();            }                   });herButtonClick = MediaPlayer.create(this, R.raw.her);        Button her = (Button) findViewById(R.id.her);        her.setOnClickListener(new View.OnClickListener() {            @Override            public void onClick(View v) {                // TODO Auto-generated method stub                herButtonClick.start();            }                   });hellButtonClick = MediaPlayer.create(this, R.raw.hell);        Button hell = (Button) findViewById(R.id.hell);        hell.setOnClickListener(new View.OnClickListener() {            @Override            public void onClick(View v) {                // TODO Auto-generated method stub                hellButtonClick.start();            }                   });mocButtonClick = MediaPlayer.create(this, R.raw.mocking);        Button mocking = (Button) findViewById(R.id.mocking);        mocking.setOnClickListener(new View.OnClickListener() {            @Override            public void onClick(View v) {                // TODO Auto-generated method stub                mocButtonClick.start();            }                   });godButtonClick = MediaPlayer.create(this, R.raw.god);        Button god = (Button) findViewById(R.id.god);        god.setOnClickListener(new View.OnClickListener() {            @Override            public void onClick(View v) {                // TODO Auto-generated method stub                godButtonClick.start();            }                   });rasButtonClick = MediaPlayer.create(this, R.raw.rasengan);        Button rasengan = (Button) findViewById(R.id.rasengan);        rasengan.setOnClickListener(new View.OnClickListener() {            @Override            public void onClick(View v) {                // TODO Auto-generated method stub                rasButtonClick.start();            }                   });raseButtonClick = MediaPlayer.create(this, R.raw.rasen);        Button rasen = (Button) findViewById(R.id.rasen);        rasen.setOnClickListener(new View.OnClickListener() {            @Override            public void onClick(View v) {                // TODO Auto-generated method stub                raseButtonClick.start();            }                   });dalekButtonClick = MediaPlayer.create(this, R.raw.dalek);        Button dalek = (Button) findViewById(R.id.dalek);        dalek.setOnClickListener(new View.OnClickListener() {            @Override            public void onClick(View v) {                // TODO Auto-generated method stub                dalekButtonClick.start();            }                   });sharButtonClick = MediaPlayer.create(this, R.raw.sharingan);        Button sharingan = (Button) findViewById(R.id.sharingan);        sharingan.setOnClickListener(new View.OnClickListener() {            @Override            public void onClick(View v) {                // TODO Auto-generated method stub                sharButtonClick.start();            }                   });    }}</code></pre><p>Sorry for the long code I just really need help</p><p>Edit: If it helps I always get:</p><p>java.lang.NullPointerExceptionMyMain$8.onClick()</p>","598925","","598925","","2011-02-10 20:02:24","2011-02-10 20:19:52","Forceclose issue on soundboard with some androids?","<android><button><sdk><crash>","1","2","","",""
"4961861","1","4962354","","2011-02-10 19:48:03","2","4047","<p>I have an Adobe AIR desktop application, built in Flex Builder 3,  that I want to run on an android device, specifically a Samsung Galaxy Tablet. I have put the application on an emulator, going through the steps of installing AIR on the emulator, packaging the application as an APK, and installing the application on the emulator. However, when I click the application, it does not run. Here is my question: is this even possible? Can a desktop application be run on a mobile device with no changes to the code, or does it need to be converted to a mobile application before compiling? Thanks for any and all input,</p><p>T</p>","611905","","","","","2012-06-16 09:51:01","Can a desktop AIR app be run on an Android device?","<android><flex><air><apk>","1","1","","",""
"4961873","1","","","2011-02-10 19:49:59","0","1541","<p>I have implemented an autocomplete feature to allow the user to start typing a contact and for that contact to appear in a dropdown list using an autoCompleteTextView, like the same way it works when picking contacts for messages or e-mails. </p><p>As I don’t want a variable holding all of the contacts at once since this could be very big, I populated my ArrayList as the user enters letters into the contact field.</p><p>I am setting it up like this:-peopleList = new ArrayList>();</p><pre><code>        adapter = new SimpleAdapter(this, peopleList, R.layout.customcontcell ,new String[] { ""Name"", ""Phone"" , ""Type"" }, new int[] { R.id.ccontName, R.id.ccontNo, R.id.ccontType });        txtPhoneNo.setAdapter(adapter);</code></pre><p>Then when the user starts typing a name it grabs all the rows from the Contacts that match that, this is done in my function “QueryContacts” like so:-</p><pre><code>selectionWhere = ContactsContract.Contacts.DISPLAY_NAME+"" LIKE '"" + name + ""%'"";                //Cursor to retrive contact details.                Cursor people = getContentResolver().query(ContactsContract.Contacts.CONTENT_URI, null, selectionWhere, null, null);</code></pre><p>This cursor is then used to populate my peopleList which is being used by the Adapter.</p><p>In this state it works, however without some checks the above code ends up retrieving ALL of the contacts initially (as no name is entered so it filters nothing) and it runs every time a new letter is typed. This is jittery and slow.</p><p>So I wanted to put some simple checks to limited it to only retrieving the contacts when 2 letters have been entered, and not retrieving anymore unless it goes below 2 letters then back to 2 again.</p><p>So around my QueryContacts functions I add:-</p><pre><code>if(name.length() &lt; 2)                mGotContacts = false;            //If the length is two letters long and we haven't queried already, query for the name.            if(name.length() == 2 &amp;&amp; mGotContacts == false)            {// Cursor code// Populate list with cursor data.}</code></pre><p>Problem is now the autocompleteTextView no longer drops down, I have checked and the variable peopleLists which populated my SimpleAdapter is being correctly updated. </p><p>So, am I doing this a daft way? Should I just grab all of the data in one go and let the AutoCompleteTextView filter it?</p><p>Is their a better way of doing this and why does it no longer work with those checks in my QueryContacts function?</p>","518118","","","","","2011-10-16 17:47:24","Optimising AutoCompleteTextView for Android Contacts","<android><autocomplete><contacts>","1","1","","",""
"4961962","1","4963240","","2011-02-10 19:57:52","0","850","<p>How do you change the horizontal alignment on the title bar?<br>Right now the default is set to the left side and I am trying to get it to be set to the right side.  </p><p>Any ideas?</p>","611884","","372239","","2014-01-04 15:42:31","2014-01-04 15:42:31","Android: Change alignment in the title bar","<android><text><alignment><titlebar><android-titlebar>","1","0","","",""
"4961999","1","5118444","","2011-02-10 20:00:28","29","10670","<p>I have a fixed height listview it has divider between list item, but it also displays divider after last list item.</p><p>Is there a way to not display divider after the last item in listview?</p>","470682","","1228","","2013-09-05 13:04:20","2013-09-05 13:04:20","remove bottom divider of a android listview","<android><listview><divider>","2","0","5","",""
"4962180","1","","","2011-02-10 20:20:05","0","73","<p>I have a widget application that includes a Main application widget registered as below,clicking on the widget sometimes launches the app activity when I have no such intention.What can be done to prevent this from happening.</p><p>         </p>","602260","","","","","2011-08-11 18:05:36","Widget Kicks Off Main Activity Unexpectedly","<android><activity><widget>","1","5","","",""
"4962273","1","","","2011-02-10 20:27:45","0","679","<p><strong>EDIT: After changing the onPostExecute() method of the GetData task to only call cursor.requery() it seems to be working.</strong></p><p>I'm building an Android activity that pulls data from a webservice using the kSoap library. The data is stored in a sqlite database, and displayed using a custom CursorAdapter in a listactivity. The code works for updating the database, and it's displaying the list as I want it to with data from the database.  </p><p>However, I want the activity to check whether the database is outdated in onCreate, and if it is old update the database and then set the Adapter. To do this i've set up an AsyncTask that updates the database in the background thread and sets the CursorAdapter in onPostExecute. If I try to use my custom CursorAdapter there's an exception. But if I use a standard BasicCursorAdapter instead (with any of the cursor's columns as data) it works fine. Again - the custom CursorAdapter seems to work fine when i'm not updating the database.</p><p>I've been trying to figure out what might cause this exception, but I've run out of ideas. Is there perhaps a problem with writing to the database and then reading from it?</p><p>Here is the activity:</p><pre><code>public class MyList extends ListActivity {private MyDBAdapter db;private Cursor cursor;private MyWebService wsData;private Context context;@Overrideprotected void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.my_list);    context = this;    wsData = new MyWebService();    db = new MyDBAdapter(this);    db.open();    //EDIT: I get the cursor and sets the adapter in onCreate instead of in the GetDataTask    cursor = db.getAll();        startManagingCursor(cursor);                ListAdapter adapter = new MyListAdapter(context,            R.layout.my_list_row,            cursor,            new String[] { cursor.getColumnName(1) },            new int[] { R.id.myListRow_id });    setListAdapter(adapter);    //If (dbIsOutdated()) {    new GetDataTask().execute();    //} else {    //setAdapter();    //}}@Overrideprotected void onDestroy() {    super.onDestroy();    db.close();}</code></pre><p>This is the task:</p><pre><code>private class GetDataTask extends AsyncTask&lt;Void, Void, Boolean&gt; {    private final ProgressDialog dialog = new ProgressDialog(context);    protected void onPreExecute() {        this.dialog.setMessage(""Downloading data..."");        this.dialog.show();    }    protected Boolean doInBackground(Void...voids) {        //First get a soapobject with all the leagues        SoapObject unparsed = wsData.getAll();        //Clear all old data in the database        db.clearTables();        //Iterate through the soapobject and fill the database       for (int i=0;i&lt;unparsed.getPropertyCount();i++) {            if (unparsed.getProperty(i) instanceof SoapObject) {                String id = ((SoapObject)unparsed.getProperty(i)).getProperty(""Id"").toString();                String name = ((SoapObject)unparsed.getProperty(i)).getProperty(""Name"").toString();                db.insert(id, name);            }        }        return true;    }    protected void onPostExecute(Boolean unused) {        if (this.dialog.isShowing()) {            this.dialog.dismiss();        }            //this updates the list            cursor.requery();            /* --- This part is not necessary it seems, and might be what                       --- causes the memory overloading                    cursor = db.getAll();            startManagingCursor(cursor);                    ListAdapter adapter = new MyListAdapter(context,                R.layout.my_list_row,                cursor,                new String[] { cursor.getColumnName(1) },                new int[] { R.id.myListRow_id });        setListAdapter(adapter);            */    }}</code></pre><p>MyWebService is a class that handles the calls to the WebService, and the getAll() method returns a SoapObject containing SoapObjects with the relevant data.</p><p>I also has a method (setAdapter()) that sets the adapter in the exact same way as the onPostExecute(), and that works with no problems.</p><p>My adapter:</p><pre><code>public class MyListAdapter extends SimpleCursorAdapter {    private Cursor mCursor;    private Context mContext;    public MyListAdapter(Context context, int layout, Cursor c,            String[] from, int[] to) {        super(context, layout, c, from, to);        this.mCursor = c;        this.mContext = context;    }    @Override    public View getView(int position, View convertView, ViewGroup parent) {        View row = convertView;        if(row==null){            LayoutInflater inflater=getLayoutInflater();            row=inflater.inflate(R.layout.my_list_row, parent, false);        }        this.mCursor.moveToPosition(position);        TextView id=(TextView)row.findViewById(R.id.leagueListRow_id);        TextView name=(TextView)row.findViewById(R.id.leagueListRow_name);        String lId = this.mCursor.getString(1);        String lName = this.mCursor.getString(2);        id.setText(lId);        name.setText(lName);        return row;    }}</code></pre><p>I'm not sure on how to read the log, but I'm assuming theese are the critical lines:</p><pre><code>[snip]02-10 19:18:10.446: DEBUG/dalvikvm(223): GC freed 20592 objects / 1063064 bytes in 546ms02-10 19:18:17.256: INFO/ARMAssembler(59): generated scanline__00000177:03515104_00001001_00000000 [ 91 ipp] (114 ins) at [0x2fa530:0x2fa6f8] in 10766582 ns02-10 19:18:17.377: ERROR/dalvikvm-heap(223): 256-byte external allocation too large for this process.02-10 19:18:17.396: ERROR/(223): VM won't let us allocate 256 bytes02-10 19:18:17.407: DEBUG/skia(223): --- decoder-&gt;decode returned false02-10 19:18:17.419: DEBUG/AndroidRuntime(223): Shutting down VM02-10 19:18:17.419: WARN/dalvikvm(223): threadid=3: thread exiting with uncaught exception (group=0x4001b188)02-10 19:18:17.427: ERROR/AndroidRuntime(223): Uncaught handler: thread main exiting due to uncaught exception02-10 19:18:17.489: ERROR/AndroidRuntime(223): android.view.InflateException: Binary XML file line #20: Error inflating class &lt;unknown&gt;02-10 19:18:17.489: ERROR/AndroidRuntime(223):     at android.view.LayoutInflater.createView(LayoutInflater.java:513)02-10 19:18:17.489: ERROR/AndroidRuntime(223):     at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)02-10 19:18:17.489: ERROR/AndroidRuntime(223):     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:563)02-10 19:18:17.489: ERROR/AndroidRuntime(223):     at android.view.LayoutInflater.rInflate(LayoutInflater.java:618)02-10 19:18:17.489: ERROR/AndroidRuntime(223):     at android.view.LayoutInflater.rInflate(LayoutInflater.java:621)02-10 19:18:17.489: ERROR/AndroidRuntime(223):     at android.view.LayoutInflater.inflate(LayoutInflater.java:407)02-10 19:18:17.489: ERROR/AndroidRuntime(223):     at android.view.LayoutInflater.inflate(LayoutInflater.java:320)02-10 19:18:17.489: ERROR/AndroidRuntime(223):     at se.gobrugda.bbmanagerdroid.ListLeaguesNew$LeagueListAdapter.getView(ListLeaguesNew.java:224)02-10 19:18:17.489: ERROR/AndroidRuntime(223):     at android.widget.AbsListView.obtainView(AbsListView.java:1274)02-10 19:18:17.489: ERROR/AndroidRuntime(223):     at android.widget.ListView.measureHeightOfChildren(ListView.java:1147)02-10 19:18:17.489: ERROR/AndroidRuntime(223):     at android.widget.ListView.onMeasure(ListView.java:1060)02-10 19:18:17.489: ERROR/AndroidRuntime(223):     at android.view.View.measure(View.java:7964)02-10 19:18:17.489: ERROR/AndroidRuntime(223):     at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3023)02-10 19:18:17.489: ERROR/AndroidRuntime(223):     at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:888)02-10 19:18:17.489: ERROR/AndroidRuntime(223):     at android.widget.LinearLayout.measureVertical(LinearLayout.java:350)02-10 19:18:17.489: ERROR/AndroidRuntime(223):     at android.widget.LinearLayout.onMeasure(LinearLayout.java:278)02-10 19:18:17.489: ERROR/AndroidRuntime(223):     at android.view.View.measure(View.java:7964)02-10 19:18:17.489: ERROR/AndroidRuntime(223):     at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3023)02-10 19:18:17.489: ERROR/AndroidRuntime(223):     at android.widget.FrameLayout.onMeasure(FrameLayout.java:245)02-10 19:18:17.489: ERROR/AndroidRuntime(223):     at android.view.View.measure(View.java:7964)02-10 19:18:17.489: ERROR/AndroidRuntime(223):     at android.widget.LinearLayout.measureVertical(LinearLayout.java:464)02-10 19:18:17.489: ERROR/AndroidRuntime(223):     at android.widget.LinearLayout.onMeasure(LinearLayout.java:278)02-10 19:18:17.489: ERROR/AndroidRuntime(223):     at android.view.View.measure(View.java:7964)02-10 19:18:17.489: ERROR/AndroidRuntime(223):     at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3023)02-10 19:18:17.489: ERROR/AndroidRuntime(223):     at android.widget.FrameLayout.onMeasure(FrameLayout.java:245)02-10 19:18:17.489: ERROR/AndroidRuntime(223):     at android.view.View.measure(View.java:7964)02-10 19:18:17.489: ERROR/AndroidRuntime(223):     at android.view.ViewRoot.performTraversals(ViewRoot.java:763)02-10 19:18:17.489: ERROR/AndroidRuntime(223):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1633)02-10 19:18:17.489: ERROR/AndroidRuntime(223):     at android.os.Handler.dispatchMessage(Handler.java:99)02-10 19:18:17.489: ERROR/AndroidRuntime(223):     at android.os.Looper.loop(Looper.java:123)02-10 19:18:17.489: ERROR/AndroidRuntime(223):     at android.app.ActivityThread.main(ActivityThread.java:4363)02-10 19:18:17.489: ERROR/AndroidRuntime(223):     at java.lang.reflect.Method.invokeNative(Native Method)02-10 19:18:17.489: ERROR/AndroidRuntime(223):     at java.lang.reflect.Method.invoke(Method.java:521)02-10 19:18:17.489: ERROR/AndroidRuntime(223):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)02-10 19:18:17.489: ERROR/AndroidRuntime(223):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)02-10 19:18:17.489: ERROR/AndroidRuntime(223):     at dalvik.system.NativeStart.main(Native Method)02-10 19:18:17.489: ERROR/AndroidRuntime(223): Caused by: java.lang.reflect.InvocationTargetException02-10 19:18:17.489: ERROR/AndroidRuntime(223):     at android.widget.ImageView.&lt;init&gt;(ImageView.java:105)02-10 19:18:17.489: ERROR/AndroidRuntime(223):     at java.lang.reflect.Constructor.constructNative(Native Method)02-10 19:18:17.489: ERROR/AndroidRuntime(223):     at java.lang.reflect.Constructor.newInstance(Constructor.java:446)02-10 19:18:17.489: ERROR/AndroidRuntime(223):     at android.view.LayoutInflater.createView(LayoutInflater.java:500)02-10 19:18:17.489: ERROR/AndroidRuntime(223):     ... 35 more02-10 19:18:17.489: ERROR/AndroidRuntime(223): Caused by: java.lang.OutOfMemoryError: bitmap size exceeds VM budget02-10 19:18:17.489: ERROR/AndroidRuntime(223):     at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method)02-10 19:18:17.489: ERROR/AndroidRuntime(223):     at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:447)02-10 19:18:17.489: ERROR/AndroidRuntime(223):     at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:323)02-10 19:18:17.489: ERROR/AndroidRuntime(223):     at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:697)02-10 19:18:17.489: ERROR/AndroidRuntime(223):     at android.content.res.Resources.loadDrawable(Resources.java:1705)02-10 19:18:17.489: ERROR/AndroidRuntime(223):     at android.content.res.TypedArray.getDrawable(TypedArray.java:548)02-10 19:18:17.489: ERROR/AndroidRuntime(223):     at android.widget.ImageView.&lt;init&gt;(ImageView.java:115)02-10 19:18:17.489: ERROR/AndroidRuntime(223):     ... 39 more02-10 19:18:17.556: INFO/Process(59): Sending signal. PID: 223 SIG: 302-10 19:18:17.556: INFO/dalvikvm(223): threadid=7: reacting to signal 302-10 19:18:17.636: INFO/dalvikvm(223): Wrote stack trace to '/data/anr/traces.txt</code></pre>","423842","","423842","","2011-02-10 22:33:19","2011-02-10 22:33:19","Error when setting CursorAdapter after updating database","<android><web-services><sqlite><ksoap2>","0","4","","",""
"4962335","1","4978489","","2011-02-10 20:33:02","1","573","<p>I use the following code to load images to rows in a ListActivity.</p><pre><code>URL url = new URL(drink.getImageUri());                InputStream fis = url.openStream();                //Decode image size                BitmapFactory.Options o = new BitmapFactory.Options();                o.inJustDecodeBounds = true;                BitmapFactory.decodeStream(fis, null, o);                int scale = 1;                if (o.outHeight &gt; imageMaxSize || o.outWidth &gt; imageMaxSize) {                    scale = (int) Math.pow(2, (int) Math.round(Math.log((imageMaxSize / (double) Math.max(o.outHeight, o.outWidth)) / Math.log(0.5))));                }                fis.close();                fis = url.openStream();                //Decode with inSampleSize                BitmapFactory.Options o2 = new BitmapFactory.Options();                o2.inSampleSize = scale;                bitmap = BitmapFactory.decodeStream(fis, null, o2);                fis.close();</code></pre><p>imageMaxSize is screenHeight/7 so the each image should be fairly small. </p><p>Have I done something wrong in the code above? All errors I got is in the second last line where I attempt to actually load the bitmap.</p><p>Thanks in advanceRoland</p>","435267","","","","","2012-10-18 06:07:25","Loading images throws OutOfMemoryException","<android><image><bitmap><listactivity>","3","2","","",""
"4962357","1","4962494","","2011-02-10 20:36:17","0","1991","<p>I have a class that consists of an edittext box to hold a string ""strResponse""  I want to access this string in another class.  Basically a user types in whatever, and the other class takes that string, and sends it in a text message.<br>That code works fine if I hard code it in.  But I want a user to define what the message should say from the other class.I was thinking global variable, but have had no luck so far.</p>","600423","","","","","2012-03-20 03:27:54","Howto access a string value from another class?","<java><android><string><global>","2","2","","",""
"4962426","1","4964029","","2011-02-10 20:41:21","4","3638","<p>I've been investigating alternative methods for saving my game's data between turns, and wonder if anyone can point me in the right direction.</p><p>I have approximately 32k of data which must be saved during onPause.  I ruled out preferences due to the sheer quantity of data.  I spent a few days playing around with SQLite but couldn't get the data to save in less than two seconds (although the time certainly hasn't been wasted).</p><p>I've decided that I'll use the database for loading constant data at the beginning of the game.  This will certainly make it easier to tweak various parameters and default values in the game.  But this still leaves me looking for the ideal method for writing data.</p><p>The data that needs to be saved is basically nine occurrences of class A and nine occurrences of class B.  I'm an intensive month into the learning curve of Android (and the nuances of Java, coming from a C++ background) and have been googling like crazy.  This brought two possibilities to mind -</p><p>1) Serialization (ObjectOutputStream)</p><p>I thought this would be the perfect solution but, having read several other posts regarding the subject, gather that it isn't highly recommended on the Android platform due to speed and memory allocations provoking the garbage collector into a potential rage.</p><p>2) DataOutputStream class</p><p>My current thought is to add Load and Save functions to both classes and to use DataOutputStream and DataInputStream calls in them to write and read the data respectively.</p><p>The data in the classes are primitives (strings and ints mostly) and arrays of primitives, so there's nothing too complicated in there to break down.  Would this second solution seem a good, viable one?  Or are there other solutions that I am unaware of as yet?</p>","574740","","574740","","2011-02-10 20:55:57","2011-02-10 23:42:44","Best method for saving data - preferences, sqlite, serializable or other?","<android><file>","4","2","2","",""
"4962479","1","","","2011-02-10 20:46:15","0","55","<p>I guess this is a lame question, I can't even make up a proper subject! Here is what I'm trying to do under Android:</p><pre><code>public void onCreate(Bundle savedInstance) {    ...    AskFilename ask = new AskFilename();    ...}</code></pre><p>Here, <code>AskFilename</code> class will present a user interface to let the user enter a filename. However, the <code>ask</code> object will be out of scope once the <code>onCreate()</code> method returns. So this means there will be no reference to <code>ask</code> any more (assuming inside <code>AskFilename</code> class, I did not assign its <code>this</code> pointer to any other variable), and so GC will, sooner or later, ""collect"" it. When this happens, if the user hasn't OK'ed the dialog box, the code in <code>AskFilename</code> is already unavailable and therefore the system will crash. Is my understanding correct? </p><p>(I can't think of a way to experiement with this idea, because I don't know how to make GC do its job. It seems that GC kicks in only when it wants to! Is there a way to make it do its job?)</p><p>If the above is correct, then what is the proper way to new a UI-related object? I know I can make evrything inside <code>AskFilename</code> static, or I can make <code>ask</code> a static vairable and assign it to null when it's done. But is there any other way? Or, the idea itself is bad in the first place? </p><p>(Does it make any difference if AskFilename is an ""inner"" class of the Activity? Like MyActivite.AskFilename.)</p><p>Thank you in advance.</p>","593407","","","","","2011-02-10 20:55:59","How long can a UI-related object stay usable?","<java><android>","1","0","","",""
"4962536","1","","","2011-02-10 20:51:45","4","4569","<p>I keep getting this error when trying to initialize and AudioRecord object, in an attempt to record sounds using the emulator using Eclipse.</p><p>I have tried with various bit sampling rates, 8000 is the only one that is valid, but the error continues to appear. I have tried on various versions of the sdk, 1.5, 1.6, 2, 2.2 and 2.3.1. (and combinations of with the AVD).</p><p>Here is the code:</p><pre><code>       Log.v(TAG, ""About to initialize recording"");   //int[] samplingRates = {44100, 22050, 16000, 11025, 8000};   int[] samplingRates = {8000};    for (int i = 0; i &lt; samplingRates.length; ++i)    {        try        {            Log.d(TAG,""Trying sampling rate: "" + samplingRates[i]);            int min = AudioRecord.getMinBufferSize(samplingRates[i],                     AudioFormat.CHANNEL_CONFIGURATION_MONO,                    //AudioFormat.CHANNEL_IN_MONO,                    AudioFormat.ENCODING_PCM_16BIT);            Log.d(TAG,""MinBufferSize: "" + min);            AudioRecord record = new AudioRecord(MediaRecorder.AudioSource.MIC, samplingRates[i],                    AudioFormat.CHANNEL_CONFIGURATION_MONO, AudioFormat.ENCODING_PCM_16BIT, min);            if (record.getState() == AudioRecord.STATE_INITIALIZED)            {                Log.d(""Recorder"", ""Audio recorder initialised at "" + record.getSampleRate());                return record;            }            record.release();            record = null;        }        catch (IllegalArgumentException e)        {            // Try the next one.            Log.d(TAG,""Initialization failed"");        }    }    // None worked.    return null;</code></pre><p>The error occurs on instantiation, AudioRecord record = new etc.</p><p>Has anyone seen this same problem, it seems to be a straight forward request so i´m suprised if this a bug, particular as I can´t get it working with different versions. </p><p>I have created the AVDs with Audio Record capabilities. Is there anything else I have to configure? </p><p>I have seen a couple of other posts on the same issue, but no replies.</p><p>Thanks in advance</p><p>Chris</p>","612092","","","","","2011-02-17 12:16:20","""Could not get audio input for record source 1"" when trying to initialize AudioRecord","<android>","1","1","","",""
"4962565","1","","","2011-02-10 20:54:42","2","845","<p>I want to display a date picker for selecting  date of birth,so as to user restricted to choose future date.currently date picker displays all dates including future also.i want to show the dates up to current dates only.Thanks.</p>","461972","","","","","2012-09-25 07:22:56","Date Picker in Android","<android>","3","0","","",""
"4962585","1","","","2011-02-10 20:56:27","0","685","<p>I have checked the Pref -> General -> Save auto before build box. But it still asks me each time when i click run.  just want the save popup to go away.</p><p>I am editing the main.xml resource file...</p>","612079","","483731","","2012-07-16 00:12:17","2013-11-11 15:42:58","Eclipse save before build","<android><eclipse-3.6>","1","5","","2013-05-01 19:35:15",""
"4962658","1","4963268","","2011-02-10 21:03:13","0","1806","<p>I have an activity that extends ListActivity and implementsOnScrollListener:</p><pre><code>public class RecentItemsList extends GenericListActivity implements OnScrollListener</code></pre><p>and in this class I use a class that extends ArrayAdapter:</p><pre><code>public class RecentItemAdapter extends ArrayAdapter&lt;Item&gt;</code></pre><p>I'm trying to bind a callback when one of the items in the list is clicked by the user, but the callback isn't firing. Here's my code:</p><pre><code>            setListAdapter(adapter);        ListView lv = getListView();        lv.setOnScrollListener(RecentItemsList.this);        lv.setOnItemClickListener(new OnItemClickListener() {            public void onItemClick(AdapterView&lt;?&gt; a, View v,   int position, long id) {                // do some stuff            }        });</code></pre><p>But the OnItemClick event is never fired, but the scroll events fire properly. Any ideas?</p>","612094","","244296","","2011-02-10 21:11:10","2011-02-10 22:01:45","ListActivity extension doesn't execute onclick listener","<android>","3","0","","",""
"4962674","1","","","2011-02-10 21:05:06","5","2390","<p>I have an app that loads a WebView.  Inside the WebView the page that's loaded has a file upload control (html input=file).  The button is visible and it says ""Choose File"", however if you click the button nothing happens.  If you are using the default Android browser and load this same page and click the button, it brings up a window letting you choose a file from your gallery, files, etc.  Why doesn't it work from the WebView?</p><p>I figure I need to override something but I don't know what that might be.  Basically I want to be able to upload photos from inside my app just like I can already do from my web app that runs in the browser.  The native app/webview version should work the same but clicking the 'Choose File' button doesn't do anything.</p><p>Thanks.</p>","612105","","","","","2014-01-13 11:31:47","How to upload files inside WebView?","<android><file><webview><upload>","1","1","2","",""
"4962692","1","","","2011-02-10 21:06:46","9","1369","<p>I have a ListView with custom layout for its items and need to specify the separate background color for checked items using selector.Here is selector for odd items:</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=""@android:color/black"" /&gt;    &lt;item android:state_checked=""true"" android:drawable=""@android:color/black"" /&gt;    &lt;item android:state_selected=""true"" android:drawable=""@color/red"" /&gt;    &lt;item android:drawable=""@android:color/white"" /&gt;&lt;/selector&gt;</code></pre><p>and here is selector for even items:</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=""@android:color/black"" /&gt;    &lt;item android:state_checked=""true"" android:drawable=""@android:color/black"" /&gt;    &lt;item android:state_selected=""true"" android:drawable=""@color/red"" /&gt;    &lt;item android:drawable=""@color/gray"" /&gt;&lt;/selector&gt;</code></pre><p>ListView item template looks like this:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;com.androidhub.core.CheckableLinearLayout    xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""match_parent"" android:layout_height=""40dip""&gt;    &lt;TextView         android:text=""TextView""         android:id=""@+id/textView1""         android:layout_height=""fill_parent""         android:layout_width=""wrap_content""         android:gravity=""center_vertical""         android:textColor=""@color/list_item""&gt;&lt;/TextView&gt;&lt;/com.androidhub.core.CheckableLinearLayout&gt;</code></pre><p>The root element of list item is CheckableLinearLayout: <a href=""http://paste.org/pastebin/view/28711"">http://paste.org/pastebin/view/28711</a></p><p>ListView has single choice mode (I also tried multiple choice mode but it also does not work for me)</p><pre><code>public class MainActivity extends ListActivity {    List&lt;String&gt; items = new ArrayList&lt;String&gt;();    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        items.add(""test 1"");        items.add(""test 2"");        items.add(""test 3"");        items.add(""test 4"");        getListView().setChoiceMode(ListView.CHOICE_MODE_SINGLE);        getListView().setAdapter(new TestAdapter(this, items));        getListView().setBackgroundColor(getResources().            getColor(android.R.color.white));    }}</code></pre><p>In adapter for this ListView I call setChecked() method of CheckableLinearLayout but it does not change its color:</p><pre><code>@Overridepublic View getView(int position, View convertView, ViewGroup parent) {    LayoutInflater inflater = LayoutInflater.from(getContext());    View v = convertView;    if(v == null) {        v = inflater.inflate(R.layout.list_item, null);    }    if(position % 2 != 0) {        v.setBackgroundResource(R.drawable.list_item_even);    }    else {        v.setBackgroundResource(R.drawable.list_item_odd);    }    if(parent instanceof ListView) {        ListView lv = (ListView)parent;        if(v instanceof CheckableLinearLayout) {            CheckableLinearLayout cll = (CheckableLinearLayout)v;            cll.setChecked(lv.isItemChecked(position));        }    }    return v;}</code></pre><p>What I'm doing wrong? I can see that <strong>state_pressed</strong> item from selector works fine but <strong>state_checked</strong> does not.What will be the right approach to setup <strong>state_checked</strong> background from XML, not from code?</p>","75368","","","","","2012-11-10 08:28:20","Need help with color selector for checked ListView items","<java><android><mobile>","3","3","4","",""
"4962872","1","4963145","","2011-02-10 21:25:09","0","546","<p>I believe to be following the standard pattern for avoiding recycled listview data,yet, I fail. As usual, the last two items of the listview (which are below the fold...get data from the other previous positions)</p><pre><code>public static class ViewHolder {    public ImageView img1;    public ImageView img2;      public TextView text1;    public TextView text2;    public TextView text3;    public TextView text4;  }public View getView(int position, View convertView, ViewGroup parent) {        View vi=convertView;        ViewHolder holder;        if( convertView == null ){            vi = inflater.inflate(R.layout.item, null);            holder=new ViewHolder();            holder.text1=(TextView)vi.findViewById(R.id.text1);            holder.text2=(TextView)vi.findViewById(R.id.text2);            holder.text3=(TextView)vi.findViewById(R.id.text3);            holder.text4=(TextView)vi.findViewById(R.id.text4);                     holder.img1=(ImageView)vi.findViewById(R.id.img1);                    holder.img2=(ImageView)vi.findViewById(R.id.img2);            vi.setTag(holder);        } else {            holder=(ViewHolder)vi.getTag();        }            String shorten=shortenText(t4);    holder.text.setTag(shorten);    holder.text.setText(shorten);       if(t1){        holder.text1.setTag(thisMsg.get(D_ENUM.T1));        holder.innerName.setText(thisMsg.get(thisMsg.get(D_ENUM.T1));    }    if(t2){        holder.text1.setTag(thisMsg.get(D_ENUM.T2));        holder.innerName.setText(thisMsg.get(thisMsg.get(D_ENUM.T2));    }    if(thisMsg.containsKey(D_ENUM.T3)){        String t3 = shortenText(thisMsg.get(D_ENUM.T3));        holder.innerDesc.setTag(t3);        holder.innerDesc.setText(t3);    }    holder.img1.setTag(img1);    imageLoader.DisplayImage(img1, act, holder.img1);    if(img2 != null) {         holder.innerImage.setTag(img2);        holder.innerImage.setVisibility(View.VISIBLE);        imageLoader.DisplayImage(img2, act, holder.img2);    } else {        holder.innerImage.setTag(img2);        holder.innerImage.setVisibility(View.GONE);    }    return vi;</code></pre>","420259","","420259","","2011-02-10 21:48:26","2011-02-10 21:48:26","How to avoid recycled item issue with ListAdapters?","<android><listview>","1","0","","",""
"4962908","1","4963619","","2011-02-10 21:28:40","0","2841","<p>Ok, this is about to drive me nuts. I'm still a newbie (and maybe an idiot) but this one has had me running in circles.</p><p>I'm trying to implement cursor control in an editText via soft buttons (left, right, up down). From what I've researched, it looks like I need the methods in the Selection object like moveUp(), moveLeft(), extendUp() etc. but they all need a ""text.layout"" object and I don't know how to get one.</p><p>Am I on the right track? Help?</p>","571876","","","","","2011-11-23 16:26:42","Cursor control in EditText","<android><android-widget>","2","0","","",""
"4963075","1","4975554","","2011-02-10 21:42:03","0","767","<p>I have a list of contacts in my application and I'd like to display a list of actions user can do with that contact (like call, message, email).</p><p>If you add contact to desktop using ""Shortcut->Contact"" you can click on the contact icon and be presented with a list of contact actions which you can use to pick an action.</p><p>Is there any way I can use it in my application? Like system api call or I will have to implement it myself?</p><p>Thanks!Leonty</p>","219449","","","","","2011-02-12 00:55:15","Android using contact action picker in application","<android-contacts><android>","2","0","","",""
"4963088","1","","","2011-02-10 21:42:58","1","885","<p>With my program I launch a activity that show a fake alertdialog for battery low. Now I want change also the icon battery on status bar but this is a system icon and there is not api for to do this. I found on the Internet this not public API <a href=""http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/1.5_r4/com/android/server/status/StatusBarIcon.java"" rel=""nofollow"">http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/1.5_r4/com/android/server/status/StatusBarIcon.java</a> but I have a problem for this line :</p><p>1) <code>View v = inflater.inflate(com.android.internal.R.layout.status_bar_icon, parent, false);</code></p><p>2)   <code>AnimatedImageView im = (AnimatedImageView)v.findViewById(com.android.internal.R.id.image);</code></p><p>because on official API there is not a com.android.internal.R.layout.status_bar_icon or com.android.internal.R.id.image I tried to replace with costant int value but for first line I get View v = com.android.server.status.statusbarview@44f0a2c0 but for second line I get AnimatedImageView im = null :-(</p><p>How can I do it?</p><p>I can not do it, I thought of creating a transparent activity in fullscreen modo and notitle and put my fake battery image on the top and with layout margin left put it over the battery icon. I tried it but my image go under the status bar...why ?? :-(</p>","612165","","142162","","2011-02-10 21:44:22","2012-02-17 08:00:26","Android icon battery","<java><android><icons><statusbar><battery>","1","2","","",""
"4963150","1","4963284","","2011-02-10 21:48:49","0","249","<p>I am using java.net.HttpURLConnection to connect to a website and send some data through a POST command. Now I am trying to find out if there is a way to read/parse the resulting website? </p><p>The PHP script I am posting to echo's some infromation on the site after the POST and that is what I want to read. </p><p>The only feedback I am able to find is the responseCode and responseMessage through getResponseCode() and getResponseMessage() but that is not really what I am looking for.</p><p>Is there any good way of doing this?  </p>","612168","","","","","2011-02-10 22:03:07","Retriving website after POST in android","<java><android><http-post>","2","2","","",""
"4963184","1","4963236","","2011-02-10 21:52:54","1","69","<p>I'm looking for information on how/if you can grab information from another app in Android. For example, if I wanted to make an app that checked which song was being played in the Music app at the moment. Is this even possible? I Googled around and searched on here but didn't find much.</p>","548223","","918414","","2013-03-16 03:01:14","2013-03-16 03:01:14","Grabbing Info From Another App","<java><android><mobile>","2","0","","",""
"4963223","1","","","2011-02-10 21:57:14","0","379","<p>I want to create an application which listens to events from a specific button (hardware button) and triggers some event.</p><p>For example, think about a PANIC button function, when some button is kept pressed for 5 seconds, this will trigger some ALERT (suppose sending an sms message).</p><p>I have not yet found a way to make this.</p><p>Please keep in mind that this MUST BE a HARDWARE BUTTON and not a software button (might in an activity).</p><p>Thank you very much.</p>","576931","","454167","","2011-02-10 22:31:22","2011-02-10 22:31:22","How can I control a PANIC button on Android?","<android><button><hardware><hardware-interface>","1","0","","",""
"4963271","1","","","2011-02-10 22:01:57","3","4774","<p>I use an Alarm to fetch data from server.I like to give user the option to start and stop the alarm.This means I have to check and see if alarm is already set.I found some code that tells me if the alarm is already set:</p><pre><code>Intent I = new Intent(getApplicationContext(),AlarmReceiver.class);PendingIntent P = PendingIntent.getBroadcast(getApplicationContext(), 0, I, PendingIntent.FLAG_NO_CREATE);found = (P!=null);</code></pre><p>if the Alarm is already set I cancel it but if it is not set then I set it (like a toggle)</p><p>Problem is this works only once. The first time the above code to check existing alarmswill return null indicating no alarm but after I cancel the alarm once it returns a pointerto something but alarm is not running.</p><p>here is the code to set alarm</p><pre><code>am = (AlarmManager) getSystemService(getApplicationContext().ALARM_SERVICE);Intent I = new Intent(getApplicationContext(),AlarmReceiver.class);PendingIntent P = PendingIntent.getBroadcast(getApplicationContext(), 0, I, PendingIntent.FLAG_CANCEL_CURRENT);am.setRepeating(AlarmManager.RTC_WAKEUP, System.currentTimeMillis(), 60000, P); </code></pre><p>and here is the code to cancel an alarm:</p><pre><code>am = (AlarmManager) getSystemService(getApplicationContext().ALARM_SERVICE);Intent I = new Intent(getApplicationContext(),AlarmReceiver.class);PendingIntent P = PendingIntent.getBroadcast(getApplicationContext(), 0, I, PendingIntent.FLAG_CANCEL_CURRENT);am.cancel(P);</code></pre><p>Am I to reset something after canceling an alarm to make it's PendingIntent go away.</p>","612179","","","","","2011-02-20 05:57:26","Android AlarmManager problem with setting & resetting an alarm","<android><android-intent><alarm><alarmmanager><android-pendingintent>","1","2","4","",""
"4963276","1","","","2011-02-10 22:02:30","1","1002","<p>Wanted nice Android Image Icon for Widget on Home screen.</p><p>Problem Widget is too big.  I adjusted the dp to 32 x 32 but still height is too much. </p><p>Using Linear Layout thats all.  ImageButton inside the widget layout.  I get a nice frame, but the widget size is too big compared to the others, and too big compared to the icon I am using. So how to set max height or actual height of the widget is my question. Thanks</p>","602260","","","","","2011-12-02 09:58:21","Android Widget Icon Size Layout","<android><layout><widget>","1","0","","",""
"4963395","1","4966470","","2011-02-10 22:18:34","3","82","<p>I'm working on a layout that comprises some of the same features seen in the screenshot below, but I'm running into a bit of confusion.  Can someone help me understand a few points for the screenshot below?</p><ul><li>What is the root layout used here?</li><li>How do I get the button bar to remain at the bottom, while the center section scrolls when it is long enough?</li><li>Similar to the Ok/Cancel buttons seen here, how do I make them each 50% width (minus some margin and padding)?</li></ul><p><img src=""http://i.stack.imgur.com/Ef01Y.jpg"" alt=""Android Market""></p>","107277","","","","","2011-02-11 07:20:39","Help identify the layout used here?","<android><android-layout>","2","0","0","",""
"4963520","1","5942696","","2011-02-10 22:34:29","1","4975","<p>I want to be able to press a button on my program and hold it down (without releasing) to increment a variable. Problem I am having right now is when I conduct the long button press it only runs once, until I release and press again.  </p><p>First I want to find out if there is a way to do this without having to use the OnTouchListener, and just using the OnLongClick. Is there a way to check the value of the button? For example.. buttondown=true; Conduct a whileloop to increment until the button is released.</p><p>Second, I don't want the updates to be delayed, because the incremented value is being drawn as the user holds down the button.</p><p>Basically I am doing something like this:</p><pre><code>btn_resume.setOnLongClickListener(new OnLongClickListener() {public boolean onLongClick(View v) {..code..return true;        }    });</code></pre>","612139","","","","","2011-10-11 07:33:18","Using an Android Long-Button press to increment/decrement counter","<android>","4","0","2","",""
"4963549","1","4963589","","2011-02-10 22:37:52","0","764","<p>We are trying to move some of our media files from our application to a server, but we can't seem to figure it out. I created a video, embedded it in my app, and it played fine. So I sent that same video file to someone to put on the server. I then went to my browser and typed in ""http://www.server.com/Android-app/testVideo.mp4"" and I get an error saying ""Sorry, this video is not valid for streaming to this device."" I am using a Samsung Moment. So I was thinking it was something wrong with the server. But the video does work on someone's Droid, so that makes it sound like a phone compatibility issue. But it is the exact same file that worked on the phone earlier. </p><p>Is there a setting (on phone or server) that needs to be changed? I just can't make since of it. Thanks for any help.</p>","469194","","","","","2011-07-15 05:57:35","Accessing video from server on Android","<android><video>","1","0","","",""
"4963581","1","","","2011-02-10 22:44:39","2","1452","<p>I would like to capture an image with the Android Camera but because the image may contain sensitive data I dont want the image saved to the phone or sd card.  Instead I would like a base64 string (compressed) which would be sent to the server immediately</p><p>In PhoneGap it seems files are saved to various places automatically. Natively I was never able to get the image stream - in onJpegPictureTaken() the byte[] parameter was always null.</p><p>can anyone suggest a way?</p>","612209","","","","","2011-02-11 00:15:46","How to capture an Android Camera image without saving a file to the phone/sdcard?","<android><camera>","1","0","1","",""
"4963682","1","","","2011-02-10 22:56:47","0","1206","<p>I'm writing an application in which i have to scroll different images one after another across the screen. In order to do that, i create a list of 10 ImageView items. These image view items are placed one after another like train coaches. </p><p>The question is how to scroll them from left to right. I thought of using scrollview, but it can accept only one child component and does vertical scrolling. </p><p>There is a Scroller class, but i'm not sure how to use it, i mean what does it scroll? I dont see any method like Scroller.scroll(view).</p><p>Another approach which i though was to user Layout animation such as TranslateAnimation, but then the end result is kind of shaky. </p><p>Can anyone point me to some sample of scrolling image from left to write. I don't want to use the gallery components because it defeats the objective of the application.</p><p>Thanks</p>","260298","","","","","2012-11-16 13:15:56","Scrolling images across the screen in android","<android>","3","0","","",""
"4963703","1","4964464","","2011-02-10 22:59:05","3","1089","<p>I'm trying to perform this simple task dealing with push notifications in Android (C2DM):</p><ul><li>if no notification exists in the notification bar, set it to ""foo A""</li><li>if a notification already exists, grab it, read its text, and then update it to something like ""N notifications: foo, bar, ..."". This is similar to what the gmail client would do on Android when you get 1 email vs multiple ones</li></ul><p>I have looked through the docs, read <a href=""http://developer.android.com/guide/topics/ui/notifiers/notifications.html#Updating"" rel=""nofollow"">http://developer.android.com/guide/topics/ui/notifiers/notifications.html#Updating</a>, searched SO and the web, but so far, I don't see a way to get access to the notification currently in the notification bar.</p><p>Do I need to manage the count elsewhere and have it reset when the user dismisses the notification? Is there no way to read the existing one?</p><p>Thank you.</p>","47680","","","","","2011-02-11 00:47:28","How can I dynamically change the Notification message when I aggregate multiple notifications in Android?","<android><notifications><android-c2dm>","1","0","2","",""
"4963773","1","5017740","","2011-02-10 23:09:11","2","6489","<p>I am trying to try out the tutorial online and wanted to put the tab to the layout xml. I have change the extends from Activity to TabActivity. In the design view of the layout xml, I have the below.</p><p>Error during post inflation process:TabHost requires a TabWidget with id ""android:id/tabs"".View found with id 'tabs' is 'com.android.layoutlib.bridge.MockView'The following classes could not be found:</p><p>I have looked for solution but none of them fixed except I found one in different language. I tried using the translator on google but not so helpful. </p><p>Does anyone manage to get the tabs function.</p><p>I am using Android 2.2 Api and develop with an eclipse IDE</p>","186820","","","","","2013-07-30 09:06:00","Anyone know what this error mean for android tabs?","<android><layout><tabs><host>","5","0","1","",""
"4963804","1","","","2011-02-10 23:13:30","0","680","<p>I'm using sharedPreferences to store some simple data that I access periodically. I've noticed that when I ""put"" something using the <code>SharedPreferences.Editor</code> (I do call <code>commit()</code>) when I later try to access the prefs with <code>prefs.getAll()</code> my newly added item is not there. </p><p>Oddly, if I close my app and fire it up again, it appears. It's like the prefs are not refreshing while my app is running. Is that by design? What gives?</p><p>BTW, I've noticed the same behavior while doing <code>editor.remove(""key"")</code>. I remove something (and call <code>commit()</code>), and when I call <code>getAll()</code> the deleted item is still in the <code>Map</code> returned. If I try to delete it again, my app force closes.</p><p>I must be doing something wrong. Any help is appreciated.</p><p>Thanks,Bobby</p>","612255","","512958","","2011-02-10 23:17:30","2011-02-11 00:40:23","SharedPreferences not refreshing?","<android>","2","1","","",""
"4963865","1","4965801","","2011-02-10 23:22:49","2","4699","<p>I have poured over every example that I can find and I have gone through the official documentation from google.  All I am trying to do is create a toast notification from a button click on a widget.</p><p>I can get the widget (and button) to appear but I can't get my intent to fire.  I have seen several examples that show doing this different ways but I just can't get it to work.  I haven't felt this helpless with coding in a long time and I'm starting to feel dumb.</p><p>This is what I have so far:</p><pre><code>public class simpleclick extends AppWidgetProvider {    /** Called when the activity is first created. */    @Override    public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {        final int N = appWidgetIds.length;        Toast.makeText(context, ""doing on update"", Toast.LENGTH_SHORT).show();        for (int i=0; i&lt;N; i++) {            int appWidgetId = appWidgetIds[i];            Intent intent = new Intent(context, simpleclick.class);            intent.setAction(""ham"");            PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, intent, 0);            RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.main);            views.setOnClickPendingIntent(R.id.Timm, pendingIntent);            appWidgetManager.updateAppWidget(appWidgetId, views);        }    }    //@Override    public void onReceive(Context context, Intent intent) {     // TODO Auto-generated method stub     Toast.makeText(context, ""action is: "" + intent.getAction(), Toast.LENGTH_SHORT).show();     super.onReceive(context, intent);    }}</code></pre><p>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=""com.tblabs.simpleclick""      android:versionCode=""1""      android:versionName=""1.0""&gt;    &lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;        &lt;receiver android:name=""simpleclick""&gt;        &lt;intent-filter&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/simpleclick"" /&gt;        &lt;/receiver&gt;    &lt;/application&gt;    &lt;uses-sdk android:minSdkVersion=""5"" /&gt;&lt;/manifest&gt; </code></pre><p>I would appreciate some help!</p><p>Thanks,Wendy</p>","612251","","375209","","2011-02-11 05:10:30","2013-05-29 13:06:41","Please help with very simple android widget button click. Getting very frustrated. :(","<android><android-widget>","2","1","","",""
"4963866","1","","","2011-02-10 23:22:55","2","919","<p>I have a layout like this (abstracted):</p><p>Scrollview - fill_parent</p><p>LinearLayout - wrap_content</p><p>ImageView 1 - wrap_content</p><p>ImageView 2 - ...</p><p>ImageView 3</p><p>...</p><p>In the course of user interaction some images are replaced by larger or smaller ones, shortening or lenghtening the area to be scrolled.And that is the problem. The Scrollview (SV) does not know about the change, so either it scrolls over a lot of empty space at the bottom, or cuts off a picture or two at the bottom.</p><p>Question 1: Can I somehow make the SV readapt to the changed hight of the LiearLayout (LL)?</p><p>Question 2: I can obtain the current size through getHight on the LL. But supplyong it to the SV via changed LayoutParams does not work - of course, that would only change the height of the SV on the screen. Is there a way to put the changed height of the LL into the SV in the code, somehow?</p><p>Question 3: I havn't tried it yet. Would creating the SV, LL and its children in code and then adding/removing children of changed size as required, make the SV adapt to the changes?</p><p>And last question: Is there a better aüpproach, except using ListViews?</p>","611923","","508666","","2012-01-29 12:55:02","2012-01-29 12:55:02","How to change size of Android ScrollView","<android><size><scrollview>","1","0","","",""
"4963902","1","9873040","","2011-02-10 23:29:21","4","1322","<p>I'm still relatively new to Java and Android development, so I'm still unfamiliar with the multitudes of libraries available for use, particularly for animation.  Where I'm from (the Flash world), we have access to several 3rd-party tweening engines that make life very easy for us when we want to programmatically move things around the stage without relying on the (vastly inferior) built-in Adobe tween APIs.  One of the most popular is Greensock's <a href=""http://www.greensock.com/tweenmax/"" rel=""nofollow"">TweenMax</a></p><p>Looking at the way Android handles tweening natively, it appears to be very cumbersome compared to what I'm used to.  I'm curious if there's a TweenMax-equivalent library out there for Android that makes animation sequencing equally easy to write in-code, with the benefits of smart intellisense, rather than having to write them all out in an external animation.xml file in the res folder.</p>","605918","","","","","2012-11-19 20:48:28","Is there a TweenMax equivalent in Java","<java><android><flash><actionscript-3><animation>","4","0","1","",""
"4963996","1","4964458","","2011-02-10 23:39:11","0","3798","<p>I would like to know if it is possible to embed the default audio player into one of my activities. Or at least be able to embed the section that has the play/pause button and the audio track seek bar.</p><p>The reason I would like to embed it rather than open it in a new intent (like this:</p><pre><code>Intent audioActivity = new Intent(Intent.ACTION_VIEW);audioActivity.setDataAndType(Uri.parse(getAudioURL()), ""audio/*"");startActivity(audioActivity);</code></pre><p>)</p><p>is that I want the users to be able to read some content within the current activity while listening to the audio. I have been able to use a progress bar which updates based on the progress in the audio track, but this does not look good and i would rather have the look and feel of the default audio player. I know the default video/audio players are not documented very well but if this is at all possible I would like to know. Thanks!</p>","612250","","","","","2011-04-23 02:33:34","android embed default audio player in app/activity","<android><audio><embed>","2","0","","",""
"4964025","1","4995230","","2011-02-10 23:42:25","0","719","<p>I've implemented a ContentProvider to add custom suggestions to my applications Quick Search Box. It works great within my app. However I also included it into the global search and it works different there. Whenever I start a search in the global search and I select one of my suggestions, this suggestion is saved and presented the next time I open the global search. What I don't like is that my current suggestions are below the ones I clicked before.</p><p>Is there a way to disable this behavior?</p><p>I am currently thinking of integrating recent suggestions in my ContentProvider to provide both - recent and custom suggestions. Though I am afraid this will result in having the same suggestions twice - first from the global search and then from my ContentProvider...</p><p>Any advice?</p>","427112","","157882","","2011-10-23 14:14:29","2011-10-23 14:14:29","Disable recent query suggestions in Android's global Quick Search Box?","<android><autosuggest><quick-search>","2","0","1","",""
"4964146","1","4964581","","2011-02-10 23:56:21","0","778","<p>i am looking to add a home screen to my app sort of like facebook app has with little icons and labels under them (Pictures, Chat, Wall, etd). I would like to go this route as opposed to adding bunch of tabs on top.</p><p>My question is how i can get it done with Android API? I know i could probably make these icons with labels within but perhaps there is a way to make it in a native way. </p><p>Thanks! :)</p>","612286","","","","","2011-02-11 03:11:12","How to accomplish Facebook like home screen using Android API?","<android>","3","0","1","",""
"4964148","1","4964539","","2011-02-10 23:56:30","7","3271","<p>First off, sorry if this has been asked but I cannot find it. I am downloading documents in my app from a remote resource. Once the document is downloaded, I want to open it for the user. What I want to know is how do I check if they have an application to handle Pdf or Tiff and launch it in the default application for them?  </p><p>Thank you.</p><p><strong>edit</strong></p><p>here is part of the solution:</p><pre><code>Intent viewDoc = new Intent(Intent.ACTION_VIEW);viewDoc.setDataAndType(    Uri.fromFile(getFileStreamPath(""test.pdf"")),     ""application/pdf"");PackageManager pm = getPackageManager();List&lt;ResolveInfo&gt; apps =     pm.queryIntentActivities(viewDoc, PackageManager.MATCH_DEFAULT_ONLY);if (apps.size() &gt; 0)    startActivity(viewDoc);</code></pre>","457577","","457577","","2011-02-13 18:19:41","2012-11-29 02:13:40","Android: Open saved file in default app from my app","<android><file-io><document><filehandler>","1","0","3","",""
"4964168","1","4964265","","2011-02-10 23:59:37","52","23610","<p>I have been using Eclipse for Android development and don't have a problem with it (I also use it for Web Service and C++ development under Linux) but I want to give IntelliJ IDEA a go as it appears to have favourable reviews.  This is easily possibly now that IDEA 10 has been released with Android support enabled in the Community Edition.</p><p>I have looked at IDEA and it looks pretty good to me with the only downside being the lack of UI on .xml file editing (AndroidManifest.xml for example) and the user interface builder provided with ADT 9.0.</p><p>Has anyone got experience they can share on IntelliJ IDEA and Android development?</p><p>EDIT:  Thanks all; I'm sticking with Eclipse as I know it pretty well and it allows me to do pretty much anything (Java-related) I like for free.  I shouldn't look a gift horse in the mouth!</p>","299924","","299924","","2011-02-11 16:52:45","2014-03-11 19:10:39","Benefits of switching from Eclipse to IntelliJ IDEA for Android development","<android><eclipse><intellij-idea>","11","0","16","2013-11-12 12:30:27",""
"4964188","1","13383025","","2011-02-11 00:02:19","3","7959","<p>My activity stack is A1 B A2, with A2 at the top. </p><p>A1 and A2 are instances of the same activity, A. Now in A2, I want A2 to exit and bring A1 to front, so the final stack should be B A1. How should I implement it?</p><p>My current code that A2 executs is:</p><pre><code>        finish();        intent = new Intent(this, A.class);        intent.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT | Intent.FLAG_ACTIVITY_PREVIOUS_IS_TOP);        startActivity(intent);</code></pre><p>The above code brought B to front, so the final stack is A1 B, which is not what I expected.</p><p>Any idea?</p><p>Thanks.</p>","445302","","","","","2013-12-07 07:28:07","Bring an activity to front using FLAG_ACTIVITY_REORDER_TO_FRONT","<android>","3","0","1","",""
"4964589","1","4964643","","2011-02-11 01:07:39","3","714","<p>Is there an effective way to sniff the browser type for the Samsung Galaxy Tablet? </p>","510395","","","","","2014-04-08 07:29:34","Galaxy Tablet browser sniff / detection","<javascript><android><tablet><galaxy>","3","0","","",""
"4964649","1","4964689","","2011-02-11 01:18:31","1","611","<p>When a user presses a shortcut on the screen and that shortcut starts up an activity, how can I get the location of where the shortcut is on the screen?</p><p>I have the same question for a widget.  When a user has a widget on the screen and pressing it fires off the setOnClickPendingIntent how can I know the location on the screen where the widget is?</p><p>In both scenarios there is no View to run View.getLocationOnScreen.</p>","242904","","","","","2011-02-11 14:13:40","How to getLocationOnScreen from a Shortcut or Widget?","<android>","1","0","","",""
"4964678","1","","","2011-02-11 01:21:42","1","667","<p>I want to know how to encrypt the external storage data (.asec).Which algorithm is used, AES or another method?And then what is the encryption key?If a method to generate encryption key is open source, I think that it is going to cause a problem. I would be grateful for any information about this.</p>","612365","","15168","","2011-02-11 02:20:08","2013-04-05 16:42:28","Android external storage encryption","<android><encryption><storage>","1","0","","",""
"4964703","1","","","2011-02-11 01:24:24","23","9492","<p>How can I fake an incoming call inside the android emulator?</p><p>The following lets me make a call but I'd like to force the emulator to receivea call, preferably from a number I've selected.</p><pre><code>adb shell am start -a android.intent.action.CALL tel:1112223333</code></pre><p>So, the direct opposite of the command above.</p>","612368","","142162","","2011-02-11 01:26:43","2014-01-30 00:32:53","Fake Incoming Call Android","<android><adb>","5","0","6","",""
"4964746","1","","","2011-02-11 01:31:32","0","945","<p>I create an instance from activity A to B, then in activity B I create another instance of activity A (I want to keep the previous A in history). I keep creating instance and I have a history stack from Activity A -> B -> A -> B -> A.....and after like 20 times, the system looks like need more memory and will kill the first activity A, then B (it calls onDestroy() from Log)...each at a time when I create each activity. I never have any memory issue in this scenario. But if I suddenly create an activity C which has lots of images that requires large memory, it will throw an Out of Memory Error: VM wont let us to allocate 70k bytes something like that. </p><p>So anyone know when will system kill an activity? Does it kill only 1 activity each time? How can I let the system give me more memory before I start activity C? Do I have a memory leak on this? Any help is appreciated. </p>","497847","","497847","","2011-02-11 18:01:51","2011-02-11 18:01:51","Android: out of memory error when infinite activities?","<android>","1","0","","",""
"4964749","1","4964894","","2011-02-11 01:32:03","2","3050","<p>How can I open a SlidingDrawer using a button not attached to it?  In other words, I like to open it w/o the handle.  </p>","742030","","","","","2014-03-10 17:11:44","Open a SlidingDrawer via button","<android><slidingdrawer>","4","0","2","",""
"4964764","1","4964878","","2011-02-11 01:34:13","0","1767","<p>When using android's mediaplayer to stream audio off the web, is it okay to call all the functions (stop(), reset(), setDataSource(), etc.) on the UI thread, or should I create a separate thread for that. In other words, will those functions ever take a few seconds to respond and thereby cause perceptible lag?</p><p>If I do have to call them from separate threads, what's the best way to handle that?</p>","312499","","312499","","2012-05-11 22:07:02","2012-05-11 22:07:02","Android MediaPlayer on UI Thread","<android><media-player>","1","0","","",""
"4964829","1","","","2011-02-11 01:45:43","16","2398","<p>I have an Android application with English strings in values/strings.xml. For each string in that file, I have an entry in values-ja/strings.xml with the Japanese translation of that string. If I set the emulator, a Nexus One or Nexus S to Japanese, the UI shows Japanese text throughout. Most of the time.</p><p>Sometimes, some portion of the UI will appear in English, even though the current locale is ja-JP. For instance, I wrote this test code in the onCreate() method of one of my activities:</p><pre><code>Log.e(TAG, ""Default locale = '"" + Locale.getDefault().toString() + ""'"");Log.e(TAG, ""My string = '"" + getResources().getString(R.string.my_string) + ""'"");</code></pre><p>Sometimes I will see in LogCat:</p><pre><code>Default locale is 'ja_JP'My string is '??'</code></pre><p>Other times I will see:</p><pre><code>Default locale is 'ja_JP'My string is 'English'</code></pre><p>Sometimes this issue is resolved by rotating the phone. Sometimes it's resolved by exiting and restarting the app. Sometimes only a portion of a single screen is in English. Sometimes this issue occurs with strings that are pulled out of the resources via code, and sometimes it occurs with strings that are only referenced by a layout. Nowhere in my application do I call Locale.setDefault(), so that's not causing the issue.</p><p><strong>UPDATE</strong></p><p>I've found a way to correct the issue for a specific activity. In that activity's onCreate():</p><pre><code>Log.e(TAG, ""getString: '"" + getString(R.string.my_string) + ""'"");Log.e(TAG, ""getResources().getConfiguration(): '"" +      getResources().getConfiguration().toString() + ""'"");Log.e(TAG, ""getResources().getDisplayMetrics(): '"" +      getResources().getDisplayMetrics().toString() + ""'"");Log.e(TAG, ""Setting configuration to getConfiguration()"");getResources().updateConfiguration(getResources().getConfiguration(),     getResources().getDisplayMetrics());Log.e(TAG, ""getString: '"" + getString(R.string.my_string) + ""'"");Log.e(TAG, ""getResources().getConfiguration(): '"" +      getResources().getConfiguration().toString() + ""'"");Log.e(TAG, ""getResources().getDisplayMetrics(): '"" +      getResources().getDisplayMetrics().toString() + ""'"");</code></pre><p>This results in the following in LogCat:</p><pre><code>getString: 'English'getResources().getConfiguration(): '{ scale=1.0 imsi=0/0 loc=ja_JP touch=3 keys=1/1/2 nav=3/1 orien=1 layout=34 uiMode=17 seq=8}'getResources().getDisplayMetrics(): 'DisplayMetrics{density=1.5, width=480, height=800, scaledDensity=1.5, xdpi=254.0, ydpi=254.0}'Setting configuration to getConfiguration()getString: '??'getResources().getConfiguration(): '{ scale=1.0 imsi=0/0 loc=ja_JP touch=3 keys=1/1/2 nav=3/1 orien=1 layout=34 uiMode=17 seq=8}'getResources().getDisplayMetrics(): 'DisplayMetrics{density=1.5, width=480, height=800, scaledDensity=1.5, xdpi=254.0, ydpi=254.0}'</code></pre><p>As you can see from the log, nothing in the current configuration changes, but getString() gives different results.</p><p>It's impractical to use this workaround in every place in my application where a resource might be used, but hopefully this provides a hint about what's going wrong.</p>","129976","","129976","","2011-02-12 05:15:38","2011-04-23 07:08:58","Why might Resources.getString() intermittently return strings from the wrong locale?","<android><localization><locale><getstring>","2","9","6","",""
"4964852","1","","","2011-02-11 01:48:47","4","1219","<p>I searched arround for solutions and didn't find anything of really pertinent on the subject.</p><p>This is why, I ask you guys your help :-)</p><p>Assuming I have an application running with Rails 3 using Devise to authenticate the users.</p><p>I need to create mobile applications for Iphone/Android and WP7.</p><p>The mobiles applications should communicate/login/create/list, do whatever the website can do.</p><p>The mobile Applications could commuicate by parsing the XML .... but maybe there are already lib/frameworks or something more sexy ?</p><p>What would be the best way to communicate between my mobile applications and my Rails website ?</p>","280603","","280603","","2011-02-11 02:59:18","2013-01-21 16:37:23","Rails3 and Devise working with Iphone/Android/Wp7 applications","<iphone><android><ruby-on-rails-3><windows-phone-7><devise>","2","4","1","",""
"4964970","1","4964999","","2011-02-11 02:11:51","1","980","<p>I am trying to get memory usage values using this class, but all the class members are zero.  I am calling it like this:</p><pre><code>android.os.Debug.MemoryInfo dbm = new android.os.Debug.MemoryInfo();</code></pre><p>but them dbm.dalvikPss (and the other class members) are zero.  Any ideas?  Thanks in advance.</p>","353271","","","","","2011-02-11 02:18:58","trouble using Debug.MemoryInfo","<android>","1","0","","",""
"4965112","1","4965494","","2011-02-11 02:39:10","1","2534","<p>I am attempting to simply acquire the user's GPS location, but my application crashes when trying to get the latitude and longitude of the device.  See code for where the error occurs..</p><pre><code>public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    LocationManager lm = (LocationManager)getSystemService(Context.LOCATION_SERVICE);     Location location = lm.getLastKnownLocation(LocationManager.GPS_PROVIDER);    final double longitude = location.getLongitude();  //error occurs here    final double latitude = location.getLatitude();    //and here    LocationListener locationListener = new LocationListener() {        public void onLocationChanged(Location location) {          // Called when a new location is found by the network location provider.            //longitude = location.getLongitude();            //latitude = location.getLatitude();        }        public void onStatusChanged(String provider, int status, Bundle extras) {}        public void onProviderEnabled(String provider) {}        public void onProviderDisabled(String provider) {}      };    //update location via GPS PROVIDER    //can also use LocationManager.NETWORK_PROVIDER    lm.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, locationListener);}</code></pre><p>I am also including the ACCESS_FINE_LOCATION permission in the manifest file:</p><pre><code>&lt;uses-permission android:name=""android.permission.ACCESS_FINE_LOCATION"" /&gt;</code></pre><p>so I'm not quite sure why this does not work.  Any help would be greatly appreciated!</p>","612414","","","","","2011-02-26 13:39:07","How to acquire a user's GPS location on an Android (2.2) device","<java><android><gps><location><manager>","2","4","2","",""
"4965132","1","","","2011-02-11 02:44:16","1","3649","<p>Is it even possible to create a ListActivity completely during runtime without using XML?  I’m trying to create a list view with 8 items, alternating between four TextViews and four ToggleButtons.  The goal is to have a vertical list with <strong>TextView</strong>, <em>ToggleButton</em>, <strong>TextView</strong>, <em>ToggleButton</em>, <strong>TextView</strong>, <em>ToggleButton</em>, <strong>TextView</strong>, <em>ToggleButton</em></p><p>Here’s my code:</p><pre><code>public class MyActivity extends ListActivity implements OnCheckedChangeListener{    private ViewGroup.LayoutParams widthLayout = new ViewGroup.LayoutParams( ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT );    private TextView[] textItems = new TextView[ 4 ];    private ToggleButton[] toggleButtons = new ToggleButtons[ 4 ];    private static final int ID_BASE = 5550;  // unique ID for this activity    public void onCreate( Bundle savedInstanceState ) {        super.onCreate( savedInstanceState );        setupView();    }//    private void setupView() {        Vector v_itemList = new Vector();        for ( int i=0; i &lt; 4; i++ ) {            int t_color = 0xFFFFFF;            //            textItems[i] = new TextView( this );            textItems[i].setText( """"+i+"". text line"" );            textItems[i].setColor( t_color );            t_color -= 0x220022;            //            toggleButtons[i] = new ToggleButton( this );            toggleButtons[i].setTextOff( """"+i+"". Off"" );            toggleButtons[i].setTextOn( ""On (""+i+"")"" );            toggleButtons[i].setId( ID_BASE+i );            toggleButtons[i].setChecked( i%2 == 1 ? true : false );            toggleButtons[i].setOnCheckedChangeListener( this );            //            v_itemList.addElement( textItems[i] );            v_itemList.addElement( toggleButtons[i] );        }        ArrayAdapter listItemAdapter = new ArrayAdapter( this, android.R.layout.simple_list_item_1, v_itemList );        this.setListAdapter( listItemAdapter );    }}</code></pre><p>When I've tried this code, I get a list list view of all the element's toString() output:android.widget.TextView@4376f760android.widget.ToggleButton@437708c8android.widget.TextView@43772b10android.widget.ToggleButton@43772fa0... ect ...</p><p>I then tried to add the TextView and ToggleButton using:</p><pre><code>this.addContentView( textItems[i], widthLayout );this.addContentView( toggleButtons[i], widthLayout );</code></pre><p>within the for loop.  But recieved a RuntimeException, Your content must have a ListView whos id attribute is 'android.R.id.list'</p><p>Any help would be appreciated, and if possible I'd like to avoid using any reference to XML.</p>","612436","","","","","2011-02-11 07:27:04","How to programmatically add run-time created view into ListActivity without XML","<android><listview><runtime><listactivity>","1","2","","",""
"4965185","1","","","2011-02-11 02:53:09","1","334","<p>I'm writing some jUnit tests for an android app I'm starting on, and I've come up on a <em>really</em> weird error.  When I run the test suite in Eclipse (either by right-clicking on the test project -> run as -> Android jUnit test, or by clicking the 'run test' button in the jUnit tab next to Package explorer), it spends a few seconds building and uploading to the emulator, and then just stops with a message in red saying that the ""Test run failed"".  </p><p>That's fine, I can live with failure -- except there's <em>no</em> other information about what failed.  The jUnit tab doesn't show any test results (no successes, no failures), the 'Problems' tab gives nothing, obviously the thing builds because it loaded into the emulator, the emulator's still running (I opened and closed a couple of apps just to make sure).  I tried running the tests in debug mode (debug as -> Android jUnit test), but no exceptions or errors in there, either.</p><p><strong>Update:</strong> I'm not sure that my test case in the DiagramClassTest is even getting executed, because a breakpoint at the beginning of the method doesn't get hit (yes, I'm running it with Run as -> Android jUnit test).  Yet, there's a runtime error in there.  I'm not overriding the <code>AndroidTestCase</code> constructor, or doing anything else funky.</p><p>Any suggestions as to what I can try next to get some information on why my tests are failing?  Complete console log below:</p><pre><code>[2011-02-11 13:43:03 - RosterManagerTest] ------------------------------[2011-02-11 13:43:03 - RosterManagerTest] Android Launch![2011-02-11 13:43:03 - RosterManagerTest] adb is running normally.[2011-02-11 13:43:03 - RosterManagerTest] Performing android.test.InstrumentationTestRunner JUnit launch[2011-02-11 13:43:03 - RosterManagerTest] Automatic Target Mode: using existing emulator 'emulator-5554' running compatible AVD 'default'[2011-02-11 13:43:06 - RosterManagerTest] Application already deployed. No need to reinstall.[2011-02-11 13:43:06 - RosterManagerTest] Project dependency found, installing: RosterManager[2011-02-11 13:43:08 - RosterManager] Application already deployed. No need to reinstall.[2011-02-11 13:43:08 - RosterManagerTest] Launching instrumentation android.test.InstrumentationTestRunner on device emulator-5554[2011-02-11 13:43:10 - RosterManagerTest] Collecting test information[2011-02-11 13:43:14 - RosterManagerTest] Test run failed: org.hezmatt.RosterManager.test.DiagramClassTest</code></pre>","60003","","60003","","2011-02-11 03:39:52","2012-09-26 22:25:44","How do I debug my test suite when the only info is ""Test run failed""?","<java><android><eclipse><junit>","0","4","","",""
"4965228","1","4965283","","2011-02-11 03:04:31","0","817","<p>I'm learning animation and scrolling features in android. I have a HorizontalLayout containing LeniarLayout. Here is my code.</p><pre><code>LinearLayout layOut = (LinearLayout)findViewById(R.id.lnLayout);                           ImageView im1= new ImageView(this);                im1.setImageResource(R.drawable.im1);        ImageView im2= new ImageView(this);        im2.setImageResource(R.drawable.im2);        ImageView im3= new ImageView(this);        im3.setImageResource(R.drawable.im3);        ImageView im4= new ImageView(this);        im4.setImageResource(R.drawable.im4);        ImageView im5= new ImageView(this);        im5.setImageResource(R.drawable.im5);        ImageView im6= new ImageView(this);        im6.setImageResource(R.drawable.im6);        layOut.addView(im1,0);        layOut.addView(im2,1);        layOut.addView(im3,2);        layOut.addView(im4,3);        layOut.addView(im5,4);        layOut.addView(im6,5);</code></pre><p>I'm trying to make these image to autoscroll continously and in definitely. I looked at Scroller class but it seems only TextView can use Scroller class, since no other class has setScroller method. What is the other way to achieve continous scrolling for in-definite period of time.</p>","260298","","","","","2011-02-11 03:57:33","Continous horizontal scrolling","<android>","2","2","","",""
"4965234","1","","","2011-02-11 03:06:28","4","1226","<p>I'm trying to decide which ad provider to go with and one of my irritations on the market are apps that require more permissions than needed. Most of the major providers require you to sign up before you get access to their documentation, so thought we could compile the information here.</p><p>What permissions are required to show ads in your Android app from each of the major ad vendors:</p><ul><li><a href=""http://admob.com/"" rel=""nofollow"">AdMob</a></li><li><a href=""http://www.tapjoy.com/"" rel=""nofollow"">TapJoy</a></li><li><a href=""http://www.google.com/mobileads/"" rel=""nofollow"">Google Mobile Ads</a></li><li><a href=""http://www.burstly.com/"" rel=""nofollow"">Burstly</a></li><li><a href=""http://www.mobclix.com/"" rel=""nofollow"">Mobclix</a></li><li><a href=""http://www.zestadz.com/"" rel=""nofollow"">zestadz</a></li><li><a href=""http://www.inmobi.com/"" rel=""nofollow"">InMobi</a></li><li><a href=""http://ivdopia.com/"" rel=""nofollow"">iVdopia</a><br>Feel free to add more. I just got the list from <a href=""http://mobile.tutsplus.com/articles/marketing/mobile-advertising-services/"" rel=""nofollow"">tutsplus</a>.</li></ul><p>(To be clear, I'm looking to see which vendors require more permissions than others.)</p>","79125","","79125","","2011-02-23 17:27:55","2011-07-28 21:19:14","What permissions are required for each the major Android ad providers?","<android><ads>","3","0","4","",""
"4965268","1","","","2011-02-11 03:12:32","0","973","<p>i got the following code but my application crash. Can someone please tell me what is wrong? Tks!</p><pre><code> public class GPS extends MapActivity{private MapController mapController;private MapView mapView;private LocationManager locationManager;GeoPoint p;int lat,lng; 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.pin);                        canvas.drawBitmap(bmp, screenPts.x, screenPts.y-50, null);                     return true;        }    } /** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.gps);  // 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, 0,            0, new GeoUpdateHandler());       //---Add a location marker---    MapOverlay mapOverlay = new MapOverlay();    List&lt;Overlay&gt; listOfOverlays = mapView.getOverlays();    listOfOverlays.clear();    listOfOverlays.add(mapOverlay);            mapView.invalidate();} @Overrideprotected boolean isRouteDisplayed() {    // TODO Auto-generated method stub    return false;}public class GeoUpdateHandler implements LocationListener {    @Override    public void onLocationChanged(Location location) {        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>","596379","","","","","2011-02-11 06:28:57","GPS with Map Overlay","<android><gps><overlay>","0","2","","",""
"4965294","1","","","2011-02-11 03:19:54","7","5963","<p>I have requirement to pop up alert dialog which is like a EULA screen.Which will have text describing EULA with a checkbox ""Don't show this again"" and in the end 2 buttons for OK and Cancel.</p><p>Any help regarding the same is appreciated.</p><p>Is it possible to have textview and checkbox as part of alert dialog ? If yes, how to do that ?any sample code is appreciated.</p><p>-Thanks &amp; regards,Manju</p>","612465","","","","","2012-08-27 14:29:30","Alert dialog with text follwed with a checkbox and 2 buttons","<android>","2","2","3","",""
"4965303","1","4965432","","2011-02-11 03:21:55","0","669","<p>Greetings all,</p><p>I'm trying to create a specific layout that should be very simple but having a very difficult time and was wondering if I could get some pointers.</p><p>The layout I'm looking for looks like this</p><pre><code>Text label   Text label   Text Labelspinner      Spinner      Edit Text</code></pre><p>The text labels and spinner columns should only take about 40% of the width total, and text label and edit text should take the remaining 60%.</p><p>I tried using a table layout, but layout_weight doesn't seem to have any effect.  The only way it seems I can set width is by hard coding the width of the items (android:width).  Should I be using a table layout for this or 2 horizontal LinearLayouts?  I'm wracking my mind here!</p>","546489","","546489","","2011-02-11 04:33:25","2011-02-11 04:40:21","Android Table (like) layout","<android><android-layout>","2","0","","",""
"4965339","1","4966227","","2011-02-11 03:29:33","1","3488","<p>I'm running an emulator targeting 2.3 (API Level 9). I've removed all downloaded apps (which includes any code that I've written) but I still get all of these logcat errors when I start up the emulator:</p><pre><code>[ollie@devdataload scripts]$ startlogcat.sh - waiting for device -E/Zygote  (   32): setreuid() failed. errno: 2E/Zygote  (   32): setreuid() failed. errno: 17E/BatteryService(   61): usbOnlinePath not foundE/BatteryService(   61): batteryVoltagePath not foundE/BatteryService(   61): batteryTemperaturePath not foundE/SurfaceFlinger(   61): Couldn't open /sys/power/wait_for_fb_sleep or /sys/power/wait_for_fb_wakeE/SensorService(   61): couldn't open device for module sensors (Invalid argument)E/System  (   61): Failure starting core serviceE/System  (   61): java.lang.SecurityExceptionE/System  (   61):      at android.os.BinderProxy.transact(Native Method)E/System  (   61):      at android.os.ServiceManagerProxy.addService(ServiceManagerNative.java:146)E/System  (   61):      at android.os.ServiceManager.addService(ServiceManager.java:72)E/System  (   61):      at com.android.server.ServerThread.run(SystemServer.java:206)E/EventHub(   61): could not get driver version for /dev/input/mouse0, Not a typewriterE/EventHub(   61): could not get driver version for /dev/input/mice, Not a typewriterE/SoundPool(   61): error loading /system/media/audio/ui/Effect_Tick.oggE/SoundPool(   61): error loading /system/media/audio/ui/KeypressStandard.oggE/SoundPool(   61): error loading /system/media/audio/ui/KeypressSpacebar.oggE/SoundPool(   61): error loading /system/media/audio/ui/KeypressDelete.oggE/SoundPool(   61): error loading /system/media/audio/ui/KeypressReturn.oggE/UsbObserver(   61): E/UsbObserver(   61): java.lang.NullPointerExceptionE/UsbObserver(   61):   at com.android.server.UsbObserver.init(UsbObserver.java:131)E/UsbObserver(   61):   at com.android.server.UsbObserver.&lt;init&gt;(UsbObserver.java:65)E/UsbObserver(   61):   at com.android.server.ServerThread.run(SystemServer.java:402)E/ThrottleService(   61): Could not open GPS configuration file /etc/gps.confE/logwrapper(  125): executing /system/bin/tc failed: No such file or directoryE/logwrapper(  126): executing /system/bin/tc failed: No such file or directoryE/logwrapper(  127): executing /system/bin/tc failed: No such file or directory</code></pre><p>I'd like to try to clean these up so that I can know for sure that any errors I'm looking at are being caused by my code. Does anyone else get these error messages and do you fix them or just ignore them?</p>","549226","","","","","2012-11-25 13:39:08","Logcat errors when running android emulator","<android><android-emulator>","2","0","","",""
"4965340","1","4965375","","2011-02-11 03:29:36","0","170","<p>I'm trying to understand this concept but I don't get it yet. I'm new to mobile connections.</p><p>How do mobile apps and/or clients connect to the internet, if they do? if not, then, how do they serve real time data from remote servers (like twitter, fb) etc..?</p><p>I've heard that mobile apps don't require internet connection but I'm confused because I don't know how they get the data from the servers of twitter or fb or any application.</p><p>For example <code>m.facebook.com</code> is a site so it'll only work with some type of connection on a mobile, but with the app.. what happends (how do all of a sudden you don't need internet connection to serve the data from their servers)????</p>","563292","","122207","","2011-02-11 05:16:19","2011-02-11 05:16:19","How do android or iphone clients work?","<iphone><android><facebook><mobile-application>","1","0","","",""
"4965450","1","4965620","","2011-02-11 03:50:06","0","49","<p>When we create google map in our application and load in motorola milestone, left side a square portion is being cut off. Can anyone what may be the reason? The same code wont show any issues in other sets..</p>","504162","","","","","2011-02-11 04:24:57","Portion of google map being cut in Motorola Milestone?","<android>","1","0","","",""
"4965488","1","","","2011-02-11 03:57:30","4","854","<p>While using honeycomb emulator is shows following error and become very slow.  </p><pre><code>02-11 02:58:50.949: ERROR/ActivityManager(365): ANR in com.android.launcher (com.android.launcher/com.android.launcher2.Launcher)02-11 02:58:50.949: ERROR/ActivityManager(365): Reason: keyDispatchingTimedOut02-11 02:58:50.949: ERROR/ActivityManager(365): Load: 2.57 / 1.18 / 0.8902-11 02:58:50.949: ERROR/ActivityManager(365): CPU usage from 3042ms to -7585ms ago:02-11 02:58:50.949: ERROR/ActivityManager(365):   74% 365/system_server: 53% user + 21% kernel / faults: 335 minor02-11 02:58:50.949: ERROR/ActivityManager(365):   9% 780/zygote: 3.8% user + 5.1% kernel / faults: 915 minor02-11 02:58:50.949: ERROR/ActivityManager(365):   8.2% 684/com.android.launcher: 6% user + 2.1% kernel / faults: 51 minor02-11 02:58:50.949: ERROR/ActivityManager(365):   0% 432/zygote: 0% user + 0% kernel / faults: 22 minor02-11 02:58:50.949: ERROR/ActivityManager(365):   2.4% 41/adbd: 0.3% user + 2% kernel02-11 02:58:50.949: ERROR/ActivityManager(365):   0.4% 546/com.android.systemui: 0.1% user + 0.2% kernel / faults: 11 minor02-11 02:58:50.949: ERROR/ActivityManager(365):   0.5% 733/logcat: 0% user + 0.5% kernel02-11 02:58:50.949: ERROR/ActivityManager(365):   0% 425/zygote: 0% user + 0% kernel02-11 02:58:50.949: ERROR/ActivityManager(365):   0% 28/servicemanager: 0% user + 0% kernel02-11 02:58:50.949: ERROR/ActivityManager(365): 100% TOTAL: 65% user + 34% kernel + 0.6% softirq02-11 02:58:50.949: ERROR/ActivityManager(365): CPU usage from 9680ms to 11220ms later:02-11 02:58:50.949: ERROR/ActivityManager(365):   70% 365/system_server: 28% user + 42% kernel02-11 02:58:50.949: ERROR/ActivityManager(365):     49% 396/InputDispatcher: 18% user + 30% kernel02-11 02:58:50.949: ERROR/ActivityManager(365):     21% 366/HeapWorker: 8.1% user + 13% kernel02-11 02:58:50.949: ERROR/ActivityManager(365):   26% 78014% user + 11% kernel / faults: 323 minor02-11 02:58:50.949: ERROR/ActivityManager(365):     20% 780/.ap: 10% user + 10% kernel02-11 02:58:50.949: ERROR/ActivityManager(365):     5.4% 781/HeapWorker: 4.6% user + 0.7% kernel02-11 02:58:50.949: ERROR/ActivityManager(365):   1.3% 41/adbd: 0% user + 1.3% kernel02-11 02:58:50.949: ERROR/ActivityManager(365):     0.6% 41/adbd: 0% user + 0.6% kernel02-11 02:58:50.949: ERROR/ActivityManager(365):     0.6% 65/adbd: 0% user + 0.6% kernel02-11 02:58:50.949: ERROR/ActivityManager(365):   0.7% 684/com.android.launcher: 0.7% user + 0% kernel02-11 02:58:50.949: ERROR/ActivityManager(365):     0.7% 684/ndroid.launcher: 0.7% user + 0% kernel02-11 02:58:50.949: ERROR/ActivityManager(365):     0.7% 691/Binder Thread #: 0.7% user + 0% kernel02-11 02:58:50.949: ERROR/ActivityManager(365): 100% TOTAL: 40% user + 58% kernel + 0.6% softirq</code></pre><p>What did went wrong here. What i need fix this?<br>thank you </p>","609646","","","user2383060","2013-05-18 19:18:05","2013-05-18 19:18:05","keyDispatchingTimedOut while using emulator","<java><android><performance><android-emulator>","4","1","","",""
"4965638","1","4965778","","2011-02-11 04:30:17","1","5310","<p>I used the following code to add a view in a layout </p><pre><code>LinearLayout linearLayout_row1_recent_released = (LinearLayout)findViewById(R.id.linearLayout);    View myview = findViewById(R.layout.row);     Button button = myview.findViewById(R.id.mybutton);     linearLayout_row1_recent_released.removeAllViews();     linearLayout_row1_recent_released.addView(myview,LinearLayout.LayoutParams.FILL_PARENT);</code></pre><p>Using row.xml i've tried to get a view. What i get is a FATAL EXCEPTION.  </p><pre><code>02-11 02:59:04.278: ERROR/AndroidRuntime(780): FATAL EXCEPTION: main02-11 02:59:04.278: ERROR/AndroidRuntime(780): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.aaaaa.ap/com.aaaaaa.ap.AppPlaceMain}: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.aaaaaa.ap/com.aaaaaa.ap.Store}: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.aaa.ap/com.aaaaaa.ap.catalog.Home}: java.lang.NullPointerException02-11 02:59:04.278: ERROR/AndroidRuntime(780):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1701)02-11 02:59:04.278: ERROR/AndroidRuntime(780):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1717)02-11 02:59:04.278: ERROR/AndroidRuntime(780):     at android.app.ActivityThread.access$1500(ActivityThread.java:123)02-11 02:59:04.278: ERROR/AndroidRuntime(780):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:984)02-11 02:59:04.278: ERROR/AndroidRuntime(780):     at android.os.Handler.dispatchMessage(Handler.java:99)02-11 02:59:04.278: ERROR/AndroidRuntime(780):     at android.os.Looper.loop(Looper.java:126)02-11 02:59:04.278: ERROR/AndroidRuntime(780):     at android.app.ActivityThread.main(ActivityThread.java:3900)02-11 02:59:04.278: ERROR/AndroidRuntime(780):     at java.lang.reflect.Method.invokeNative(Native Method)02-11 02:59:04.278: ERROR/AndroidRuntime(780):     at java.lang.reflect.Method.invoke(Method.java:491)02-11 02:59:04.278: ERROR/AndroidRuntime(780):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:841)02-11 02:59:04.278: ERROR/AndroidRuntime(780):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:599)02-11 02:59:04.278: ERROR/AndroidRuntime(780):     at dalvik.system.NativeStart.main(Native Method)02-11 02:59:04.278: ERROR/AndroidRuntime(780): Caused by: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.aaaaaa.ap/com.aaaaaa.ap.Store}: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.aaaaaaa.ap/com.aaaaaaa.ap.catalog.Home}: java.lang.NullPointerException02-11 02:59:04.278: ERROR/AndroidRuntime(780):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1701)02-11 02:59:04.278: ERROR/AndroidRuntime(780):     at android.app.ActivityThread.startActivityNow(ActivityThread.java:1543)02-11 02:59:04.278: ERROR/AndroidRuntime(780):     at android.app.LocalActivityManager.moveToState(LocalActivityManager.java:130)02-11 02:59:04.278: ERROR/AndroidRuntime(780):     at android.app.LocalActivityManager.startActivity(LocalActivityManager.java:342)02-11 02:59:04.278: ERROR/AndroidRuntime(780):     at android.widget.TabHost$IntentContentStrategy.getContentView(TabHost.java:680)02-11 02:59:04.278: ERROR/AndroidRuntime(780):     at android.widget.TabHost.setCurrentTab(TabHost.java:349)02-11 02:59:04.278: ERROR/AndroidRuntime(780):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1048)02-11 02:59:04.278: ERROR/AndroidRuntime(780):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1665)02-11 02:59:04.278: ERROR/AndroidRuntime(780):     ... 11 more02-11 02:59:04.278: ERROR/AndroidRuntime(780): Caused by: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.aaaaaaa.ap/com.aaaaaa.ap.catalog.Home}: java.lang.NullPointerException02-11 02:59:04.278: ERROR/AndroidRuntime(780):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1701)02-11 02:59:04.278: ERROR/AndroidRuntime(780):     at android.app.ActivityThread.startActivityNow(ActivityThread.java:1543)02-11 02:59:04.278: ERROR/AndroidRuntime(780):     at android.app.LocalActivityManager.moveToState(LocalActivityManager.java:130)02-11 02:59:04.278: ERROR/AndroidRuntime(780):     at android.app.LocalActivityManager.startActivity(LocalActivityManager.java:342)02-11 02:59:04.278: ERROR/AndroidRuntime(780):     at com.aaaaad.ap.Store.onCreate(Store.java:29)02-11 02:59:04.278: ERROR/AndroidRuntime(780):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1048)02-11 02:59:04.278: ERROR/AndroidRuntime(780):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1665)02-11 02:59:04.278: ERROR/AndroidRuntime(780):     ... 20 more02-11 02:59:04.278: ERROR/AndroidRuntime(780): Caused by: java.lang.NullPointerException02-11 02:59:04.278: ERROR/AndroidRuntime(780):     at android.view.ViewGroup.addView(ViewGroup.java:2684)02-11 02:59:04.278: ERROR/AndroidRuntime(780):     at com.aaaaa.ap.catalog.Home.onCreate(Home.java:51)02-11 02:59:04.278: ERROR/AndroidRuntime(780):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1048)02-11 02:59:04.278: ERROR/AndroidRuntime(780):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1665)02-11 02:59:04.278: ERROR/AndroidRuntime(780):     ... 26 more</code></pre><p>Is there any other good way to add views dynamically to a linear layout?  What have I done wrong here ? </p>","609646","","609646","","2011-02-12 04:14:57","2012-01-10 00:00:24","Create a view by Java code","<android>","2","0","1","",""
"4965705","1","","","2011-02-11 04:44:48","0","160","<p>I'm facing with a big problem when debugging my android project.There are some code that really ran but break point is not hit.So i cannot debug my project.Can I help me in this situation.Thanks</p>","422579","","","","","2011-02-11 04:53:06","Problem when debugging in eclipse","<java><android><eclipse><debugging>","1","4","","",""
"4965718","1","","","2011-02-11 04:49:49","0","597","<p>I have CustomListView ,ie contain a background image and TextView, </p><p>When an item is selected i need to change the background image and font color, currently i can change the background of selected row of the listview using an xml, but i can't change the text color.</p><p>By default my text color is black when am clicking an item in listview i need to change the text color to white. </p><p>am using following layout for my customlistview</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=""match_parent""     android:layout_height=""29dp""    android:id=""@+id/appcategoryLinearLayout""    android:background=""@drawable/appcategorybg1""    android:gravity=""left|center_vertical""    &gt;        &lt;TextView        android:gravity=""left|center_vertical""        android:text=""fdsfsdfsdfdsfdsfdsf""        android:paddingLeft=""8dp""        android:textSize=""8dp""        android:textColor=""@color/black""        android:id=""@+id/appCategoryNameTextView""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""/&gt;&lt;/LinearLayout&gt;</code></pre>","487219","","487219","","2011-02-11 05:10:27","2011-02-11 06:10:02","ListView and its text color","<android>","2","2","","",""
"4965724","1","","","2011-02-11 04:51:03","3","3833","<p>I am attempting to build an augmented reality application for Android and have come across the problem of layering surface views. I need a surface view to display the camera preview onto which I will overlay graphics, and I need a surface view to draw my graphics on. This second surface also needs to be drawn above the camera preview but have a transparent background. In my current implementation, I have both surface views working and appearing as they are supposed to, but the background is not transparent and therefore there is no appearance of the second surface view with the graphics drawn being superimposed on the camera preview surface view. How could this be achieved? Upon searching numerous stack overflow questions as well as other forums I've come across many conflicting opinions pertaining to this matter. Some say that layering surface views in Android is impossible whilst others say that it is a matter of using a different layout (FrameLayout vs. LinearLayout?) Specifically, my implementation includes two views: a class, CustomCameraView, that extends SurfaceView, and a class, CustomDrawView, that also extends SurfaceView contained in a FrameLayout with the CustomDrawView appearing after the CustomCameraView. How can these be layered so that CustomDrawView seems superimposed on CustomCameraView?</p>","355977","","","","","2013-09-23 04:46:00","Layered SurfaceViews in a FrameLayout in Android","<java><android><transparency><augmented-reality><surfaceview>","2","1","2","",""
"4965728","1","4965847","","2011-02-11 04:52:19","0","1700","<p>hi i am a new android developer. When i am searching for a logic related to my app in google, i found a java application which is related to my android app. After making some changes i succeded in getting output, but i need the code to be in an android based project. When i change to convert it i get lot of errors, is there any possible way to convert the java application into an android app by including any external jar file..... The java application is just a part of my android app, based on that i have to develop more so pls help me....</p><p>thanx in Advance </p>","596364","","","","","2013-01-17 12:51:59","Convert an java file into android program","<java><android>","2","0","","",""
"4965739","1","4966293","","2011-02-11 04:55:20","3","21886","<p>I wrote code for matching filepath which have extenstion .ncx ,</p><pre><code> pattern = Pattern.compile(""$(\\|\/)[a-zA-Z0-9_]/.ncx""); Matcher matcher = pattern.mather(""\sample.ncx"");</code></pre><p>This shows a invalid escape sequence (valid ones are \b \t \n \f \r \"" \' \ ) syntax error pattern. How can I fix it.</p>","482604","","482604","","2011-02-11 05:04:48","2011-02-11 06:40:41","""Invalid escape sequence (valid ones are \b \t \n \f \r \"" \' \\ )"" syntax error","<java><android><regex>","3","0","1","",""
"4965745","1","","","2011-02-11 04:56:09","0","489","<p>I've been struggling to lay out two ListViews in a vertical LinearLayout.  I finally saw the answer on here about wrapping each in their own LinearLayout, and adding each one of these LinearLayouts to the original LinearLayout with weights of 1.  So that's what I tried...  but I just cannot seem to get this to work.</p><p>I'm doing this all in code:</p><pre><code>public class MyDualList extends LinearLayout{    private LinearLayout    _layout1;    private LinearLayout    _layout2;    private ListView        _list1;    private ListView        _list2;    public MyDualList(Context context, ListView list1, ListView list2)    {        super(context);        _list1 = list1;        _list2 = list2;        _layout1 = new LinearLayout(context);        _layout1.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, 0, 1));        _layout1.addView(_list1, new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));        _layout2 = new LinearLayout(context);        _layout2.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, 0, 1));        _layout2.addView(_list2, new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));        addView(_layout1);        addView(_layout2);    }}</code></pre><p>This is my latest attempt, but I swear I've tried every combination/setting for the LayoutParams' height (FILL_PARENT, WRAP_CONTENT, 0) as well as various weights.</p><p>The result is never very good; if my second list is very long, it inevitably takes up the vast majority of the original vertical layout (certainly much more than 50%).</p><p>I'm not going to give up!  Maybe someone can help me out a bit.</p><p>Thanks,Ken</p>","612537","","","","","2011-02-13 08:29:43","Problem laying out two ListViews","<android><listview>","3","8","","",""
"4965764","1","4966853","","2011-02-11 04:59:43","0","470","<p>How to get a particular row of data from data base on Listview click?And set that data in edittext?</p>","555910","","","","","2011-02-11 08:12:19","How to get a particular row of data from data base on Listview click?","<android><sqlite><listview><edittext>","1","1","","",""
"4965771","1","","","2011-02-11 05:00:20","3","2470","<p>Which open source code review tool can i use for my android apps.</p>","610921","","","","","2011-03-05 14:12:01","code review tool","<android>","3","1","1","2012-08-28 16:28:02",""
"4965798","1","","","2011-02-11 05:05:48","2","1978","<p>Deal All,         I have a problem;         I have a layout with scroll view over three list view A,B,C.         I want scroll hole layout as well as scroll each list view.</p><p>problem:        List view are not scroll when layout is scroll if I remove scroll layout then list is scroll but layout is not scroll.</p><p>Please give me a any possible solution <strong>Thanks in advance.</strong></p>","588763","","510491","","2011-03-11 10:44:24","2011-08-24 11:20:12","How to scroll ListView with in another scroll view","<android><listview><android-layout><scrollview>","2","0","","",""
"4965877","1","","","2011-02-11 05:19:42","3","1040","<p>Any searches for any information on how to provide your own custom state for use in a drawable state list selector pulls up very little but almost all of them (here and elsewhere) refer to this <a href=""https://groups.google.com/forum/#!topic/android-developers/uqr2BNI7NZo"" rel=""nofollow"">google groups post</a>.</p><p>I have getters and setters like this:  (Not included in the above post, but using their wording to keep it simple)</p><pre><code>public void setFried(boolean fried){    if(mFried != fried){        mFried = fried;        refreshDrawableState();    }}public void isFried(){    return mFried;}</code></pre><p>I have been trying to get it to work for the last couple hours and nothing seems to be working.  It just simply does not change the appearance.  I watched what happened as it called onCreateDrawableState(), and I watched what would come out of getDrawableState() after I changed the custom state.  The custom state values are in fact appearing in the drawableState array.</p><p>Since I can see the state is actually being merged into the array, and since it seems to be completely ignoring any of my custom state in the selector, I think the xml must be wrong.</p><p>Here is what the post suggested:</p><pre><code>&lt;selector xmlns:android=""http://schemas.android.com/apk/res/android""   xmlns:app=""http://schemas.android.com/apk/res/my.app.package""&gt;   &lt;item android:drawable=""@drawable/item_baked"" state_baked=""true""      state_fried=""false"" /&gt;   &lt;item android:drawable=""@drawable/item_fried"" state_baked=""false""      state_fried=""true"" /&gt;   &lt;item android:drawable=""@drawable/item_overcooked"" state_baked=""true""      state_fried=""true"" /&gt;   &lt;item android:drawable=""@drawable/item_raw"" state_baked=""false""      state_fried=""false"" /&gt;&lt;/selector&gt;</code></pre><p>Can you really just write state_fried and state_baked or do they need a prefix like app:state_fried?  If I try adding a prefix I get a Console error like: <code>No resource identifier found for attribute 'state_fried' in package my.app.package</code></p><p>Has anyone actually got custom states to work?  Is the referenced post all you need to get this to work or is there something wrong with it or missing?</p><p>I don't know if it makes any difference but I am using an Android Library Project and the selector and the attr.xml is in the Library project.</p><p>Thanks</p><p><strong>Update</strong>Looks like the problem is that Library Projects don't play well with custom attributes.  See <a href=""http://groups.google.com/group/android-developers/browse_thread/thread/fc9ac9f168a2ec4f/33ac0c1a69e8d86c"" rel=""nofollow"">here</a>, <a href=""http://stackoverflow.com/questions/3432649/r-java-file-from-android-library-project-not-importing-into-application-project"">here</a>, <a href=""http://code.google.com/p/android/issues/detail?id=9656"" rel=""nofollow"">here</a>.</p><p>Haven't seen much of a workaround unfortunately...</p>","445348","","445348","","2011-03-07 23:39:56","2011-03-07 23:39:56","Custom state drawables not working in Library Projects","<android><state><drawable>","1","0","3","",""
"4965885","1","4966218","","2011-02-11 05:20:35","1","213","<p>I recently upgraded the Android SDK on our build machine, and now Android builds using Ant fail with the obscure message:</p><pre><code>The &lt;apply&gt; type doesn't support the nested ""path"" element.</code></pre><p>Our build.xml is the standard one generated by Android tools, and we automatically run </p><pre><code>android update project -p .</code></pre><p>before Ant runs the debug task.The error message appears during the <code>-dex</code> phase of the build process.</p><p>Since this buildfile is using one of the standard Android templates, I'm not sure what's causing this change in behavior.  Any ideas?</p>","246793","","183172","","2011-02-11 06:54:49","2011-02-11 06:54:49","Builds of Android package fail with 'apply' message after updating SDK - how to fix?","<android><ant><build-error>","1","0","","",""
"4965907","1","","","2011-02-11 05:24:53","0","500","<p>My problem is list of checkboxes are there which are checked in gridview , while scrolling  the list, those checked one is turned to unchecked one.</p>","554827","","331473","","2011-11-24 07:44:44","2011-11-24 07:44:44","Unchecking the checked checkboxes while scolling the list in Android?","<android>","1","3","","",""
"4965997","1","4966118","","2011-02-11 05:43:26","0","427","<p>I am beginner to android... Am trying following: In list of spinner items if select the one particular item (Example:Extra) means only the edittext text has to go enable.Remaining times it want to be disable..And I've to add extra item while select the particular item..... The sample code will help me lot...Thank you</p>","565106","","","","","2011-02-11 06:10:23","In spinner items if select particular item means only the edit text has be go enable and get item to add spinner","<android><edittext><spinner>","1","3","1","",""
"4966055","1","","","2011-02-11 05:57:06","1","4620","<p>How to get the value from  the <code>ListView</code> ,</p><p>i.e when an list item is clicked it sends the data from the <code>ListView</code>and set the value of <code>ListView</code> in an <code>EditText</code>.</p>","555910","","68805","","2011-02-11 06:07:32","2012-09-28 13:36:01","How to get the value from the listview","<android><listview><edittext>","3","0","","",""
"4966105","1","4966131","","2011-02-11 06:08:04","1","1059","<p>I'm making an application in which m using Tab Bars. Now what i need to know is, how to open other Tab through <code>setOnTabChangedListener()</code> in my code</p><p>for example. i am currently in tab and when i click on the 2nd tab it should call the activity of 2nd tab.</p>","521015","","68805","","2011-02-11 06:36:03","2011-02-11 12:13:19","how to call an Activity through TabBars","<android>","1","0","","",""
"4966128","1","4966199","","2011-02-11 06:12:12","0","903","<p>How can i display list items(ListView) with different colors in android ?</p>","610940","","","","","2011-02-11 06:42:33","Display List Items with different background colors in android","<android>","2","0","1","",""
"4966153","1","","","2011-02-11 06:15:24","0","130","<p>I am making a call to a RESTful Webservice from my Activity in Android.  The URL is specified as a string resource.  But what I don't understand is, after a few months chances are I will be changing the URL.  How do I ensure that the phones that have old URL get the new URL?</p><p>(Needless to say I am a newbie to Android.)</p>","545086","","","","","2011-02-11 06:28:56","Changing URL Location in an Android App","<android><web-services><rest>","1","1","","",""
"4966188","1","5090931","","2011-02-11 06:22:08","11","31844","<p>I have this JSON string, I want to POST this data to server(POST METHOD). How this can be done in android..  </p><p>JSON string...  </p><pre><code>{""clientId"": ""ID:1234-1234"",""device"": {    ""userAgent"": ""myUA"",    ""capabilities"": {        ""sms"": true,        ""data"": true,        ""gps"": true,        ""keyValue"": {            ""Key2"": ""MyValue2"",            ""Key1"": ""myvalue1""        }    },    ""screen"": {        ""width"": 45,        ""height"": 32    },    ""keyValue"": {        ""DevcKey2"": ""myValue2"",        ""DevcKey1"": ""myValue1""    }},""time"": 1294617435368</code></pre><p>}</p><p>So my question is how can i form this JSON array and POST it to server...<br>Thanks in advance....</p>","443387","","1340329","","2013-09-21 06:20:28","2013-09-21 06:20:28","How to POST data to server in JSON format","<java><android><json><post>","3","3","3","",""
"4966201","1","","","2011-02-11 06:24:14","0","146","<p>I am making a android game application.I want to highlight url when running in emulatorCan anybody guide me</p><p>Thanks in advanceTushar</p>","475349","","","","","2011-02-11 08:37:27","underline a url in android","<android>","1","0","","",""
"4966219","1","4966277","","2011-02-11 06:27:32","3","1878","<p>I am looking for a spec or reference of all the possible options for the various XML layout attribute settings that typically come with an android UI. Google seem to be good at burying it. This is similar to <a href=""http://stackoverflow.com/questions/2870694/android-xml-layout-guide"">this</a> question but remains in-effectively answered.</p><p>Such as what are my options available to me for the TextView layout_width definition ? There must be a complete definition published ... somehwere....</p>","193467","","","","","2011-02-11 06:44:57","Where is a reference to the android XML UI layout?","<android><android-layout><android-ui><android-xml>","3","0","1","",""
"4966242","1","","","2011-02-11 06:31:58","0","168","<p>I need to display a simple animation (about 20 frames, each frame being about 40 x 40 pixels in size).</p><p>Ideally I would use an animated gif for this, but android &lt; 2.2 does not support it, amazingly.</p><p>I'm wondering if anyone has experience composing the individual frames into a manual animation. This is what I believe we have to do. Any experience with the playback being choppy? Kind of don't want to start if the results are going to be poor.</p><p>Thanks</p>","291701","","","","","2011-02-11 06:36:40","Anyone try playing animated gifs manually?","<android>","1","0","","",""
"4966285","1","","","2011-02-11 06:38:15","0","613","<p>I have created a BootReceiver which creates a new activity and popup an Alert Dialog. After pressing OK/Cancel that activity still is not closed completely. I can see the same in Window List button &amp; I can see the Alert dialog from the Window list.</p><p>Any ideas what might be wrong?</p><p>My code looks like below , calling finish after OK/Cancel buttoon protected void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);</p><pre><code>    WindowManager.LayoutParams winParams;    getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));    // Windows Attributes       requestWindowFeature(Window.FEATURE_NO_TITLE);    winParams = getWindow().getAttributes();    winParams.flags |= (WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED            | WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON);    getWindow().setAttributes(winParams);     // Show Popup    popup = new AlertDialog.Builder(this)    .setCancelable(true)    .setPositiveButton(""agree"", new OnClickListener() {         public void onClick(DialogInterface dialog, int arg1) {                if( DEBUG ) Log.d(LOG_TAG, "" AGREE CLICKED""  );        finish();}})    .setNegativeButton(""disagree"", new OnClickListener() {         public void onClick(DialogInterface dialog, int arg1) {                if( DEBUG ) Log.d(LOG_TAG, "" DISAGREE CLICKED""  );    finish();}})    .setOnCancelListener(        new DialogInterface.OnCancelListener() {            public void onCancel(DialogInterface dialog) {                finish();    }});    popup.setIcon(android.R.drawable.ic_dialog_alert);    popup.setTitle(""title"");    popup.setMessage(""Message"");    dialog = popup.create();    winParams =  dialog.getWindow().getAttributes();    winParams.flags |= (WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED            | WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON);    dialog.getWindow().setAttributes(winParams);    dialog.setOnDismissListener(AlwaysReqWhenPS);    dialog.setOnKeyListener(this);                 dialog.show();}protected void onStop() {    if( DEBUG ) Log.d(LOG_TAG, "" OnStop Called""  );    super.onStop();}public void onDestroy() {    if( DEBUG ) Log.d(LOG_TAG, "" onDestroy Called""  );    super.onDestroy();}public void onPause() {    if( DEBUG ) Log.d(LOG_TAG, "" onPause Called""  );    super.onPause();}</code></pre>","469119","","469119","","2011-02-11 07:09:04","2011-02-11 07:09:04","Activity Still Runs - Android","<android><activity><alertdialog>","1","3","","",""
"4966375","1","","","2011-02-11 06:53:15","0","2249","<p>I want to store my SD card contents to Google docs (or any Google cloud service) and retrieve them from there via an Android device.</p><p>Can anyone tell me how to do that?</p>","513162","","501557","","2011-02-11 09:56:33","2011-02-11 09:56:33","Store files to Google cloud from Android?","<java><android>","3","0","","",""
"4966384","1","","","2011-02-11 06:54:57","0","901","<p>I have an apk file ,how do i install it  in android emulator. I am working under Linux operating system.</p>","605934","","","","","2013-05-30 06:02:22","Installing a apk file ,in android emulator","<android>","4","2","","2014-01-04 23:06:13",""
"4966424","1","","","2011-02-11 07:00:39","1","3292","<p>I have a android app, and I will load a local html page, but this page is too large to fit the <code>WebView</code>.</p><p>I have to control the horizontal and vertical controller to view the rest part of the page ,how to autosize the html page to fit my <code>WebView</code>? </p>","612639","","68805","","2011-02-11 07:37:58","2013-05-23 08:04:52","How to autosize html page into the WebView?","<android><webkit>","1","0","","",""
"4966448","1","4966502","","2011-02-11 07:03:59","0","3387","<p>I want to create a simple game.I need this information how to create custom controls </p><p>doubts:</p><ol><li><p>Custom controls and OnScreen controls are same or different.</p></li><li><p>Next how to create custom controls </p></li><li><p>How to create onscreen controls.</p></li></ol>","486554","","486554","","2011-02-11 07:15:56","2011-02-11 07:15:56","How can i create custom controls?","<android><controls>","1","0","","",""
"4966449","1","","","2011-02-11 07:04:34","1","1259","<p>I'm trying to create a <code>TableLayout</code> with dynamically added rows and columns (from an array of obbjects). Since it's dynamic must I code(?)</p><p>All the examples I can find is doing it using xml layouts. The only ones out there that does it in code only adds a single view, like a button, which makes me believe its not doable, and I need two columns at least, where one of the will contain a view with an image and text.</p>","498112","","68805","","2011-02-11 07:12:10","2012-06-03 14:33:24","android tablerow and columns in code","<android><tablelayout><tablerow>","1","0","","",""
"4966486","1","","","2011-02-11 07:13:15","7","3703","<p>I am making an Android app that needs to have the phone reboot or turn off when a button is clicked. Is this possible? Or will the phone require root access?</p>","583952","","418183","","2011-02-11 07:32:19","2012-12-17 15:05:52","Reboot the phone on a button click","<android>","1","2","2","",""
"4966496","1","4969260","","2011-02-11 07:14:38","2","2261","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/3031630/android-how-to-cancel-a-request-of-location-update-with-intent"">Android: how to cancel a request of Location update with intent?</a>  </p></blockquote><p>I am trying to disable a pending intent(broadcast) which I have previously created in a different activity but I can't get it to work. I've read that I should recreate the intent(with the same extras and everything), pass it as a parameter so that I can instantiate the pendingIntent and then pass the pendingIntent as a parameter to the location managers removeUpdates method. </p><p>In other words:</p><hr><pre><code>Bundle extra = new Bundle();extra.putString(""name"", extras.getString(""poiName"")); //create same extrasextra.putInt(""id"", extras.getInt(""rowId"")); //create same extrasIntent intent = new Intent(PROX_ALERT_INTENT);  intent.putExtra(PROX_ALERT_INTENT, extra);  //put same extras in the intentPendingIntent proximityIntent = PendingIntent.getBroadcast(this.getApplicationContext(),extras.getInt(""rowId"") , intent, PendingIntent.FLAG_UPDATE_CURRENT);  //pass in the intentLocationManager locationManager = (LocationManager)getSystemService(Context.LOCATION_SERVICE);                                               locationManager.removeUpdates(proximityIntent);  //remove pendingIntent</code></pre><hr><p>That didn't work so I thought that it might have to do with the intent that im passing in being a new object and not the same with the one used in order to create the pending intent.</p><p>So I tried removing the pendingIntent right after I create it but that didnt work either: </p><pre><code>Bundle extras = new Bundle();    extras.putString(""name"", poiName);    extras.putInt(""id"", requestCode);    Intent intent = new Intent(PROX_ALERT_INTENT);    intent.putExtra(PROX_ALERT_INTENT, extras);    PendingIntent proximityIntent = PendingIntent.getBroadcast(this.getApplicationContext(), requestCode , intent, PendingIntent.FLAG_CANCEL_CURRENT);    locationManager.addProximityAlert(        latitude, // the latitude of the central point of the alert region        longitude, // the longitude of the central point of the alert region        POINT_RADIUS, // the radius of the central point of the alert region, in meters        PROX_ALERT_EXPIRATION, // time for this proximity alert, in milliseconds, or -1 to indicate no expiration         proximityIntent // will be used to generate an Intent to fire when entry to or exit from the alert region is detected   );    locationManager.removeUpdates(proximityIntent);</code></pre><hr><p>Can you please help me with that??? Its been bugging be since wednesday...wish i had more reputation to put a boundy on this one... </p><p>Thanks</p><p>mike</p>","582665","","","","","2011-02-11 12:59:46","Location manager doesnt remove location updates!","<android><geolocation><android-intent><locationmanager><android-pendingintent>","1","4","","2012-08-20 16:23:13",""
"4966563","1","4967291","","2011-02-11 07:24:57","0","63","<p>In Android, the concept <em>Window</em> seems not important anymore.</p>","84325","","84325","","2011-02-11 07:30:20","2011-02-11 09:14:04","How the Activity related to Window in Android?","<android><android-layout>","1","1","","",""
"4966570","1","","","2011-02-11 07:25:49","0","630","<p>I have a button and as a background, I have an image selector which reacts on press event. The button's text is a spannable string which may contain some links or phone numbers. I linkify those links and phone numbers but how to pass further onClick event to button's text to open browser when I tap over a link?</p>","517558","","","","","2011-02-11 08:47:34","android pass onClick event to child","<android><events><onclick>","1","0","","",""
"4966590","1","4966678","","2011-02-11 07:27:59","1","678","<p>Is it possible(or OK) to provide in-app purchase in a free android app? I want to create one app that will be free for a limited time. User will be prompted to pay for it after few months. My app has lot of user generated data. Migrating the data to a paid version is quite complicated.</p>","349161","","","","","2012-01-04 13:43:17","Is it OK to provide In App purchase in a free android app?","<android><in-app-purchase>","3","0","","",""
"4966600","1","","","2011-02-11 07:29:15","0","35","<p>when the particular list in the item is clicked .it loads the data in the particular list and send that data to the another activity and set that data in edittext in that activity .how it can be done?pls help me??</p>","555910","","","","","2011-02-11 07:47:57","when the particular list in the item is clicked .it loads the data in the particular list","<android><listview><edittext>","1","0","","",""
"4966603","1","4967152","","2011-02-11 07:29:47","0","845","<p>I want make a live dictionary app.<br></p><p>Can a Activity/Window get the text of another Activity/Window ?<br></p><p>Is it possible ?<br></p><p>P.S. this app will works for all other apps in the phone, so I cannot insert code to other apps. I mean get text without the help of the target apps. When two apps running, user touch one app and the other app get the text that been touched.</p>","84325","","84325","","2011-02-11 13:21:04","2011-02-11 13:21:04","How can a Activity/Window get the text of another Activity/Window?","<android>","2","0","","",""
"4966639","1","","","2011-02-11 07:35:20","1","566","<p>(I know this has been asked before but it's a different issue.)</p><p>I accidententley signed my market app with the debug.keystore I don't want to loose my progress on the Market.</p><p>So I signed my app with the debug.keystore so I can do this</p><p>Version 1.0 => Signed with Certificate AVersion 2.0 => Signed with Certificate A &amp; BVersion 3.0 => Signed with Certificate B</p><p>Then I tried to issue the command</p><p>jarsigner -verbose -keystore private.keystore myapp.apk private</p><p>and I get the following error</p><p>jarsigner: unable to sign jar: java.util.zip.ZipException: invalid entry compressed size (expected 2735 but got 2785 bytes)</p><p>Help!</p><p>Please check this at google you are badly mistaken why would I be here complaining if it didnt happen</p><p><a href=""http://www.google.com/support/forum/p/Android+Market/thread?fid=214674fe44ec7f0d00049bff172dfec9&amp;hl=en"" rel=""nofollow"">http://www.google.com/support/forum/p/Android+Market/thread?fid=214674fe44ec7f0d00049bff172dfec9&amp;hl=en</a> </p>","583739","","583739","","2011-02-11 17:16:35","2011-02-11 17:16:35","How to sign an APK with more than one certificate?","<android><key>","1","0","1","",""
"4966653","1","","","2011-02-11 07:37:14","3","2439","<p>New to android, trying to figure out Services. I'm trying to bind a service to an activity, I'm following the examples in the documentation, but I keep getting a NullPointerException on the line marked below(appService.playSong(title)). Checking it in the debugger reveals that appService is indeed null. </p><pre><code>public class Song extends Activity implements OnClickListener,Runnable {protected static int currentPosition;private ProgressBar progress;private TextView songTitle;private MPService appService;private ServiceConnection onService = new ServiceConnection() {    public void onServiceConnected(ComponentName className,            IBinder rawBinder) {        appService = ((MPService.LocalBinder)rawBinder).getService();    }    public void onServiceDisconnected(ComponentName classname) {        appService = null;    }};public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.song);    Intent bindIntent = new Intent(Song.this,MPService.class);    bindService(bindIntent,onService,            Context.BIND_AUTO_CREATE);    Bundle b = getIntent().getBundleExtra(""songdata"");    String title = b.getString(""song title"");    // ...     appService.playSong(title); // nullpointerexception    // ...}</code></pre><p>Here's the relevant part of the service:</p><pre><code>package org.example.music;// importspublic class MPService extends Service {private MediaPlayer mp;public static int currentPosition = 0;public List&lt;String&gt; songs = new ArrayList&lt;String&gt;();public static String songTitle;private static final String MEDIA_PATH = new String(""/mnt/sdcard/"");@Overridepublic void onCreate() {    super.onCreate();    mp = new MediaPlayer();    songs = Music.songs;}@Overridepublic int onStartCommand(Intent intent, int flags, int startId) {    return Service.START_STICKY;}public class LocalBinder extends Binder {    MPService getService() {        return MPService.this;    }}private final IBinder binder = new LocalBinder();@Overridepublic IBinder onBind(Intent intent) {    return binder;}public void playSong(String songPath) {try {    mp.reset();    mp.setDataSource(songPath);    mp.prepare();    mp.start();    mp.setOnCompletionListener(new OnCompletionListener() {        public void onCompletion(MediaPlayer arg0) {            nextSong();        }    });    songTitle = songPath.substring(12,songPath.length()-4);} catch (IOException e) {    Log.v(getString(R.string.app_name),e.getMessage());}}public void nextSong() {if (++currentPosition &gt;= songs.size()) {    currentPosition = 0;}String song = MEDIA_PATH+songs.get(currentPosition);playSong(song);} public void prevSong() {if (--currentPosition&lt;0) {    currentPosition=songs.size()-1;}String song = Music.MEDIA_PATH+songs.get(currentPosition);playSong(song);}public int getSongPosition() {return mp.getCurrentPosition();}public MediaPlayer getMP() {return mp;}}</code></pre><p>I have registered the service in AndroidManifest.xml and set android:enabled=""true"". Do you see any obvious mistakes here?</p>","275552","","275552","","2011-02-15 20:06:40","2011-02-20 14:38:57","Android can't bind to service","<android><service>","3","0","2","",""
"4966706","1","4986399","","2011-02-11 07:44:06","0","174","<p>Is it possible to have both a context menu and default click behavior on ExpandableListView group items?  </p><p>I tried this and found that once I overrode onCreateContextMenu in the activity that contained the ExpandableListView, the group views would no longer respond to clicks.  They wouldn't highlight when (short) pressed and they wouldn't expand.</p><p>Thanks!  </p>","369722","","","","","2011-02-13 19:40:06","Possible to have both a context menu and default click behavior on ExpandableListView group items?","<android><contextmenu><group><expandablelistview>","1","0","","",""
"4966766","1","","","2011-02-11 07:56:53","0","313","<p>I am trying to get the list of all predictive words based on user input I am using android Softkeyboard sample any idea how should I move on</p><p>RegardsSaurabh</p>","517247","","","","","2012-01-30 09:57:50","Android Softkeyboard predictive text","<android><android-softkeyboard>","1","0","","",""
"4966777","1","","","2011-02-11 07:58:43","1","171","<p>I'm going to create an iGoogle Gadget, and an Android version as well. User data will be saved in the gadget like this (javascript):</p><pre><code>var prefs = new gadgets.Prefs();prefs.set(""foo"",""bar"");</code></pre><p>In Android side, the app will login with user's Google Account. Is it possible to access user data in the gadget preferences?If not, any other way to store user data that both Gadget and Android can access with Google Account?</p>","513080","","3383428","","2014-03-07 18:58:44","2014-03-07 18:58:44","Access Google Gadgets preferences from Android app","<android><google-gadget><google-account><igoogle>","0","0","","",""
"4966816","1","5016641","","2011-02-11 08:06:32","7","20554","<p>I'm beginner in Java Android developing. I'm using Eclipse SDK 3.6.1 version. I have a preferences window with two checkbox and one back button.</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=""PIN requirement""&gt;                            &lt;CheckBoxPreference                                            android:title=""Use PIN""                     android:defaultValue=""true""                                                                  android:key=""checkboxPref"" /&gt;            &lt;CheckBoxPreference                    android:title=""Don't use PIN""                    android:defaultValue=""false""                                            android:key=""checkboxPref2"" /&gt;                    &lt;/PreferenceCategory&gt;&lt;PreferenceCategory&gt;    &lt;Preference            android:title=""Back""                            android:key=""customPref"" /&gt;    &lt;/PreferenceCategory&gt;&lt;/PreferenceScreen&gt;</code></pre><p>How to change two CheckBox in to the RadioButton group?</p>","572853","","","","","2012-06-05 08:51:25","How to create RadioButton group in preference.xml window?","<android><xml><checkbox><radio-button><preferences>","3","0","5","",""
"4966828","1","","","2011-02-11 08:08:21","0","133","<p>I want to prevent anyone from apk reverse compilation. We need to do something. I browsed on the internet, but I still don't know the operational steps clearly. </p><p>Who can tell me how to do it? </p><p>Anyone's help is so welcome!! Thanks!!</p>","1837505","","204723","","2011-02-11 08:12:37","2011-02-11 08:14:04","About compiler and decompilation","<android><decompiler>","2","2","","",""
"4966839","1","","","2011-02-11 08:09:35","2","484","<p>As far as I can tell, if I have defined a configuration activity for my widget then <code>onUpdate</code> should not be called when it is first created. It would be the configuration activity's responsibility to perform the initial configuration of the widget.</p><p>Why is it then that I still get calls to <code>onUpdate</code> in the widget provider, and after that call the configuration activity is started. If I cancel the configuration activity I get no visible widget on the home screen. If I have cancelled a widget configuration (by pressing back in the configuration activity) and reinstall the APK all the widgets, including the cancelled ones, each gets mentioned in calls to <code>onUpdate</code>.</p><p>Surely this shouldn't be so. And if it is, then how do I get rid of the widgets that was cancelled during configuration.</p><p>I'm running my code on the emulator with Android 1.6.</p>","3414","","3414","","2011-02-11 14:57:44","2011-10-03 16:08:00","Why is onUpdate() called for my widgets even though I have a configuration activity?","<android><configuration><appwidget>","1","0","","",""
"4966910","1","5176670","","2011-02-11 08:20:32","12","16198","<p>i want to upload .mp3 file(only) from device to my server.i want to browse path of media data and select any mp3 file and upload it.<br>how can i do this?</p><p>any idea?</p><p>Thanks..</p>","472882","","350685","","2011-02-11 12:56:33","2013-04-26 11:33:55","Android:How to upload .mp3 file to http server?","<android><file-upload>","3","1","21","",""
"4966915","1","","","2011-02-11 08:21:11","1","1169","<p>What is wrong with this script? </p><pre># Imports the monkeyrunner modules used by this program </pre><pre> from com.android.monkeyrunner import MonkeyRunner, MonkeyDevice</pre> <pre># Connects to the current device, returning a MonkeyDevice object </pre><pre>device = MonkeyRunner.waitForConnection() </pre><pre>#Reboot </pre><pre>device.reboot('None')</pre><p>I also tried changing the bootloadType. Insted of the last line I tried with, device.reboot('bootloader') and device.reboot('recovery'), but it didn't work either. </p>","612730","","612730","","2011-02-11 08:28:10","2011-03-07 11:37:02","How can I reboot Android Emulator using monkeyrunner?","<android><android-emulator><monkeyrunner>","1","0","","",""
"4966971","1","4967002","","2011-02-11 08:30:19","1","1049","<p>Can anybody explain me in simple words what is the use of Mainfest file and R.java file in android. </p><p>Why do we need these files while making an application?</p>","552027","","68805","","2011-02-11 08:52:02","2011-03-14 07:44:13","What is mainfest file in android?","<android>","3","1","1","",""
"4967049","1","4967407","","2011-02-11 08:41:11","-1","472","<p>I wish to create up,down &amp; right, lift activities in my game. </p><p>Eg: i have one ball i want to move right, left and up, down </p><p>plZ help me...how to create....</p>","486554","","486554","","2011-02-11 09:17:01","2011-02-11 09:27:58","How to handle up, down & right, left action in game?","<android>","1","4","","",""
"4967064","1","","","2011-02-11 08:42:56","1","827","<p>What is wrong with this script? </p><pre> # Imports the monkeyrunner modules used by this program </pre><pre>from com.android.monkeyrunner import MonkeyRunner, MonkeyDevice </pre><pre># Connects to the current device, returning a MonkeyDevice object </pre><pre>device = MonkeyRunner.waitForConnection() </pre><pre> #Uninstall package </pre><pre> device.removePackage ('MyApp.apk')</pre><p>I also tried using the path of the application and didn't work. </p>","612730","","","","","2011-02-11 08:47:13","How can I uninstall a package using Monkeyrunner?","<android><android-emulator><monkeyrunner>","1","0","1","",""
"4967066","1","4967235","","2011-02-11 08:43:09","0","426","<p>I am quite new to the HTTP set of classes.I am trying to integrate MySpace with my android cell phone.</p><p>I am able to make a http connection to ""mobileservices.myspace.com"" and able to do first post(to get the  hash and salt) but when i try to open input stream to get the response, i get a FileNotFoundException.</p><p>If i open the input stream before opening the output stream to post data, i get same exception during opening the output stream.</p><p>So the second opening (be it input stream or output stream) is giving this exception. I have set both flags , <code>doInput</code> and <code>doOutput</code> to true. </p><p>What could be the problem ?</p>","540154","","68805","","2011-02-11 09:07:13","2011-02-11 09:08:28","MySpace integration","<android><http><myspace>","1","0","","",""
"4967155","1","","","2011-02-11 08:56:48","0","391","<p>I have a CSV file(written in german language) and I m parsing it in my code.</p><pre><code>CSVParser newLineParser = new CSVParser('\n');        try {            String[] points = newLineParser.parseLine(csv);            CSVParser commaParser = new CSVParser();            int pointsLength = points.length;            for (int i = 1; i &lt; pointsLength; i++) {                String[] pointComponents = commaParser.parseLine(points[i]);            }        }         catch (Exception e) {            Log.e(""Exception"", e.getMessage());        }</code></pre><p>I am getting error in the parseLine method as:</p><pre><code>java.io.IOException: Un-terminated quoted field at end of CSV line</code></pre><p>what may be the reason for this error?</p>","504162","","504162","","2011-02-11 11:00:15","2011-02-11 11:00:15","java.io.IOException: Un-terminated quoted field at end of CSV line","<android><parsing><csv>","2","0","","",""
"4967178","1","","","2011-02-11 09:01:10","2","5569","<p>In my application when the user presses DPAD_LEFT, i want to generate two DPAD_UP presses. I know it can be done using a method like this:</p><pre><code>@Override private boolean onKeyDown(int keyCode, KeyEvent event) {   if (keyCode == KeyEvent.KEYCODE_DPAD_LEFT) {        keyDownUp(KeyEvent.KEYCODE_DPAD_UP);        keyDownUp(KeyEvent.KEYCODE_DPAD_UP);        return true;   }   return super.onKeyDown(keyCode,event);}private void keyDownUp(int a) {        getCurrentInputConnection().sendKeyEvent(                new KeyEvent(KeyEvent.ACTION_DOWN, a));        getCurrentInputConnection().sendKeyEvent(                new KeyEvent(KeyEvent.ACTION_UP, a));}</code></pre><p>But, to being able to use ""getCurrentInputConnection()"" method, i need to extend InputMethodService and it is impossible cause my application already extends another class. Is there another way to solve this? </p>","511853","","546999","","2011-02-11 09:01:57","2011-07-04 09:52:35","How to Generate Key Presses Programmatically Android","<java><android><key>","3","0","3","",""
"4967202","1","","","2011-02-11 09:04:13","6","7462","<p>I've used this exact code and others that work to a certain degree, but I keep getting the following error: </p><pre><code>{""error"":{""type"":""OAuthException"",""message"":""An active access token must be used to query information about the current user.""}}</code></pre><p>Here is the code: I've used the access_token I get back and validated it against plugging it into my browser and it works great.  But this code seems to either not be using the access token I get back, or I'm not setting it.  I've even tried the FB.setAccessToken() method as well as params.putString(""access_token"", MY_ACCESS_TOKEN).</p><p>I'm wondering, since I did not need to change the access token for the website url to work, I would not think that I don't need to do anything special to the access_token like ecoding it like in a url?  </p><p>Thanks for your help.  I've scoured the net for answers for hours and there seems to not be any.</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>","610397","","","","","2012-08-04 16:44:39","Android - OAuthException - I keep getting: ""An active access token must be used to query information about the current user""","<android><access-token>","4","1","","",""
"4967208","1","","","2011-02-11 09:04:45","0","3803","<p>I have an application with a login, what I want to do is lunch de applicationand then interact with the app, sending the username and password. </p><p>What is wrong with this script? </p><pre><code># Imports the monkeyrunner modules used by this programfrom com.android.monkeyrunner import MonkeyRunner, MonkeyDevice# Connects to the current device, returning a MonkeyDevice objectdevice = MonkeyRunner.waitForConnection()# Installs the Android package.device.installPackage('myproject/bin/LoginApp.apk')# Runs an activity in the applicationdevice.startActivity(component='com.example.android.myapplication.MainActivity')# Write username and passworddevice.press('KEYCODE_BUTTON_SELECT','DOWN_AND_UP')device.press('KEYCODE_U','DOWN_AND_UP')device.press('KEYCODE_S','DOWN_AND_UP')device.press('KEYCODE_E','DOWN_AND_UP')device.press('KEYCODE_R','DOWN_AND_UP')device.press('KEYCODE_ENTER','DOWN_AND_UP')device.press('KEYCODE_P','DOWN_AND_UP')device.press('KEYCODE_A','DOWN_AND_UP')device.press('KEYCODE_S','DOWN_AND_UP')device.press('KEYCODE_S','DOWN_AND_UP')device.press('KEYCODE_ENTER','DOWN_AND_UP')device.press('KEYCODE_ENTER','DOWN_AND_UP')</code></pre><p>I also tried with the function type, like <code>device.type('user')</code>.Sometimes works well, but sometimes doesn't, I don´t know why. </p><p>May be, the focus of the keyboard is in the search bar or somewhere else. In the script,When I press the select button, what I am trying is to select the textfield to enter the username.</p><p>Another idea that come to my mind is that, I have to wait until the activity starts/loads correctly and then send the commands to interact. How can I do that?</p>","612730","","81398","","2012-05-29 14:39:15","2012-12-26 03:56:46","How can I send commands to Android Emulator using Monkeyrunner?","<android><android-emulator><monkeyrunner>","2","0","","",""
"4967309","1","","","2011-02-11 09:16:12","0","412","<p>I have developed a face-detection android application which is able to detect faces and draw a bounding box around the person's face when the face is being detected. But for now I was wondering if it is possible to get the coordinates (x and y axis) of the bounding box or any methods to determine the coordinates of the bounding box. Does anyone of you have any suggestions on this? Thanks in advance.</p>","586575","","","","","2011-02-11 10:41:51","FaceDetection Bounding Box questions","<java><android><opencv><face-detection>","1","1","","",""
"4967392","1","","","2011-02-11 09:26:28","2","1224","<p>I have a TabActivity to show two list, one list in each tab. While starting the application the contents of two tabs are shown as overlapping. But when the other tab is selected then its working properly. Please help me</p><p>My code is:</p><pre><code>@Overridepublic void onCreate( Bundle savedInstanceState ){    super.onCreate( savedInstanceState );       setContentView( R.layout.tab_layout );    Resources res = getResources(); // Resource object to get Drawables    tabHost = getTabHost();    tabHost.setOnTabChangedListener( this );    // setup list view 1    listView1 = ( ListView ) findViewById( R.id.list1 );    // setup list view 2    listView2 = ( ListView ) findViewById( R.id.list2 );    // add views to tab host    tabHost.addTab( tabHost.newTabSpec( LIST1_TAB_TAG ).setIndicator( LIST1_TAB_TAG,            res.getDrawable( R.drawable.rupees ) ).setContent( new TabContentFactory()    {        public View createTabContent( String arg0 )        {            return listView1;        }    } ) );    tabHost.addTab( tabHost.newTabSpec( LIST2_TAB_TAG ).setIndicator( LIST2_TAB_TAG,            res.getDrawable( R.drawable.food ) ).setContent( new TabContentFactory()    {        public View createTabContent( String arg0 )        {            return listView2;        }    } ) );    // Set listener for list1    listView1.setOnItemClickListener( new OnItemClickListener()    {        public void onItemClick( AdapterView parent, View view, int position, long id )        {            onListItemClick( id );        }    } );    // Set listener for list2    listView2.setOnItemClickListener( new OnItemClickListener()    {        public void onItemClick( AdapterView parent, View view, int position, long id )        {            onListItemClick( id );        }    } );    listView2.setVisibility( View.INVISIBLE );}</code></pre>","612806","","612806","","2011-02-18 13:52:52","2011-05-24 19:39:46","Tab contents are overlapping in android application","<android><tabactivity>","2","1","","",""
"4967418","1","4967446","","2011-02-11 09:29:27","7","13652","<p>I'm slowly working through an Android learning book and was given the following code to assign user data:</p><pre><code>package com.androidbook.triviaquiz;import android.app.Activity;import android.content.SharedPreferences;public class QuizActivity extends Activity {    public static final String GAME_PREFERENCES = ""GamePrefs"";    SharedPreferences settings = getSharedPreferences(GAME_PREFERENCES, MODE_PRIVATE);    SharedPreferences.Editor prefEditor = settings.edit();    prefeditor.putString(""UserName"", ""John Doe""); //**syntax error on tokens**    prefEditor.putInt(""UserAge"", 22); //**syntax error on tokens**    prefEditor.commit();}</code></pre><p>However, I get an error (lines indicated with comments) that underlines the period and says ""misplaced construct"" and also that underlines the arguments saying ""delete these tokens"".  I have seen this done in other applications in the same format, I don't understand what is wrong.</p>","612812","","299924","","2011-02-11 09:31:28","2013-02-22 18:47:55","Using shared preferences editor","<android><sharedpreferences>","3","0","2","",""
"4967435","1","4967491","","2011-02-11 09:31:44","1","2794","<p>I've wrote all the needed code to save my Activity state (a simple form with EditText widgets) and restore it on phone rotation and it works great.</p><p>My problem is on managing screen on/off changes: when going off, onSaveInstanceState is called and everything goes well.On screen on, onRestoreInstanceState is not called, neither onCreate, only onResume.</p><p>Am I missing something?</p>","600351","","600351","","2011-02-11 09:36:57","2012-06-28 13:23:52","onRestoreInstanceState not called when screen wake up?","<android><screen><state>","3","0","1","",""
"4967448","1","4967774","","2011-02-11 09:33:13","63","86899","<p>I want to send sms.</p><p>What is the intent for SMS sending...or any other code?I want to show compose sms view with my pre-define text passing over in message field.</p><p>Is there any help for that?</p>","543022","","1225413","","2013-02-13 06:37:18","2014-03-18 20:12:12","Send SMS in android","<android><sms>","8","3","36","",""
"4967459","1","","","2011-02-11 09:34:38","7","3823","<p>I want to get the mobile number of a sim which is inserted into the device. I know as pr the android SDK <code>TelephoneManger</code> is the class by which we can get it by <code>getLine1Number()</code> method. but it always returns null values.</p><p><strong>Queries:</strong></p><ul><li>Can i get mobile number fromdevice?</li><li>Is it a sim dependent or in some casealso device dependent? </li><li>Any other ways to get the mobile number from device?</li></ul>","383597","","68805","","2011-02-11 09:51:21","2011-09-29 05:28:05","Get Mobile no from real device","<android>","3","0","2","",""
"4967523","1","","","2011-02-11 09:42:04","2","1143","<p>I have an TabActivity which has 3 Tabs reusing the same Activity  for all the 3 tabs.</p><p>I am differentiating by means of extras(intent.putextras()) which i shall display the contents of each tab</p><p>Now the problem is when we switch the tab from each other the extra values which i passed through Intent is coming wrong for the second tab.</p><p>As i understood when we created the FirstTab, the only Activity is created and so the contents are drawn as per it.</p><p>when we add the secondTab the intent storing the extra value</p><p>and again when we creating the third tab the Intent over-writing the extra value.</p><p>so when ever we are switching to 2nd tab, i'm receiving the 3rd Tab extra value and hence showing wrong contents to the user.</p><p>here is the code, </p><pre><code>public class ContentsTab extends TabActivity implements OnTabChangeListener{public static final String _ID = ""_id"";public static final int ID_1 = 1;public static final int ID_2 = 2;public static final int ID_3 = 4;private TabHost mTabHost;private static Intent newIntent;@Overrideprotected void onCreate(Bundle savedInstanceState) {// TODO Auto-generated method stubsuper.onCreate(savedInstanceState);     newIntent = new Intent(this, ShowContents.class);mTabHost = getTabHost();    newIntent.putExtra(_ID, ID_1);mTabHost.addTab(mTabHost.newTabSpec(INT_EXT_MEM)            .setContent(newIntent)            .setIndicator(""one""));    newIntent.putExtra(_ID, ID_2);    mTabHost.addTab(mTabHost.newTabSpec(EXT_MEM)                            .setIndicator(""two"")            .setContent(newIntent));    newIntent.putExtra(_ID, ID_3);    mTabHost.addTab(mTabHost.newTabSpec(INT_MEM)            .setContent(newIntent)            .setIndicator(""three""));    mTabHost.setCurrentTabByTag(""one"");    mTabHost.setOnTabChangedListener(this);}@Overridepublic void onTabChanged(String tabId) {    //This is only coming once the Tab is changed    Log.d(TAG, ""onTabChanged arg0 = ""+tabId);               }</code></pre><p>}</p><p>showcontents.class</p><pre><code>public class ShowContents extends ListActivity {@Overrideprotected void onCreate(Bundle savedInstanceState) {            super.onCreate(savedInstanceState);         Bundle extras = getIntent().getExtras();    int mId_ContentType;    mId_ContentType = extras != null? extras.getInt(_ID): -1;    updateData(mId_ContentType);}</code></pre><p>}</p><p>Here the illustration, when user presses tab1, ShowContents.class should receive 1 as extras and same with tab2 and tab3, but the following values are receivedTab1 - 1Tab2 - 4(correct value should be 2)Tab3 - 4</p><p>Tab1 and Tab3 values are coming correct.</p><p>Is there any alternative to send the correct extra parameters to Tab2? using the same class activity?</p><p>Please help me</p><p>Thanks for your time :)</p>","177303","","177303","","2011-02-17 05:44:35","2012-08-08 15:22:22","How to use the same Activity for 3 different tabs in TabActivity with different inputs","<android><tabwidget><tabactivity>","1","0","2","",""
"4967552","1","","","2011-02-11 09:44:48","2","880","<p>I have a text file with Chinese words written to a line. The line is surrounded with <code>""\r\n""</code>, and written using <code>fileOutputStream.write(string.getBytes())</code>.</p><p>I have no problems reading lines of English words, my buffered reader parses it with <code>readLine()</code> perfectly. However, it recognizes the Chinese sentence as multiple lines, thus screwing up my programme flow.</p><p>Any solutions?</p>","610907","","40342","","2011-02-11 09:50:58","2011-02-11 09:50:58","Readline() in Java does not handle Chinese characters properly","<java><android><character-encoding>","2","1","","",""
"4967574","1","4967605","","2011-02-11 09:47:38","2","401","<p>What is wrong in this xml ? the two textviews don't seem to occupy same space</p><pre><code>           &lt;LinearLayout                android:id=""@+id/detail_address"" android:layout_width=""fill_parent""                android:layout_height=""wrap_content"" android:padding=""10px""                android:layout_weight=""1""&gt;                &lt;TextView android:id=""@+id/address"" android:text=""Address:""                    android:layout_width=""wrap_content"" android:layout_height=""wrap_content""                    android:layout_gravity=""center_vertical"" android:textColor=""@color/fontonbg""                    android:gravity=""right"" android:layout_weight=""1"" /&gt;                &lt;TextView android:id=""@+id/address_details""                    android:text=""Lorem ipsum dolor sit amet Lorem ipsum dolor sit amet""                    android:layout_width=""wrap_content"" android:layout_height=""wrap_content""                    android:textColor=""@color/bigfontonbg"" android:textStyle=""bold""                    android:textSize=""16sp"" android:layout_toLeftOf=""@+id/address_btn""                    android:layout_marginLeft=""10px"" android:gravity=""left""                    android:layout_weight=""1"" android:layout_gravity=""center_vertical"" /&gt;                &lt;ImageView android:id=""@+id/address_btn"" android:src=""@drawable/button""                    android:layout_width=""wrap_content"" android:layout_height=""wrap_content""                    android:layout_gravity=""center_vertical""                    android:layout_marginRight=""10px"" /&gt;            &lt;/LinearLayout&gt;</code></pre>","266272","","","","","2012-02-16 19:27:43","android linearlaout layout_width not working as expected","<android><android-linearlayout>","3","0","","",""
"4967617","1","4967975","","2011-02-11 09:53:26","0","962","<p>hi am using following xml as my customlistview background</p><p>when am click an item it will highlight but it will not persist , it create only a clickable effect ,i want to be highlight a particular item in listview when click</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;selectorxmlns:android=""http://schemas.android.com/apk/res/android""&gt;&lt;!--ON FOCUS --&gt;&lt;item android:state_focused=""true"" android:state_pressed=""false"" android:drawable=""@@drawable/appcategoryselectedimg"" /&gt;&lt;!--ON CLICK--&gt;&lt;item android:state_focused=""true"" android:state_pressed=""true"" android:drawable=""@@drawable/appcategoryselectedimg"" /&gt;&lt;!--long touch and simple touch and release--&gt;&lt;item android:state_focused=""false"" android:state_pressed=""true"" android:drawable=""@@drawable/appcategoryselectedimg"" /&gt;&lt;!--Default --&gt;&lt;item   android:drawable=""@color/transperent"" /&gt; &lt;/selector&gt;</code></pre>","487219","","","","","2012-03-21 09:42:08","android listview and background color","<android>","2","0","1","",""
"4967625","1","11240243","","2011-02-11 09:53:58","2","586","<p>Which is the best Twitter connectivity <strong>Library</strong> for Android?. And any examples available?</p>","2311189","","100957","","2011-02-11 10:24:49","2012-06-28 07:49:57","Android Twitter Connectivity?","<android><twitter>","3","3","","",""
"4967646","1","","","2011-02-11 09:56:20","2","3141","<p>Does anyone know if we can use c++ exceptions in Android c++ code, use the STL, and target old releases of Android (for me specifically 2.2)?</p><p>I know that previously the NDK did not support exceptions. I know that there used to be libraries that supported exceptions but not the STL. I know that the latest NDK supports exceptions and the STL and creates code that runs on 2.3.</p><p>But I'd like to write some code that runs on 2.2 and preferably earlier releases, uses the STL, and uses exceptions. I'm a bit confused about the releases of Android, of the SDK, and of the NDK, and how they connect. To put it another way, can I use the latest library version on older version of the Android OS?</p>","612829","","","","","2011-07-21 07:50:19","Android NDK and C++ exceptions: current status?","<android><exception><stl><sdk><android-ndk>","1","0","","",""
"4967669","1","4969421","","2011-02-11 09:58:30","149","92954","<p>first of all, i made this with help from<br><a href=""http://stackoverflow.com/questions/576513/android-download-binary-file-problems"">Android download binary file problems</a><br>and<br><a href=""http://stackoverflow.com/questions/4604239/install-application-programmatically-on-android"">Install Application programmatically on Android</a><br>thanks guys!</p><p>i want to make autoupdate and autoinstall at once. it is local so it's non-market application.<br>here is my code for it:</p><pre><code>public void Update(String apkurl){      try {            URL url = new URL(apkurl);            HttpURLConnection c = (HttpURLConnection) url.openConnection();            c.setRequestMethod(""GET"");            c.setDoOutput(true);            c.connect();            String PATH = Environment.getExternalStorageDirectory() + ""/download/"";            File file = new File(PATH);            file.mkdirs();            File outputFile = new File(file, ""app.apk"");            FileOutputStream fos = new FileOutputStream(outputFile);            InputStream is = c.getInputStream();            byte[] buffer = new byte[1024];            int len1 = 0;            while ((len1 = is.read(buffer)) != -1) {                fos.write(buffer, 0, len1);            }            fos.close();            is.close();//till here, it works fine - .apk is download to my sdcard in download file            Intent promptInstall = new Intent(Intent.ACTION_VIEW)            .setData(Uri.parse(PATH+""app.apk""))            .setType(""application/android.com.app"");            startActivity(promptInstall);//installation is not working        } catch (IOException e) {            Toast.makeText(getApplicationContext(), ""Update error!"", Toast.LENGTH_LONG).show();        }  }  </code></pre><p>my permissions are INTERNET, WRITE_EXTERNAL_STORAGE, INSTALL_PACKAGES, DELETE_PACKAGES</p><p>when Intent promptInstall is load, app crashes =/<br>so, am i missing permissions or is my code incorrect, or is some better ways to do this?  </p><p>btw, sorry for my english</p>","555762","","","","","2014-03-03 03:57:28","Android: install .apk programmatically","<android><install>","5","8","140","2013-02-28 07:08:33",""
"4967708","1","","","2011-02-11 10:02:25","3","3820","<p>I am trying to composite a background bitmap from multiple smaller bitmaps.  I am using Eclipse with the Android SDK.</p><p>I have loaded a (mostly) blank background bitmap (pixel dimensions are 320x480) like so:</p><pre><code>Bitmap mBackground = BitmapFactory.decodeResource( res, R.drawable.background );</code></pre><p>Then I load a bitmap 'tile' (128x128) the same way.</p><p>I have tried multiple ways of drawing the tile onto the bitmap but every single method does not work the way I would like/expect.  I want to draw the tile bitmap scaled down to 64x64 and at a specific location (pixel offset) on the background bitmap.</p><p>1) Using a Canvas...</p><pre><code>Canvas c = new Canvas( mBackground );c.drawBitmap( mTile, null, new Rect( 10, 10, 73, 73 ), null );</code></pre><p>This draws the tile way too big (not fullsize, not 64x64, but somewhere in between, about 66% of original)</p><p>2) Using drawables (which basically seems to be the same):</p><pre><code>Canvas c = new Canvas( mBackground );c.translate( 10, 10 );d.setBounds( 0, 0, 63, 63 );d.draw( c );</code></pre><p>Same result as experiment #1...</p><p>The documentation mentions in numerous places (without a concise explanation anywhere) that this has to do with the device independent 'densities' thus I tried the next approach...</p><p>3) Using fixed scale resources.  I created the /res/drawable-nodpi (I also tried just /res/drawable) folder and moved my resources (background and tile png images) into it.    That causes an exception when creating the Canvas from the background Bitmap because an unscaled bitmap apparently becomes immutable and therefore cannot be assigned to a Canvas!</p><p>4) I tried using BitmapFactory.Options and setting inScaled to false, and passing those options to both of the decodeResource calls for the background and the tile.  This has the exact same effect as #3 (exception thrown).</p><p>Nothing has worked and its becoming quite frustrating.  I am sure I am just missing some detail that is peculiar to bitmaps when it comes to the different coordinate spaces but I cannot find it anywhere in the documentation or elsewhere (I've tried multiple android development sites to no avail).</p><p>Hopefully someone who has done this will see this plea! Thanks, jason</p>","612157","","612157","","2011-02-11 16:47:31","2011-02-11 16:47:31","Android: Draw multiple bitmaps on another bitmap","<android><bitmap>","2","2","2","",""
"4967740","1","4967833","","2011-02-11 10:06:12","7","11117","<p>I would like to be able to transfer data from one activity to another activity. How can this be done?</p>","555910","","1371041","","2013-12-22 06:28:09","2013-12-22 06:28:09","Transfer data from one Activity to Another Activity Using Intents","<android><android-intent>","5","2","1","",""
"4967780","1","4968486","","2011-02-11 10:10:55","0","512","<p>I have a list view of items, every item has a layout with three text views. I need to change an item's text views color, when the item is clicked. How can I get a link on this item and its views using adapter? Thanks in advance </p>","543539","","","","","2011-02-11 11:30:37","Change text color of an item in list view?","<android><list><colors><view><adapter>","1","1","","",""
"4967799","1","4968327","","2011-02-11 10:12:57","4","9056","<p>I have an activity which is called by few other activities. For example: I have Activity1,Activity2,Activity3.Activity1 calls Activity2 and pass parameter.Activity3 also calls Activity2 and pass parameter.</p><p>Now based on the calling activity, Activity2 performs some task.But how do I know which activity is calling Activity2??can anybody plz help me??</p>","574308","","","","","2014-03-30 00:35:01","how to know the calling activity in android","<android><activity>","6","3","","",""
"4967818","1","4968093","","2011-02-11 10:15:24","1","1397","<p>I have tabhost with 4 tabs. If I (for example) open tab #3, start a simple alert dialog, and then rotate the phone a few times, it loses focus on which tab was open before, so when I press back, tab #1 shows up instead of tab #3.</p><p>I would be <strong>very</strong> grateful for a solution or any hints to solve this problem.</p><pre><code>protected void onSaveInstanceState(Bundle outState) {           super.onSaveInstanceState(outState);        saveState();    }    protected void onPause() {        super.onPause();        saveState();    }    protected void onResume() {        super.onResume();        getTabHost().setCurrentTab(currentTab);    }       private void saveState(){        currentTab=getTabHost().getCurrentTab();    }</code></pre>","577604","","496830","","2011-03-14 20:13:39","2011-03-14 20:13:39","How can I prevent the current tab view from being lost when rotating the screen?","<android>","1","0","","",""
"4967884","1","","","2011-02-11 10:22:45","6","15473","<p>I try to run an android example but i keep getting: emulator.exe has stop working.</p><p>This is the console lines:</p><pre><code>[2011-02-11 10:14:49 - Teste] New emulator found: emulator-5554[2011-02-11 10:14:49 - Teste] Waiting for HOME ('android.process.acore') to be launched...[2011-02-11 10:14:49 - Emulator] [2011-02-11 10:14:49 - Emulator] This application has requested the Runtime to terminate it in an unusual way.[2011-02-11 10:14:49 - Emulator] Please contact the application's support team for more information.[2011-02-11 10:14:51 - Emulator] Bad ram offset 74116c00[2011-02-11 10:14:51 - Emulator] emulator: warning: opening audio input failed[2011-02-11 10:14:51 - Emulator] [2011-02-11 10:14:51 - Emulator] emulator: emulator window was out of view and was recentred[2011-02-11 10:14:51 - Emulator] [2011-02-11 10:14:51 - Teste] emulator-5554 disconnected! Cancelling 'com.example.android.apis.ApiDemos activity launch'!</code></pre><p>You know what is this?</p><p>Thank you.</p>","612882","","580556","","2011-02-11 14:40:57","2011-10-23 13:38:04","emulator.exe has stop working?","<android><emulator><offset><hello-world>","4","1","3","",""
"4967904","1","6093678","","2011-02-11 10:24:36","13","34909","<p>So I have an Activity (say TestActivity) which needs to act as a normal unthemed Activity as well as a Theme.Dialog at other place. I am trying to reuse same TestActivity for both the tasks.</p><p>All I am looking for setting the theme dynamically.The code is simple:Here is my activity's <code>onCreate</code> that works with a black background</p><pre><code>public void onCreate(Bundle icicle) {    if (Utility.isDialog == true)        setTheme(android.R.style.Theme_Dialog);    super.onCreate(icicle);    requestWindowFeature(Window.FEATURE_NO_TITLE);.....</code></pre><p>and here is the Manifest Entry</p><pre><code>&lt;activity android:name="".TestActivity""/&gt;</code></pre><p>And in the meantime I found a post that says it can't be done here is the post <a href=""http://code.google.com/p/android/issues/detail?id=4394"">http://code.google.com/p/android/issues/detail?id=4394</a> .But there is a strong feeling that it can be done.</p><p>All suggestions are welcome.</p>","437703","","356895","","2013-02-28 12:29:41","2013-09-04 12:45:30","Android:How to programmatically set an Activity's theme to Theme.Dialog","<android><activity><dialog><themes>","6","1","4","",""
"4967962","1","","","2011-02-11 10:29:46","0","1353","<p>i have a service in one application and i want to use that service in one more application.so inoder to start or stop or bind with the service should i need to set any permission?if yes what are the permissions?</p>","555653","","","","","2012-12-18 04:46:40","Permission for services","<android><service>","2","0","1","",""
"4968014","1","4968095","","2011-02-11 10:37:00","0","425","<p>hi i have created a new mp3 player app for my owm. In that i am playing songs from a folder where its been stored, the problem is when one song is in play and when i click the next song both gets played, i want the other one to be stopped. the following is my code</p><pre><code>lv.setOnItemClickListener(new OnItemClickListener()     {        public void onItemClick(AdapterView&lt;?&gt; arg0, View arg1, int arg2,long arg3)         {            Log.e("""", ""aaaaa ""+arg2);            if(arg2==0)            {             mplayer = MediaPlayer.create(aply.this, R.raw.a);             mplayer.start();            }            else            {                            mplayer = MediaPlayer.create(aply.this, R.raw.download);             mplayer.start();            }            mplayer.start();            }        });</code></pre><p>pls help me in this....</p>","596364","","512958","","2011-02-11 10:41:33","2012-03-22 18:45:35","audio player app for android","<java><android><mp3>","2","0","","",""
"4968116","1","","","2011-02-11 10:47:18","2","861","<p>Is it possible for Activity(s) to communicate using user defined object?</p><p>p.s. <br /></p><ol><li><p>So far as I know, when I want Activity(s) to communicate to each other, I have to use primitive type of objects, such as int, String, boolean,...etc.</p></li><li><p>We don't use Serializable, Parcelable and static class.</p></li></ol>","559011","","559011","","2011-02-11 11:04:34","2011-03-04 07:27:43","how to communicate between Activity(s) using non-primitive object","<android><activity>","3","1","2","",""
"4968119","1","","","2011-02-11 10:47:43","16","9548","<p>I tried to include admob to an Android app in Eclipse. But I get an error in the layout.xml. Eclipse tells me that com.admot.android.ads.AdView is an unbound prefix. I have the admob library included in the build path, following the pdf instruction. But it still does not seem to find the AdView class. But why?</p><p>Here is the layout producing the error:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout     xmlns:android=""http://schemas.android.com/apk/res/android""    xmlns:app=""http://schemas.android.com/apk/res/renegrothmann.kalah""    android:layout_width=""wrap_content"" android:layout_height=""wrap_content""    &gt;            &lt;renegrothmann.kalah.GameView                android:id=""@+id/gameView"" android:layout_width=""fill_parent""                android:layout_height=""fill_parent""                android:layout_margin=""2px""                /&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""                /&gt;&lt;/LinearLayout&gt;</code></pre>","447111","","447111","","2011-02-11 14:31:50","2014-02-16 18:13:43","com.admob.android.ads.AdView unbound prefix?","<android><admob>","4","3","4","",""
"4968127","1","","","2011-02-11 10:48:52","2","578","<p>I'm trying to do some local web dev/testing and connect from my <code>FroYo</code> Android device to my mac via it's 'name.local' address on the network, rather than via it's IP. </p><p>Is this possible? My device refuses to connect, but works with IP.</p><p>I have to use name.local due to the nature of the site I'm developing - the domain name has to remain static.</p>","254022","","881286","","2013-08-18 02:18:08","2013-08-18 02:18:08","Connecting Android phone to a mac on network with name.local not IP","<android><networking><localhost>","0","1","1","",""
"4968132","1","4968200","","2011-02-11 10:49:28","0","296","<p>hi alli need some help from you guys.. well here's the description</p><p>Guys is it possible that we make some Tab Bars in our Android and then there are only two tab bars. one for the View and second for the Help.now is it possible that when i click on View Tab then it open an activity named ""List"" and when we click any list item then it should change the activity from ""list"" to ""Wotever"" remaining in the same Tab.</p><p>please guide me guys... and help through some tutorial.. </p><p>Thnks a bunch.. </p>","521015","","","","","2011-02-11 10:57:19","how to call Activity in TabBars in android","<android>","3","0","1","",""
"4968226","1","5256371","","2011-02-11 11:00:05","3","21594","<p>I want to get data from <code>database</code> in my android <code>table view</code>.</p><p>Should I use loop? Is static good for this?</p>","785775","","180538","","2011-02-11 11:23:26","2013-05-28 21:01:29","show data in table view in android","<android>","5","5","3","",""
"4968426","1","4969234","","2011-02-11 11:24:13","1","2235","<p>I am on a project that need to use a gallery view in it. If you will build the HelloGallery project from developer.android site (The Default Android Example of Gallery) it will work great.</p><p>Issue is <h3>if you will scroll the gallery with a fast swipe. it will move so quick that the last image comes to front.</h3>  How can I control this horizontal scrolling rate and make any swipe move to next/previous image only?</p><p>This will be bad to read touch events of gallery and reading left or right swipe over the view and setting the next or previous image to front.</p>","467592","","667810","","2012-08-21 04:26:09","2012-08-21 04:26:09","Android Gallery Horizontal Scroll Rate","<android><android-gallery>","2","2","","",""
"4968461","1","","","2011-02-11 11:28:13","0","685","<p>Helloour tester want to stop function in video player.so I add stop button and call seekto(0) and pause when user press stop key.</p><p>but I has one problem. videoview is not clear play screen.</p><p>please help me.</p>","510250","","","","","2011-02-11 11:34:03","how to draw black screen during pause state in video view","<android><multimedia>","1","0","","",""
"4968512","1","4968595","","2011-02-11 11:35:19","0","315","<p>please help me a little in TabBar android</p><p>i m using a TabBar the code is below</p><pre><code>&lt;TabHost android:layout_width=""fill_parent""android:layout_height=""wrap_content""     xmlns:android=""http://schemas.android.com/apk/res/android""android:id=""@android:id/tabhost""&gt;    &lt;LinearLayout android:id=""@+id/LinearLayout01""        android:orientation=""vertical"" android:layout_height=""fill_parent""        android:layout_width=""fill_parent""&gt;        &lt;FrameLayout android:id=""@android:id/tabcontent""            android:layout_height=""fill_parent""             android:layout_width=""fill_parent""            android:layout_weight=""1""&gt;        &lt;/FrameLayout&gt;        &lt;TabWidget android:id=""@android:id/tabs""            android:layout_height=""wrap_content""             android:layout_width=""fill_parent""            android:layout_weight=""0""&gt;        &lt;/TabWidget&gt;    &lt;/LinearLayout&gt;&lt;/TabHost&gt;</code></pre><p>Now my Tab Bar displays on the whole screen .. what i want is that on the top right corner i want to display 2 small images and then it should display a tab bar. on the other part of the screen.. please help me guide how do i add into it..</p><p>Thnks a bunch...</p>","521015","","","","","2011-02-11 11:43:22","Need Help in TabBar Layout in Android","<android><android-layout>","1","0","","",""
"4968520","1","4975751","","2011-02-11 11:36:02","1","4331","<p>I have a ImageView object inside a LinearLayout. I'm setting an animation to the ImageView which will move image view from point x to y. Now, starting point should be right corner of parent container. My question is , how do i get the dimension of the container in which the view is present. I don't see view.getParent().getWidth() kind of method in view hierachy.</p>","260298","","","","","2011-02-12 01:39:18","How to get width of the container in which my view is added in Android","<android>","2","0","","",""
"4968546","1","4969005","","2011-02-11 11:38:25","0","3300","<p>Gurus, I am a lil lost on this topic. Here's a breakdown of what I'm trying to do.</p><p>[User/Android Device] sends location info to a server -> [server] </p><p>[server] returns a list of items that has been sorted using sql from a  - >[db]</p><p>[server] obtains table information and returns to user -> [User/Android Device]</p><p>so from the above situtation, I am lost as to how do i communicate with the server using eclipse? do i use php or asp in java(if it's possible :S) or could i be pointed to somewhere to a link to read on?</p><p>from the server there will be a php/asp page that handles the request correct? </p><p>Hope fellow gurus get what i'm trying to say</p>","612966","","13302","","2011-02-12 07:43:11","2011-02-12 07:43:11","What should I do to connect to Server from eclipse - Android?","<java><android><database><eclipse>","3","1","1","",""
"4968798","1","","","2011-02-11 12:07:16","0","494","<p>I have a receiver in my app (public class SMSReceiver extends BroadcastReceiver) which works just fine - except when the screen turns off. After the screen has turned off, the receiver stops receiving SMSes. Is there any way to solved this?</p>","604724","","","","","2011-02-11 18:29:36","Keep application active after the screen is turned off","<android>","1","0","","",""
"4968814","1","4969261","","2011-02-11 12:08:57","0","2793","<p>I'm making mini bookmarks application. The idea is to populate the relative layout with favicons of sites that are stored in browser's bookmark database. I extracted blob images from the database and converted them to drawables using Drawable.createFromStream method. How can I properly sizeup those imageviews because currently they are very small? Another problem that I have is the relative layout. How can I properly populate the horizontal area with icons so when it reaches end of screen they go in new line?</p><p>Here's my code:</p><pre><code>@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    ScrollView scrollView = new ScrollView(this);    RelativeLayout relativeLayout = new RelativeLayout(this);    ImageView bookmark;    scrollView.addView(relativeLayout);    this.startManagingCursor(cursor);    Uri Bookmarks = Browser.BOOKMARKS_URI;    cursor = managedQuery(            Bookmarks, projection, selection, null, Browser.BookmarkColumns.VISITS + "" DESC"");    if (cursor.moveToFirst()) {        int idCounter = 1;        ByteArrayInputStream blobImage;        do{           bookmark = new ImageView(this);           bookmark.setId(idCounter++);           blobImage = new ByteArrayInputStream(                   cursor.getBlob(cursor.getColumnIndex(BookmarkColumns.FAVICON)));           bookmark.setImageDrawable(                   Drawable.createFromStream(blobImage, """" + bookmark.getId()));           RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(                   LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);           if(idCounter &gt; 1) {               params.addRule(RelativeLayout.BELOW, bookmark.getId() - 1);           }           relativeLayout.addView(bookmark, params);        } while (cursor.moveToNext());     }     this.setContentView(scrollView);}</code></pre><p>}</p>","607767","","","","","2011-02-11 12:59:52","How to properly resize imageview on all screens?","<android><blob><drawable><favicon>","1","0","","",""
"4968859","1","5261796","","2011-02-11 12:15:06","1","2750","<p>I am currently implementing a view in Android that involves using a larger than the screen size bitmap as a background and then having drawables drawn ontop of this. This is so as to simulate a ""map"" that can be scrolled horizontally aswell as vertically. </p><p>Which is done by using a canvas and then drawing to this the full ""map"" bitmap, then putting the other images on top as an overlay and then drawing only the viewable bit of this to screen. </p><p>Overriding the touch events to redraw the screen on a scroll/fling.</p><p>I'm sure this probably has a huge ammount of overhead (by creating a canvas of the full image whilst using(drawing) only a fifth of it) and could be done in a different way as to the explained, but I was just wondering what people would do in this situation, and perhaps examples?</p><p>If you need more info just let me know, </p><p>Thanks, </p><p>Simon</p>","600282","","491044","","2011-03-10 15:15:41","2012-04-10 17:25:37","Android: Scrollable (bitmap) screen","<android><scrolling><bitmap>","3","0","1","",""
"4968883","1","4990254","","2011-02-11 12:18:14","9","16912","<p>I was just wondering if there was a way to change the opacity of the background image for a <code>View</code> (ie. <code>TextView</code>, etc.).</p><p>I know that I can set the background image like this:</p><pre><code>android:background=""@drawable/my_drawable_image""</code></pre><p>Or I can set a specific background colour with an alpha setting like this:</p><pre><code>android:background=""#10f7f7f7""</code></pre><p>Is there a way I can control the opacity (set the alpha) if I'm setting the background as a drawable image? And I want to do this in the XML Layout. I already know that I could grab the Drawable object and programmatically set the alpha, but I want to see if I can do it in the layout.</p>","380579","","","","","2014-04-01 20:43:35","Opacity on a background Drawable image in View (using XML Layout)","<android><layout><view><opacity><drawable>","4","0","","",""
"4968897","1","4968943","","2011-02-11 12:19:48","2","560","<p>I need to make an antivirus type thing... for which i want that after downloading and before installing the application i want to check it... how can that be possible...</p>","578215","","","","","2011-02-11 12:25:18","hook between downloading and installing application from android market","<android><installation><checking>","1","0","1","",""
"4968915","1","","","2011-02-11 12:21:39","1","1955","<p>I need to save current tab in my tabactivity. When I'm e.g. on tab nr 3, next if open dialog and press back button it brings me back to tab1. To solve that I tried to create int currentPos to which I pass getCurrentTab() in onSaveInstanceState()/onPause and read it with setCurrenttab(currentPos) in onResume() method but it does not work :( I tried to change currentPost to static - then it works however this is an ugly way i suppose ;/I would be EXTREMELY thankful for any help</p><pre><code>protected void onSaveInstanceState(Bundle outState) {       super.onSaveInstanceState(outState);    saveState();    outState.putInt(CURRENT_TAB, getTabHost().getCurrentTab());}protected void onRestoreInstanceState(Bundle savedInstanceState){    currentTab = (savedInstanceState ==null) ? currentTab=0 :           savedInstanceState.getInt(CURRENT_TAB);    if(currentTab &gt;=0){        getTabHost().setCurrentTab(currentTab);    }}protected void onPause() {    super.onPause();        saveState();}protected void onResume() {    super.onResume();       getTabHost().setCurrentTab(currentTab);     }   private void saveState(){    currentTab=getTabHost().getCurrentTab();}</code></pre>","577604","","","","","2011-05-30 20:14:42","Why this code does not save current tab state?","<android>","2","0","","",""
"4968926","1","","","2011-02-11 12:22:54","3","2406","<p>hi <br>I am writing an Android application in which I displays a List . Clicking on any item on list will display another list which is a Fragment.Say this Fragment as Fragment1.I will display this fragment every time I click 1,2,4 listitems. But When I click ListItem3 I will display another Fragment say Fragment2 besides Fragment1. My question is before clicking the ListItem3, a ProgressBar with ""Loading"" text is displayed at a place where Fragment2 is supposed to be displayed when I click ListItem3. The ProgressBar  is there even after the Fragment2 is displayed. Can anyone tell me the reason why  this ProgressBar is displayed?I will be waiting for reply.</p><p><br>Thanks in Advance.</p>","429501","","","","","2011-08-02 05:56:10","Progress bar appears with loading string before fragment gets loaded in HoneyComb3.0","<android>","1","2","","",""
"4968988","1","4969477","","2011-02-11 12:30:21","5","590","<p>I have released <a href=""https://market.android.com/details?id=fixedpointcode.fleya"" rel=""nofollow"">an app</a> on the market with <strong>minSDK</strong> set to 4 (Android 1.6) but now I want to release an <strong>update</strong> with features unavailable in 1.6 so I need a higher <strong>minSDK</strong>.</p><p>So, my question is: Will users running 1.6 be notified of this update?...and if yes will they be able to download/install it?</p>","338449","","338449","","2011-12-22 13:19:37","2011-12-22 13:19:37","What if I want to release an update with higher minSDK than the one on the market?","<android><sdk><google-play>","1","0","3","",""
"4968989","1","","","2011-02-11 12:30:23","0","1766","<p>I am trying to access json object using following code</p><p><a href=""http://epubreader.XXXXXXX.net/public/json/books.json"" rel=""nofollow"">http://epubreader.XXXXXXX.net/public/json/books.json</a></p><pre><code>        try       {          InputStream in = openHttpConnection(""http://epubreader.feathersoft.net          /public/json/books.json"");           Data=new byte[in.available()];          in.read(Data);        }       catch(IOException e)           {           Log.e(""url"", e.getLocalizedMessage()+e.getCause()+e.getStackTrace());               }   }   private InputStream openHttpConnection(String url_send) throws IOException   {        InputStream in = null;        int response = -1;        URL url = new URL(url_send);        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();           }        } catch (Exception ex) {           throw new IOException(""Error connecting"");        }        return in;    }  }   </code></pre><p>Then I got Nullpointer exception I cannot figure out what it is please help me</p><p>Thanks for your time</p>","482604","","482604","","2011-02-11 12:38:48","2011-02-11 12:55:17","""Null pointer exception"" when accessing json object using url","<android><web-services><json>","1","0","","",""
"4969025","1","4969174","","2011-02-11 12:33:13","1","3730","<p>Hi I was wondering if anybody would know the best way to encrypt a file before I send it to the server and then how to unencrypt it once on the server? Files could be txt or jpg...I dont know much about encryption..thanks</p>","569654","","","","","2013-03-05 18:17:11","Android File encryption","<android><encryption>","3","0","2","",""
"4969026","1","4969112","","2011-02-11 12:33:25","1","3664","<p>I have a <code>list</code> of <code>ImageView</code>s, which download the images from the net.<br>I downloaded the images from server and it displays in <code>ImageView</code>, but <code>.bmp</code> images don't show in <code>ImageView</code>.<br>Please help me to solve this problem.</p>","537819","","469983","","2012-03-26 08:06:29","2013-08-05 06:57:12","How to set .bmp image to ImageView","<android><android-imageview>","2","0","","",""
"4969053","1","4998348","","2011-02-11 12:37:14","9","14977","<p>Does anybody know, how to build a bluetooth connection between Android and LEGO-Mindstorm-NXT?The connection between two NXTs works fine. But the other Connection-type likes not so easy.I am working with the LeJOS Firmware 0.85 and the Android SDK Tools (2.2 Froyo).</p>","588275","","","","","2012-08-07 12:03:51","Bluetooth-connection between Android and Lego Mindstorm NXT","<android><bluetooth><lego><mindstorms><nxt>","2","2","9","",""
"4969135","1","","","2011-02-11 12:45:12","0","1333","<p>I have a Sqlite database in which a base64 code string is stored as a BLOB. I want to fetch this BLOB from the db and decode the base64 and show the image in an ImageView. I have read about encoding and decoding base64 and this is what I am using now. </p><pre><code>        String[] image = new String[100000];        if (cursor.moveToFirst()){             int i = 0;         do {image[i] = cursor.getString(1);         i++;}         while (cursor.moveToNext()); String imagebyte = image[0];    byte[] decodedString = Base64.decode(imagebyte, Base64.DEFAULT);    Bitmap decodedByte = BitmapFactory.decodeByteArray(decodedString, 0, decodedString.length);    mImage.setImageBitmap(decodedByte);</code></pre><p>But nothing shows up and I don't get any error messages. In order to pinpoint the problem I tried encoding and decoding an image, and then the bitmap showed. Is this the right way to decode it? I am here using cursor.getString(1), I have tried with using getBlob(1) also, but still nothing shows. Should I use getString or getBlob?Is there an easy way to check validity of the base64 code? THanks!</p>","455479","","","","","2011-02-11 13:33:59","How do I decode base64 blob to bitmap Android?","<android><database><sqlite><base64>","1","0","","",""
"4969171","1","4969191","","2011-02-11 12:49:13","18","85334","<p>Building a multi-language application in Java. Getting an error when inserting String value from <code>R.string</code> resource XML file:</p><pre><code>public static final String TTT =  (String) getText(R.string.TTT);</code></pre><p>This is the error message:</p><blockquote>  <p>Error: Cannot make a static reference to the non-static method getText(int) from the type        Context</p></blockquote><p>Thanks in advance.</p>","552222","","1670308","","2014-04-15 13:50:33","2014-04-15 13:50:33","Cannot Make Static Reference to Non-Static Method","<java><android>","6","2","12","",""
"4969217","1","4969561","","2011-02-11 12:54:24","5","6315","<p>I want my application user to be able to share/recommend my app to other users. I use the ACTION_SEND intent. I add plain text saying something along the lines of: install this cool application. But I can't find a way to enable users to directly go to the install screen of market place for instance. All I can provide them with is a web link or some text.In other words I am looking for a very direct way for android users to have my app installed.</p><p>Thanks for any help/pointers,</p><p>Thomas</p>","573240","","","","","2012-06-09 15:33:48","Share application ""link"" in Android","<android><share>","3","0","4","",""
"4969226","1","4969417","","2011-02-11 12:55:21","3","6601","<p>Hey folks, this is my first post so go easy on me!</p><p>I want to develop an application where you can navigate through 7 or so screens like you can on the homescreen.</p><p>I have seen a few posts on this but I can't seem to get them to work, I also can't seem to add comments to them (I'm sure thats me being a noob)</p><p>So I need a working project so I can look at it and dissect it and use the bits relevant to me. </p><p>This one was of interest but I just can't get it to work.  I use Eclipse and the SDK is that what everyone else uses?</p><p><a href=""http://stackoverflow.com/questions/3467461/developing-an-android-homescreen"">Developing an Android Homescreen</a></p><p>When I implement it I need to tell the app how to start because it installs it but says there is no activity.</p><p>hope you can help</p><p>T</p><p>What I have in my Main.Java</p><pre><code>package com.matthieu.launcher;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.ViewFlipper;public class main extends Activity {   /** Called when the activity is first created. */   @Override   public void onCreate(Bundle savedInstanceState) {      super.onCreate(savedInstanceState);      setContentView(R.layout.main);      Button onebutton = (Button)findViewById(R.id.soundsone);      onebutton.setOnClickListener(new OnClickListener() {         public void onClick(View v) {            Intent i = new Intent(main.this, series1button.class);            startActivity(i);            overridePendingTransition(R.anim.push_up_in, R.anim.push_up_out);         }      });      Button twobutton = (Button)findViewById(R.id.soundstwo);      twobutton.setOnClickListener(new OnClickListener() {         public void onClick(View v) {            Intent i = new Intent(main.this, series2button.class);            startActivity(i);            overridePendingTransition(R.anim.push_up_in, R.anim.push_up_out);         }      });      Button threebutton = (Button)findViewById(R.id.soundsthree);      threebutton.setOnClickListener(new OnClickListener() {         public void onClick(View v) {            Intent i = new Intent(main.this, series3button.class);            startActivity(i);            overridePendingTransition(R.anim.push_up_in, R.anim.push_up_out);                    }      });      Button fourbutton = (Button)findViewById(R.id.soundsfour);      fourbutton.setOnClickListener(new OnClickListener() {         public void onClick(View v) {            Intent i = new Intent(main.this, series4button.class);            startActivity(i);            overridePendingTransition(R.anim.push_up_in, R.anim.push_up_out);         }      });      Button fivebutton = (Button)findViewById(R.id.soundsfive);      fivebutton.setOnClickListener(new OnClickListener() {         public void onClick(View v) {            Intent i = new Intent(main.this, series5button.class);            startActivity(i);            overridePendingTransition(R.anim.push_up_in, R.anim.push_up_out);         }      });      Button sixbutton = (Button)findViewById(R.id.soundssix);      sixbutton.setOnClickListener(new OnClickListener() {         public void onClick(View v) {            Intent i = new Intent(main.this, series6button.class);            startActivity(i);            overridePendingTransition(R.anim.push_up_in, R.anim.push_up_out);         }      });      Button sevenbutton = (Button)findViewById(R.id.soundsseven);      sevenbutton.setOnClickListener(new OnClickListener() {         public void onClick(View v) {            Intent i = new Intent(main.this, series7button.class);            startActivity(i);            overridePendingTransition(R.anim.push_up_in, R.anim.push_up_out);                    }      });      Button eightbutton = (Button)findViewById(R.id.soundseight);      eightbutton.setOnClickListener(new OnClickListener() {         public void onClick(View v) {            Intent i = new Intent(main.this, series8button.class);            startActivity(i);            overridePendingTransition(R.anim.push_up_in, R.anim.push_up_out);                    }      });   }}</code></pre><p>Then Dragablespace.java</p><pre><code>package com.matthieu.launcher;import android.content.Context;import android.app.Activity;import android.util.Log;import android.content.res.TypedArray;import android.util.AttributeSet;import android.view.MotionEvent;import android.view.VelocityTracker;import android.view.View;import android.view.ViewGroup;import android.view.ViewConfiguration;import android.widget.Scroller;public class DragableSpace extends ViewGroup {   private Scroller mScroller;   private VelocityTracker mVelocityTracker;   private int mScrollX = 0;   private int mCurrentScreen = 0;   private float mLastMotionX;   private static final String LOG_TAG = ""DragableSpace"";   private static final int SNAP_VELOCITY = 1000;   private final static int TOUCH_STATE_REST = 0;   private final static int TOUCH_STATE_SCROLLING = 1;   private int mTouchState = TOUCH_STATE_REST;   private int mTouchSlop = 0;   public DragableSpace(Context context) {      super(context);      mScroller = new Scroller(context);      mTouchSlop = ViewConfiguration.get(getContext()).getScaledTouchSlop();      this.setLayoutParams(new ViewGroup.LayoutParams(                                   ViewGroup.LayoutParams.WRAP_CONTENT,                                   ViewGroup.LayoutParams.FILL_PARENT));   }   public DragableSpace(Context context, AttributeSet attrs) {      super(context, attrs);      mScroller = new Scroller(context);      mTouchSlop = ViewConfiguration.get(getContext()).getScaledTouchSlop();      this.setLayoutParams(new ViewGroup.LayoutParams(                                   ViewGroup.LayoutParams.WRAP_CONTENT ,                                   ViewGroup.LayoutParams.FILL_PARENT));      TypedArray a=getContext().obtainStyledAttributes(attrs,R.styleable.DragableSpace);      mCurrentScreen = a.getInteger(R.styleable.DragableSpace_default_screen, 0);   }   @Override   public boolean onInterceptTouchEvent(MotionEvent ev) {      /*       * This method JUST determines whether we want to intercept the motion.       * If we return true, onTouchEvent will be called and we do the actual       * scrolling there.       */      /*       * Shortcut the most recurring case: the user is in the dragging state       * and he is moving his finger. We want to intercept this motion.       */      final int action = ev.getAction();      if ((action == MotionEvent.ACTION_MOVE) &amp;&amp; (mTouchState != TOUCH_STATE_REST)) {        return true;      }      final float x = ev.getX();      switch (action) {         case MotionEvent.ACTION_MOVE:            /*             * mIsBeingDragged == false, otherwise the shortcut would have caught it. Check             * whether the user has moved far enough from his original down touch.             */            /*             * Locally do absolute value. mLastMotionX is set to the y value             * of the down event.             */            final int xDiff = (int) Math.abs(x - mLastMotionX);            boolean xMoved = xDiff &gt; mTouchSlop;            if (xMoved) {                // Scroll if the user moved far enough along the X axis                mTouchState = TOUCH_STATE_SCROLLING;            }            break;        case MotionEvent.ACTION_DOWN:            // Remember location of down touch            mLastMotionX = x;            /*             * If being flinged and user touches the screen, initiate drag;             * otherwise don't.  mScroller.isFinished should be false when             * being flinged.             */            mTouchState = mScroller.isFinished() ? TOUCH_STATE_REST : TOUCH_STATE_SCROLLING;            break;        case MotionEvent.ACTION_CANCEL:        case MotionEvent.ACTION_UP:            // Release the drag            mTouchState = TOUCH_STATE_REST;            break;    }    /*     * The only time we want to intercept motion events is if we are in the     * drag mode.     */    return mTouchState != TOUCH_STATE_REST;}@Overridepublic boolean onTouchEvent(MotionEvent event) {    if (mVelocityTracker == null) {        mVelocityTracker = VelocityTracker.obtain();    }    mVelocityTracker.addMovement(event);    final int action = event.getAction();    final float x = event.getX();    switch (action) {        case MotionEvent.ACTION_DOWN:            Log.i(LOG_TAG, ""event : down"");            /*             * If being flinged and user touches, stop the fling. isFinished             * will be false if being flinged.             */            if (!mScroller.isFinished()) {                mScroller.abortAnimation();            }            // Remember where the motion event started            mLastMotionX = x;            break;        case MotionEvent.ACTION_MOVE:            // Log.i(LOG_TAG,""event : move"");            // if (mTouchState == TOUCH_STATE_SCROLLING) {            // Scroll to follow the motion event            final int deltaX = (int) (mLastMotionX - x);            mLastMotionX = x;            //Log.i(LOG_TAG, ""event : move, deltaX "" + deltaX + "", mScrollX "" + mScrollX);            if (deltaX &lt; 0) {                if (mScrollX &gt; 0) {                    scrollBy(Math.max(-mScrollX, deltaX), 0);                }            } else if (deltaX &gt; 0) {                final int availableToScroll = getChildAt(getChildCount() - 1)                    .getRight()                    - mScrollX - getWidth();                if (availableToScroll &gt; 0) {                    scrollBy(Math.min(availableToScroll, deltaX), 0);                }            }            // }            break;        case MotionEvent.ACTION_UP:            Log.i(LOG_TAG, ""event : up"");            // if (mTouchState == TOUCH_STATE_SCROLLING) {            final VelocityTracker velocityTracker = mVelocityTracker;            velocityTracker.computeCurrentVelocity(1000);            int velocityX = (int) velocityTracker.getXVelocity();            if (velocityX &gt; SNAP_VELOCITY &amp;&amp; mCurrentScreen &gt; 0) {                // Fling hard enough to move left                snapToScreen(mCurrentScreen - 1);            } else if (velocityX &lt; -SNAP_VELOCITY                    &amp;&amp; mCurrentScreen &lt; getChildCount() - 1) {                // Fling hard enough to move right                snapToScreen(mCurrentScreen + 1);            } else {                snapToDestination();            }            if (mVelocityTracker != null) {                mVelocityTracker.recycle();                mVelocityTracker = null;            }            // }            mTouchState = TOUCH_STATE_REST;            break;        case MotionEvent.ACTION_CANCEL:            Log.i(LOG_TAG, ""event : cancel"");            mTouchState = TOUCH_STATE_REST;    }    mScrollX = this.getScrollX();    return true;}private void snapToDestination() {    final int screenWidth = getWidth();    final int whichScreen = (mScrollX + (screenWidth / 2)) / screenWidth;    Log.i(LOG_TAG, ""from des"");    snapToScreen(whichScreen);}public void snapToScreen(int whichScreen) {             Log.i(LOG_TAG, ""snap To Screen "" + whichScreen);    mCurrentScreen = whichScreen;    final int newX = whichScreen * getWidth();    final int delta = newX - mScrollX;    mScroller.startScroll(mScrollX, 0, delta, 0, Math.abs(delta) * 2);                 invalidate();}public void setToScreen(int whichScreen) {    Log.i(LOG_TAG, ""set To Screen "" + whichScreen);    mCurrentScreen = whichScreen;    final int newX = whichScreen * getWidth();    mScroller.startScroll(newX, 0, 0, 0, 10);                 invalidate();}@Overrideprotected void onLayout(boolean changed, int l, int t, int r, int b) {    int childLeft = 0;    final int count = getChildCount();    for (int i = 0; i &lt; count; i++) {        final View child = getChildAt(i);        if (child.getVisibility() != View.GONE) {            final int childWidth = child.getMeasuredWidth();            child.layout(childLeft, 0, childLeft + childWidth, child                    .getMeasuredHeight());            childLeft += childWidth;        }    }}@Overrideprotected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {    super.onMeasure(widthMeasureSpec, heightMeasureSpec);    final int width = MeasureSpec.getSize(widthMeasureSpec);    final int widthMode = MeasureSpec.getMode(widthMeasureSpec);    if (widthMode != MeasureSpec.EXACTLY) {        throw new IllegalStateException(""error mode."");    }    final int heightMode = MeasureSpec.getMode(heightMeasureSpec);    if (heightMode != MeasureSpec.EXACTLY) {        throw new IllegalStateException(""error mode."");    }    // The children are given the same width and height as the workspace    final int count = getChildCount();    for (int i = 0; i &lt; count; i++) {        getChildAt(i).measure(widthMeasureSpec, heightMeasureSpec);    }    Log.i(LOG_TAG, ""moving to screen ""+mCurrentScreen);    scrollTo(mCurrentScreen * width, 0);      }  @Overridepublic void computeScroll() {    if (mScroller.computeScrollOffset()) {        mScrollX = mScroller.getCurrX();        scrollTo(mScrollX, 0);        postInvalidate();    }}}</code></pre><p>Then my main.xml layout</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;com.matthieu.launcher.DragableSpace xmlns:app=""http://schemas.android.com/apk/res/com.matthieu.launcher"" xmlns:android=""http://schemas.android.com/apk/res/android"" android:id=""@+id/space"" android:layout_width=""fill_parent"" android:layout_height=""fill_parent"" app:default_screen=""1""&gt;   &lt;include android:id=""@+id/left"" layout=""@layout/left_screen"" /&gt;   &lt;include android:id=""@+id/center"" layout=""@layout/initial_screen"" /&gt;   &lt;include android:id=""@+id/right"" layout=""@layout/right_screen"" /&gt;&lt;/com.matthieu.launcher.DragableSpace&gt;</code></pre><p>I also have 3 other layout files called initial, left and right(_screen)</p>","613038","","286364","","2011-06-27 12:14:52","2011-06-27 12:14:52","Android Homescreen","<android><viewflipper><launcher>","1","15","2","",""
"4969249","1","4975723","","2011-02-11 12:58:32","1","1024","<p>I'm trying to draw a <a href=""http://stackoverflow.com/questions/4668231/creating-interactive-contour-plots-on-android"">2D contour plot of some data</a> on Android and I'm wondering what the best approach would be to draw those. The whole datasets can be relatively large (2k * 2k points) and zooming and moving inside the plot should be very fast. Most of the time only a small part of the data will be drawn as the user has zoomed in on the data. </p><p>My idea now would be to draw the whole plot onto a large canvas, but clip it to the portion visible on the screen, so that only that part would be really drawn in the end. I find the 2D drawing API of Android somewhat confusing and I'm not sure if this is really a feasible approach and how I would then go about executing it.</p><p>So my questions are:</p><ul><li>Is it a good idea to draw onto a canvas much larger than the screen and use clipping to display only the relevant part? </li><li>How would I create a larger canvas and how would I select which parts should be drawn?</li></ul>","347857","","","","","2011-02-12 01:33:55","Using a canvas much larger than the screen","<java><android><graphics><canvas><drawing>","3","0","","",""
"4969344","1","","","2011-02-11 13:08:56","0","384","<p>i have a seekbar which i implemented in an xml file. i wanted to place this seekbar on a custom drawable rectangle which i have drawn using the canvas draw method and i have named the the class as ""controlButtons.java"", i.e different rectangles will act as menus as if.</p><p>my main problem is how should i make the seekbar appear on the rectangle without having to make the class ""extend linearlayout"".</p><p>is there a way to import something as a linearlayout and place it on the canvas</p><p>hope you'll be able to help me..thanks</p><p>raaj</p>","613071","","","","","2011-02-11 18:24:49","how to import something in a linear layout and place it on a canvas","<android><canvas>","2","1","","",""
"4969353","1","4970040","","2011-02-11 13:09:39","0","447","<p>In my code i just used two listview and two CustomAdapter for this two listView,in which first listview is implement through an CustomAdapter,from this CustomAdapter i just want to call another (Activity/Other custom Adapter for second listview).It gives Exception like </p><blockquote>  <p>java.lang.IllegalStateException:  System services not available to  Activities before onCreate()</p></blockquote><pre><code>private LayoutInflater mInflater;    ViewFlipper vfWall;    ImageView ivComments;    TextView tvComments;    ListView lvComments;    WallCustom2 adapterForComments;    ImageDownloader imageDownloader = new ImageDownloader();    private static final String[] URLS =      {      ""http://lh5.ggpht.com/_mrb7w4gF8Ds/TCpetKSqM1I/AAAAAAAAD2c/Qef6Gsqf12Y/s144-c/_DSC4374%20copy.jpg"",    };    String[] itms={""hey dude kya kar raha hai..........""};    public WallCustom(Context context,ViewFlipper vfWall,ImageView ivComments,TextView tvComments,ListView lvComments)    {        this.ivComments=ivComments;        this.tvComments=tvComments;        this.lvComments=lvComments;        this.mInflater = LayoutInflater.from(context);        this.vfWall=vfWall;    }    public int getCount()     {        return  URLS.length;    }    public Object getItem(int position) {        return position;    }    public long getItemId(int position) {        return position;    }    public View getView(final int position, View convertView, ViewGroup parent) {        // TODO Auto-generated method stub        final ViewHolder holder;        if (convertView == null)         {            convertView = mInflater.inflate(R.layout.wallcustom, null);            holder = new ViewHolder();            holder.Image = (ImageView) convertView.findViewById(R.id.ivImageWallCustom);            holder.Message= (TextView) convertView.findViewById(R.id.tvMessageWallCustom);            holder.comments= (TextView) convertView.findViewById(R.id.tvExtraWallCustom);            convertView.setTag(holder);        }         else         {            holder = (ViewHolder) convertView.getTag();        }         if(imageDownloader.download(URLS[position],holder.Image)!=null)         {             holder.Image.setImageBitmap( imageDownloader.download(URLS[position],holder.Image));         }        holder.Message.setText(""hey dude kya kar raha hai.........."");        holder.comments.setText(""Comments "");        holder.comments.setOnClickListener(new View.OnClickListener()         {            public void onClick(View v)             {                 if(imageDownloader.download(URLS[position],ivComments)!=null)                 {                     ivComments.setImageBitmap( imageDownloader.download(URLS[position],ivComments));                 }                 tvComments.setText(itms[position]);                 Wall wallobj=new Wall();                adapterForComments=wallobj.ListViewForComments(); // gives object of second custom adapter                lvComments.setAdapter(adapterForComments); // lvComments my second list view in which i want to set second custom adapter                 vfWall.showNext();            }        });        return convertView;    }    class ViewHolder     {        ImageView Image;        TextView Message;        TextView comments;    }</code></pre>","590489","","590489","","2011-02-11 13:39:32","2011-02-11 14:18:56","Called other Activity/CustomAdapter from an customadapter","<android>","1","1","","",""
"4969484","1","4969577","","2011-02-11 13:24:09","3","710","<p>I have extended View and passed it an instance of my Activity so the view can access some member variables and methods.  </p><p>But now I'm thinking this could be a potential memory leak, because even after the Activity is destroyed, it still has a reference to the view in a member variable, and vice versa. So the garbage collector may never clean them up.</p><p>However, I've seen in some of the Google API demos and examples cases where they have passed the Activity to the View as a listener.</p>","506796","","","","","2011-02-11 13:32:14","Is it safe for a view to reference the activity that's displaying it?","<android>","2","0","","",""
"4969541","1","4969583","","2011-02-11 13:29:10","4","13749","<p>I have to play a mp3 file and when click on back button on the device then automatically the song should stop. So I tried below given method. But it is not working.</p><pre><code>  public void onCreate(Bundle icicle) {    super.onCreate(icicle);    setContentView(R.layout.audioplaying);        play=(ImageView)findViewById(R.id.play);        stop=(ImageView)findViewById(R.id.stop);        songid=(TextView)findViewById(R.id.songid);        status=(TextView)findViewById(R.id.status);        String s=Songs.song;        status.setText(""Please Wait....!"");        mp=new MediaPlayer();        try{        mp.setDataSource(s);        mp.prepare();        }        catch(Exception ex){            Log.e(""Exception"",ex.getMessage());        }        Log.e(""Status"",""Song is going to Start"");        mp.start();        start=true;        Log.e(""Status"",""Song was Started"");        status.setText(""Playing...!"");        songid.setText(s);        play.setOnClickListener(this);        stop.setOnClickListener(this);    }@Overridepublic 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 super.onKeyDown(keyCode, event);}public void onBackPressed() {    Log.d(""CDA"", ""onBackPressed Called"");    audioStreamer.stop();    audioStreamer.getMediaPlayer().stop();    if(start)    {    mp.stop();    start=false;    }    else{         Intent setIntent = new Intent(AudioPlay1.this,Songs.class);         startActivity(setIntent);          finish();    }    Intent setIntent = new Intent(AudioPlay1.this,Songs.class);    startActivity(setIntent);     finish();    return;}    @Override    public void onClick(View v) {        if(v.equals(play)){        try{        mp.prepare();        }        catch(Exception ex){Log.e(""Exception in onclick"",ex.toString());}        mp.start();        start=true;        Log.e(""Status"",""Song was Started again"");        status.setText(""Playing...!"");        }        if(v.equals(stop)){        mp.stop();        start=false;        Log.e(""Status"",""Song was stopped"");        status.setText(""Song was Stopped"");        }    }</code></pre><p>the song is not stopping and the previous page cant display. Please tell me the solution. </p><p>Best Regards.</p><p>Thank you in advance. </p>","745367","","1806099","","2013-01-09 04:44:59","2013-01-09 04:44:59","Override back button in android","<android><override><back-button>","2","2","1","",""
"4969544","1","6196066","","2011-02-11 13:29:24","1","339","<p>I want to display data in my android application from the database in a gap of few seconds and update the UI using threads. So how can i separate the logic for both getting the data from the database and UI? </p>","610940","","","","","2011-09-11 16:45:39","Threads in Android","<android>","3","5","1","",""
"4969553","1","","","2011-02-11 13:29:58","10","1542","<p>I must be missing something here. The JavaDoc of <code>ActivityUnitTestCase</code> suggest that this test case tests an Activity in isolation from the system:</p><blockquote>  <p>This class provides isolated testing of a single activity. The activity under test will be created with minimal connection to the system infrastructure, and you can inject mocked or wrappered versions of many of Activity's dependencies.</p></blockquote><p>I was assuming that includes not actually starting the application. Moreover, it exposes a <code>setApplication</code> helper that one can presumably use to inject a mock application.</p><p>However, any <code>ActivityUnitTestCase</code> I start launches the (actual) application and calls its <code>onCreate</code> method. More precisely, the <code>InstrumentationTestRunner</code> seems to be doing that, and doing so even before I get a chance to <code>setApplication</code> in my test's <code>setUp</code> method! I didn't even notice that for quite a while, since it seems to happen at a point during test suite launch where not even Eclipse breakpoints are reached, but writing to the logs in <code>onCreate</code> reveals that it's actually called.</p><p>This is completely beyond me. Why would I want to use a mock app object when Android's test runner instantiates and executes the actual application anyway? This is even more problematic considering that the instrumentation runner runs in its own thread, and spawns the main application thread when doing so. This means there is a race condition between the test being executed and <code>Application.onCreate</code> being called. If you do anything in there that could affect your tests, e.g. writing to a shared preference file, then you're completely screwed, since your tests will randomly fail.</p><p>Am I missing something or is this simply a gross oversight in the test framework?</p><p><strong>UPDATE</strong>This seems to affect <code>ApplicationTestCase</code> as well. Before my test case is even started, I can reach a breakpoint in my application class' <code>onCreate</code>. We start a fire-and-forget AsyncTask in there, which will randomly fail because I get no chance to mock it out (remember, that's before <code>setUp</code> is called on my test case). Here is the stack trace I see during this obscure invocation of onCreate:</p><pre><code>Thread [&lt;1&gt; main] (Suspended (breakpoint at line 86 in QypeRadar))  QypeRadar.onCreate() line: 86   InstrumentationTestRunner(Instrumentation).callApplicationOnCreate(Application) line: 969   ActivityThread.handleBindApplication(ActivityThread$AppBindData) line: 4244 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>Why does the test runner <code>callApplicationOnCreate</code> even though <a href=""http://developer.android.com/reference/android/test/ApplicationTestCase.html"">the docs</a> clearly state:</p><blockquote>  <p>The test case will not call onCreate() until your test calls createApplication(). This gives you a chance to set up or adjust any additional framework or test logic before onCreate().</p></blockquote><p>That's a flat out lie--it doesn't give me the chance!</p>","127013","","127013","","2011-02-16 10:28:38","2011-02-16 10:28:38","How to prevent ActivityUnitTestCase from calling Application.onCreate?","<android><unit-testing>","1","4","3","",""
"4969611","1","","","2011-02-11 13:35:58","1","467","<p>my app have been suspended : I have a functionnality in my app to share picture, and some users have share some porn pictures. I wan't to delete this functionnality and update my app. But in the publish console, I can't do any update in my app until it is in ""suspended"" state.</p><p>How can I contact google mods to find an issue ? </p><p>Thanks.</p>","613116","","","","","2011-05-26 14:04:41","My app have been suspended","<android>","1","0","","",""
"4969634","1","4969861","","2011-02-11 13:38:48","0","912","<p>Hello this is probably a typical question but i cant seem to find a clear answer?</p><p>I have a backend application that will serve data in json form.</p><p>The data will be in form [code] [name].</p><p>The data sets might vary from 100-2000 rows.</p><p>What would be best...</p><p>Store directly these json responses as files and then parse them if they exist?Or store them in the android database?</p><p>In each case the data does not change that often maybe 1 per week.</p><p>Which way  would be the faster and which more efficient?</p><p>Thanks</p>","390517","","","","","2011-02-11 14:12:14","Android performance Maintain json files or an sqlite database?","<android><json><sqlite>","2","0","","",""
"4969689","1","5004506","","2011-02-11 13:43:16","4","13561","<p>I'm trying to use Android's animation framework to have my ImageView move in a diamond pattern. Here's my animation.xml:</p><pre><code>&lt;set xmlns:android=""http://schemas.android.com/apk/res/android"" android:shareInterpolator=""true""&gt;&lt;translate     android:fromXDelta=""40%p"" android:toXDelta=""90%p""     android:fromYDelta=""10%p"" android:toYDelta=""40%p""     android:duration=""500"" android:startOffset=""0""/&gt;&lt;translate     android:fromXDelta=""90%p"" android:toXDelta=""40%p""     android:fromYDelta=""40%p"" android:toYDelta=""90%p""     android:duration=""500"" android:startOffset=""500""/&gt;&lt;translate     android:fromXDelta=""40%p"" android:toXDelta=""10%p""     android:fromYDelta=""90%p"" android:toYDelta=""40%p""     android:duration=""500"" android:startOffset=""1000""/&gt;&lt;translate     android:fromXDelta=""10%p"" android:toXDelta=""40%p""     android:fromYDelta=""40%p"" android:toYDelta=""10%p""     android:duration=""500"" android:startOffset=""1500""/&gt;&lt;/set&gt;</code></pre><p>My layout:</p><pre><code>&lt;FrameLayout xmlns:android=""http://schemas.android.com/apk/res/android""android:orientation=""vertical"" android:layout_width=""match_parent"" android:layout_height=""match_parent""&gt;    &lt;ImageView        android:id=""@+id/img""          android:layout_width=""wrap_content""         android:layout_height=""wrap_content""        android:src=""@drawable/icon""/&gt;&lt;/FrameLayout&gt;</code></pre><p>And my onStart:</p><pre><code>protected void onStart() {    super.onStart();    ImageView img = (ImageView)findViewById(R.id.img);    Animation a = AnimationUtils.loadAnimation(this, R.anim.diamond);    img.startAnimation(a);}</code></pre><p>When I start my application all I see is a blank screen for 2 seconds then my image pops into the upper-left corner of the screen. If I remove all but one of the translate animations I will see the image move in a diagonal line.</p><p>I would prefer to use XML to define the animation and not Java.</p><p>Does anyone have any insight into how I can see the entire animation? </p><p>-Dan</p>","212389","","","","","2012-10-12 11:12:02","Android animation XML issues","<android><animation>","3","2","6","",""
"4969697","1","","","2011-02-11 13:43:54","1","2479","<p>I have Used this Program for taking Gps periodically but i got exception in that, please give me solution</p><pre><code>     package com.excerciseTest;     import java.util.ArrayList;     import java.util.Calendar;     import java.util.List;     import java.util.Locale;     import java.util.Timer;     import java.util.TimerTask;     import android.app.Activity;     import android.app.AlarmManager;     import android.app.NotificationManager;     import android.app.PendingIntent;     import android.app.Service;     import android.content.Context;     import android.content.Intent;     import android.location.Address;     import android.location.Geocoder;     import android.location.Location;     import android.location.LocationListener;     import android.location.LocationManager;     import android.os.Bundle;     import android.os.CountDownTimer;     import android.os.IBinder;     import android.os.Looper;     import android.util.Log;     import android.widget.Toast;    public class GpsService extends Service{            private Long counter = 0L;         private Timer timer = new Timer();        private final Calendar time = Calendar.getInstance();        private LocationManager locationManager;        private Location currentLocation;       @Override        public IBinder onBind(Intent intent) {    // TODO Auto-generated method stub    return null;}@Overridepublic void onCreate() {    super.onCreate();    /*Intent intent = new Intent(this, RepeatingAlarmReceiver.class);    PendingIntent pendingIntent = PendingIntent.getService(getApplicationContext(), 0, intent, 0);    AlarmManager alarmManager = (AlarmManager) getSystemService(ALARM_SERVICE);    alarmManager.setRepeating(AlarmManager.RTC_WAKEUP, System.currentTimeMillis() + (5 * 1000), 10 * 1000,pendingIntent);    Toast.makeText(this, ""Alarm set"", Toast.LENGTH_LONG).show();    */    try    {        _startService();        //Set Starting point of latitude and longitude        /*        counter=0L;        new CountDownTimer(3000, 1000) {             public void onTick(long millisUntilFinished) {                 locationManager=(LocationManager)getSystemService(LOCATION_SERVICE);                locationManager.requestLocationUpdates(""gps"", (long)30000, (float) 10.0, new LocationListener()                {                    public void onLocationChanged(Location arg0)                     {                            counter++;                            System.out.println(counter);                            handleLocationChanged(arg0);                            /*                            System.out.println(""latitude""+lati.get(0).toString());                            System.out.println(""langitude""+lati.get(1).toString());                            /*                            if(counter==1)                            {                                checklatAt0=getLatitude();                                checklonat0=getLongitude();                                 System.out.println(""Latitude At 0""+checklatAt0);                                System.out.println(""Longitude At 0""+checklonat0);                            }                               if(counter==300)                            {                                checklatAt300=getLatitude();                                checklonat300=getLongitude();                                System.out.println(""Latitude At 300""+checklatAt300);                                System.out.println(""Longitude At 300""+checklonat300);                                counter = 0L;                            }                              System.out.println(counter);                           counter++;            }            public void onProviderDisabled(String arg0) {                // TODO Auto-generated method stub            }            public void onProviderEnabled(String arg0) {                // TODO Auto-generated method stub            }            public void onStatusChanged(String arg0, int arg1, Bundle arg2) {                // TODO Auto-generated method stub            }        });                //mTextField.setText(""seconds remaining: "" + millisUntilFinished / 1000);             }             public void onFinish() {                 //mTextField.setText(""done!"");             }          }.start();         */    /*        timer.scheduleAtFixedRate(                new TimerTask(){                     public void run()                     {            /// Subscribe to the location manager's updates on the current location                        locationManager.requestLocationUpdates(""gps"", (long)30000, (float) 10.0, new LocationListener()                        {                            public void onLocationChanged(final Location arg0)                             {                                    ArrayList lati=handleLocationChanged(arg0);                                    System.out.println(lati.get(0).toString());                                    System.out.println(lati.get(1).toString());                                    if(counter==1)                                    {                                        checklatAt0=getLatitude();                                        checklonat0=getLongitude();                                         System.out.println(""Latitude At 0""+checklatAt0);                                        System.out.println(""Longitude At 0""+checklonat0);                                    }                                       if(counter==300)                                    {                                        checklatAt300=getLatitude();                                        checklonat300=getLongitude();                                        System.out.println(""Latitude At 300""+checklatAt300);                                        System.out.println(""Longitude At 300""+checklonat300);                                        counter = 0L;                                    }                                      System.out.println(counter);                                   counter++;                    }                    public void onProviderDisabled(String arg0) {                        // TODO Auto-generated method stub                    }                    public void onProviderEnabled(String arg0) {                        // TODO Auto-generated method stub                    }                    public void onStatusChanged(String arg0, int arg1, Bundle arg2) {                        // TODO Auto-generated method stub                    }                });                    }                        }, 0, 1000L);    */    }    catch(Exception e)    {        e.printStackTrace();    }}private void _startService() {    counter=0L;    timer.scheduleAtFixedRate(          new TimerTask() {            public void run() {              counter++;              getLocatonUpdate(getApplicationContext());            }          },          0,          1000);      Log.i(getClass().getSimpleName(), ""Timer started!!!"");    }@Overridepublic void onDestroy() {    super.onDestroy();    // Cancel the persistent notification.    Toast.makeText(this, ""Service destroyed at "" + time.getTime() + ""; counter is at: "" + counter, Toast.LENGTH_LONG).show();}public void getLocatonUpdate(Context c){    locationManager=(LocationManager)c.getSystemService(c.LOCATION_SERVICE);    locationManager.requestLocationUpdates(""gps"", (long)30000, (float) 10.0, new LocationListener()    {        public void onLocationChanged(Location arg0)         {                System.out.println(counter);                handleLocationChanged(arg0);        }        public void onProviderDisabled(String arg0) {        // TODO Auto-generated method stub    }    public void onProviderEnabled(String arg0) {        // TODO Auto-generated method stub    }    public void onStatusChanged(String arg0, int arg1, Bundle arg2) {    // TODO Auto-generated method stub    }    });}private void handleLocationChanged(Location loc){        this.currentLocation = loc;        // Update the latitude &amp; longitude TextViews        System.out.println(Double.toString(loc.getLatitude()));        System.out.println(Double.toString(loc.getLongitude()));    } }</code></pre><p>And this is exception</p><pre><code>       02-11 19:05:06.930: ERROR/AndroidRuntime(614): FATAL EXCEPTION: Timer-0      02-11 19:05:06.930: ERROR/AndroidRuntime(614): java.lang.RuntimeException: Can't           create handler inside thread that has not called Looper.prepare()      02-11 19:05:06.930: ERROR/AndroidRuntime(614):     at android.os.Handler.&lt;init&gt;         (Handler.java:121)      02-11 19:05:06.930: ERROR/AndroidRuntime(614):     at        android.location.LocationManager$ListenerTransport$1.&lt;init&gt;(LocationManager.java:173)      02-11 19:05:06.930: ERROR/AndroidRuntime(614):     at       android.location.LocationManager$ListenerTransport.&lt;init&gt;(LocationManager.java:173)     02-11 19:05:06.930: ERROR/AndroidRuntime(614):     at       android.location.LocationManager._requestLocationUpdates(LocationManager.java:579)    02-11 19:05:06.930: ERROR/AndroidRuntime(614):     at      android.location.LocationManager.requestLocationUpdates(LocationManager.java:446)    02-11 19:05:06.930: ERROR/AndroidRuntime(614):     at     com.excerciseTest.GpsService.getLocatonUpdate(GpsService.java:262)   02-11 19:05:06.930: ERROR/AndroidRuntime(614):     at      com.excerciseTest.GpsService$1.run(GpsService.java:239)   02-11 19:05:06.930: ERROR/AndroidRuntime(614):     at     java.util.Timer$TimerImpl.run(Timer.java:284)</code></pre>","461503","","318508","","2011-02-11 17:55:04","2011-02-12 01:38:23","Cant Create handler inside thread problem in gps detetction","<android>","2","0","","",""
"4969740","1","","","2011-02-11 13:49:51","2","1446","<p>I have a TabHost with 4 tabs. I need only the selected tab activity to be available on the stack. When user changes the tab, how to finish the activity under previous tab. I tried the following code. Here showing code for first tab. It similar for remaining tabs: </p><pre><code>spec = tabHost.newTabSpec(""tab1"").setIndicator(""Tab1"",             res.getDrawable(R.drawable.ic_tab_tab1))                    .setContent(new Intent(this, Tab1.class)                    .addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY | Intent.FLAG_ACTIVITY_CLEAR_TOP));</code></pre><p>But the above code is deleting the Tab1 Activity on stack/heap only when the user comes again to that tab but not when user changes to new tab.</p>","607741","","","","","2011-02-11 21:20:53","Android TabHost with only selected tab on stack","<android><android-tabhost>","1","0","","",""
"4969845","1","","","2011-02-11 14:00:29","0","372","<p>I have <code>ScrollView</code> with <code>LinearLayout</code>. In <code>LinearLayout</code> I am adding <code>WebView</code> with scrollable content. In <code>LinearLayout</code> I have some buttons. I want to implement both functionality vertical scroll and swipe from left to right. Can anybody tell me how to do that?</p>","426344","","84631","","2012-05-27 13:03:53","2012-05-27 13:03:53","ScrollView with swipe and scroll","<android>","1","0","","",""
"4969867","1","4969896","","2011-02-11 14:02:12","1","1216","<p>I put extensive logging in apps to ease debugging, but I want to ensure only the minimum goes into the production application. My understanding is that the compiler doesn't remove unused code, there's no conditional compilation with Android, but Proguard will remove unused code. Here's a sample tracing class:</p><pre><code>public class Trace{  public static final int logginglevel = 5;  public static final boolean errors = logginglevel &gt; 1;  public static final boolean warnings = logginglevel &gt; 2;  public static final boolean info = logginglevel &gt; 3;  public static final boolean debug = logginglevel &gt; 4;}</code></pre><p>Then in the application itself log like this:</p><pre><code>if (Trace.debug) Log.d(TAG,""problem"")</code></pre><p>Will this succeed in allowing Proguard to identify the unused statements and remove them? This statement is pretty ugly, but it's the shortest I can see that it can be.</p><p>Is there a more succinct way to include logging in an Android app, but have it automatically stripped out for the production build? I suspect it's possible to configure Proguard itself to remove specific aspects of the code, but not sure if that's a better solution than this.</p>","477415","","","","","2011-06-02 16:10:20","How to add logging to Android Java app that is stripped out by Proguard?","<java><android><proguard>","2","0","1","",""
"4969895","1","","","2011-02-11 14:03:39","1","599","<p>Where can I got it got to implement in my project to generate unique IDs in the same ways.</p>","613150","","","","","2011-02-12 06:46:58","How the R.java file generate unique id for resources","<android>","1","1","2","",""
"4969923","1","","","2011-02-11 14:07:17","1","1136","<p>I try to make my first android app !I call a webservice with ksoap2 to get details of my account.I have a function witch return a Array (resultRequestSOAP).In the resultRequestSOAP  there is an ARRAY of object.Below my function :</p><pre><code>    public Array listall(String session){    final String SOAP_ACTION = ""http://www.nubio.net/soap/vps#listAll"";    final String METHOD_NAME = ""listAll"";    final String NAMESPACE = ""http://www.nubio.net/soap/vps"";    final String URL = ""http://www.nubio.net/soap/vps"";    Array myArray = null;    SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);    //SoapObject     request.addProperty(""session"",session);    SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);    envelope.setOutputSoapObject(request);    HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);    try         {            androidHttpTransport.call(SOAP_ACTION, envelope);            resultRequestSOAP =  envelope.getResponse();            //retour = resultRequestSOAP.toString();            if(resultRequestSOAP != null){               myArray = (Array)resultRequestSOAP;             }        }    catch (Exception aE)        {    aE.printStackTrace ();;        }    return myArray;}</code></pre><p>I test the function to return string and it's works fine, but i need to show the array on the screen.How can i display the array in the resultRequestSOAP; ?But the original return of the soap in resultRequestSOAP; is :</p><pre><code>array(   0 =&gt; Object{     vps_id      : int     ip          : string     hostname    : string     password    : string (optional)     os          : string     os_arch     : integer     os_distri   : string     expire      : string (DATE TIME)   },   ...)</code></pre><p>So i can i return the array from the soap and display it!?I'm sorry for my english, i hope you could help me :)The best for me will only display the ""hostname string"" from the array as button is it possible?</p>","613152","","180538","","2011-02-13 12:44:11","2011-02-13 12:44:11","Need help to display the return of SOAP request from webservice","<java><android><object><soap>","2","3","1","",""
"4969948","1","","","2011-02-11 14:10:01","1","1569","<p>We received stack trace of InstantiationException while creating instance of Activity. Log has <code>newInstance failed: no &lt;init&gt;()</code> message</p><p>The situation is quite clear: VM can't find default parameterless constructor. This is explained in <a href=""http://stackoverflow.com/questions/2120699/newinstance-failed-no-init"">this thread</a></p><p>As my research shown people usually receive this when they add parameters to constructors of their Activities, which definitely is bad. But this is not our case - we always have access to default constructor. Another reason of that exception could be another exception while initializing some member(initialiation is run in default constructor, right?) - but again we don't do that. All members are initialized in onCreate() method.</p><p>Some details(names changed):activity is added to AndroidManifest.xml:</p><pre><code>&lt;manifest    package=""app.name""    ....&gt;    ....    &lt;activity        android:name=""app.name.activity.OurActivity""        android:label=""@string/NAME""&gt;    &lt;/activity&gt;</code></pre><p>Now the way that we create the intent may look strange, but it works in every case:</p><pre><code>Context packageContext = layoutInflater.getContext().createPackageContext(""app.name"", 0);Intent intent = new Intent(packageContext, OurActivity.class);...startActivity(intent);</code></pre><p>I would think that this could be a problem, but:1) this works fine for months2) same client got same exception in another activity which is start using activity as a context;</p><p>I can't reproduce the exception to understand/fix it. But somehow one of our clients got it. He has Droid ERIS(Verizon) device</p><p>Any thoughts? Is there any case I don't know about when VM will not find the default constructor?</p>","613036","","613036","","2011-02-11 16:00:42","2011-06-19 00:03:13","InstantiationException, newInstance failed: no <init>, while there is only default constructor in Activity","<android><instantiationexception>","0","2","","",""
"4970045","1","","","2011-02-11 14:19:20","1","929","<p>I have a simple webview with javascript enabled. And I am loading a web page inside that. Page has a javascript function which emits the window.innerWidth and window.innerHeight. When I run this on Nexus one, innerWidth and innerHeight are coming 313x533. But when I load that page in android browser then they're coming 320x452.<br>I couldn't find any reasonable explanation for that. In my html page I have declared the following viewport.<br><code>&lt;meta name=""viewport"" content=""width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"" /></code></p>","195802","","","","","2012-01-04 12:05:33","Android WebView's window.innerWidth is coming 313","<android><webview>","1","0","1","",""
"4970062","1","","","2011-02-11 14:20:58","20","1821","<p>Can anyone tell me how to run <strong>ndk-gdb</strong> from within emacs using <strong>gdb-mode</strong>?  I'm currently running it in a <em>shell</em> buffer. What I'd love to have is a way to automatically sync a source file buffer with the current pc in gdb when I break or step. Anything more, like setting breaks from source, buffers that show gdb locals etc., and key shortcuts for gdb commands would be gravy.</p><p>Background: I'm developing in GNU Emacs 23.1.90.1 (i386-apple-darwin10.5.0, NS apple-appkit-1038.35) of 2010-12-15 on OSX 10.6.6 with android-mode, using android-ndk-r5b and mixed java/c/c++ code for an android target. </p><p>Android-mode and shell (running ndk-gdb) within emacs allow me to see just about everything I need, but my setup would be more convenient if I could get a source buffer to sync with the debugger, or get the equivalent of what is described in EmacsWiki <a href=""http://www.emacswiki.org/emacs/GdbMode"">here</a>.</p><p>FYI, I'm currently using eclipse for java side debugging and development, but finding it unstable and difficult to set up for native work, despite the availability of <a href=""http://www.eclipse.org/sequoyah/"">sequoyah</a>, and besides, eclipse is no emacs.</p><p>[Appended]</p><p>Running M-x gdb with ndk-gdb as the gdb command (see below) results in a buffer called <em>gud</em> with a modeline saying ""(Debugger:run [initializing...])"".  The buffer does not accept gdb commands, nor does it accept emacs gdb commands - (M-s, M-n etc result in &lt;></p><p>Output: </p><pre>Current directory is /Users/jpschelter/Android NDK installation path: /Developer/android-ndk-r5bUsing specific adb command: /Developer/android-sdk-mac_x86/platform-tools/adb...... ......(no debugging symbols found)warning: Unable to find dynamic linker breakpoint function.GDB will be unable to debug shared library initializersand track explicitly loaded dynamic code.0xafd0e21c in nanosleep () from /Developer/Projects/ECS/DIGG/Projects/droid/obj/local/armeabi/libc.so(gdb) Undefined command: ""1-inferior-tty-set"".  Try ""help"".(gdb) Undefined command: ""2-gdb-set"".  Try ""help"".(gdb) Undefined command: ""3-gdb-set"".  Try ""help"".(gdb) Undefined command: ""4-file-list-exec-source-files"".  Try ""help"".(gdb) Undefined command: ""5-file-list-exec-source-file"".  Try ""help"".(gdb) Undefined command: ""6-gdb-show"".  Try ""help"".(gdb) Undefined command: ""7-stack-info-frame"".  Try ""help"".(gdb) Undefined command: ""8-thread-info"".  Try ""help"".(gdb) Undefined command: ""9-break-list"".  Try ""help"".</pre><p>Buffers called <code>*threads of*</code>, <code>*input/output of*</code> and <code>*breakpoints of*</code> are also created, but are empty.</p><p>Browsing through the gdb-mi.el source of my emacs, and comparing to the <strong>gdb-debug-log</strong> output, it looks like gdb-mi is trying to send these parameters to a gdb executable, but gdb-server is not responding to the commands as expected? </p><p>Note that running M-x gud-gdb with the command-line for ndk-gdb seems to result in the equivalent of running ndk-gdb within a shell, so the issue seems to be within the configuration of gdb-mode in emacs.</p>","322759","","322759","","2011-03-07 15:39:20","2012-08-11 06:03:13","Integration of android ndk's ndk-gdb with emacs?","<android><emacs><gdb><android-ndk>","2","1","5","",""
"4970068","1","9299368","","2011-02-11 14:21:49","3","1801","<p>I'm writing an app that needs to write events to a calendar in the background, without input from the user once the app has been setup. This means that the methods where the event is created using Intents is not what I am after.</p><p>I found this code on a website, but it doesn't work:</p><pre><code>    long start = 1297512000; // 2011-02-12 12h00    long end = 1297515600;   // 2011-02-12 13h00    String title = ""TEST ENTRY - DELETE ME!!"";     ContentValues cvEvent = new ContentValues();    cvEvent.put(""calendar_id"", 1);    cvEvent.put(""title"", title);    cvEvent.put(""dtstart"", start );    //cvEvent.put(""hasAlarm"", 1);    cvEvent.put(""dtend"", end);    getContentResolver().insert(Uri.parse(""content://com.android.calendar/events""), cvEvent);</code></pre><p>Now, before anybody wades in with the ""Google HIGHLY recommend you don't use this method"" or such like, I already know this.</p><p>Has anyone got this working? I'm running Gingerbread on my device, so that may cause an issue!</p><p>The only alternative I've found is to use the GData APIs, but then I need to authenticate which is why the above is better.... there are apps out there that need no authentication so they must be using this too! :)</p><p>If anyone can help, please do!</p><p>ThanksNeil</p>","67419","","67419","","2011-02-11 14:27:31","2012-02-15 18:47:58","Add Calendar Event in Android App","<android><google-calendar>","3","2","1","",""
"4970085","1","4970086","","2011-02-11 12:21:52","4","88","<p>I have released <a href=""http://fixedpointcode.blogspot.com"" rel=""nofollow"">an app</a> on the market with minSDK set to 4 (Android 1.6) but now I want to release an update with features unavailable in 1.6 so I need a higher minSDK.</p><p>So, my question is:Will users running 1.6 be notified of this update?...and if yes will they be able to download/install it?</p>","338449","Mircea Nistor","19750","","2011-09-05 13:31:47","2011-09-05 13:31:47","What if I want to release an update with higher minSDK than the one on the market?","<android><google-play>","1","1","","",""
"4970160","1","","","2011-02-11 14:31:08","1","888","<p>In my application I'm using the following custom attribute for a custom view:</p><pre><code>&lt;attr name=""direction""&gt;    &lt;enum name=""up"" value=""1"" /&gt;    &lt;enum name=""down"" value=""2"" /&gt;&lt;/attr&gt;</code></pre><p>The thing is that in my custom view I must compare the current direction with the possible ones. Is there a way to access the values for the up &amp; down attributes?</p><p>Thanks a lot,</p><p>Gratzi</p>","460611","","","","","2011-02-11 17:31:33","Using the custom enum attributes values","<android>","1","0","","",""
"4970165","1","4971562","","2011-02-11 14:31:39","1","2320","<p>So in my layout, I've got two buttons on the same line, one left aligned and one right aligned. I also have TextViews above the buttons to serve as labels, but they too are aligned left and right respectively. I'd like them to instead be centered above the buttons and on the same line as one another, but I can't figure out how to do this without explicitly setting coordinates, which will then break on some phones. I tried setting various weights and layout options, but it just doesn't work how I'd like. Is there a way to do this in a RelativeLayout? Or maybe it's just not possible.</p><p>Thanks in advance.</p>","483402","","","","","2012-03-19 09:18:44","RelativeLayout Two TextViews Centered Above Buttons","<android><textview><relativelayout>","2","0","","",""
"4970204","1","4976327","","2011-02-11 14:35:01","9","5112","<p>I'm playing text with android TTS - <code>android.speech.tts.TextToSpeech</code></p><p>I use: <code>TextToSpeech.speak</code> to speak and <code>.stop</code> to stop. Is there a way to pause the text also?</p>","345859","","1304064","","2012-08-14 22:25:14","2013-05-22 10:27:25","How to pause android.speech.tts.TextToSpeech?","<android><text-to-speech>","6","0","5","",""
"4970224","1","5015203","","2011-02-11 14:36:53","0","726","<p>I have a <code>WebView</code> where the user can click on links and it will load these url inside this <code>WebView</code>. All is fine until i set the following:</p><pre><code>myWebView.getSettings().setLayoutAlgorithm(LayoutAlgorithm.SINGLE_COLUMN);  </code></pre><p>The reason i'm using this, as it will fit all the content on screen (which i actually just need for images).  </p><p>It will kill my current activity and restarts the previous. The log looks like this:  </p><pre><code>02-11 14:32:39.717: INFO/DEBUG(27): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***02-11 14:32:39.717: INFO/DEBUG(27): Build fingerprint: 'generic/google_sdk/generic/:2.1/ERD79/22607:eng/test-keys'02-11 14:32:39.727: INFO/DEBUG(27): pid: 298, tid: 312  &gt;&gt;&gt; com.mypackage &lt;&lt;&lt;02-11 14:32:39.727: INFO/DEBUG(27): signal 11 (SIGSEGV), fault addr 0000000402-11 14:32:39.738: INFO/DEBUG(27):  r0 004e6731  r1 00000014  r2 00000001  r3 004e667c02-11 14:32:39.738: INFO/DEBUG(27):  r4 00000004  r5 004e6740  r6 00000000  r7 0000000002-11 14:32:39.748: INFO/DEBUG(27):  r8 45365d88  r9 426b8f1c  10 426b8f04  fp 002d919802-11 14:32:39.748: INFO/DEBUG(27):  ip 00000000  sp 45364784  lr aa17a1b7  pc aa17e856  cpsr 0000003002-11 14:32:40.147: INFO/DEBUG(27):          #00  pc 0017e856  /system/lib/libwebcore.so02-11 14:32:40.157: INFO/DEBUG(27):          #01  lr aa17a1b7  /system/lib/libwebcore.so02-11 14:32:40.177: INFO/DEBUG(27): code around pc:02-11 14:32:40.187: INFO/DEBUG(27): aa17e844 e69eda00 f7ffa813 6f22fb91 b0216ea6 02-11 14:32:40.187: INFO/DEBUG(27): aa17e854 59a00094 1c27bdf0 683b378c 22019903 02-11 14:32:40.187: INFO/DEBUG(27): aa17e864 18471ad0 971b2000 2f00901a da009708 02-11 14:32:40.187: INFO/DEBUG(27): code around lr:02-11 14:32:40.197: INFO/DEBUG(27): aa17a1a4 28004798 1c28d00f fad0f7c4 f0041c28 02-11 14:32:40.197: INFO/DEBUG(27): aa17a1b4 9b05f9b1 181f9903 29009705 1c28d00d 02-11 14:32:40.197: INFO/DEBUG(27): aa17a1c4 fc68f003 6828e009 680230ac 47901c28 02-11 14:32:40.197: INFO/DEBUG(27): stack:02-11 14:32:40.197: INFO/DEBUG(27):     45364744  004e67e0  [heap]02-11 14:32:40.197: INFO/DEBUG(27):     45364748  00422618  [heap]02-11 14:32:40.197: INFO/DEBUG(27):     4536474c  aa17d25b  /system/lib/libwebcore.so02-11 14:32:40.197: INFO/DEBUG(27):     45364750  00000000  02-11 14:32:40.197: INFO/DEBUG(27):     45364754  00000000  02-11 14:32:40.207: INFO/DEBUG(27):     45364758  004e6740  [heap]02-11 14:32:40.207: INFO/DEBUG(27):     4536475c  004e67e0  [heap]02-11 14:32:40.207: INFO/DEBUG(27):     45364760  004e6740  [heap]02-11 14:32:40.207: INFO/DEBUG(27):     45364764  00000000  02-11 14:32:40.207: INFO/DEBUG(27):     45364768  aa17cc95  /system/lib/libwebcore.so02-11 14:32:40.207: INFO/DEBUG(27):     4536476c  aa17f1e9  /system/lib/libwebcore.so02-11 14:32:40.207: INFO/DEBUG(27):     45364770  00000000  02-11 14:32:40.217: INFO/DEBUG(27):     45364774  00000000  02-11 14:32:40.217: INFO/DEBUG(27):     45364778  df002777  02-11 14:32:40.217: INFO/DEBUG(27):     4536477c  e3a070ad  02-11 14:32:40.217: INFO/DEBUG(27):     45364780  004e667c  [heap]02-11 14:32:40.217: INFO/DEBUG(27): #00 45364784  004e667c  [heap]02-11 14:32:40.217: INFO/DEBUG(27):     45364788  004e6740  [heap]02-11 14:32:40.217: INFO/DEBUG(27):     4536478c  00000000  02-11 14:32:40.237: INFO/DEBUG(27):     45364790  00000000  02-11 14:32:40.237: INFO/DEBUG(27):     45364794  aa17a1b7  /system/lib/libwebcore.so02-11 14:32:40.237: INFO/DEBUG(27):     45364798  00000000  02-11 14:32:40.247: INFO/DEBUG(27):     4536479c  004e63d0  [heap]02-11 14:32:40.247: INFO/DEBUG(27):     453647a0  00000000  02-11 14:32:40.257: INFO/DEBUG(27):     453647a4  00000001  02-11 14:32:40.257: INFO/DEBUG(27):     453647a8  ffffffff  02-11 14:32:40.289: INFO/DEBUG(27):     453647ac  00000000  02-11 14:32:40.289: INFO/DEBUG(27):     453647b0  00332640  [heap]02-11 14:32:40.289: INFO/DEBUG(27):     453647b4  00000001  02-11 14:32:40.297: INFO/DEBUG(27):     453647b8  00000000  02-11 14:32:40.307: INFO/DEBUG(27):     453647bc  004e667c  [heap]02-11 14:32:40.307: INFO/DEBUG(27):     453647c0  00000000  02-11 14:32:40.307: INFO/DEBUG(27):     453647c4  00000000  02-11 14:32:40.307: INFO/DEBUG(27):     453647c8  00000000  02-11 14:32:42.638: INFO/DEBUG(27): debuggerd committing suicide to free the zombie!</code></pre><p>It looks like a bug in Android, does anyone know a workaround?</p>","571088","","","","","2011-02-16 10:23:42","Webview crashes when using LayoutAlgorithm.SINGLE_COLUMN","<android><webview>","1","0","","",""
"4970334","1","4973294","","2011-02-11 14:47:38","1","520","<p>How often does android requests location updates? For example if you add a proximity alert to a location manager how often will it update the location? </p><p>In the documentation it says: ""In case the screen goes to sleep, checks for proximity alerts happen only once every 4 minutes. This conserves battery life by ensuring that the device isn't perpetually awake"" </p><p>But what if the screen doesn't go to sleep?</p><p>Thanks in advance</p><p>Mike</p>","582665","","","","","2011-02-11 19:42:42","How often does android requests location updates?","<android><geolocation><coordinates><locationmanager><proximity>","1","0","","",""
"4970353","1","","","2011-02-11 14:49:30","0","902","<p>I write a REST WCF RIA Silverlight 4.0 compatible service, that I can access sucessfully from a javascript + jQuery.1.4.2.js + JSON2.js (and, of course, from .NET 4.0 applications)</p><p>Basically, what I'm doing in my Android activity is:</p><pre><code>            HttpPost request = new HttpPost(SERVICE_URI + ""/SubmitChanges"");                     request.setHeader(""Accept"", ""application/json; charset=utf-8"");                     request.setHeader(""Content-type"", ""application/json; charset=utf-8"");        // Build JSON string                    JSONStringer myTable = new JSONStringer()        .object()        .key(""changeSet"")        .array()            .object()            .key(""Id"").value(0)            .key(""Entity"")                .object()                    .key(""__type"").value(""MyTable:#MyServiceApp.Web"")                    .key(""ID"").value(21)                .endObject()            .key(""Operation"").value(4)            .endObject()        .endArray()        .endObject();        Log.d(""WebInvoke"", ""MyTable : "" + myTable.toString());                                   StringEntity entity = new StringEntity(myTable.toString());//          entity.setContentType(""application/json; charset=utf-8""); //          entity.setContentEncoding(new BasicHeader(HTTP.CONTENT_TYPE,""application/json; charset=utf-8""));             request.setEntity(entity);            Log.d(""WebInvoke"", ""Entity : "" + entity.toString());                                       // Send request to WCF service                         DefaultHttpClient httpClient = new DefaultHttpClient();            httpClient.getCredentialsProvider().setCredentials(new AuthScope(null,-1), new UsernamePasswordCredentials(""myuser"",""mypassword""));//          HttpClientParams myParam = (HttpClientParams) httpClient.getParams();//          Log.d(""WebInvoke"", ""Entity : "" + myParam.toString());                                       HttpResponse response = httpClient.execute(request);              </code></pre><p>When turned to Android app, I noted that I cannot do PUT's operations (GETs worked OK). They returned error 400 - Bad requestAs it worked OK on js, I used fiddler2 to see what's happend. When I setup the emulator to work throught fiddler proxy, suddenly, the request has turned OK. Then I tryed again without proxy, and it returned to error 400. I tryed also uploading the apk to my Galaxy S and connecting through web. Again, GETs works, but PUTs don't...</p><p>Any ideas?</p><p>Saludos,     OSCAR.</p><p>UPDATE</p><p>This is previous to execute request without proxy</p><pre><code>request HttpPost  (id=830085521536)     aborted false    abortLock   ReentrantLock  (id=830085616656)    connRequest null    entity  StringEntity  (id=830085531688)    headergroup HeaderGroup  (id=830085644864)    params  null    releaseTrigger  null    uri URI  (id=830085878840)httpClient  DefaultHttpClient  (id=830085612544)        connManager null    cookieStore BasicCookieStore  (id=830085604904)    credsProvider   BasicCredentialsProvider  (id=830085612624)    defaultParams   null    httpProcessor   null    keepAliveStrategy   null    log Jdk14Logger  (id=830085596488)    proxyAuthHandler    null    redirectHandler null    requestExec null    retryHandler    null    reuseStrategy   null    routePlanner    null    supportedAuthSchemes    null    supportedCookieSpecs    null    targetAuthHandler   null    userTokenHandler    null</code></pre><p>This is posterior to execute request without proxy</p><pre><code>request HttpPost  (id=830085521536)     aborted false    abortLock   ReentrantLock  (id=830085616656)    connRequest null    entity  StringEntity  (id=830085531688)    headergroup HeaderGroup  (id=830085644864)    params  BasicHttpParams  (id=830085486480)    releaseTrigger  SingleClientConnManager$ConnAdapter  (id=830085855888)    uri URI  (id=830085878840)httpClient  DefaultHttpClient  (id=830085612544)        connManager SingleClientConnManager  (id=830085927648)    cookieStore BasicCookieStore  (id=830085604904)    credsProvider   BasicCredentialsProvider  (id=830085612624)    defaultParams   BasicHttpParams  (id=830085575968)    httpProcessor   BasicHttpProcessor  (id=830085617496)    keepAliveStrategy   DefaultConnectionKeepAliveStrategy  (id=830085544576)    log Jdk14Logger  (id=830085596488)    proxyAuthHandler    DefaultProxyAuthenticationHandler  (id=830085951384)    redirectHandler DefaultRedirectHandler  (id=830085524448)    requestExec HttpRequestExecutor  (id=830085525992)    retryHandler    DefaultHttpRequestRetryHandler  (id=830085583064)    reuseStrategy   DefaultConnectionReuseStrategy  (id=830085882544)    routePlanner    DefaultHttpRoutePlanner  (id=830085880096)    supportedAuthSchemes    AuthSchemeRegistry  (id=830085650400)    supportedCookieSpecs    CookieSpecRegistry  (id=830085516320)    targetAuthHandler   DefaultTargetAuthenticationHandler  (id=830085583264)    userTokenHandler    DefaultUserTokenHandler  (id=830085486432)response    BasicHttpResponse  (id=830085980112)        entity  BasicManagedEntity  (id=830085983552)    headergroup HeaderGroup  (id=830085625184)    locale  Locale  (id=830085944016)    params  ClientParamsStack  (id=830085486448)    reasonCatalog   EnglishReasonPhraseCatalog  (id=830004383520)    statusline  BasicStatusLine  (id=830085625160)</code></pre><p>This is previous to execute request with proxy</p><pre><code>request HttpPost  (id=830085966120)     aborted false       abortLock   ReentrantLock  (id=830085966520)        connRequest null        entity  StringEntity  (id=830085971592)     headergroup HeaderGroup  (id=830085966392)      params  null        releaseTrigger  null        uri URI  (id=830085966568)  httpClient  DefaultHttpClient  (id=830085973896)        connManager null        cookieStore BasicCookieStore  (id=830085974504)     credsProvider   BasicCredentialsProvider  (id=830085974144)     defaultParams   null        httpProcessor   null        keepAliveStrategy   null        log Jdk14Logger  (id=830085974120)      proxyAuthHandler    null        redirectHandler null        requestExec null        retryHandler    null        reuseStrategy   null        routePlanner    null        supportedAuthSchemes    null        supportedCookieSpecs    null        targetAuthHandler   null        userTokenHandler    null    </code></pre><p>This is posterior to execute request with proxy</p><pre><code>request HttpPost  (id=830085966120)     aborted false       abortLock   ReentrantLock  (id=830085966520)        connRequest null        entity  StringEntity  (id=830085971592)     headergroup HeaderGroup  (id=830085966392)      params  BasicHttpParams  (id=830085980824)      releaseTrigger  SingleClientConnManager$ConnAdapter  (id=830085981992)      uri URI  (id=830085966568)  httpClient  DefaultHttpClient  (id=830085973896)        connManager SingleClientConnManager  (id=830085978144)      cookieStore BasicCookieStore  (id=830085974504)     credsProvider   BasicCredentialsProvider  (id=830085974144)     defaultParams   BasicHttpParams  (id=830085977232)      httpProcessor   BasicHttpProcessor  (id=830085978848)       keepAliveStrategy   DefaultConnectionKeepAliveStrategy  (id=830085978816)       log Jdk14Logger  (id=830085974120)      proxyAuthHandler    DefaultProxyAuthenticationHandler  (id=830085980560)        redirectHandler DefaultRedirectHandler  (id=830085980152)       requestExec HttpRequestExecutor  (id=830085976912)      retryHandler    DefaultHttpRequestRetryHandler  (id=830085980128)       reuseStrategy   DefaultConnectionReuseStrategy  (id=830085978800)       routePlanner    DefaultHttpRoutePlanner  (id=830085978832)      supportedAuthSchemes    AuthSchemeRegistry  (id=830085975792)       supportedCookieSpecs    CookieSpecRegistry  (id=830085976320)       targetAuthHandler   DefaultTargetAuthenticationHandler  (id=830085980344)       userTokenHandler    DefaultUserTokenHandler  (id=830085980776)  response    BasicHttpResponse  (id=830085927240)        entity  BasicManagedEntity  (id=830085863688)       headergroup HeaderGroup  (id=830085944256)      locale  Locale  (id=830085944272)       params  ClientParamsStack  (id=830085980792)        reasonCatalog   EnglishReasonPhraseCatalog  (id=830004383520)       statusline  BasicStatusLine  (id=830085927216)  </code></pre>","613223","","613223","","2011-02-14 01:17:12","2012-02-01 08:47:51","Weird httpPost behavoir (may be json, auth, proxy related) GET works, POST works, but not without proxy (partially solved)","<java><android><authentication><post><httpclient>","3","0","","",""
"4970366","1","4970844","","2011-02-11 14:51:08","1","587","<p>I'm trying to make a mobile mashup of existing apps</p><p>Got Default Android System Camera App for 2.2 Froyo from<a href=""http://android.git.kernel.org/?p=platform/packages/apps/Camera.git;a=summary"" rel=""nofollow"">http://android.git.kernel.org/?p=platform/packages/apps/Camera.git;a=summary</a> Works and compiles great</p><p>Got Default Android System GALLERY App for 2.2 Froyo from<a href=""http://android.git.kernel.org/?p=platform/packages/apps/Gallery.git;a=summary"" rel=""nofollow"">http://android.git.kernel.org/?p=platform/packages/apps/Gallery.git;a=summary</a></p><p>Doesn't compile! Some errors -</p><p>local variables mLength, mHeight ... cannot be resolved</p><p>import android.provider.DrmStore;... cannot be resolved</p><p>How can I compile and run the default gallery app on Froyo? </p>","338825","","","","","2011-02-11 15:29:51","Default Android Gallery App doesn't compile :(","<android><system><default><gallery>","1","0","","",""
"4970372","1","","","2011-02-11 14:51:23","2","362","<p>I'm using a <code>VideoView</code> to play online videos (with streaming, http://... style) in my application.With 3G connectivity: on some videos (not all), i get immediatly the following error when the video starts : <code>ERROR/PlayerDriver(12039): Command PLAYER_INIT completed with an error or info PVMFFailure</code>When I switch to Wifi, all videos are fine.What can I do to prevent this error?Thanks.</p>","86121","","","","","2011-04-11 13:00:20","Android ERROR/PlayerDriver PVMFFailure on 3G but OK on Wifi","<android><wifi><videoview><3g>","0","0","2","",""
"4970386","1","","","2011-02-11 14:52:44","0","350","<p>I am new in android development and i am getting the following, when i am adding the login java code in the .java file. </p><p><strong>The application testlogin (process com.android.app.testlogin) has stopped unexpectedly. Please try again</strong></p><p>i have tryed and search for it but i cant find any type of solution for this error. i have task to complite in short time, so please help me. and provide some instructions for it. </p>","613208","","","","","2013-01-16 16:48:59","The application testlogin (process com.android.app.testlogin) has stopped unexpectedly. Please try again","<android>","0","2","1","",""
"4970509","1","","","2011-02-11 15:02:28","0","2064","<p>I want to receive json string every minute from https server. Emulator works nice, but on device my widget stops to update info (ignores new json strings) after about 30 minutes. First 30 minutes widget works perfectly.</p><p>Timer:</p><pre><code>public void run() {        client = new RestClient(""https://example.com/check_messages_new.php"");              if (userName != null)        {            client.AddParam(""user"", userName);            client.AddParam(""output"", ""json"");            try {                client.Execute(RequestMethod.GET);            } catch (Exception e) {                connect = false;                e.printStackTrace();            }        }</code></pre><p>RestClient.Execute():</p><pre><code>    response = new String[3];    response[0] = ""0"";    Log.d(LOG_TAG, ""response[0] set to 0"");    HttpParams httpParameters = new BasicHttpParams();    // Set the timeout in milliseconds until a connection is established.    int timeoutConnection = 5000;    HttpConnectionParams.setConnectionTimeout(httpParameters, timeoutConnection);    // Set the default socket timeout (SO_TIMEOUT)     // in milliseconds which is the timeout for waiting for data.    int timeoutSocket = 25000;    HttpConnectionParams.setSoTimeout(httpParameters, timeoutSocket);    HttpClient client = new DefaultHttpClient(httpParameters);    //HttpConnectionParams.setConnectionTimeout(client.getParams(), 25000);             HttpResponse httpResponse;    try {        httpResponse = client.execute(request);        responseCode = httpResponse.getStatusLine().getStatusCode();        message = httpResponse.getStatusLine().getReasonPhrase();        HttpEntity entity = httpResponse.getEntity();        if (entity != null) {            InputStream instream = entity.getContent();            response = convertStream(instream);            // Closing the input stream will trigger connection release            instream.close();        }    } catch (ClientProtocolException e)  {        response[0] = ""0"";        client.getConnectionManager().shutdown();        e.printStackTrace();    } catch (IOException e) {        response[0] = ""0"";        client.getConnectionManager().shutdown();        e.printStackTrace();    }}</code></pre><p>Thanks for help</p>","613238","","","","","2011-02-11 16:18:59","Timer and DefaultHttpClient","<android>","1","2","2","",""
"4970570","1","4970623","","2011-02-11 15:07:21","2","467","<p>Let's say I want my app to display a file browser.  Are there any significant advantages or disadvantages to having this file browser extend Dialog instead of extending Activity?  I was unable to to find anything useful in the documentation; any input?</p><p>Thanks</p>","426493","","","","","2011-03-28 05:15:00","Android: should I launch a new activity or show a dialog?","<android><activity><dialog>","1","0","","",""
"4970589","1","4970683","","2011-02-11 15:09:01","2","2666","<p>While Developing an ""hello world"" app for my brand new htc desire, i found something strange.</p><p>I can't execute my programm, it says: ""You can't do that with an error in your code"" or something ;)</p><p>i know eclipse. normally eclipse show me where the error is, in which file exactly, but if i look to the project browser, i get that image:<a href=""http://img404.imageshack.us/i/unbenanntdpe.png/"" rel=""nofollow"">http://img404.imageshack.us/i/unbenanntdpe.png/</a></p><p>and i just developed in 2 files:<a href=""http://pastebin.com/KfU2fH98"" rel=""nofollow"">http://pastebin.com/KfU2fH98</a></p><p>the error happend all off a sudden, can someone figure out what this mean?</p><p>thank you!</p>","527142","","","","","2011-02-11 15:15:53","Eclipse error in project, but i can't find it","<android><eclipse><adb>","1","1","","",""
"4970605","1","","","2011-02-11 15:10:18","1","1106","<p>I am programmatically creating a nested set of <code>PreferenceScreen</code>s. When the user dives into one of these screens, and taps something in there, I want to go back to the previous <code>PreferenceScreen</code>, (i.e. the ""parent"").</p><p>I couldn't find any information on this, and calling <code>finish()</code> doesn't do the job but rather returns from ALL the <code>PreferenceScreen</code>s instead of just one.</p>","609502","","29995","","2012-05-05 16:12:51","2012-05-05 16:12:51","Return from nested Android PreferenceScreen to previous PreferenceScreen","<android><nested><preferencescreen>","3","0","2","",""
"4970615","1","4970783","","2011-02-11 15:11:12","1","490","<p>My layout is like this</p><pre><code>Title LayoutListviewBottomLayout.</code></pre><p>I have an 150 item which i have custom layout which i want to add in listview.So my main problem is i want to add slowly slowly one by one that customlayouts in listview.So whenever the first screen is displayed i want load 10 items from server and add it to listview.then onscroll down i want to load the remaining 10 items from 150 cutom layouts.So how can I do this activity?</p>","537819","","244296","","2011-02-11 15:13:27","2011-02-11 15:24:17","Android ListView in Activity","<android><android-listview>","1","1","","",""
"4970651","1","4971539","","2011-02-11 15:13:25","2","509","<p>I am making an windows application which would send and receive information with an <strong>Android</strong> phone.</p><p>I need to make use of the <strong>wifi</strong> to do so ( <strong>win32api</strong> for <strong>python</strong> ).</p><p>The app. would be something like this:</p><p>The android screen would show the desktop screen.where ever you touch , a click would me made on the corresponding point on the actual desktop.This is the most basic thing. And if I figure out to do this i will be able to do the rest.</p><p>PLEASE SUGGEST.THANK YOU</p>","613254","","","","","2011-02-11 16:31:30","How to use wifi using python?","<python><android><winapi><wifi><pywin32>","1","2","","",""
"4970658","1","","","2011-02-11 15:14:04","2","1026","<p>I am currently playing around on the NDK for android, trying out the OpenGL ES 2.0 capabilities. But i don't know how to load an image into an OpenGL texture. My plan is to send a bitmap with the native function call and then use GLUt to make a texture out of it. So, how do i use GLUt in native code on the android platorm?</p><p>Or is this he wrong take on the problem?</p><p>(sorry for bad english).</p><p>Thanx in advance!</p>","613253","","297762","","2011-02-11 15:15:49","2011-02-11 16:01:06","How do a use GLUt in native code on android?","<android><jni><android-ndk><glut><opengl-es-2.0>","1","0","","",""
"4970761","1","4971366","","2011-02-11 15:22:28","0","1493","<p>What i'm trying to do:  ListView activity A, I touch an item, it opens a new listview activity.  I take the primary key from the database row selected in list A and use putExtra. In activity B, in onCreate I want to check and see if there is any row in Table B where the column TOPIC_CONTENT_TOPIC_ID has a value that equals the primary key from table A that was putExtra.  If the table is empty, or if there is no matching ID, i want to create a new row where column TOPIC_CONTENT_TOPIC_ID now equals the primary key from table A.  Here is my code.  It crashes on the db.query();</p><pre><code>public void onCreate(Bundle savedInstanceState){    super.onCreate(savedInstanceState);    setContentView(R.layout.topic_content);    dbMaker = new DatabaseMaker(this);    SQLiteDatabase db = dbMaker.getReadableDatabase();    Intent myIntent = getIntent();    int topicIDInt = (int) myIntent.getLongExtra(""com.spentakapps.ScripturalConcordance.Topics"", -1);    String topicID = Long.toString(myIntent.getLongExtra(""com.spentakapps.ScripturalConcordance.Topics"", -1));    String WHERE = DatabaseStructure.TOPICS_CONTENT_TOPIC_ID + "" = "" + topicID;    Cursor cur = db.query(DatabaseStructure.TABLE_TOPICS_CONTENT, new String[] {DatabaseStructure.TOPICS_CONTENT_CONTENT},WHERE, null, null, null, null);    if (cur.getCount() &lt;= 0)    {        ContentValues values = new ContentValues();        values.put(DatabaseStructure.TOPICS_CONTENT_TOPIC_ID, topicIDInt);        db = dbMaker.getWritableDatabase();        db.insert(DatabaseStructure.TABLE_TOPICS_CONTENT, null, values);        db = dbMaker.getReadableDatabase();        cur = db.query(DatabaseStructure.TABLE_TOPICS_CONTENT, new String[] {DatabaseStructure.TOPICS_CONTENT_TOPIC_ID},WHERE, null, null, null, null);    }    View addContentButton = findViewById(R.id.content_button_add);    addContentButton.setOnClickListener(this);    //Set up data binding    SimpleCursorAdapter  adapter = new SimpleCursorAdapter(this,R.layout.topiccontentlineitem,cur, FROM,TO);    setListAdapter(adapter);}</code></pre>","591016","","","","","2011-02-11 16:15:52","How to check if a row in a table exists?","<android><sql>","1","0","","",""
"4970970","1","4971559","","2011-02-11 15:40:15","1","298","<p>Just curious how people are handling this situation:</p><p>Let's say when your Activity is created you launch an AsyncTask or Thread to hit a web service and retrieve a piece of data.  Suppose, before the AsyncTask finishes, the user has hit some button that sends them to a new Activity.  While on the new Activity, the AsyncTask finishes.</p><p>When the AsyncTask finishes, you want a member variable of the first Activity to update, but that Activity is now stopped.</p><p>What do you do?  As I understand it, you can't safely access the member variable because Android could have reclaimed it.  You could use a BroadcastReceiver, but if you're no longer on that Activity, the BR won't receive the message.  So what is the right answer?</p><p>Update:</p><p>A possibility is to have the task write to a database and read from that database in the Activity's onResume().  However, in my case, this is not appropriate.  The data in my Activity is not to be written (read: saved) to the database until the user is finished with that Activity and has clicked a ""save"" button.</p>","406790","","","","","2011-02-11 16:33:02","Updating object in memory when Activity is stopped","<android>","2","1","1","",""
"4971157","1","","","2011-02-11 15:56:43","0","254","<p>I want to link many List at the ListView.<strong>First List:</strong> USA, EU, Asia, Afrika ...Then when i click USA it should come the <strong>Second List:</strong> Virginia, North Carolina, Ohio ...Than click Virginia the <strong>third List:</strong> Virginia Beach, Norfolk, Chesapeake ...And at the end by clicking in the <strong>third List</strong> should come my Created <strong>html Page</strong> at the WebView. Thanks!</p>","613304","","","","","2011-02-13 11:56:14","Android: ListView link several list","<android><listview>","1","1","","",""
"4971272","1","4971490","","2011-02-11 16:06:16","0","1502","<p>I am facing problem with displaying bitmap using native code. My code is as below </p><p>Native Code</p><pre><code> JNIEXPORT void JNICALL Java_app_Panel_renderbitmap(JNIEnv* env, jobject obj,  jobject bitmap, jlong time_ms) { AndroidBitmapInfo  info;void*              pixels;int                ret;if ((ret = AndroidBitmap_getInfo(env, bitmap, &amp;info)) &lt; 0) {    return;}if (info.format != ANDROID_BITMAP_FORMAT_RGB_565) {    return;}if ((ret =AndroidBitmap_lockPixels(env, bitmap, &amp;pixels)) &lt; 0) {}memcpy(pixels, pictureRGB, 480*320);AndroidBitmap_unlockPixels(env, bitmap);}</code></pre><p>Java Code</p><pre><code>         Bitmap mBitmap = Bitmap.createBitmap(480, 320, Bitmap.Config.RGB_565);         renderbitmap(mBitmap, 0);         canvas.drawBitmap(mBitmap, 0, 0, null);</code></pre><p>And my Application is crashing at memcpy, in which pictureRGB is declared as        int *pictureRGB[4];</p><p>All the pixels are inside the pictureRGB. Is there anything wrong the way i am doing? Am passing correct values to bitmap and memcpy?</p>","574911","","","","","2011-02-11 16:26:03","problem displaying bitmap from native code in android","<android><bitmap><android-ndk>","1","3","1","",""
"4971392","1","4971959","","2011-02-11 16:18:20","0","4428","<p>I want to show some text in opengl ES. I have a 512*512 font texture (texture atlas), all letter is 32*32 pixel here. </p><p>My text length is about 400 char.</p><p>My algorithm</p><pre><code>    opengl.setClearTransparentBGEnabled();    float y2=0;    float j =0;    for (int i=0; i&lt;text.length(); i++) {        int ch  =(int)text.charAt(i);        float x2=((float)j*16*scale/50);        j++;        if ((text.charAt(i)+"""").equals(""\n"")) {            y2+=(16*scale*2)/50;            j=0;            x2=0;        }        opengl.saveMatrix();            Sprites.selectVertex(""font""+name)                    .setSprite(ch)                    .translate(x-x2, y+y2, -9)                    .scale(scale, scale, scale)                    .rotate(90, 0, 0, 1)                    .draw(true);        opengl.loadMatrix();    }    opengl.setClearTransparentBGDisabled();</code></pre><p>My only probleme, this method is very slow: after this i get 15-20 FPS. </p><p>What is the best way, to render texts in opengl-es dynamically? </p>","472537","","571593","","2011-02-24 18:18:58","2012-02-10 09:56:53","Android opengl-es fast way to render text","<android><opengl-es>","4","0","","",""
"4971569","1","4972442","","2011-02-11 16:33:50","1","834","<p>I have some question, If I create listview like this</p><p>[text]</p><p>[text]</p><hr><p>[text]</p><p>[text]</p><hr><p>each list contain 2 lines and I want to make context menuwhen I try long press to each list it will show context menu </p><p>So how to create context menu from the list which contain multi line....</p>","605358","","605358","","2011-02-11 17:40:17","2011-02-11 18:02:01","How to create context menu from the list which contain multi line","<android><contextmenu><listactivity>","1","0","","",""
"4971571","1","","","2011-02-11 16:34:01","0","446","<p>I am trying to create a view that slides up from the bottom of the screen. I tried setting the initial position of the view (which should be offscreen) in xml, but instead of placing the imageview where I specified, it truncated it. My second thought was to set the position of the view programatically inside the onWindowFocusChanged method. Here's my code</p><pre><code>    @Overridepublic void onWindowFocusChanged(boolean hasFocus) {    if(hasFocus) {    slide_dock.layout(slide_dock.getLeft(), phone_height - 70, slide_dock.getRight(), phone_height + 230);    }}</code></pre><p>The problem is that this only works SOME of the time. I've been debugging it, and I believe the issue is that the layout values of slide_dock get altered after my onWindowFocusChanged function completes, I'm just not sure where. Can anyone here help me out? Or link me to somewhere that explains the layout process in-depth? I've been searching around to no avail. </p>","613356","","246246","","2013-07-15 20:58:44","2013-07-15 20:58:44","layout function doesn't change View dimension.","<android><android-layout>","2","0","","",""
"4971622","1","4971758","","2011-02-11 16:39:08","6","1130","<p>One of the external libraries that my app uses have spaces in its logcat tag:</p><pre><code>Log.d(""Some External Library"", ""Debug Message"");</code></pre><p>How do I write the filter-spec in the logcat command to handle spaces? Logcat inside eclipse was able to filter it but I prefer the command line.</p><p>I've tried the following and they don't work:</p><pre><code>adb logcat -s ""Some External Library""adb logcat -s Some\ External\ Libraryadb logcat -s Some External Library</code></pre>","113246","","","","","2011-02-13 10:20:47","Handling spaces in logcat","<android><logcat>","1","1","3","",""
"4971676","1","","","2011-02-11 16:45:40","2","2246","<p>Okay I see there are plenty of examples on how to call a number, and I also see that I can only have it pop up the dialer to go to an emergency number.  But in all those example they hard coded ""911"" as the number to use. well this works fine in the US but since android phones are sold in other countries and thusly there is the possibility that my app will be bought by someone not in the US, or that someone who lives in the us may take their phone overseas; is there a way then my app can realize it's not in the us and thusly has to use a different number to call emergency service and what that number would be?</p><p>So to sum up I'd like to know if there is a way I can have it so when the app goes to bring up the dialer with the emergency number for the country it's in, with out having to know that number at complie time?</p>","569335","","","","","2011-02-11 16:58:05","android how to get the emergency number to call","<android><numbers><call><phone-number>","1","1","0","",""
"4971749","1","5422563","","2011-02-11 16:52:10","3","21241","<p>I am trying to place a marker on a map overlay and then present a dialog when the user selects the drawable.  The problem is the events seem to overlap.  After I click the map and the marker is drawn, the onTap fires immediately afterwards, and because I have just drawn the marker, it is directly under the onTap event, so my dialog always fires.  Does anyone have any suggestions on how to make these events mutually exclusive?</p><p>Here is the code for the map activity:</p><pre><code>public class SelectGameLocation extends MapActivity implements GestureDetector.OnGestureListener, GestureDetector.OnDoubleTapListener  {    private MapView mapView = null;    private SelectGameLocationItemizedOverlay selectLocationOverlay = null;    private List&lt;Overlay&gt; mapOverlays = null;    private GestureDetector gestureDetector = null;    @Override    protected void onCreate(Bundle arg0) {        super.onCreate(arg0);        //set the layout        setContentView(R.layout.activity_select_game_location);        //configure activity for double clicks        gestureDetector = new GestureDetector(this);        gestureDetector.setOnDoubleTapListener(this);        //create and configure mapview        mapView = (MapView) findViewById(R.id.selectGameLocation);        mapView.setBuiltInZoomControls(true);        mapView.setHapticFeedbackEnabled(true);        //configure the overlay to draw the icons on the map        mapOverlays = mapView.getOverlays();        Drawable drawable = this.getResources().getDrawable(R.drawable.map_icon);        selectLocationOverlay = new SelectGameLocationItemizedOverlay(drawable, this);        mapOverlays.add(selectLocationOverlay);    }    @Override    public boolean dispatchTouchEvent(MotionEvent ev) {        gestureDetector.onTouchEvent(ev);        return super.dispatchTouchEvent(ev);    }    @Override    public boolean onDoubleTap(MotionEvent me) {        GeoPoint p = GeoPointHelper.getPointClicked(me, mapView);        mapView.getController().animateTo(p);        mapView.getController().zoomIn();        return true;    }    //Overridden methods but not used    @Override    public boolean onDoubleTapEvent(MotionEvent me) {        return false;    }    @Override    public boolean onDown(MotionEvent me) {        return false;    }    @Override    protected boolean isRouteDisplayed() {        return false;    }    @Override    public void onShowPress(MotionEvent e) {    }    @Override    public boolean onSingleTapConfirmed(MotionEvent me) {        return false;    }    @Override    public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY) {        return false;    }    @Override    public void onLongPress(MotionEvent e) {    }    @Override    public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) {        return false;    }    @Override    public boolean onSingleTapUp(MotionEvent me) {        return false;    }}</code></pre><p>and the code for the overlay class:</p><pre><code>public class SelectGameLocationItemizedOverlay extends ItemizedOverlay {    private Context context = null;    private List&lt;OverlayItem&gt; overlays = new ArrayList&lt;OverlayItem&gt;();    public SelectGameLocationItemizedOverlay(Drawable marker, Context context) {        super(boundCenterBottom(marker));        this.context = context;    }    @Override    protected boolean onTap(int index) {        OverlayItem itemClicked = overlays.get(index);        AlertDialog.Builder dialog = new AlertDialog.Builder(context);        dialog.setTitle(itemClicked.getTitle());        dialog.setMessage(itemClicked.getSnippet());        dialog.setCancelable(true);        dialog.setPositiveButton(R.string.yes, new DialogInterface.OnClickListener() {            public void onClick(DialogInterface dialog, int id) {                Log.i(this.getClass().getName(), ""Selected Yes To Add Location"");                ((SelectGameLocation) context).finish();            }        });        dialog.setNegativeButton(R.string.no, new DialogInterface.OnClickListener() {            public void onClick(DialogInterface dialog, int id) {                Log.i(this.getClass().getName(), ""Selected No To Add Location"");                dialog.cancel();            }        });        dialog.show();        return true;    }    @Override    public boolean onTouchEvent(MotionEvent me, MapView mapView) {        drawMarker(GeoPointHelper.getPointClicked(me, mapView));        return super.onTouchEvent(me, mapView);    }    private OverlayItem drawMarker(GeoPoint p) {                    OverlayItem overlayitem = new OverlayItem(p, ""Select As Game Location?"", ""Do you want this location to be added as the location for the game?"");            getOverlays().clear();            addOverlay(overlayitem);            return overlayitem;    }    public List&lt;OverlayItem&gt; getOverlays() {        return overlays;    }    public void addOverlay(OverlayItem overlay) {        overlays.add(overlay);        populate();    }    @Override    protected OverlayItem createItem(int i) {        return overlays.get(i);    }    @Override    public int size() {        return overlays.size();    }}</code></pre>","517210","","496830","","2011-03-25 02:04:54","2012-12-09 09:15:06","Android: ItemizedOverlay onTouchEvent and onTap overlapping","<android><android-mapview><ontouchevent><overlayitem>","3","0","5","",""
"4971785","1","4972055","","2011-02-11 16:56:46","0","79","<p>I have two classes class 1 and class 2. </p><p>Within class 1 I have an onclick button which calls the next class using the following:</p><pre><code>Intent StartGameIntent = new Intent(StartGame.this,class2.class);    startActivity(StartGameIntent);</code></pre><p>Is there anyway to make class 1 remain in state. so when I call class 1 from class 2, class one will still show what was originally there?</p><p>Thanks</p>","608658","","","","","2011-02-17 17:55:27","When calling another class can you make the initial class remain in state","<android>","2","0","","",""
"4971822","1","5311428","","2011-02-11 16:59:49","1","924","<p>can any one tell me how to prepare the list view with loading animation when dragged list down. Just like twitter animation for loading new tweets.how to keep the required view when the list view dragged down.</p>","613379","","","","","2012-04-02 16:37:54","Android List view animation while dragging down","<android><list><animation><twitter><loading>","1","0","1","",""
"4971914","1","4971976","","2011-02-11 17:08:56","2","2157","<p>I'm writing an audio player using MediaPlayer that allows the user to skip the actual tune. A skip request might occur at any time, including between a call to MediaPlayer.prepareAsync and the upcoming onPrepared callback. The doc says:</p><p><em>It is important to note that the Preparing state is a transient state, and the behavior of calling any method with side effect while a MediaPlayer object is in the Preparing state is undefined.</em></p><p>Does that include calls to reset, or even to release? Because if it so, then I would either have to wait for the onPrepared callback to reuse the MediaPlayer or allocate a brand new MediaPlayer if I don't want to wait and release the obsolete one on the onPrepared callback, right?</p>","448783","","","","","2011-12-30 23:20:48","Safe to reset a MediaPlayer in preparing state?","<android>","3","0","2","",""
"4971921","1","4972024","","2011-02-11 17:09:36","1","216","<p>I'm making an app that is essentially a web form. I fill it out and send it to a website to be processed. But I only want it to send the data when connected to wifi.</p><p>I was thinking of putting the data into a tinyDB then running a check for wifi immediately. If connected it would submit the form and delete the db entry. I'd probably also run a check when the app is loaded and closed. It's important that I don't lose the data.</p><p>Is there a better way to do this?</p>","599116","","","","","2011-02-11 17:23:56","Upload data when Wi-Fi is connected?","<android>","3","0","1","",""
"4972098","1","5729803","","2011-02-11 17:25:38","0","3225","<p>Does anyone have any experience with pjsip on android devices? I see several non-commercial/test projects using it, so I'm assuming it can be done, but none of them are well documented. I thought a good place to start would be the pjsip-jni project, but there's basically no documentation (that I've found, at least). I think I'm going to just try and dig into pjsip-jni and the android ndk and see where it gets me, but if anyone has any insight it would be greatly appreciated.</p>","98642","","","","","2011-04-20 11:55:21","pjsip for Android","<java><android><c><android-ndk><pjsip>","1","0","","",""
"4972145","1","4986732","","2011-02-11 17:31:34","11","4291","<p>In Google's Notepad Example, they don't seem to close the database, at least not in onDestroy().</p><p>What is the purpose of closing it, and do I really need to?  Does an open database take up significant memory?  I have found that closing it in onDestroy leaves vulnerabilities if there are any threads running that might try to access it after the Activity is finished.</p>","506796","","","","","2011-02-13 20:38:59","Is it essential to close the database?","<android><sqlite>","2","2","4","",""
"4972175","1","4972302","","2011-02-11 17:34:33","3","1924","<p><br>I'm in the process of writing my first android app, a simple media player just to practice my semi-decent java/mark-up skills.<br>The app will have the now-playing screen as the ""main"" page along with a song browser and pop-up music controls. I have done a bit of work in both the former and latter but I'm having a problem with MediaPlayer. If I start a song playing, it will play and pause fine until I exit the music controls dialog and then re-enter it. At this point it seems to create a second instance of the MediaPlayer object. </p><h2>Main Player Screen</h2><pre><code>package org.practicesession.zoomplayer;import android.app.Activity;import android.media.MediaPlayer;import android.os.Bundle;import android.content.Intent;import android.view.View;import android.view.View.OnClickListener;public class zoomPlayer extends Activity implements OnClickListener {    static MediaPlayer myPlayer;    private static int stateMediaPlayer;    /** Called when the activity is first created. */     @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        View returnButton = findViewById(R.id.button_return);        returnButton.setOnClickListener(this);        View playerControls = findViewById(R.id.album_art_panel);        playerControls.setOnClickListener(this);        View playlistView = findViewById(R.id.song_info_panel);        playlistView.setOnClickListener(this);        View shuffleButton = findViewById(R.id.player_shuffle_button);        shuffleButton.setOnClickListener(this);        View repeatButton = findViewById(R.id.player_repeat_button);        repeatButton.setOnClickListener(this);        View ratingButton = findViewById(R.id.player_rating_button);        ratingButton.setOnClickListener(this);    }    @Override    public void onClick(View v) {        switch(v.getId()){        case R.id.album_art_panel:            Intent i = new Intent(this, PlayerControls.class);            startActivity(i);            break;        }    }    public static void setStateMediaPlayer(int i){        stateMediaPlayer = i;    }    public static int getStateMediaPlayer(){        return stateMediaPlayer;    }}</code></pre><h2>Popup controls</h2><pre><code>package org.practicesession.zoomplayer;import android.app.Activity;import android.media.MediaPlayer;import android.os.Bundle;import android.view.View;import android.view.View.OnClickListener;//Extends to implement the functionality of the main pagepublic class PlayerControls extends Activity implements OnClickListener{    private final int stateMP_Playing = 1;    private final int stateMP_Pausing = 2;    @Override    public void onCreate(Bundle savedInstanceState){        super.onCreate(savedInstanceState);        setContentView(R.layout.playcontrols);        View exitButton = findViewById(R.id.controls_exit_pane);        exitButton.setOnClickListener(this);        View volUpButton = findViewById(R.id.controls_vol_up);        volUpButton.setOnClickListener(this);        View playButton = findViewById(R.id.controls_play);        playButton.setOnClickListener(this);        View volDownButton = findViewById(R.id.controls_vol_down);        volDownButton.setOnClickListener(this);        musicPlayback();    }    public void musicPlayback(){        zoomPlayer.myPlayer = new  MediaPlayer();        zoomPlayer.myPlayer = MediaPlayer.create(this, R.raw.outta);        zoomPlayer.setStateMediaPlayer(stateMP_Pausing);    }    @Override    public void onClick(View v) {        switch(v.getId()){        case R.id.controls_exit_pane:            finish();            break;        case R.id.controls_play:            switch(zoomPlayer.getStateMediaPlayer()){                case stateMP_Playing:                    zoomPlayer.myPlayer.pause();                    zoomPlayer.setStateMediaPlayer(stateMP_Pausing);                    break;                case stateMP_Pausing:                    zoomPlayer.myPlayer.start();                    zoomPlayer.setStateMediaPlayer(stateMP_Playing);                    break;            }            break;        }    }}</code></pre><p>It seems to be a normal java problem rather than anything else. I've tried set/get methods, static variables, removing inheritance etc. to no avail</p><p>Do note too that the code above is the result of fooling around with this for hours so it's not as tidy as it can be...for example, the controls screen originally inherited from main screen as many of the imports and methods are shared. I removed this to see if it was causing the problem but no joy</p><p>Thanks for any help!</p>","613428","","","","","2011-02-11 17:50:57","How do I access a variable from another class without it creating a new instance","<java><android>","4","0","","",""
"4972379","1","","","2011-02-11 17:55:22","0","416","<p>So I am playing around with the Android api, and am trying to figure out how to get the heading the phone is pointing towards.</p><p>I have the following code:</p><pre><code>private SensorManager mSensorManager;private Sensor mAcceller;/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    mSensorManager = (SensorManager)getSystemService(SENSOR_SERVICE);    checkNotNull(mSensorManager);    try {        mAcceller = mSensorManager.getSensorList(3).get(0);    } catch (Exception e) {        showToast(e.getMessage(), Toast.LENGTH_LONG);    }}</code></pre><p>But when I try to run it on my phone I just get a message that the program has crashed. When I run it in the emulator it tells me that there are no sensors (thats to be expect, but it means I can't test the code).</p><p>Does anybody know how to work around this issue? I know the error happens in the try statement because if I comment it out, the program runs.</p><p><em>Edit</em>: It turns out that I am an idiot, the crash happened when I null refered somewhere else in my code, as a response to getting a notification that the sensor had been turned on.</p><p>Dave if you upgrade your comment to an answer, I will mark that as accepted (since I found the problem as soon as I figured out how the debugger worked).</p>","21133","","21133","","2011-02-11 19:15:54","2011-02-11 19:15:54","Why does my Android program crash when I access the Orientation sensor (HTC Desire)?","<java><android>","1","2","","",""
"4972391","1","","","2011-02-11 17:56:58","7","2484","<p>My activity stack is A B C, with C at the top. A started B using startActivityForResult().</p><p>Now, in C, it starts A and clears the top using the following code:</p><pre><code>        finish();        intent = new Intent(this, A.class);        intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);        startActivity(intent);</code></pre><p>My question is, will onActivityResult() in A be called after the code above is executed? I expected it will, because B is destroyed after C starts A and clears the top. But, my test code showed that onActivityResult() in A was not called. I am confused. Can someone help?</p><p>Thanks.</p>","445302","","","","","2013-04-17 02:27:20","FLAG_ACTIVITY_CLEAR_TOP and onActivityResult","<android>","2","1","2","",""
"4972535","1","","","2011-02-11 18:11:57","0","1796","<p>I have been developing an application which needs to access video camera but with Android emulator i couldn't find a way to access my web cam directly as the Android device's camera. so any way to do this ?</p><p>Thanks !!</p>","434375","","","","","2011-11-08 19:16:18","How can we directly access webcam from Android emulator","<android>","2","4","","",""
"4972633","1","","","2011-02-11 18:23:42","1","282","<p>i am trying to upload a file to Amazon S3 using HttpUrlConnection and the put method.</p><pre><code>  outputStream = new DataOutputStream( connection.getOutputStream() );        bytesAvailable = fileInputStream.available();        int current = 0;        bufferSize = Math.min(bytesAvailable, maxBufferSize);        buffer = new byte[bufferSize];        // Read file        bytesRead = fileInputStream.read(buffer, 0, bufferSize);        while (bytesRead &gt; 0)       {            outputStream.write(buffer, 0, bufferSize);            bytesAvailable = fileInputStream.available();            bufferSize = Math.min(bytesAvailable, maxBufferSize);            bytesRead = fileInputStream.read(buffer, 0, bufferSize);            current+=bytesRead;        }</code></pre><p>is this the proper way to use the buffer to output data? It all works great for smaller files but when i try to upload something larger it says </p><pre><code>02-11 19:04:38.718: INFO/dalvikvm-heap(15385): Grow heap (frag case) to 9.204MB for 3143696-byte allocation</code></pre><p>what am i doing wrong?any help is highly appreciated, thank you.</p>","448192","","","","","2011-02-11 18:23:42","heap size warning when uploading a file using url connection","<android><upload><httpurlconnection>","0","0","","",""
"4972650","1","4973623","","2011-02-11 18:25:38","1","321","<p>Recently in an attempt to integrate a phone with a wireless sensor network i have adapted a class to work as an activity as well as a listener class which reads from a serial port and plots some readings on to a simple canvas based View.I tried initially to construct a threaded canvas using the more normal message handlers and thread that updates and invalidates however the class that stores the readings that i need to plot was also working off a thread which listens to the USB port. I couldn't get it working at the time and i decided that i probably didn't need to constantly update the canvas given that i only need to update it with new readings.</p><p>So the activity class is as follows.</p><pre><code>public class Oscilloscope extends Activity implements MessageListener Graph graph;boolean guard=false;MoteIF mote;Data data;String comm;static String writeLog;public Vector &lt;Integer&gt;  arrayvals = new Vector&lt;Integer&gt;();public Oscilloscope(String comm, String writelog){    this.comm = comm;    this.writeLog = writelog;}public Oscilloscope(){}public void onCreate(Bundle b){    super.onCreate(b);    graph = new Graph(this);    this.setContentView(graph);    if(guard==false)    {        create(""dummy:1"",null).run();    }}synchronized public void messageReceived(int dest_addr, Message msg) {    if (msg instanceof OscilloscopeMsg) {        OscilloscopeMsg omsg = (OscilloscopeMsg)msg;        periodUpdate(omsg.get_version(), omsg.get_interval());        data.update(omsg.get_id(), omsg.get_count(), omsg.get_readings());        List temp1 = Arrays.asList(omsg.get_readings());        Vector&lt;Integer&gt; temp= new Vector&lt;Integer&gt;(temp1);        this.arrayvals = temp;        Paint p = new Paint();        p.setColor(Color.BLUE);        this.graph.update();        this.graph.invalidate();    }}public Oscilloscope create(String a, String b){    guard = true;    Oscilloscope os = new Oscilloscope(a,b);    os.guard = true;    return os;}</code></pre><p>Not sure why it is i cant get the code brackets working properly there, i apologise. There are other methods in the class but the class itself acts as it should minus the view part, paying particular attention to the messagereceived method where the readings are read in as array of ints. My problem is that once the onDraw method has been called once and then messagereceived is called afterwards the graph object seems to be null which obviously throws a null pointer when i try to call update. I could be not seeing something really obvious.The graph code is really simple as below:</p><pre><code>public class Graph extends View     Paint paint= new Paint();    public float x;    public float y;    Vector&lt;CoOrdinate&gt; coVec = new Vector&lt;CoOrdinate&gt;();    public Graph(Context context) {        super(context);    }    public void onDraw(Canvas canvas)    {            Log.v(""Line 28 Graph.java"",""Y: ""+y+""X: ""+x);            canvas.drawCircle(x, y, 2, paint);            Log.v(this.toString(),""onDraw in the graph"");    }    public void update()    {        Log.v(""Line 31 of Graph.java"","""");        x+=100;        y+=100;        paint.setColor(Color.GREEN);    }}</code></pre><p>Any help appreciated. Thanks.</p><pre><code>02-11 19:03:00.933: DEBUG/AndroidRuntime(301): &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;02-11 19:03:00.933: DEBUG/AndroidRuntime(301): CheckJNI is ON02-11 19:03:02.012: DEBUG/AndroidRuntime(301): --- registering native functions ---02-11 19:03:03.942: INFO/ActivityManager(60): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=graphAndroid.graphs/.Oscilloscope }02-11 19:03:04.062: DEBUG/AndroidRuntime(301): Shutting down VM02-11 19:03:04.082: DEBUG/jdwp(301): adbd disconnected02-11 19:03:04.122: INFO/AndroidRuntime(301): NOTE: attach of thread 'Binder Thread #3' failed02-11 19:03:04.263: INFO/ActivityManager(60): Start proc graphAndroid.graphs for activity graphAndroid.graphs/.Oscilloscope: pid=308 uid=10040 gids={1015}02-11 19:03:05.263: INFO/ARMAssembler(60): generated scanline__00000077:03545404_00000004_00000000 [ 47 ipp] (67 ins) at [0x361990:0x361a9c] in 6676000 ns02-11 19:03:05.493: INFO/System.out(308): Creating dummy source (dummy:1)02-11 19:03:05.493: INFO/System.out(308): No Motes:102-11 19:03:05.503: VERBOSE/Line 129 Oscilloscope.java(308): Made it to here02-11 19:03:05.503: VERBOSE/Line 135 Oscilloscope.java(308): Made it here02-11 19:03:05.513: VERBOSE/Line 137 Oscilloscope.java(308): Made it here02-11 19:03:05.513: VERBOSE/Line 114 MoteIF.java(308): Third constructor02-11 19:03:05.513: VERBOSE/Line 121 MoteIF.java(308): Made it here02-11 19:03:05.513: VERBOSE/Line 123 MoteIF.java(308): Made it here02-11 19:03:05.523: VERBOSE/Line 127 MoteIF.java(308): Made it here02-11 19:03:05.523: VERBOSE/Line 130 MoteIF.java(308): Made it here02-11 19:03:05.523: VERBOSE/Line 69 PhoenixSource.java(308): Made it here02-11 19:03:05.523: VERBOSE/Line 71 PhoenixSource.java(308): Made it here02-11 19:03:05.523: VERBOSE/Line 74 PhoenixSource.java(308): Made it here02-11 19:03:05.523: VERBOSE/Line 133 MoteIF.java(308): Made it here02-11 19:03:05.523: VERBOSE/Line 138 MoteIF.java(308): Made it here02-11 19:03:05.533: VERBOSE/Line 140 MoteIF.java(308): Made it here02-11 19:03:05.543: VERBOSE/Line 142 MoteIF.java(308): Made it here02-11 19:03:05.543: VERBOSE/Line 138 Oscilloscope.java(308): Made it here02-11 19:03:05.543: VERBOSE/Line 140 Oscilloscope.java(308): Made it to here02-11 19:03:05.783: VERBOSE/Line 28 Graph.java(308): Y: 0.0X: 0.002-11 19:03:05.793: VERBOSE/graphAndroid.graphs.Graph@43e3deb8(308): onDraw in the graph02-11 19:03:05.823: INFO/ActivityManager(60): Displayed activity graphAndroid.graphs/.Oscilloscope: 1679 ms (total 1679 ms)02-11 19:03:07.543: INFO/System.out(308): SimulatedOscilloscopePacketSource moteId is 002-11 19:03:07.543: VERBOSE/1(308): A test, line 424 OscilloscopeMsg class02-11 19:03:07.543: WARN/dalvikvm(308): threadid=7: thread exiting with uncaught exception (group=0x4001d800)02-11 19:03:07.563: ERROR/AndroidRuntime(308): FATAL EXCEPTION: Thread-802-11 19:03:07.563: ERROR/AndroidRuntime(308): java.lang.NullPointerException02-11 19:03:07.563: ERROR/AndroidRuntime(308):     at graphAndroid.graphs.Oscilloscope.messageReceived(Oscilloscope.java:108)02-11 19:03:07.563: ERROR/AndroidRuntime(308):     at net.tinyos.message.Receiver.packetReceived(Receiver.java:210)02-11 19:03:07.563: ERROR/AndroidRuntime(308):     at net.tinyos.packet.PhoenixSource.dispatch(PhoenixSource.java:165)02-11 19:03:07.563: ERROR/AndroidRuntime(308):     at net.tinyos.packet.PhoenixSource.packetDipatchLoop(PhoenixSource.java:157)02-11 19:03:07.563: ERROR/AndroidRuntime(308):     at net.tinyos.packet.PhoenixSource.run(PhoenixSource.java:174)02-11 19:03:07.613: WARN/ActivityManager(60):   Force finishing activity graphAndroid.graphs/.Oscilloscope02-11 19:03:07.932: WARN/IInputConnectionWrapper(129): showStatusIcon on inactive InputConnection02-11 19:03:08.463: INFO/ARMAssembler(60): generated scanline__00000077:03515104_00000000_00000000 [ 33 ipp] (47 ins) at [0x36b288:0x36b344] in 746000 ns</code></pre>","613477","","613477","","2011-02-11 19:06:50","2011-02-11 20:35:26","Null Pointer on View","<android>","2","7","0","",""
"4972663","1","","","2011-02-11 18:26:42","0","1745","<p>How do I add a background image and icon to my app in eclipse?And an exit button that closes app?</p>","613481","","","","","2011-02-12 06:31:35","Help with backgroud image and exit button","<android><eclipse>","1","3","0","",""
"4972695","1","","","2011-02-11 18:32:22","5","6351","<p>Okay after searching through the various threads that I could find on this topic, and trying everything that seemed to work for the others... I have succumb to the need to post my own issue. </p><p>As a total noob to Android and Java, you will have to forgive the need to talk to me like a child :)</p><p>I have an app that has 3 activities so far. A main window that works as a navigation screen to choose one of the other two. The first works perfectly, but when I try button number 2... it crashes. </p><p>I have some code that I am trying to run onCreate... so when I saw that it was often the XML layout that caused the crash.. I commented out the Java code... and presto the layout loads fine. </p><p>putting the code back in, it crashes once again. </p><p>Looking in LogCat I see a line that says ""No Package identifier when getting value for resource number 0x0000000d""</p><p>Then all sorts of lines about fatal exceptions and shutting down the VM. </p><p>So, garnering confidence from other posts, I went to the R.java file to see what resource has that ID... and it's not in there. They ALL start with 0x7f...  now the ONLY one that ends in ""d"" is a textview with the ID ""game_Answer1"". But I am not certain if that is what it's referring to or not.</p><p>I did try the Eclipse clean command, as well as deleting the R.java... same issue. </p><p>Below is the java code that seems to be crashing... again, hold the laughter at my spaghetti code as this is attempt #2 in Java beyond a hello world app!</p><hr><pre><code>import android.app.Activity;import android.os.Bundle;import android.widget.TextView;import java.util.Random;public class playgame extends Activity {/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.gamelayout);    //set up first question    genQuestion();}Random generator = new Random();public void genQuestion() {    int i = generator.nextInt(25);    int correct = generator.nextInt(2)+1;    TextView g_answera = (TextView) findViewById(R.id.game_Answer1);    TextView g_answerb = (TextView) findViewById(R.id.game_Answer2);    TextView g_answerc = (TextView) findViewById(R.id.game_Answer3);    g_answera.setText(""-"");    g_answerb.setText(""-"");    g_answerc.setText(""-"");    if(correct==1){        g_answera.setText(""!"");    }    if(correct==2){        g_answerb.setText(""!"");    }    if(correct==3){        g_answerc.setText(""!"");    }}</code></pre><p>Below is the XML layout associated with this issue... just in case I am missing something obvious:</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=""#ffffff""  android:id=""@+id/gamelayoutwrapper""&gt;&lt;RelativeLayout android:layout_height=""wrap_content"" android:id=""@+id/games_animalnameFrame"" android:layout_width=""fill_parent"" android:gravity=""right""&gt;    &lt;TextView android:layout_height=""wrap_content"" android:id=""@+id/game_animalname"" android:layout_width=""fill_parent"" android:textSize=""60sp"" android:layout_alignParentRight=""true"" android:gravity=""right"" android:text=""__nteater""&gt;&lt;/TextView&gt;&lt;/RelativeLayout&gt;&lt;RelativeLayout android:layout_width=""wrap_content"" android:id=""@+id/game_animalimageFrame"" android:layout_below=""@+id/games_animalnameFrame"" android:layout_centerInParent=""true"" android:layout_height=""wrap_content"" android:gravity=""top""&gt;    &lt;ImageView android:id=""@+id/game_animalImage"" android:src=""@drawable/elephant"" android:scaleType=""fitCenter"" android:layout_width=""fill_parent"" android:layout_height=""fill_parent"" android:paddingBottom=""10dp""&gt;&lt;/ImageView&gt;&lt;/RelativeLayout&gt;&lt;RelativeLayout android:layout_height=""wrap_content"" android:id=""@+id/gameLettersFrame"" android:layout_alignParentBottom=""true"" android:layout_width=""fill_parent"" android:layout_centerHorizontal=""true"" android:background=""#cccccc""&gt;            &lt;TextView android:layout_height=""wrap_content"" android:id=""@+id/game_Answer1"" android:text=""A"" android:paddingLeft=""20dp"" android:paddingRight=""20dp"" android:layout_gravity=""left"" android:clickable=""true"" android:textSize=""100sp"" android:layout_width=""wrap_content"" android:layout_alignParentLeft=""true"" android:textColor=""#090999"" android:background=""#ccccFF""&gt;&lt;/TextView&gt;            &lt;TextView android:layout_height=""wrap_content"" android:id=""@+id/game_Answer2"" android:text=""B"" android:paddingLeft=""20dp"" android:paddingRight=""20dp"" android:layout_gravity=""center_horizontal"" android:clickable=""true"" android:textSize=""100sp"" android:layout_width=""wrap_content"" android:layout_centerInParent=""true"" android:textColor=""#090999"" android:background=""#ffcccc""&gt;&lt;/TextView&gt;            &lt;TextView android:layout_height=""wrap_content"" android:id=""@+id/game_Answer3"" android:text=""C"" android:paddingLeft=""20dp"" android:paddingRight=""20dp"" android:layout_gravity=""right"" android:clickable=""true"" android:textSize=""100sp"" android:layout_width=""wrap_content"" android:layout_alignParentLeft=""false"" android:layout_alignParentRight=""true"" android:textColor=""#090999"" android:background=""#ccffcc""&gt;&lt;/TextView&gt;&lt;/RelativeLayout&gt;</code></pre><p></p>","613484","","512958","","2011-02-11 20:31:33","2013-10-10 12:36:56","Crashing due to ""No package identifier when getting value of resource number...""","<java><android><xml><debugging><resources>","5","0","1","",""
"4972699","1","4972740","","2011-02-11 18:32:35","78","45560","<p>In Microsoft Visual Studio, there is a menu option to stop a running program (whether in debug or release mode).</p><p>But in Eclipse I couldn't find such option.</p><p>So for now, I stop the program (returning control to Eclipse) simply by closing the emulator.</p><p>Is there a better way of doing this? Such that I don't need to close (and restart) the emulator?</p>","418055","","","","","2014-03-30 21:06:01","Android: How to stop running program under Eclipse?","<android><eclipse><android-emulator>","7","1","14","",""
"4972747","1","4973332","","2011-02-11 18:37:30","1","717","<p>Short Version:</p><p>Is there a guaranteed minimum VM Budget Size (or at least a reasonable target)? I am exceeding it with an xml layout that is nothing but a linearlayout wrapping a single 30KB image.</p><p>Long version: </p><p>I'm getting the following error related to bitmap exceeding vm budget:</p><pre><code>java.lang.RuntimeException: Unable to start activity ComponentInfo{com.dah.rh/com.dah.rh.activities.SplashActivity}: android.view.InflateException: Binary XML file line #8: Error inflating class &lt;unknown&gt;   at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2649)   at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2674)   at android.app.ActivityThread.access$2200(ActivityThread.java:131)   at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1975)   at android.os.Handler.dispatchMessage(Handler.java:99)   at android.os.Looper.loop(Looper.java:123)   at android.app.ActivityThread.main(ActivityThread.java:4702)   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.view.InflateException: Binary XML file line #8: Error inflating class &lt;unknown&gt;   at android.view.LayoutInflater.createView(LayoutInflater.java:513)   at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)   at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:563)   at android.view.LayoutInflater.rInflate(LayoutInflater.java:618)   at android.view.LayoutInflater.inflate(LayoutInflater.java:407)   at android.view.LayoutInflater.inflate(LayoutInflater.java:320)   at android.view.LayoutInflater.inflate(LayoutInflater.java:276)   at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:208)   at android.app.Activity.setContentView(Activity.java:1629)   at com.dah.rh.activities.SplashActivity.onCreate(SplashActivity.java:26)   at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)   at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2587)   ... 11 moreCaused by: java.lang.reflect.InvocationTargetException   at android.widget.ImageView.&lt;init&gt;(ImageView.java:105)   at java.lang.reflect.Constructor.constructNative(Native Method)   at java.lang.reflect.Constructor.newInstance(Constructor.java:446)   at android.view.LayoutInflater.createView(LayoutInflater.java:500)   ... 22 moreCaused by: java.lang.OutOfMemoryError: bitmap size exceeds VM budget   at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method)   at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:464)   at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:340)   at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:697)   at android.content.res.Resources.loadDrawable(Resources.java:1714)   at android.content.res.TypedArray.getDrawable(TypedArray.java:549)   at android.widget.ImageView.&lt;init&gt;(ImageView.java:115)   ... 26 more</code></pre><p>The line in the stacktrace that is my code is the following:</p><pre><code>setContentView(R.layout.splash_page);</code></pre><p>From here, Android attempts to inflate the resource splash_page.xml listed below:</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:gravity=""center""&gt;  &lt;ImageView    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""     android:src=""@drawable/logo""/&gt;&lt;/LinearLayout&gt;</code></pre><p>The image ""logo.png"" is a 240x138px png sizing in at 30KB.  It seems strange to me that this would exceed the budget whereas other pages where I have loaded 6 images totaling over 35KB total have not exceeded the budget.  It seems like the only thing I can do is to shrink the image, but I have no idea how small to make it.</p>","462252","","","","","2011-02-11 19:48:15","What is the minimum VM Budget Size?","<android><bitmap><imageview><virtual-machine>","1","6","","",""
"4972780","1","5336445","","2011-02-11 18:41:08","1","1584","<p>I am resizing image and rotating it using Matrix:</p><pre><code>Matrix mtx = new Matrix();if(orientation&gt;0) {    mtx.postRotate(orientation);    Log.d(TAG,""image rotated: ""+orientation);}if(scale&lt;1) {    mtx.postScale(scale,scale);    Log.d(TAG,""image scaled: ""+scale);}bmp = Bitmap.createBitmap(bm_orig, 0, 0, width, height, mtx, true);bm_orig.recycle();bmp.compress(Bitmap.CompressFormat.JPEG,95,output);bmp.recycle();</code></pre><p>When bmp_orig is taken, used <strong>3.2 Mpx</strong> Camera, image resized and rotated looks normal.</p><p>But when source is <strong>4 Mpx or bigger</strong>, result after resizing has barely-noticeable <strong>linear noise</strong></p><p>I dont know, why does this noise appear, and how to remove it.</p><p><strong>Any idea</strong>?May be another way to resize and rotate?</p>","613494","","613494","","2011-08-21 06:16:23","2011-08-21 06:16:23","Bitmap resizing and rotating: linear noise","<android><image><matrix><resize><rotation>","1","0","3","",""
"4972793","1","4973545","","2011-02-11 18:43:11","0","2244","<p>I created the soundboard and the code compiles, it just wont create any sounds or play the mp3, where am I coding it wrong as it does not start anywhere.</p><pre><code>import android.app.Activity;import android.content.Intent;import android.media.MediaPlayer;import android.os.Bundle;import android.view.View;import android.view.View.OnClickListener;import android.widget.Button;public class SplashActivity extends Activity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.splash);        Button next = (Button) findViewById(R.id.Button01);        next.setOnClickListener(new View.OnClickListener() {            public void onClick(View view) {                Intent myIntent = new Intent(view.getContext(), Activity2.class);                startActivityForResult(myIntent, 0);            }        });    }    public class Bluarg extends Activity implements OnClickListener{        MediaPlayer mp1;        MediaPlayer mp2;        MediaPlayer mp3;        MediaPlayer mp4;        MediaPlayer mp5;        MediaPlayer mp6;        MediaPlayer mp7;        MediaPlayer mp8;        MediaPlayer mp9;        MediaPlayer mp10;        MediaPlayer mp11;        MediaPlayer mp12;        MediaPlayer mp13;        MediaPlayer mp14;        MediaPlayer mp15;        MediaPlayer mp16;        public void onCreate(Bundle savedInstanceState) {            super.onCreate(savedInstanceState);            mp1 = MediaPlayer.create(this, R.raw.deb1);            mp2 = MediaPlayer.create(this, R.raw.deb2);            mp3 = MediaPlayer.create(this, R.raw.deb3);            mp4 = MediaPlayer.create(this, R.raw.deb4);            mp5 = MediaPlayer.create(this, R.raw.deb5);            mp6 = MediaPlayer.create(this, R.raw.deb6);            mp7 = MediaPlayer.create(this, R.raw.deb7);            mp8 = MediaPlayer.create(this, R.raw.deb8);            mp9 = MediaPlayer.create(this, R.raw.deb9);            mp10 = MediaPlayer.create(this, R.raw.deb10);            mp11 = MediaPlayer.create(this, R.raw.deb11);            mp12 = MediaPlayer.create(this, R.raw.deb12);            mp13 = MediaPlayer.create(this, R.raw.deb13);            mp14 = MediaPlayer.create(this, R.raw.deb14);            mp15 = MediaPlayer.create(this, R.raw.deb15);            mp16 = MediaPlayer.create(this, R.raw.deb16);            final Button button2 = (Button) findViewById(R.id.Button02);            button2.setOnClickListener(this);            final Button button3 = (Button) findViewById(R.id.Button03);            button3.setOnClickListener(this);            final Button button4 = (Button) findViewById(R.id.Button04);            button4.setOnClickListener (this);            final Button button5 = (Button) findViewById(R.id.Button05);            button5.setOnClickListener (this);            final Button button6 = (Button) findViewById(R.id.Button06);            button6.setOnClickListener (this);            final Button button7 = (Button) findViewById(R.id.Button07);            button7.setOnClickListener (this);            final Button button8 = (Button) findViewById(R.id.Button08);            button8.setOnClickListener (this);            final Button button9 = (Button) findViewById(R.id.Button09);            button9.setOnClickListener (this);            final Button button10 = (Button) findViewById(R.id.Button10);            button10.setOnClickListener (this);            final Button button11 = (Button) findViewById(R.id.Button11);            button11.setOnClickListener (this);            final Button button12 = (Button) findViewById(R.id.Button12);            button12.setOnClickListener (this);            final Button button13 = (Button) findViewById(R.id.Button13);            button13.setOnClickListener (this);            final Button button14 = (Button) findViewById(R.id.Button14);            button14.setOnClickListener (this);            final Button button15 = (Button) findViewById(R.id.Button15);            button15.setOnClickListener (this);            final Button button16 = (Button) findViewById(R.id.Button16);            button16.setOnClickListener (this);            final Button button17 = (Button) findViewById(R.id.Button17);            button17.setOnClickListener (this);        }        @Override        public void onClick(View v) {            switch(v.getId()) {            case R.id.Button02:                mp1.start();                break;            case R.id.Button03:                mp2.start();                break;            case R.id.Button04:                mp3.start();                break;            case R.id.Button05:                mp4.start();                break;              case R.id.Button06:                mp5.start();                break;            case R.id.Button07:                mp6.start();                break;                 case R.id.Button08:                mp7.start();                break;            case R.id.Button09:                mp8.start();                break;                 case R.id.Button10:                mp9.start();                break;            case R.id.Button11:                mp10.start();                break;             case R.id.Button12:                mp11.start();                break;            case R.id.Button13:                mp12.start();                break;                case R.id.Button14:                mp13.start();                break;            case R.id.Button15:                mp14.start();                break;                case R.id.Button16:                mp15.start();                break;             case R.id.Button17:                mp16.start();                break;                }        }        @Override        protected void onDestroy() {            mp1.release();            mp2.release();            mp3.release();            mp4.release();            mp5.release();            mp6.release();            mp7.release();            mp8.release();            mp9.release();            mp10.release();            mp11.release();            mp12.release();            mp13.release();            mp14.release();            mp15.release();            mp16.release();            super.onDestroy();        }    }}</code></pre>","613496","","21234","","2011-02-12 11:02:50","2011-02-12 11:02:50","Problem playing media from raw resource through MediaPlayer","<android><media-player>","1","3","","",""
"4972927","1","5014285","","2011-02-11 18:59:48","24","18650","<p>I currently do a lot of WPF development and have started creating some basic Android apps. When creating WPF apps I often use MVVM, normally using Prism, and would like to know if there are any examples of MVVM for the Android platform?</p>","249733","","249733","","2011-04-07 06:57:07","2013-02-19 02:33:25","Android MVVM Design Pattern Examples","<java><android><design-patterns><mvvm><dependency-injection>","5","0","24","",""
"4972968","1","4973904","","2011-02-11 19:04:34","2","1631","<p>I can't figure out why this cursor is empty in just this one particular device. but works on all other android devices.There are several audiofiles on the sdcard, and the stock mediaplayer can find and play these songs alright.</p><pre><code>Cursor c = managedQuery(MediaStore.Audio.Media.EXTERNAL_CONTENT_URI, new String[] { ""distinct "" + MediaStore.Audio.Media.ALBUM, MediaStore.Audio.Media.ARTIST, MediaStore.Audio.Media.ALBUM_KEY, MediaStore.Audio.Media.ALBUM_ID},                 null,                null,                 MediaStore.Audio.Media.ARTIST);</code></pre><p>Both the ambling book player (I'm guessing they just loop through the folders and do their own id3 parsing) and the stock android music player find the music but I can't get anything from the mediastore. No "".nomedia"" files are present, I have tried inserting new mp3 files to a new folder.  </p>","595099","","","","","2011-04-10 16:16:46","Empty cursor from the MediaStore","<android><mediastore>","2","0","2","",""
"4973079","1","4973153","","2011-02-11 19:16:31","3","18672","<p>I am working on a project that requires some simple math to be performed on currency, however it arrives in the form of a String.  I am new to Java/Android so I am looking for help in converting from a String to a data type appropriate to this operation.  At first I thought Float was right but after reading elsewhere and introducing myself to the numbers class, it appears BigDecimal is correct.  Am I on the right track?  At this point I simply want to subtract the sum of payments from an initial invoice amount.  I get the feeling this code is simple but clumsy and I suspect I am missing a great deal about the nuances of working with currency.  How would you do it?  All advice warmly appreciated!</p><pre><code>    // capture variables from sending activity    String invoiceAmt = getIntent().getStringExtra(""invoiceAmt"");    String paymentsSum = getIntent().getStringExtra(""paymentsSum"");    // convert strings to BigD's     BigDecimal amt = new BigDecimal(invoiceAmt);    BigDecimal sum = new BigDecimal(paymentsSum);    // Do the math    BigDecimal invDue = amt.subtract(sum);    // insert the value (back to string) into textView    TextView tvInvoiceDue = (TextView)findViewById(R.id.InvoiceDue);    tvInvoiceDue.setText(invDue.toString());</code></pre>","593078","","512958","","2011-02-11 19:36:07","2011-02-11 19:36:07","Converting from String to BigDecimal to do math on currency","<java><android><string><currency><bigdecimal>","1","0","2","",""
"4973102","1","4997140","","2011-02-11 19:19:42","0","643","<p>I have an android application with different flavours.What I mean by flavours is that they differ only in their application name,icon and a url that webview in the application uses.</p><p>What I have now:Application 1 with app_name1 and icon1:{Code...myWebview.loadUrl(url1);code..}Application 2 with app_name2 and icon2:{SameCode...myWebview.loadUrl(url2)Samecode..}</p><p>What I would like to have :</p><p>Application(pick the application name and icon from build parameter):{Code ..myWebview.loadUrl(pick the url from build parameter)Code..}</p><p>Is this possible? This would be so good to have as I am manually copying any change that i do in either of the projects to the other and I am scared about how I would handle more than 2 ""flavours"".</p>","287280","","","","","2011-02-14 20:54:19","Android Compile Time directive","<android><build>","2","0","","",""
"4973154","1","4973422","","2011-02-11 19:26:02","0","162","<p>I've received a strange bug report:</p><p>After a OTA update of the SO from 2.1 to 2.2 the SharedPreferences have been wiped, thus making my app return to the 1st time screen.</p><p>Is this a normal behaviour, wipe of the SharedPreferences on system update although maintaining the app installed?</p><p>Thanks</p>","327011","","","","","2011-02-12 21:21:17","Upgrading Android Version cleans application data?","<android><ota>","1","0","","",""
"4973175","1","4973409","","2011-02-11 19:28:45","2","1649","<p>I have a child of CursorAdapter class, and a ListView which every item has two TextViews. One holding a text, and another holding a number.</p><p>Text is from one Cursor column, and number from another. I want to hide number if it is equals to 0.</p><p>My View for list item 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=""wrap_content""        android:padding=""10dp""&gt;    &lt;TextView        android:background=""@drawable/task_count_indicator""        android:layout_width=""wrap_content""        android:layout_height=""fill_parent""        android:layout_alignParentRight=""true""        android:layout_gravity=""center_vertical""        android:textColor=""@color/white""        android:id=""@+id/txtTaskCount"" /&gt;    &lt;TextView        android:layout_height=""fill_parent""        android:layout_width=""fill_parent""        android:ellipsize=""marquee""        android:textSize=""18sp""        android:layout_alignParentLeft=""true""        android:layout_gravity=""center_vertical""        android:id=""@+id/placeItemName""/&gt;&lt;/RelativeLayout&gt;</code></pre><p>My adapter code is:</p><pre><code>    @Override    public View newView(Context context, Cursor cursor, ViewGroup viewGroup) {        return LayoutInflater.from(context).inflate(R.layout.places_list_item, viewGroup, false);    }    @Override    public void bindView(View view, Context context, Cursor cursor) {        int taskCount = cursor.get...// get to know it...        TextView name = (TextView) view.findViewById(R.id.placeItemName);        name.setText(                cursor.getString(                        cursor.getColumnIndexOrThrow(...)));        TextView count = (TextView)view.findViewById(R.id.txtTaskCount);        if(taskCount &gt; 0)            count.setText(Integer.toString(taskCount));        else            count.setVisibility(View.GONE);    }</code></pre><p>The problem is what sometimes every view that holds a number is drawn hidden, or with incorrect value (text content is always correct). I log the <code>taskCount</code> value - it is always correct.</p><p>Also i noticed, if i comment an if statement and assign text to <code>count</code> always, like this:</p><pre><code>    //if(taskCount &gt; 0)        count.setText(Integer.toString(taskCount));    //else        //count.setVisibility(View.GONE);</code></pre><p>the problem isn't reproducing.</p>","296433","","","","","2013-08-26 16:04:12","Hide an element of ListView's item depending on Cursor's column value","<android><android-listview>","2","0","","",""
"4973228","1","4973621","","2011-02-11 19:34:25","4","5861","<p>I have a ListView where each row has two webviews side by side, taking up the entire row. I've set up onListItemClick() in my ListActivity, but they are not fired when I tap on one of the rows (unless the place I happen to tap is outside the webview's border - but this isn't likely behavior, users would most likely want to tap on the image inside the webview).</p><p>I've tried setting setFocusable(false) and setFocusableInTouchMode(false), but those don't help. </p><p>Ideally this would operate exactly like Facebook's newsfeed, where you can tap on the profile picture of someone's wall post and it acts as if you've tapped the entire row (in FBs case the text for the wall post)</p>","612094","","","","","2013-06-13 08:05:44","Android WebView inside ListView onclick event issues","<android><android-webview><android-listview>","5","0","5","",""
"4973259","1","4973540","","2011-02-11 19:38:16","2","1695","<p>I am looking around for a number picker in a 10-key style, ideally as a dialog... but called as an activity is fine too.  I want to offer the user an interface that is a little more directed toward entering $ for an invoice amount field.  I have seen adjustments to the date and time pickers but they looked awkward for this application.  I have also seem someone call the built-in calculator, which would be fine, but I don't know how they were capturing a returned value (if they were).  Any ideas?  Yes, I can fall back to a regular edit field and the standard android keyboard... I was just hoping for something a little more slick. Thanks!</p>","593078","","","","","2011-02-11 20:10:04","Looking for Android number picker (10-key style)","<android><dialog><picker>","1","0","","",""
"4973310","1","4973958","","2011-02-11 19:45:27","13","23578","<p>Today I faced an error due to which my Android application is getting by SIGNAL 11.</p><p>This error usually occurs due to unauthorized memory area access by Android internal storage. Some of the possible scenarios are web access, network communication, server image downloading and such. Mine was the case of browser load url!</p><p><a href=""http://bootloader.wikidot.com/linux:android:crashlog"" rel=""nofollow"">http://bootloader.wikidot.com/linux:android:crashlog</a></p><p>I need to launch the browser after a QR code scan.</p><p>Application was keep on scanning and launching the browser fluently but the issue occurs after 15-20 attempts of same steps..</p><p>I researched a lot and found that its the MEMORY ERROR which occurs in Android Native libraries.. usually when an unknown memory area is tried to access by the android internal storage system.</p><p>Finally I revealed that when I saw my application memory usage in the Android application setting section, i found that the cache has been reached to 10 MB..</p>","563735","","563735","","2013-01-29 06:55:46","2013-08-26 05:41:55","SIGNAL 11 SIGSEGV crash Android","<android><sigsegv>","2","4","8","",""
"4973333","1","","","2011-02-11 19:48:15","0","154","<p>How can I get updates from a Service to an activity? For example, if I am downloading a file, I would like to show a progress bar in the activity.  I don't want to use AsyncTask (they only run while the activity is in focus, which is no good).</p><p>Many apps do this, so of course it is possible but finding an example is difficult.</p>","550587","","","","","2011-02-11 20:05:22","Service progress updates","<android><android-service>","1","0","","",""
"4973395","1","4973600","","2011-02-11 19:54:50","1","616","<p>I am having a small problem, every time i try to change the preferences in my program they never change in the activity, they just stay at what the default is.</p><pre><code>public class Reciever extends BroadcastReceiver {boolean smsOn = false;    String smsColor = new String (""Green"");    Uri smsSound;    String smsVibrate = new String (""Normal"");    SharedPreferences pref = PreferenceManager.getDefaultSharedPreferences(arg0);     smsOn = pref.getBoolean(Preferences.""PREF_SMS_ON"", false);     smsColor = pref.getString(Preferences.SMS_PREF_COLOR, ""Green"");     smsSound = Uri.parse(pref.getString(Preferences.SMS_PREF_SOUND, ""Silent""));     smsVibrate = pref.getString(Preferences.SMS_PREF_SOUND, ""Normal"");             //all variable remain default value verified through debugger       NotificationManager mNotificationManager = (NotificationManager) arg0.getSystemService(Context.NOTIFICATION_SERVICE);        if (arg1.getAction().equals(ACTION)){            if(smsOn == true){....... if checkbox is checked  smsOn still remains false }</code></pre><p>prefenceactivity class</p><pre><code>public class Preferences extends PreferenceActivity implements OnPreferenceClickListener{public static final String PREF_SMS_ON = ""PREF_SMS_ON"";public static final String VIBRATE_ON_CALL1 = ""VIBRATE_ON_CALL1"";public static final String SMS_PREF_COLOR = ""SMS_PREF_COLOR"";public static final String SMS_PREF_SOUND = ""SMS_PREF_SOUND"";public static final String SMS_PREF_VIB = ""SMS_PREF_VIB"";}</code></pre><p>xml file(i will just copy one)</p><pre><code>    &lt;CheckBoxPreference         android:key=""PREF_SMS_ON""        android:title=""SMS Notifications""        android:summary=""Turn On SMS Notifications""        android:defaultValue=""false""&gt;    &lt;/CheckBoxPreference&gt;  </code></pre><p>i dont understand what it wrong, it all looks like it should work to me</p>","599346","","","","","2011-02-14 14:34:52","Preference selection always staying default","<android><preferenceactivity>","1","0","","",""
"4973606","1","","","2011-02-11 20:18:06","2","501","<p>I have a <code>ViewGroup</code> and I'm adding child Views to it like this:</p><pre><code>mViewGroup.addView(view, new LayoutParams(LayoutParams.WRAP_CONTENT,                LayoutParams.WRAP_CONTENT));</code></pre><p>(the <code>WRAP_CONTENT</code> is important for the <code>onclicklistener</code> to work as expected).</p><p>So far so good, but later I move the child Views around dynamically by either overriding their <code>onDraw</code> methods or by overriding the ViewGroups:</p><pre><code>protected boolean getChildStaticTransformation(View child, Transformation t)</code></pre><p>The problem is that the Children disappear if they are moved outside their original region which seems to be calculated when they are first added. I tried calling <code>setClipChildren(false);</code> but it didn't work.</p><p>I could solve the problem by using <code>LayoutParams.FILL_PARENT</code> when adding the child views but in this case the <code>onClickListener</code> would react to any click on the whole <code>ViewGroup</code> and I want it to only react to clicks on the specific area where my transformed child View is located.</p><p>Maybe I could still use <code>LayoutParams.FILL_PARENT</code> if there is a way to define where the clickable region for the <code>View</code> should be.</p><p>Any suggestions?</p>","480894","","512958","","2011-02-11 20:36:22","2011-03-24 03:25:54","Child Views that are translated, scaled or rotated disappear","<android><android-layout>","1","0","","",""
"4973703","1","","","2011-02-11 20:29:28","0","399","<p>I'm trying to add functionality to the fingerpaint portion of the api demo and so far Ive got a save and a way to change the size of the brush.</p><p>What I want to do is to allow the user the ability to load an image from their gallery and also allow them to capture a picture and draw that as well.</p><p>Things I know I need:</p><p>an intent to launch the gallery view</p><p>an onclicklistener to listen for the pic to be pressed</p><p>I already have a button set up to be clicked to launch my LoadBackGroundImage class but I cant figure out where to start when it comes to making it work. Everything I have tried so far either creates an error or does nothing on pressing the button from the list of choices Ive created.</p><p>This I what I have so far for my LoadBackGround.java class</p><p>public class LoadBackGround extends Dialog {</p><pre><code>public LoadBackGround(Context context, int theme) {    super(context, theme);    // TODO Auto-generated constructor stub}private android.view.View.OnClickListener mClickListener;private View myBGloaderView;private Gallery gallery;public Object getImage(){    Intent intent = new Intent(Intent.ACTION_GET_CONTENT);    intent.setType(""image/*"");    Object bgPic = intent;    return bgPic;}</code></pre><p>}</p><p>Now I know that what I have here isnt anywhere close to what I need to accomplish my goal but its what Ive been able to come up with on my own and I could definitely use some help.</p>","607013","","","","","2011-02-11 20:29:28","Trying to allow users to load an image from gallery to the background in fingerpaint","<android><image><background><loading>","0","2","","",""
"4973707","1","","","2011-02-11 20:29:35","0","535","<p>My program is structured as followed.  I have the following main activity.  This activity will create a ""Determine Location"" object.  This Determine location object will take in a few parameters.  Amongst them is a handler to pass the results along to.  In the following I pass in threadHandler which is of type MyThreadHandler (an extension of handler).  This DetermineLocation object implements runnable and in the run method it queries the GPS and passes the results along in a message to threadHandler (passed into the DetLoc object). The threadHandler instance takes in a textview object upon creation (this is the text view to update)</p><p>For debugging purposes I have disabled the GPS update feature and only had DetLoc's run method pass a random number.  This however is still crashing my program.</p><p>The crash mainly happens while pushing a lot of input to the device (such as pressing the screen in multiple places really fast).  This is a thread issue for sure but I do not see why.</p><p>MAIN:</p><pre><code>public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    threadModifiedText = (TextView) findViewById(R.id.thread_modified_text);    threadHandler = new MyHandler(threadModifiedText);    //Start up the DetermineLocation thread.  This thread will query the GPS every N milliseconds.    // then push the results over hte network if at all possible    DetermineLocation detLoc = new DetermineLocation(this, threadHandler, 3000);    Thread detLocThread = new Thread(detLoc);    detLocThread.start();}</code></pre><p>ALSO MAIN:</p><pre><code>class MyHandler extends Handler{private TextView threadModifiedText;public MyHandler(TextView tv) {    threadModifiedText = tv;} public void handleMessage(Message msg) {        // whenever the Thread notifies this handler we have        // only this behavior        threadModifiedText.setText((CharSequence)msg.obj); }}</code></pre><p>DetermineLocation class (as you can see the GPS stuff has been commented out and its still crashing):</p><pre><code>public class DetermineLocation implements Runnable {private int updateInterval;private int provider=3;private Handler threadHandler;private Context c;public final int GPS_ONLY=1;public final int NETWORK_ONLY=2;public final int ANY_AVAILABLE=3;public DetermineLocation(Context c, Handler h, int ui) {    this.c = c;    this.updateInterval = ui;    this.threadHandler = h;}public void changeProvider(int providerConst) {     if(providerConst &lt;=3 &amp;&amp; providerConst &gt;= 1)        provider = providerConst;}public void changeUpdateInterval(int updateIntervalMS) {    if(updateIntervalMS &gt;= 0)        this.updateInterval = updateIntervalMS;}@Overridepublic void run() {    Message m = new Message();    //LocationManager locationManager = (LocationManager)c.getSystemService(Context.LOCATION_SERVICE);     //Location loc = locationManager.getLastKnownLocation(LocationManager.NETWORK_PROVIDER);    while(true) {    CharSequence cs = Math.random() + ""\r\n""; //+ loc.getLatitude() + "" "" + loc.getLongitude();    m.obj = cs;    threadHandler.sendMessage(m);    try {        Thread.sleep(updateInterval);    } catch (InterruptedException e) {        // TODO Auto-generated catch block        e.printStackTrace();    }    }}</code></pre>","613592","","512958","","2011-02-11 20:38:38","2011-02-11 21:29:47","Android Multithreaded Application is Crashing","<java><android><multithreading><handler>","1","1","","",""
"4973715","1","4973745","","2011-02-11 20:30:49","2","2368","<p>I have an Activity that consists only of a huge EditText, full screen.</p><p>To match with my app's colours, i changed the background color of the EditText. But although it occupies the whole screen, it only changes the first line. Everytime i press enter i go to a new line and that line gets the background i want.</p><p>What propertie can i set in order to do this? I just can't see it!</p>","495904","","","","","2011-07-19 15:14:07","EditText background color","<java><android>","3","0","","",""
"4973736","1","4974204","","2011-02-11 20:32:28","8","6711","<p>I've been searching all evening, and I can't find a way to have IntelliJ deploy my android application to my device via USB debugging. I can't see any options to specify the target other than a virtual device.</p><p>I have device drivers installed, and all updates available to IntelliJ X and the SDK.</p><p>Is it even possible? Or only for eclipse?</p>","155695","","","","","2011-06-11 01:46:48","Can I make IntelliJ debug my android applications via the device instead of the emulator?","<android><intellij-idea>","1","0","4","",""
"4973761","1","4973951","","2011-02-11 20:35:45","0","356","<p>I want to issue a notification that stays in the status bar until I specifically issue a cancel from notification manager.  I know that there are some time fields for this, and I could of course provide an huge number for this, but i was wondering if there is a preferred way to specify this. Some way to indicate to the system that the notification is to be maintained until canceled, or is the millisecond measure the only way to go?</p>","602260","","","","","2011-02-11 20:55:13","Android Keeping Notification Alive","<android><notifications>","1","0","","",""
"4973827","1","4973869","","2011-02-11 20:41:55","2","1374","<p>In SQLite I have a table of contacts with one of the columns being <code>last_name</code>. How can I get unique set of first characters of all last names in the table? Something like <code>['a', 'b', 'd', 'f', 'w']</code>. It would help if query would be case insensitive. I'm using SQLite on Android. Thanks</p>","135946","","135946","","2013-04-01 17:34:52","2013-04-01 17:34:52","Select distinct first character based on the string column","<android><sql><sqlite><match><partial>","1","0","","",""
"4973864","1","4973943","","2011-02-11 20:45:46","2","298","<p>I have a mildly successful app that targets Android 1.6 and am looking to upgrade the target API to 2.1 in order to include more features. </p><p>What will happen to those still using android 1.6? Will they just not see the update? I'd love to be able to check which api the user is using and implement code based on that within the same app.</p><p>It's a paid app so making a new separate version is out of the question.</p>","613627","","881229","","2014-01-22 20:19:58","2014-01-22 20:19:58","Upgrading already published app's API from 1.6 to 2.1?","<android>","2","0","1","",""
"4973866","1","4973915","","2011-02-11 20:46:02","6","3172","<p>Is there an API for speech to text for languages other then English? I know the API for English (<a href=""http://developer.android.com/resources/articles/speech-input.html"" rel=""nofollow"">http://developer.android.com/resources/articles/speech-input.html</a>) but I want be able to recognize speech in my language as e.g. Google Maps or Search do. It can even be general API, not Android API.</p>","209502","","209502","","2014-03-27 17:12:38","2014-03-27 17:12:38","Google speech to text API for languages other than English","<android><api><speech-recognition><speech>","2","0","3","",""
"4973889","1","4974020","","2011-02-11 20:48:56","1","1813","<p>I have a GridView where each cell contains an ImageView and TextView. When a user clicks on a cell, it changes the background color of that cell to Gray. However, when I scroll down, another cell is also selected (i.e. the background color is gray).</p><p>My guess is that this is because the cell reuses the same view as the cell that was just hidden when scrolling down.</p><p>This also happens when I change the orientation. If I select cell 1, when I change the orientation, another cell is now selected and cell 1 is not.</p><p>Thanks in advance.</p><pre><code>public class LazyFeaturedTopicItemAdapter extends BaseAdapter {private Activity activity;private ArrayList&lt;Topic&gt; topics;private static LayoutInflater inflater=null;public PostItemImageLoader imageLoader; public LazyFeaturedTopicItemAdapter(Activity a, ArrayList&lt;Topic&gt; d) {    activity = a;    topics=d;    inflater = (LayoutInflater)activity.getSystemService(Context.LAYOUT_INFLATER_SERVICE);    imageLoader=new PostItemImageLoader(activity.getApplicationContext());}public int getCount() {    return topics.size();}public Object getItem(int position) {    return position;}public long getItemId(int position) {    return position;}public static class ViewHolder{    public ImageView imgThumbnail;    public TextView txtName;}public View getView(int position, View convertView, ViewGroup parent) {    View vi=convertView;    ViewHolder holder;    final Topic topicItem = topics.get(position);    if(convertView==null){        vi = inflater.inflate(R.layout.featured_topic_item, null);        holder=new ViewHolder();        holder.txtName = (TextView) vi.findViewById(R.id.featured_topic_item_name);        holder.imgThumbnail = (ImageView)vi.findViewById(R.id.featured_topic_item_thumbnail);        vi.setTag(holder);    }    else        holder=(ViewHolder)vi.getTag();        holder.txtName.setText(topicItem.getName());                                         holder.imgThumbnail.setTag(topicItem.getPictureLink());    imageLoader.DisplayImage(topicItem.getPictureLink(), activity, holder.imgThumbnail);    vi.setOnClickListener(            new View.OnClickListener() {                @Override                public void onClick(final View v) {                    if (topicItem.isSelected) {                        v.setBackgroundColor(Color.WHITE);                        topicItem.isSelected = false;                    }                    else {                        v.setBackgroundColor(Color.GRAY);                        topicItem.isSelected = true;                    }                }            }    );    return vi;}}</code></pre><p>Here is the solution in case anybody is interested. I added the following code before the listener.</p><pre><code>    if (topicItem.isSelected) {        vi.setBackgroundColor(Color.GRAY);    }    else {        vi.setBackgroundColor(Color.WHITE);    }</code></pre>","112381","","112381","","2011-02-11 21:26:02","2011-02-11 21:26:02","When selecting a cell in GridView/ListView, it selects another cell too","<android>","1","0","","",""
"4973985","1","4974097","","2011-02-11 20:58:42","6","5165","<p>I am developing an android application in that i want to read the incoming message without knowing the user.I want to always run the incoming message checker in background.If a new message is received means i want to read the content of the message and that message contains some words(password) means i want to activate the application </p><p>Please explain me how to do that with sample code because i am new to android </p>","609050","","","","","2012-04-02 12:58:01","How to read the incoming message using service in background in android?","<android><sms>","1","0","4","",""
"4974048","1","4974105","","2011-02-11 21:05:34","1","526","<p>I have many views in a linear layout to create. I have created a background thread that loops through all the data and creates an array list of views. At the end of the thread it calls runOnUIThread to loop through the array list and add each view to the linear layout.</p><p>Is this dangerous? The views aren't part of the hierarchy yet when I'm creating and manipulating them in the background thread. Initial testing hasn't yielded any problems.</p><p>(I am using a linear layout instead of list views, because my experience with list views is that they try to reuse some of their elements for multiple rows. For example, a checkbox that you check becomes unchecked again if it scrolls off the screen and back on. This seems simpler.  Maybe I'm taking a performance hit, though. Still need to check this thoroughly.)</p>","506796","","","","","2011-02-11 21:11:19","Is it safe to create and modify views in a background thread before adding them to a ViewGroup?","<android>","1","0","","",""
"4974093","1","","","2011-02-11 21:10:06","3","15881","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/2378800/android-webview-click-opens-default-browser"">android webview click opens default browser</a>  </p></blockquote><p>I have an application that opens a website in webview on start, however I can't seem to figure out how to keep any URL's that a user clicked on from opening in the browser.</p><p>Is there anyway to load the clicked URL inside the webview app?</p><p>EDIT - Using the below solution I still get an error on the private class ""Illegal modifier for the local class MainScreenActivity; only abstract or final is permitted""... even if I try to rename this I get the same error</p><pre><code>public class MainScreenActivity extends Activity {/** Called when the activity is first created. */public void onCreate(Bundle icicle) {    super.onCreate(icicle);    requestWindowFeature(Window.FEATURE_NO_TITLE);    WebView webview = new WebView(this);    webview.getSettings().setJavaScriptEnabled(true);    webview.loadUrl(""http://www.talk-of-the-tyne.co.uk"");    setContentView(webview);    private class MainScreenActivity extends WebViewClient {        @Override        public boolean shouldOverrideUrlLoading(WebView view, String url) {            view.loadUrl(url);            return true;        }    }    }}</code></pre><p>Apologies if I am being thick about this, I just can't seem to get my head around this one</p>","613649","","613649","","2011-02-12 20:23:22","2011-12-11 19:45:00","Android URL redirect in webview","<android><webview><android-webview>","1","4","1","2011-07-17 03:46:31",""
"4974107","1","4975022","","2011-02-11 21:11:39","0","1148","<p>I have a spinner with huge amount of items, so the simple scrolling is very slow for user. I want to use ""Big"" touchable scrollbar or it like in ScrollView. How can I do it?</p>","497132","","","","","2011-02-11 23:18:28","""Big"" scrollbar for spinner","<android><scrollbar><spinner><scrollview>","2","0","","",""
"4974156","1","4974293","","2011-02-11 21:17:50","0","124","<p>I have an application developed for android phone. Now I am going to customize it to be used on tablet (Galaxy Tab). Assuming I have to redesign some screens and flows for better user experience, are there any tips/things to be aware of/etc. you can share?</p><p>Thanks</p><p>PS. I am aware of this: <a href=""http://innovator.samsungmobile.com/galaxyTab.do"" rel=""nofollow"">http://innovator.samsungmobile.com/galaxyTab.do</a></p>","367677","","367677","","2011-02-11 21:42:46","2011-02-11 21:42:46","Customizing an application for tablet - any suggestions?","<android><gui><user-interface><user-experience><tablet>","1","0","","",""
"4974309","1","4974377","","2011-02-11 21:33:53","18","49254","<p>Where can I get PDF version of Android SDK docs and developer guide. Saw a posting that installed sdk has the html docs, mine does not.  Is this a separate download. any eclipse update  for this? Thanks</p>","602260","","210916","","2011-02-12 04:06:13","2013-10-31 07:06:09","Android SDK and Developer Guide Offline or PDF","<android><pdf><documentation>","3","0","8","2013-10-30 12:31:20",""
"4974321","1","4974395","","2011-02-11 21:35:10","0","1521","<p>I have a basic TabActivity. On android 2.1 (and possibly older versions), it looks like a drop shadow is added below the tab widget. On 2.3, this shadow is not present. Is there a way to turn that shadow off completely? Maybe something like ""android:fadingEdgeLength=0"" ?</p><p>Thanks</p>","291701","","","","","2011-02-11 21:43:55","TabHost - get rid of drop shadow?","<android>","1","0","1","",""
"4974401","1","4974480","","2011-02-11 21:44:40","2","2783","<p>Beginner android question. Ok, I've successfully written files. E.g.                 // get the file name            String filename = getResources().getString(R.string.filename);</p><pre><code>        FileOutputStream toWriteTo;        try {            toWriteTo = openFileOutput(filename, MODE_WORLD_READABLE);            // get the string to write            String toWrite = getResources().getString(R.string.contentstowrite);            toWriteTo.write(toWrite.getBytes());            toWriteTo.close();            ...                        }        catch (Exception ex) {            Toast.makeText(HelloFilesAppActivity.this, ""fail!"", Toast.LENGTH_SHORT).show();        }        }});</code></pre><p>And I've proved that it is there by reading it and displaying contents, even using getFilesDir() and displaying all of the files in the folder. </p><p>Everything I read says that the files are in /data/data//files/But I cannot find them. (I'm on Windows XP). My install didn't use default locations because my C:\ is pretty full. I looked in C:\Documents and Settings\Mike\.android\avd and in the project folder and in the place I installed the SDK: D:\Program Files\Android\android-sdk-windows. So where is /data/data/ ?</p><p>I read that I can use ADB to push and pull files back and forth, but I'm using Eclipse ADT and I'd prefer to use something other than command line. The book I'm using seems to imply that you can use Eclipse but then proceeds to give the command-line commands. </p><p>I found info about the Project Explorer in the DDMS, but I don't see the files I have written.</p><p>I've been working under the assumption that I might want to create a text file using some other means in Windows that I would read with my App. So if the answer is ""why do you want to do this?"", that's what I'm after. Eventually a DB probably too (that's in the next chapter :-) ).</p><p>Do I have to use the ADB command line?</p><p>thanks</p><p>Mike</p>","613586","","","","","2011-02-11 22:00:37","where is /data/data/?","<android>","2","0","1","",""
"4974523","1","","","2011-02-11 22:00:14","2","2199","<p>I'm currently playing with the marquee feature of Android's Textview. But there is a problem-I have a layout containing a few TextView. On one of them, which shows a title of an music file, I want to apply the marquee feature.On another, I keep updating the current track time (every second).</p><p>The problem is, everytime the TextView which shows the track time is updated (setText()), the marquee of the other TextView stops. I guess this is because setTExt() moves the focus to the TextView which I to apply the text to.</p><p>Is there a solution for this?</p><p>I used a custom class for the marquee TextView from this <a href=""http://androidbears.stellarpc.net/?p=185"" rel=""nofollow"">tutorial</a></p><p>Is there a possibility (maybe a custom class as well) for the other TextView to not ""steal"" focus?</p><p>Thanks!</p><p>Regards</p>","613695","","","","","2012-12-12 14:43:46","Android TextView SetText() stops marquee of another TextView - workaround?","<android><textview><marquee>","5","0","","",""
"4974565","1","4986359","","2011-02-11 22:06:36","0","300","<p>There is an AsyncTask that fetches something from the web and then calls Activity.showDialog in onPostExecute(...).What exactly happens if </p><ol><li>I start AsyncTask in Activity B</li><li>Go back to Activity A</li><li>AsyncTask finishes it's job (doInBackground() returns)</li></ol><p>? Is onPostExecute() called?</p>","243225","","243225","","2011-02-13 16:03:40","2011-02-13 19:33:20","How exactly does AyncTask behave in this situation?","<android>","2","0","1","",""
"4974568","1","4974695","","2011-02-11 22:06:43","86","91969","<p>I'm on Mac, working on Android development from the terminal.  I have successfully created the <a href=""http://developer.android.com/resources/tutorials/hello-world.html"">HelloWorld</a> project and now I'm trying to run it from the command line in the Android emulator.  Which command runs the emulator for my HelloWorld project?</p><p>I already have the Android tools and platform-tools in my PATH.</p><p><strong>Edit:</strong></p><p>How do I tell the emulator to run my HelloWorld project from the command line?  I've already built the project with ant.</p>","117642","","403455","","2012-09-19 19:01:14","2013-06-14 06:17:59","How do I launch the Android emulator from the command line?","<android><command-line><android-emulator><console><console-application>","6","0","38","",""
"4974591","1","4974875","","2011-02-11 22:09:46","9","10135","<p>I'm trying to parse the XML HttpResponse i get from a HttpPost to a server (last.fm), for a last.fm android app. If i simply parse it to string i can see it being a normal xml string, with all the desired information. But i just cant parse the single NameValuePairs. This is my HttpResponse object:</p><pre><code>HttpResponse response = client.execute(post);HttpEntity r_entity = response.getEntity();</code></pre><p>I tried two different things and non of them worked. First i tried to retrieve the NameValuePairs:</p><pre><code>List&lt;NameValuePair&gt; answer = URLEncodedUtils.parse(r_entity);String name = ""empty"";String playcount = ""empty"";for (int i = 0; i &lt; answer.size(); i++){   if (answer.get(i).getName().equals(""name"")){      name = answer.get(i).getValue();   } else if (answer.get(i).getName().equals(""playcount"")){      playcount = answer.get(i).getValue();   }}</code></pre><p>After this code, name and playcount remain ""empty"". So i tried to use a XML Parser:</p><pre><code>DocumentBuilder db = DocumentBuilderFactory.newInstance().newDocumentBuilder();Document answer = db.parse(new DataInputStream(r_entity.getContent()));NodeList nl = answer.getElementsByTagName(""playcount"");String playcount = ""empty"";for (int i = 0; i &lt; nl.getLength(); i++) {   Node n = nl.item(i);   Node fc = n.getFirstChild();   playcount Url = fc.getNodeValue();}</code></pre><p>This seems to fail much earlier since it doesn't even get to setting the playcount variable. But like i said if i perform this:</p><pre><code>EntityUtils.toString(r_entity);</code></pre><p>I will get a perfect xml string. So it should no problem to pars it since the HttpResponse contains the correct information. What am i doing wrong?</p>","435036","","435036","","2011-02-11 22:22:15","2011-02-11 22:52:25","Parsing a XML HttpResponse","<android><xml><parsing><http-post><httpresponse>","3","0","1","",""
"4974594","1","4975097","","2011-02-11 22:10:57","0","85","<p>is HTML &amp;/ xHTML within the res / assets folder searchable @ run time like XML?Thnx!</p>","742030","","742030","","2011-02-11 22:37:00","2011-02-11 23:29:35","Is HTML searchable?","<android><html><xhtml>","1","4","","",""
"4974789","1","4974829","","2011-02-11 22:39:30","2","1818","<p>I am getting a java.lang.NullPointerException error on line 41 (setText) when I execute the following code.</p><p>I have seen EditText boxes being set with this line before and I do not understand what I am doing wrong.</p><p>I have no experience with eclipse or java but I am trying to learn.  Please help!</p><p>Code:</p><pre><code>package Psychrometric.Calculator;import android.app.Activity;import android.app.AlertDialog;import android.util.Log;import android.view.View;import android.view.View.OnClickListener;import android.widget.Button;import android.widget.EditText;import android.widget.TextView;import android.text.TextUtils;import android.os.Bundle;public class Calculator extends Activity {private EditText altitude;private EditText barometricPressure;/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);           setContentView(R.layout.main);    Button calcButton = (Button) findViewById(R.id.calcButton);    calcButton.setOnClickListener(new OnClickListener() {            public void onClick(View arg0) {                    altitude = (EditText) findViewById(R.id.altitude);            if (altitude.getText().length() != 0)             {                double altitudeDouble = new Double(altitude.getText().toString());                     double barometricPressureDouble = 29.92 * java.lang.Math.pow((1 - 0.0000068753 * altitudeDouble), 5.259);                 altitude.setText(Double.toString(altitudeDouble));                barometricPressure.setText(Double.toString(barometricPressureDouble));            }    }   });   }   }XML:&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;ScrollView xmlns:android=""http://schemas.android.com/apk/res/android""android:id=""@+id/ScrollView01"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;&lt;TableLayoutandroid:id=""@+id/widget27""android:layout_width=""320px""android:layout_height=""825px""xmlns:android=""http://schemas.android.com/apk/res/android""android:orientation=""vertical""android:stretchColumns=""1""&gt;&lt;TableRowandroid:id=""@+id/firstRow""android:layout_width=""fill_parent""android:layout_height=""75px""xmlns:android=""http://schemas.android.com/apk/res/android""android:orientation=""horizontal""&gt;&lt;Buttonandroid:id=""@+id/calcButton""android:layout_width=""185px""android:layout_height=""75px""android:text=""Calculate""&gt;&lt;/Button&gt;&lt;/TableRow&gt;&lt;TableRowandroid:id=""@+id/widget45""android:layout_width=""fill_parent""android:layout_height=""50px""xmlns:android=""http://schemas.android.com/apk/res/android""android:orientation=""horizontal""&gt;&lt;TextViewandroid:id=""@+id/widget221""android:layout_width=""wrap_content""android:layout_height=""50px""android:text=""Altitude""&gt;&lt;/TextView&gt;&lt;EditTextandroid:id=""@+id/altitude""android:layout_width=""wrap_content""android:layout_height=""50px""android:textSize=""18sp""android:numeric=""decimal""&gt;&lt;/EditText&gt;&lt;TextViewandroid:id=""@+id/widget454""android:layout_width=""wrap_content""android:layout_height=""50px""android:text=""ft""&gt;&lt;/TextView&gt;&lt;/TableRow&gt;&lt;TableRowandroid:id=""@+id/widget32""android:layout_width=""fill_parent""android:layout_height=""50px""xmlns:android=""http://schemas.android.com/apk/res/android""android:orientation=""horizontal""&gt;&lt;TextViewandroid:id=""@+id/widget222""android:layout_width=""wrap_content""android:layout_height=""50px""android:text=""Barometric Pressure""&gt;&lt;/TextView&gt;&lt;EditTextandroid:id=""@+id/barometricPressure""android:layout_width=""wrap_content""android:layout_height=""50px""android:textSize=""18sp""android:numeric=""decimal""&gt;&lt;/EditText&gt;&lt;TextViewandroid:id=""@+id/widget455""android:layout_width=""wrap_content""android:layout_height=""50px""android:text=""in. Hg""&gt;&lt;/TextView&gt;&lt;/TableRow&gt;&lt;/TableLayout&gt;&lt;/ScrollView&gt;LogCat:02-11 12:49:02.334: DEBUG/AndroidRuntime(11161): Shutting down VM02-11 12:49:02.334: WARN/dalvikvm(11161): threadid=1: thread exiting with uncaught exception (group=0x400259f8)02-11 12:49:02.394: ERROR/AndroidRuntime(11161): FATAL EXCEPTION: main02-11 12:49:02.394: ERROR/AndroidRuntime(11161): java.lang.NullPointerException02-11 12:49:02.394: ERROR/AndroidRuntime(11161):     at Psychrometric.Calculator.Calculator$1.onClick(Calculator.java:41)02-11 12:49:02.394: ERROR/AndroidRuntime(11161):     at android.view.View.performClick(View.java:2408)02-11 12:49:02.394: ERROR/AndroidRuntime(11161):     at android.view.View$PerformClick.run(View.java:8817)02-11 12:49:02.394: ERROR/AndroidRuntime(11161):     at android.os.Handler.handleCallback(Handler.java:587)02-11 12:49:02.394: ERROR/AndroidRuntime(11161):     at android.os.Handler.dispatchMessage(Handler.java:92)02-11 12:49:02.394: ERROR/AndroidRuntime(11161):     at android.os.Looper.loop(Looper.java:144)02-11 12:49:02.394: ERROR/AndroidRuntime(11161):     at android.app.ActivityThread.main(ActivityThread.java:4937)02-11 12:49:02.394: ERROR/AndroidRuntime(11161):     at java.lang.reflect.Method.invokeNative(Native Method)02-11 12:49:02.394: ERROR/AndroidRuntime(11161):     at java.lang.reflect.Method.invoke(Method.java:521)02-11 12:49:02.394: ERROR/AndroidRuntime(11161):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)02-11 12:49:02.394: ERROR/AndroidRuntime(11161):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)02-11 12:49:02.394: ERROR/AndroidRuntime(11161):     at dalvik.system.NativeStart.main(Native Method)02-11 12:49:02.404: WARN/ActivityManager(220):   Force finishing activity Psychrometric.Calculator/.Calculator</code></pre>","613741","","139010","","2011-02-11 22:43:15","2011-02-11 22:46:26","java.lang.NullPointerException when trying to set EditText widget","<android><eclipse><nullpointerexception>","1","1","","",""
"4974816","1","4974937","","2011-02-11 22:44:09","18","6005","<p>Whenever I start my app, I get a <code>java.lang.IllegalArgumentException: column '_id' does not exist</code> error in my LogCat. I have created the column <code>'_id'</code>, but it still throws this. Here is my main .java:</p><pre><code>package com.gantt.shoppinglist;import android.app.Dialog;import android.app.ListActivity;import android.database.Cursor;import android.os.Bundle;import android.view.View;import android.view.View.OnClickListener;import android.widget.Button;import android.widget.EditText;import android.widget.ListView;import android.widget.SimpleCursorAdapter;public class ShoppingList extends ListActivity {    private DataHelper DataHelper;    /** Called when the activity is first created. */    @Override    protected void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        DataHelper = new DataHelper(this);        Cursor c = (Cursor) DataHelper.selectAll();        long id = c.getLong(c.getColumnIndex(""_id""));        startManagingCursor(c);        ListView lv = (ListView) findViewById(android.R.id.list);        String[] from = new String[] { com.gantt.shoppinglist.DataHelper.getDatabaseName() };        int[] to = new int[] { android.R.id.text1 };        SimpleCursorAdapter adapter = new SimpleCursorAdapter(this,                android.R.layout.simple_list_item_1, c, from, to);               lv.setAdapter(adapter);        Button button1main = (Button) findViewById(R.id.add);        button1main.setOnClickListener(new OnClickListener()  {            @Override            public void onClick(View v)  {            final Dialog additem = new Dialog(ShoppingList.this);            additem.setContentView(R.layout.maindialog);            final EditText et = (EditText)additem.findViewById(R.id.edittext);            additem.setTitle(""Type your item"");            additem.setCancelable(true);            et.setHint(""Type the name of an item..."");            Button button = (Button) additem.findViewById(R.id.cancel);            button.setOnClickListener(new OnClickListener()  {                @Override                public void onClick(View v)  {                    additem.dismiss();                }            });            additem.show();            Button ok = (Button) additem.findViewById(R.id.ok);            ok.setOnClickListener(new OnClickListener() {                @Override                public void onClick(View v) {                    final String text = et.getText().toString();                    additem.dismiss();                    et.setText("""");                }            });       }        });    }}</code></pre><p>Here is my DataHelper class:</p><pre><code>package com.gantt.shoppinglist;import java.util.ArrayList;import java.util.List;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;public class DataHelper {       private static final String DATABASE_NAME = ""items.db"";       private static final int DATABASE_VERSION = 1;       private static final String TABLE_NAME = ""table1"";       public static final String KEY_ROWID = ""_id"";       private Context context;       private SQLiteDatabase db;       private SQLiteStatement insertStmt;       private static final String INSERT = ""insert into ""           + TABLE_NAME + ""(name) values (?)"";       public DataHelper(Context context) {          this.context = context;          OpenHelper openHelper = new OpenHelper(this.context);          this.db = openHelper.getWritableDatabase();          this.insertStmt = this.db.compileStatement(INSERT);       }       public long insert(String name) {          this.insertStmt.bindString(1, name);          return this.insertStmt.executeInsert();       }       public void deleteAll() {          this.db.delete(TABLE_NAME, null, null);       }       public Cursor selectAll() {          List&lt;String&gt; list = new ArrayList&lt;String&gt;();          Cursor cursor = this.db.query(TABLE_NAME, new String[] { ""name"" },             null, null, null, null, ""name desc"");          if (cursor.moveToFirst()) {             do {                list.add(cursor.getString(0));              } while (cursor.moveToNext());          }          if (cursor != null &amp;&amp; !cursor.isClosed()) {             cursor.close();          }          return cursor;       }       public static String getDatabaseName() {        return DATABASE_NAME;    }    private static class OpenHelper extends SQLiteOpenHelper {          OpenHelper(Context context) {             super(context, getDatabaseName(), null, DATABASE_VERSION);          }          @Override          public void onCreate(SQLiteDatabase db) {              db.execSQL(""CREATE TABLE "" + TABLE_NAME + ""(id INTEGER PRIMARY KEY, name TEXT"");          }          @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 "" + TABLE_NAME);             onCreate(db);          }       }    }</code></pre>","560096","","","","","2013-02-06 13:38:03","App Crashes On Startup Due To java.lang.IllegalArgumentException: column '_id' does not exist","<android><sqlite><crash><cursor>","2","1","1","",""
"4974832","1","4974870","","2011-02-11 22:47:00","3","944","<p>When I try to <code>findViewById()</code> on my custom view I keep getting a <code>ClassCastException</code>. I've tried so many things that I'm sure I've botched the code now!  </p><p>To make sure I'm not going insane I stripped down the classes to their bare minimum inorder to find what was wrong.  </p><p>I'm new to android programming and I'm sure I'm missing something basic. </p><p><strong>This is <code>BaseImageView</code> an extended view class.</strong></p><pre><code>package com.company.product.client.android.gui.views;import android.content.Context;import android.graphics.Canvas;import android.graphics.Color;import android.view.View;public class BaseImageView    extends View{    public BaseImageView(Context context)    {        super(context);    }    @Override    protected void onDraw(Canvas canvas)    {        super.onDraw(canvas);        canvas.drawColor(Color.GREEN);    }}</code></pre><p><strong>This is <code>LiveImageView</code> an extension of the <code>BaseImageView</code> class.</strong></p><pre><code>package com.company.product.client.android.gui.views;import android.content.Context;import android.util.AttributeSet;public class LiveImageView    extends BaseImageView{    public LiveImageView(Context context, AttributeSet attrs)    {        super(context);    }}</code></pre><p><strong>Here is the Layout <code>my_view.xml</code>.</strong>    </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:gravity=""center""&gt;    &lt;View        class=""com.company.product.client.android.gui.views.LiveImageView""        android:id=""@+id/lvImage""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content"" /&gt;&lt;/LinearLayout&gt;</code></pre><p><strong>And here is the onCreate in my Activity <code>LiveViewActivity</code>.</strong></p><pre><code>@Overridepublic void onCreate(Bundle savedInstanceState){    super.onCreate(savedInstanceState);    try    {        setContentView(R.layout.my_view);        final LiveImageView lvImage = (LiveImageView) findViewById(R.id.lvImage);    }    catch (final Exception e)    {        Log.e(TAG, ""onCreate() Exception: "" + e.toString());        e.printStackTrace();    }</code></pre><p><strong>Finally, this is stack trace.</strong></p><pre><code>02-11 17:25:24.829: ERROR/LiveViewActivity(1942): onCreate() Exception: java.lang.ClassCastException: android.view.View02-11 17:25:24.839: WARN/System.err(1942): java.lang.ClassCastException: android.view.View02-11 17:25:24.839: WARN/System.err(1942):     at com.company.product.client.android.gui.screen.LiveViewActivity.onCreate(LiveViewActivity.java:26)02-11 17:25:24.839: WARN/System.err(1942):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)02-11 17:25:24.849: WARN/System.err(1942):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2459)02-11 17:25:24.849: WARN/System.err(1942):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512)02-11 17:25:24.849: WARN/System.err(1942):     at android.app.ActivityThread.access$2200(ActivityThread.java:119)02-11 17:25:24.849: WARN/System.err(1942):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863)02-11 17:25:24.859: WARN/System.err(1942):     at android.os.Handler.dispatchMessage(Handler.java:99)02-11 17:25:24.859: WARN/System.err(1942):     at android.os.Looper.loop(Looper.java:123)02-11 17:25:24.859: WARN/System.err(1942):     at android.app.ActivityThread.main(ActivityThread.java:4363)02-11 17:25:24.869: WARN/System.err(1942):     at java.lang.reflect.Method.invokeNative(Native Method)02-11 17:25:24.869: WARN/System.err(1942):     at java.lang.reflect.Method.invoke(Method.java:521)02-11 17:25:24.869: WARN/System.err(1942):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)02-11 17:25:24.869: WARN/System.err(1942):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)02-11 17:25:24.879: WARN/System.err(1942):     at dalvik.system.NativeStart.main(Native Method)</code></pre>","600257","","","","","2014-03-27 07:46:15","CastClassException on Custom View","<android><android-custom-view>","4","0","1","",""
"4974927","1","4975752","","2011-02-11 23:00:59","2","2842","<p>I am trying to implement a very simple ""todo"" list.I chose to use a ListView of CheckedTextView (with id checked_text), the ListView uses CHOICE_MODE_MULTIPLE of course.</p><p>Now, I am using the SQLite database to store the list items.</p><h2>To fill the list I have something like:</h2><pre><code>cursor = dbHelper.fetchAll();startManagingCursor(cursor);String[] from = new String[] {  DbAdapter.NAME };int[] to = new int[] { R.id.checked_text };SimpleCursorAdapter notes = new SimpleCursorAdapter(this,R.layout.todo_multi_row, cursor, from, to);listView.setAdapter(notes);</code></pre><hr><p>This is working fine, it gets all the items in the DB and for eachitem it creates a CheckedTextView with as text DbAdapter.NAME.</p><p>But what I really need is to get both the text, and the checked state,and check the Rows accordingly.</p><p>Let's say I can get the state (as integer 0/1) from the DB usingDbAdapter.CHECKED.. how can I implement a cursor adapter that gets thejob done?</p><p>I searched everywhere (for instance <a href=""http://stackoverflow.com/questions/2406937/android-save-checkbox-state-in-listview-with-cursor-adapter"">this question</a> which is a mess) but found nothing to solve this problem. Wah. It seemed so easy at first.</p><p>Thanks,<br>Stefano</p><hr><p>@Bert F:<br>Thanks, this is the method I am using to fill my list:</p><pre><code>private void fillData() {        Log.d(""LIST"",""fill"");        cursor = dbHelper.fetchAllTodos();        startManagingCursor(cursor);        String[] from = new String[] { TodoDbAdapter.NAME };        int[] to = new int[] { R.id.checked_text };        SimpleCursorAdapter notes = new SimpleCursorAdapter(this,                R.layout.todo_multi_row, cursor, from, to);        final SimpleCursorAdapter.ViewBinder mViewBinder =            new SimpleCursorAdapter.ViewBinder() {                @Override                public boolean setViewValue(                        final View view,                        final Cursor cursor,                        final int columnIndex) {                    Log.d(""LIST"",view +"" ""+cursor+"" ""+columnIndex);                    CheckedTextView item = (CheckedTextView) view;                    Log.d(""LIST"",""NAME: ""+item.getText()+"" State: ""+item.isChecked());                    return false;                }            };        notes.setViewBinder(mViewBinder);        listView.setAdapter(notes);    }</code></pre><p>Now, as a test I am just printing out what is happening.<br>If I add 1 element to the list what I see is:  </p><pre><code>02-12 14:45:35.913: DEBUG/LIST(22621): fill02-12 14:45:35.933: DEBUG/LIST(22621): android.widget.CheckedTextView@479da398 android.database.sqlite.SQLiteCursor@479d98f0 202-12 14:45:35.933: DEBUG/LIST(22621): NAME:  State: false02-12 14:45:35.933: DEBUG/LIST(22621): android.widget.CheckedTextView@479da398 android.database.sqlite.SQLiteCursor@479d98f0 202-12 14:45:35.943: DEBUG/LIST(22621): NAME: first item State: false02-12 14:45:36.013: DEBUG/LIST(22621): android.widget.CheckedTextView@479dc6c0 android.database.sqlite.SQLiteCursor@479d98f0 202-12 14:45:36.013: DEBUG/LIST(22621): NAME:  State: false02-12 14:45:36.223: DEBUG/LIST(22621): android.widget.CheckedTextView@479dc6c0 android.database.sqlite.SQLiteCursor@479d98f0 202-12 14:45:36.223: DEBUG/LIST(22621): NAME: first item State: false</code></pre><p>And if I check it..  </p><pre><code>02-12 14:53:33.123: DEBUG/LIST(22621): android.widget.CheckedTextView@479dc6c0 android.database.sqlite.SQLiteCursor@479d98f0 202-12 14:53:33.123: DEBUG/LIST(22621): NAME: first item State: false02-12 14:53:33.123: DEBUG/LIST(22621): android.widget.CheckedTextView@479da398 android.database.sqlite.SQLiteCursor@479d98f0 202-12 14:53:33.123: DEBUG/LIST(22621): NAME: first item State: false</code></pre><p>Let aside the fact that it says it is not checked, why is it firing so many times ? I just have 1 item :I</p><hr><p>EDIT: ugly solution</p><pre><code>private void fillData() {        Log.d(""LIST"",""fill"");        cursor = dbHelper.fetchAllTodos();        startManagingCursor(cursor);        String[] from = new String[] { TodoDbAdapter.NAME };        int[] to = new int[] { R.id.checked_text };        SimpleCursorAdapter notes = new SimpleCursorAdapter(this,                R.layout.todo_multi_row, cursor, from, to);        final SimpleCursorAdapter.ViewBinder mViewBinder =            new SimpleCursorAdapter.ViewBinder() {                @Override                public boolean setViewValue(                        final View view,                        final Cursor cursor,                        final int columnIndex) {                     final int checkedIndex =                         cursor.getColumnIndexOrThrow(                                 TodoDbAdapter.CHECKED);                     Log.d(""LIST"",""VIEW: ""+view+"" NAME: ""+cursor.getString(columnIndex)+"" ""+cursor.getInt(checkedIndex));                    return false;                }            };        notes.setViewBinder(mViewBinder);        listView.setAdapter(notes);    }</code></pre><p>With 2 entry (first selected second not) when I load the list I have:</p><pre><code>02-12 15:59:48.613: DEBUG/LIST(23533): fill02-12 15:59:48.643: DEBUG/LIST(23533): VIEW: android.widget.CheckedTextView@47a30ec0 NAME: test 102-12 15:59:48.653: DEBUG/LIST(23533): VIEW: android.widget.CheckedTextView@47a30ec0 NAME: LOL 002-12 15:59:48.683: DEBUG/LIST(23533): VIEW: android.widget.CheckedTextView@47a30ec0 NAME: test 102-12 15:59:48.683: DEBUG/LIST(23533): VIEW: android.widget.CheckedTextView@47a331f8 NAME: LOL 002-12 15:59:48.713: DEBUG/LIST(23533): VIEW: android.widget.CheckedTextView@47a35770 NAME: test 102-12 15:59:48.713: DEBUG/LIST(23533): VIEW: android.widget.CheckedTextView@47a35770 NAME: LOL 002-12 15:59:48.783: DEBUG/LIST(23533): VIEW: android.widget.CheckedTextView@47a35770 NAME: test 102-12 15:59:48.783: DEBUG/LIST(23533): VIEW: android.widget.CheckedTextView@47a35770 NAME: LOL 0</code></pre><p>Cheers.</p>","613761","","613761","","2011-02-12 15:03:57","2011-02-12 15:03:57","Android: ListView of CheckedTextView + SQLite, display checked rows with Adapter?","<android><sqlite><listview><cursor><checkedtextview>","1","2","","",""
"4974963","1","","","2011-02-11 23:08:29","0","1452","<p>I want to consume a BasicHttp WCF web service with ksoap2 that is compressed by GZIP.</p><p>Is there a way to do this in the Android version of ksoap2 (http://code.google.com/p/ksoap2-android/) or is there another way?</p>","432219","","432219","","2011-02-11 23:19:53","2011-06-10 14:45:38","ksoap2 (Android) and GZIPped BasicHttpBinding","<android><wcf><ksoap2><basichttpbinding>","1","1","","",""
"4975081","1","","","2011-02-11 23:25:53","0","1034","<p>I am currently using managedQuery to query the images in the sdcard by using the mediastore but it couldn't get through the function getColumnIndexOrThrow and pop out a error dialog on the emulator.</p><p>image_cursor = this.managedQuery(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, null, null, null, null);</p><pre><code>    if (image_cursor == null)    {        TextView test = (TextView) this.findViewById(R.id.textView1);        test.setText(""null"");    }    while ( image_cursor.moveToNext()) {        if (image_cursor.getCount() &gt; 0)        {            TextView test = (TextView) this.findViewById(R.id.textView1);            test.setText(""entered"");        int index = image_cursor.getColumnIndexOrThrow(MediaStore.Images.Media.CONTENT_TYPE);        //  TextView test = (TextView) this.findViewById(R.id.textView1);        //  test.setText(image_cursor.getString(index));        }    }}</code></pre><p>Anyone have this problem before?</p>","186820","","","","","2011-02-12 00:23:58","Android cursor getColumnIndexOrThrow gave me an error","<android><cursor><managed>","1","0","","",""
"4975162","1","","","2011-02-11 23:41:48","0","208","<p>I have several rectangular shapes on my screen, some of them rotated. Now the user clicks on a position(x,y) ofthe screen. Is there a standard algorithm to detect which of the rectangle(s) was clicked(contains the (x,y) coordinates)?</p><p>This is related to a problem I'm having:<a href=""http://stackoverflow.com/questions/4973606/child-views-that-are-translated-scaled-or-rotated-disappear"">Child Views that are translated, scaled or rotated disappear </a></p>","480894","","","Aryabhatta","2011-02-11 23:47:23","2011-02-12 02:24:14","How to detect which rectangle was clicked?","<android><algorithm><android-layout>","1","2","","",""
"4975198","1","4975308","","2011-02-11 23:48:05","2","349","<p>I'm using <a href=""http://code.google.com/p/android-misc-widgets/source/browse/trunk/android-misc-widgets/src/org/miscwidgets/widget/Panel.java?r=9"" rel=""nofollow"">an android panel widget</a> in my application to create a sliding panel effect from the top of my app (similar to the notification panel).  When clicked the panel opens to fill about 30% of the screen.  By default the panel is closed and has a handle to ""show"".  I'm trying to modify it to be in the shown state by default but am unsure how to do it.  I assume that I'll have to modify the Panel.java file but I suppose it might also be done in my layout file.. Any tips?</p>","558840","","","","","2011-02-12 00:32:52","Inflating panel.java by default in android","<android><panel>","1","0","","",""
"4975240","1","4975327","","2011-02-11 23:55:08","0","190","<p>I have a ListView that contains a list of TextViews, and in my onItemClick() method, I need to get at the string value of the TextView that was clicked. How do I do this?</p><p>Here is my onItemClick function:</p><pre><code>public void onItemClick(AdapterView&lt;?&gt; arg0, View arg1, int arg2,                    long arg3) {                Intent startNewActivity=new Intent(getBaseContext(),DetailCurrencyActivity.class);                startActivity(startNewActivity);            }</code></pre><p>Update 1:This is the custom list adapter where the listview gets populated:</p><pre><code>//custom list adapter    public class listRecordAdapter extends BaseAdapter{        private JSONObject[] listOf_Records=null;        private Context context;        private TextView ticker,value,value2,changeval;        public listRecordAdapter(Context context,JSONObject[] listOf_Records){            Log.i(""Concerts"", ""artistEventAdapter: constructor"");            this.listOf_Records=listOf_Records;            this.context=context;        }        @Override        public int getCount() {                     return listOf_Records.length;        }        @Override        public Object getItem(int position) {                       return listOf_Records[position];        }        @Override        public long getItemId(int position) {                       return position;        }        @Override        public View getView(int position, View convertView, ViewGroup parent) {            Log.i(""CurrencyActivity"", ""artistListAdapter: getView"");            if(convertView==null){                convertView=LayoutInflater.from(context).inflate(R.layout.forex_listview_item, null);            }            try{                ticker=(TextView)convertView.findViewById(R.id.ticker);                ticker.setText(this.listOf_Records[position].getString(""ticker""));                Log.i(""CurrentActivity"", ""listRecordAdapter: getView ticker-&gt;""+ticker.getText());                value=(TextView)convertView.findViewById(R.id.value);                           value.setText(this.listOf_Records[position].getString(""value""));                Log.i(""CurrentActivity"", ""listRecordAdapter: getView value-&gt;""+value.getText());                value2=(TextView)convertView.findViewById(R.id.value2);                         value2.setText(this.listOf_Records[position].getString(""value2""));                Log.i(""CurrentActivity"", ""listRecordAdapter: getView value2-&gt;""+value2.getText());                changeval=(TextView)convertView.findViewById(R.id.changeval);                           changeval.setText(this.listOf_Records[position].getString(""changeval""));                Log.i(""CurrentActivity"", ""listRecordAdapter: getView changeval-&gt;""+changeval.getText());            }catch(Exception ex){                Log.i(""CurrencyActivity"", ""listRecordAdapter: getView exiting with exception message-&gt;""+ex.getMessage());            }            return convertView;        }    }</code></pre>","549226","","549226","","2011-02-12 00:52:22","2011-02-12 00:52:22","Need to access the text of a TextView child of a ListView","<java><android>","2","1","","",""
"4975290","1","4975714","","2011-02-12 00:02:25","2","3203","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/4447477/android-how-to-copy-files-in-assets-to-sdcard"">Android: How to copy files in &#39;assets&#39; to sdcard?</a>  </p></blockquote><p>Is there any way to copy the content of the asset folder with all the directories, subdirectories and files to the sdcard? </p><p>Thank you in advance!! </p>","217527","","","","","2011-02-12 01:32:02","how to copy content of asset folder to sdcard?","<android>","1","2","","2011-09-21 07:33:19",""
"4975305","1","","","2011-02-12 00:05:34","0","899","<p>I am new to android and this is the first time I have tried anything with VideoView. I am streaming a couple MP4 files, the first (about 5mb and 1 minute long) opens automatically the other two (about 100mb and 1 hour long) require user interaction and while it plays fine the heap keeps growing and eventually it starts producing memory errors and upon user interaction will force close. I know I am missing something and made a number of mistakes but hope someone will be kind enough to help me resolve these issues and possibly educate me as to what and why. Thank you for your time.</p><p>public class VideoPlayer extends Activity implements OnClickListener{ </p><pre><code>/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    this.setVolumeControlStream(AudioManager.STREAM_MUSIC);    requestWindowFeature(Window.FEATURE_NO_TITLE);       getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,                                WindowManager.LayoutParams.FLAG_FULLSCREEN);     setContentView(R.layout.main);    VideoView videoView = (VideoView) findViewById(R.id.VideoView);      MediaController mediaController = new MediaController(this);      mediaController.setAnchorView(videoView);    videoView.setMediaController(mediaController);     Uri video = Uri.parse(""URL"");     videoView.setVideoURI(video);    videoView.requestFocus();    videoView.start();      View Button1 = findViewById(R.id.video1);         Button1.setOnClickListener(this);    View Button2 = findViewById(R.id.video2);         Button2.setOnClickListener(this);}  public void onClick(View view) {     VideoView videoView = (VideoView) findViewById(R.id.VideoView);    switch (view.getId()) {    case R.id.video1:    Uri video1 = Uri.parse(""URL"");     videoView.setVideoURI(video1);    videoView.requestFocus();    videoView.start();     Toast.makeText(VideoPlayer.this, ""Episode1"", Toast.LENGTH_SHORT).show();    break;     case R.id.video2:    Uri video2 = Uri.parse(""URL"");     videoView.setVideoURI(video2);    videoView.requestFocus();    videoView.start();    Toast.makeText(VideoPlayer.this, ""Episode 2"", Toast.LENGTH_SHORT).show();    break;     } }</code></pre><p>}</p><p>Log Cat:</p><p>02-12 01:36:18.407 21977 25284 E AdMobSDK:<br>at com.admob.android.ads.u.a(AssetDownloader.java:211)</p><p>02-12 01:36:18.407 21977 25284 E AdMobSDK:<br>at com.admob.android.ads.i.d(AdMobURLConnector.java:201)</p><p>02-12 01:36:18.407 21977 25284 E AdMobSDK:<br>at com.admob.android.ads.i.run(AdMobURLConnector.java:284)</p><p>02-12 01:36:18.407 21977 25284 E AdMobSDK:<br>at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:648)</p><p>02-12 01:36:18.407 21977 25284 E AdMobSDK:<br>at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:673)</p><p>02-12 01:36:18.407 21977 25284 E AdMobSDK:<br>at java.lang.Thread.run(Thread.java:1058)</p><p>02-12 01:36:18.507 21977 25285 E AdMobSDK: couldn't create a Bitmap</p><p>02-12 01:36:18.507 21977 25285 E AdMobSDK: java.lang.OutOfMemoryError: bitmap size exceeds VM budget</p><p>02-12 01:36:18.507 21977 25285 E AdMobSDK:<br>at android.graphics.BitmapFactory.nativeDecodeByteArray(Native Method)</p><p>02-12 01:36:18.507 21977 25285 E AdMobSDK:<br>at android.graphics.BitmapFactory.decodeByteArray(BitmapFactory.java:308)</p><p>02-12 01:36:18.507 21977 25285 E AdMobSDK:<br>at android.graphics.BitmapFactory.decodeByteArray(BitmapFactory.java:321)</p><p>02-12 01:36:18.507 21977 25285 E AdMobSDK:<br>at com.admob.android.ads.u.a(AssetDownloader.java:211)</p><p>02-12 01:36:18.507 21977 25285 E AdMobSDK:<br>at com.admob.android.ads.i.d(AdMobURLConnector.java:201)</p><p>02-12 01:36:18.507 21977 25285 E AdMobSDK:<br>at com.admob.android.ads.i.run(AdMobURLConnector.java:284)</p><p>02-12 01:36:18.507 21977 25285 E AdMobSDK:<br>at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:648)</p><p>02-12 01:36:18.507 21977 25285 E AdMobSDK:<br>at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:673)</p><p>02-12 01:36:18.507 21977 25285 E AdMobSDK:<br>at java.lang.Thread.run(Thread.java:1058)</p><p>02-12 01:36:18.507 21977 25285 E AndroidRuntime: Crash logging skipped, alreadylogging another crash</p><p>02-12 01:36:18.517 21977 25285 I AdMobSDK: assetsDidFailToLoad()</p><p>02-12 01:36:18.527 21977 25284 I AdMobSDK: assetsDidFailToLoad()</p><p>02-12 01:36:38.587 21977 25296 I AdMobSDK: No fill.  Server replied that no ads are available (859ms)</p><p>02-12 01:37:00.887 21977 25285 E dalvikvm-heap: 14400-byte external allocation too large for this process.</p><p>02-12 01:37:00.907 21977 25285 E         : VM won't let us allocate 14400 bytes</p><p>02-12 01:37:01.017 21977 25284 E dalvikvm-heap: 1444-byte external allocation to o large for this process.</p><p>02-12 01:37:01.017 21977 25284 E         : VM won't let us allocate 1444 bytes</p><p>02-12 01:37:01.057 21977 25285 E AdMobSDK: couldn't create a Bitmap</p><p>02-12 01:37:01.057 21977 25285 E AdMobSDK: java.lang.OutOfMemoryError: bitmap size exceeds VM budget</p><p>02-12 01:37:01.057 21977 25285 E AdMobSDK:<br>at android.graphics.BitmapFactory.nativeDecodeByteArray(Native Method)</p><p>02-12 01:37:01.057 21977 25285 E AdMobSDK:<br>at android.graphics.BitmapFactory.decodeByteArray(BitmapFactory.java:308)</p><p>02-12 01:37:01.057 21977 25285 E AdMobSDK:<br>at android.graphics.BitmapFactory.decodeByteArray(BitmapFactory.java:321)</p><p>02-12 01:37:01.057 21977 25285 E AdMobSDK:<br>at com.admob.android.ads.u.a(AssetDownloader.java:211)</p><p>02-12 01:37:01.057 21977 25285 E AdMobSDK:<br>at com.admob.android.ads.i.d(AdMobURLConnector.java:201)</p><p>02-12 01:37:01.057 21977 25285 E AdMobSDK:<br>at com.admob.android.ads.i.run(AdMobURLConnector.java:284)</p><p>02-12 01:37:01.057 21977 25285 E AdMobSDK:<br>at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:648)</p><p>02-12 01:37:01.057 21977 25285 E AdMobSDK:<br>at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:673)</p><p>02-12 01:37:01.057 21977 25285 E AdMobSDK:<br>at java.lang.Thread.run(Thread.java:1058)</p><p>02-12 01:37:01.137 21977 25284 E AdMobSDK: couldn't create a Bitmap</p><p>02-12 01:37:01.137 21977 25284 E AdMobSDK: java.lang.OutOfMemoryError: bitmap size exceeds VM budget</p><p>02-12 01:37:01.137 21977 25284 E AdMobSDK:<br>at android.graphics.BitmapFactory.nativeDecodeByteArray(Native Method)</p><p>02-12 01:37:01.137 21977 25284 E AdMobSDK:<br>at android.graphics.BitmapFactory.decodeByteArray(BitmapFactory.java:308)</p><p>02-12 01:37:01.137 21977 25284 E AdMobSDK:<br>at android.graphics.BitmapFactory.decodeByteArray(BitmapFactory.java:321)</p><p>02-12 01:37:01.137 21977 25284 E AdMobSDK:<br>at com.admob.android.ads.u.a(AssetDownloader.java:211)</p><p>02-12 01:37:01.137 21977 25284 E AdMobSDK:<br>at com.admob.android.ads.i.d(AdMobURLConnector.java:201)</p><p>02-12 01:37:01.137 21977 25284 E AdMobSDK:<br> at com.admob.android.ads.i.run(AdMobURLConnector.java:284)</p><p>02-12 01:37:01.137 21977 25284 E AdMobSDK:<br>at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:648)</p><p>02-12 01:37:01.137 21977 25284 E AdMobSDK:<br>at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:673)</p><p>02-12 01:37:01.137 21977 25284 E AdMobSDK:<br>at java.lang.Thread.run(Thread.java:1058)</p><p>02-12 01:37:01.157 21977 25284 E AndroidRuntime: Crash logging skipped, alreadylogging another crash</p><p>02-12 01:37:01.177 21977 25284 I AdMobSDK: assetsDidFailToLoad()</p><p>02-12 01:37:21.367 21977 25317 I AdMobSDK: No fill.  Server replied that no adsare available (914ms)</p><p>02-12 01:37:42.327 21977 25326 I AdMobSDK: No fill.  Server replied that no ads are available (902ms)</p><p>02-12 01:38:00.027 21977 21977 E dalvikvm-heap: 1024-byte external allocation to o large for this process.</p><p>02-12 01:38:00.047 21977 21977 E         : VM won't let us allocate 1024 bytes</p><p>02-12 01:38:06.747    94   117 W WindowManager: Key dispatching timed out sending to com.test.player.one/com.test.player.one.VideoPlayer</p><p>02-12 01:38:06.757    94   117 W WindowManager: Dispatch state: {{KeyEvent{action=1 code=25 repeat=0 meta=0 scancode=53 mFlags=8} to Window{4372b048 Panel:com.test.player.one/com.test.player.one.VideoPlayer paused=false} @ 1297496735963 lw=Window{4372b048 Panel:com.test.player.one/com.test.player.one.VideoPlayer paused=false} lb=android.os.BinderProxy@43708e60 fin=false gfw=true ed=true tts=0 wf=false fp=false mcf=Window{437e9590 Panel:com.test.player.one/com.test.player.one.VideoPlayer paused=false}}}</p><p>02-12 01:38:06.767    94   117 W WindowManager: Current state:  {{null to Window{4351cc20com.test.player.one/com.test.player.one.VideoPlayer paused=false}@ 1297503486770 lw=Window{4351cc20 com.test.player.one/com.test.player.one.VideoPlayer paused=false} lb=android.os.BinderProxy@435f0470 fin=false gfw=true ed=true tts=0 wf=false fp=false mcf=Window{437e9590 Panel:com.test.player.one/com.test.player.one.VideoPlayer paused=false}}}</p><p>02-12 01:38:11.777    94   117 W WindowManager: Key dispatching timed out sending to com.test.player.one/com.test.player.one.VideoPlayer</p><p>02-12 01:38:11.787    94   117 W WindowManager: Dispatch state: {{KeyEvent{action=1 code=25 repeat=0 meta=0 scancode=53 mFlags=8} to Window{4372b048 Panel:com.test.player.one/com.test.player.one.VideoPlayer paused=false} @ 1297496735963 lw=Window{4372b048 Panel:com.test.player.one/com.test.player.one.VideoPlayer paused=false} lb=android.os.BinderProxy@43708e60 fin=false gfw=true ed=true tts=0 wf=false fp=false mcf=Window{437e9590 Panel:com.test.player.one/com.test.player.one.VideoPlayer paused=false}}}</p><p>02-12 01:38:11.787    94   117 W WindowManager: Current state:  {{null to Window{4351cc20 com.test.player.one/com.test.player.one.VideoPlayer paused=false}@ 1297503491791 lw=Window{4351cc20 com.test.player.one/com.test.player.one.VideoPlayer paused=false} lb=android.os.BinderProxy@435f0470 fin=false gfw=true ed=true tts=0 wf=false fp=false mcf=Window{437e9590 Panel:com.test.player.one/com.test.player.one.VideoPlayer paused=false}}}</p><p>02-12 01:38:11.887    94   117 I ActivityManager: ANR (application not responding) in process: com.test.player.one</p><p>02-12 01:38:11.887    94   117 I ActivityManager: Annotation: keyDispatchingTimedOut</p><p>02-12 01:38:11.887    94   117 I ActivityManager: CPU usage:</p><p>02-12 01:38:11.887    94   117 I ActivityManager: Load: 4.27 / 4.6 / 4.88</p><p>02-12 01:38:11.887    94   117 I ActivityManager: CPU usage from 11872ms to 78ms ago:</p><p>02-12 01:38:11.887    94   117 I ActivityManager:   system_server: 4% = 3% user+ 1% kernel</p><p>02-12 01:38:11.887    94   117 I ActivityManager:   adbd: 1% = 0% user + 0% kernel</p><p>02-12 01:38:11.887    94   117 I ActivityManager:   events/0: 0% = 0% user + 0%kernel</p><p>02-12 01:38:11.887    94   117 I ActivityManager:   com.test.player.one: 0% =0% user + 0% kernel</p><p>02-12 01:38:11.887    94   117 I ActivityManager:   wpa_supplicant: 0% = 0% user + 0% kernel</p><p>02-12 01:38:11.887    94   117 I ActivityManager:   com.android.inputmethod.latin: 0% = 0% user + 0% kernel</p><p>02-12 01:38:11.887    94   117 I ActivityManager:   krpcserversd: 0% = 0% user + 0% kernel</p><p>02-12 01:38:11.887    94   117 I ActivityManager:   kondemand/0: 0% = 0% user +0% kernel</p><p>02-12 01:38:11.887    94   117 I ActivityManager:   servicemanager: 0% = 0% user + 0% kernel</p><p>02-12 01:38:11.887    94   117 I ActivityManager:   port_bridge: 0% = 0% user +0% kernel</p><p>02-12 01:38:11.887    94   117 I ActivityManager:   dhd_dpc: 0% = 0% user + 0% kernel</p><p>02-12 01:38:11.887    94   117 I ActivityManager:   com.motorola.atcommand: 0% = 0% user + 0% kernel</p><p>02-12 01:38:11.887    94   117 I ActivityManager:   logcat: 0% = 0% user + 0% kernel</p><p>02-12 01:38:11.887    94   117 I ActivityManager: TOTAL: 9% = 5% user + 3% kernel</p><p>02-12 01:38:11.897    94   117 I ActivityManager: Removing old ANR trace file from /data/anr/traces.txt</p><p>02-12 01:38:12.197    94   117 W WindowManager: No window to dispatch pointer action 1</p><p>02-12 01:38:12.337    94   104 E ANRInfo : ANR information:PID:21977/test VideoPlayer / test VideoPlayer</p><p>02-12 01:38:12.337    94   104 E ANRInfo : Package Name:com.test.player.one</p><p>02-12 01:38:12.337    94   104 E ANRInfo : shortMsg: ANR keyDispatchingTimedOut</p><p>02-12 01:38:12.337    94   104 E ANRInfo : longMsg:</p><p>02-12 01:38:12.337    94   104 E ANRInfo : ANR (application not responding) in process: com.test.player.one</p><p>02-12 01:38:12.337    94   104 E ANRInfo : Annotation: keyDispatchingTimedOut</p><p>02-12 01:38:12.337    94   104 E ANRInfo : CPU usage:</p><p>02-12 01:38:12.337    94   104 E ANRInfo : Load: 4.27 / 4.6 / 4.88</p><p>02-12 01:38:12.337    94   104 E ANRInfo : CPU usage from 11872ms to 78ms ago:</p><p>02-12 01:38:12.337    94   104 E ANRInfo :   system_server: 4% = 3% user + 1% kernel</p><p>02-12 01:38:12.337    94   104 E ANRInfo :   adbd: 1% = 0% user + 0% kernel</p><p>02-12 01:38:12.337    94   104 E ANRInfo :   events/0: 0% = 0% user + 0% kernel</p><p>02-12 01:38:12.337    94   104 E ANRInfo :   com.test.player.one: 0% = 0% user + 0% kernel</p><p>02-12 01:38:12.337    94   104 E ANRInfo :   wpa_supplicant: 0% = 0% user + 0% kernel</p><p>02-12 01:38:12.337    94   104 E ANRInfo :   com.android.inputmethod.latin: 0% = 0% user + 0% kernel</p><p>02-12 01:38:12.337    94   104 E ANRInfo :   krpcserversd: 0% = 0% user + 0% kernel</p><p>02-12 01:38:12.337    94   104 E ANRInfo :   kondemand/0: 0% = 0% user + 0% kernel</p><p>02-12 01:38:12.337    94   104 E ANRInfo :   servicemanager: 0% = 0% user + 0% kernel</p><p>02-12 01:38:12.337    94   104 E ANRInfo :   port_bridge: 0% = 0% user + 0% kernel</p><p>02-12 01:38:12.337    94   104 E ANRInfo :   dhd_dpc: 0% = 0% user + 0% kernel</p><p>02-12 01:38:12.337    94   104 E ANRInfo :   com.motorola.atcommand: 0% = 0% user + 0% kernel</p><p>02-12 01:38:12.337    94   104 E ANRInfo :   logcat: 0% = 0% user + 0% kernel</p><p>02-12 01:38:12.337    94   104 E ANRInfo : TOTAL: 9% = 5% user + 3% kernel</p><p>02-12 01:38:12.337    94   104 E ANRInfo :</p><p>02-12 01:38:12.337    94   104 E ANRInfo :</p><p>02-12 01:38:12.337    94   104 E ANRInfo : com.android.server.am.ActivityManagerService$AutomaticANRException: ANR information:PID:21977/test VideoPlayer / test VideoPlayer</p><p>02-12 01:38:12.337    94   104 E ANRInfo : Package Name:com.test.player.one</p><p>02-12 01:38:12.337    94   104 E ANRInfo : shortMsg: ANR keyDispatchingTimedOut</p><p>02-12 01:38:12.337    94   104 E ANRInfo : longMsg:</p><p>02-12 01:38:12.337    94   104 E ANRInfo : ANR (application not responding) in process: com.test.player.one</p><p>02-12 01:38:12.337    94   104 E ANRInfo : Annotation: keyDispatchingTimedOut</p><p>02-12 01:38:12.337    94   104 E ANRInfo : CPU usage:</p><p>02-12 01:38:12.337    94   104 E ANRInfo : Load: 4.27 / 4.6 / 4.88</p><p>02-12 01:38:12.337    94   104 E ANRInfo : CPU usage from 11872ms to 78ms ago:</p><p>02-12 01:38:12.337    94   104 E ANRInfo :   system_server: 4% = 3% user + 1% kernel</p><p>02-12 01:38:12.337    94   104 E ANRInfo :   adbd: 1% = 0% user + 0% kernel</p><p>02-12 01:38:12.337    94   104 E ANRInfo :   events/0: 0% = 0% user + 0% kernel</p><p>02-12 01:38:12.337    94   104 E ANRInfo :   com.test.player.one: 0% = 0% user + 0% kernel</p><p>02-12 01:38:12.337    94   104 E ANRInfo :   wpa_supplicant: 0% = 0% user + 0% kernel</p><p>02-12 01:38:12.337    94   104 E ANRInfo :   com.android.inputmethod.latin: 0% = 0% user + 0% kernel</p><p>02-12 01:38:12.337    94   104 E ANRInfo :   krpcserversd: 0% = 0% user + 0% kernel</p><p>02-12 01:38:12.337    94   104 E ANRInfo :   kondemand/0: 0% = 0% user + 0% kernel</p><p>02-12 01:38:12.337    94   104 E ANRInfo :   servicemanager: 0% = 0% user + 0% kernel</p><p>02-12 01:38:12.337    94   104 E ANRInfo :   port_bridge: 0% = 0% user + 0% kernel</p><p>02-12 01:38:12.337    94   104 E ANRInfo :   dhd_dpc: 0% = 0% user + 0% kernel</p><p>02-12 01:38:12.337    94   104 E ANRInfo :   com.motorola.atcommand: 0% = 0% user + 0% kernel</p><p>02-12 01:38:12.337    94   104 E ANRInfo :   logcat: 0% = 0% user + 0% kernel</p><p>02-12 01:38:12.337    94   104 E ANRInfo : TOTAL: 9% = 5% user + 3% kernel</p><p>02-12 01:38:12.337    94   104 E ANRInfo :</p><p>02-12 01:38:12.337    94   104 E ANRInfo :</p><p>02-12 01:38:12.337    94   104 E ANRInfo :<br>at com.android.server.am.ActivityManagerService$2.handleMessage(ActivityManagerService.java:943)</p><p>02-12 01:38:12.337    94   104 E ANRInfo :<br>at android.os.Handler.dispatchMessage(Handler.java:99)</p><p>02-12 01:38:12.337    94   104 E ANRInfo :<br>at android.os.Looper.loop(Looper.java:123)</p><p>02-12 01:38:12.337    94   104 E ANRInfo :<br>at com.android.server.am.ActivityManagerService$AThread.run(ActivityManagerService.java:1293)</p><p>02-12 01:38:12.607    94 25339 I DumpStateReceiver: Finished: 3057 bytes read; status 0</p><p>02-12 01:38:12.647    94 25339 I DumpStateReceiver: Added state dump to 1 crashes</p><p>02-12 01:38:58.937   154   360 I TLSStateManager: org.apache.harmony.nio.internal.SocketChannelImpl@433fecb0: Wrote out 29 bytes of data with 0 bytes remaining.</p><p>02-12 02:24:05.567    94   104 I ActivityManager: Killing process com.test.player.one (pid=21977) at user's request</p><p>02-12 02:24:05.617    94    98 I ActivityManager: Process com.test.player.one (pid 21977) has died.</p><p>02-12 02:24:05.627    94  3990 I WindowManager: WIN DEATH: Window{4351cc20 com.test.player.one/com.test.player.one.VideoPlayer paused=false}</p><p>02-12 02:24:05.647    94  4769 I WindowManager: WIN DEATH: Window{435200f0 SurfaceView paused=false}</p><p>02-12 02:24:05.647    94   249 I WindowManager: WIN DEATH: Window{437e9590 Panel:com.test.player.one/com.test.player.one.VideoPlayer paused=false}</p><p>02-12 02:24:05.697    94    98 I PowerManagerService: keypad run :false:0:0</p><h1>02-12 02:24:05.697    54 23705 E QCvdec  : =====================================</h1><p>02-12 02:24:05.707    54 23705 E QCvdec  :                    Open Max Statistics</p><h1>02-12 02:24:05.707    54 23705 E QCvdec  : =====================================</h1><p>02-12 02:24:05.707    54 23705 E QCvdec  : empty this buffer rate = 23.981506</p><p>02-12 02:24:05.707    54 23705 E QCvdec  : empty this buffer total time = 3284447535</p><p>02-12 02:24:05.707    54 23705 E QCvdec  : empty this buffer count = 78766</p><h1>02-12 02:24:05.717    54 23705 E QCvdec  : =====================================</h1><h1>02-12 02:24:05.717    54 23705 E QCvdec  : =====================================</h1><p>02-12 02:24:05.717    54 23705 E QCvdec  :                      Arm Statistics</p><h1>02-12 02:24:05.717    54 23705 E QCvdec  : =====================================</h1><p>02-12 02:24:05.717    54 23705 E QCvdec  : Total number of frames decoded = 78762</p><p>02-12 02:24:05.717    54 23705 E QCvdec  : Average Arm time/frame(ms)     = 0.757315</p><p>02-12 02:24:05.727    54 23705 E QCvdec  : Frames Arm Decoded/sec         = 1320.454102</p><h1>02-12 02:24:05.727    54 23705 E QCvdec  : =====================================</h1><p>02-12 02:24:05.727    54 23705 E QCvdec  :                     Frame Done Statistics</p><h1>02-12 02:24:05.727    54 23705 E QCvdec  : =====================================</h1><p>02-12 02:24:05.727    54 23705 E QCvdec  : frame done cumulative time     = 1772355679</p><p>02-12 02:24:05.727    54 23705 E QCvdec  : Frames Done per second         = 44.438599</p><h1>02-12 02:24:05.727    54 23705 E QCvdec  : =====================================</h1><h1>02-12 02:24:05.727    54 23705 E QCvdec  : =====================================</h1><p>02-12 02:24:05.727    54 23705 E QCvdec  :                       Dsp Statistics</p><h1>02-12 02:24:05.727    54 23705 E QCvdec  : =====================================</h1><p>02-12 02:24:05.727    54 23705 E QCvdec  : Total number of frames decoded = 78762</p><p>02-12 02:24:05.727    54 23705 E QCvdec  : Average Dsp time/frame(ms)     = 16.785728</p><p>02-12 02:24:05.727    54 23705 E QCvdec  : Frames Dsp Decoded/sec)        = 59.574417</p><h1>02-12 02:24:05.737    54 23705 E QCvdec  : =====================================</h1><p>02-12 02:24:05.767    94   113 I PowerManagerService: keypad run :false:0:0</p><p>02-12 02:24:05.787    54    89 W AudioFlinger: write blocked for 195 msecs</p><p>02-12 02:24:05.887    94 11446 W InputManagerService: Got RemoteException sending setActive(false) notification to pid 21977 uid 10049</p>","613795","","613795","","2011-02-12 10:18:43","2011-02-12 10:18:43","Android - VideoView Memory Problem","<android><memory><heap><videoview>","0","2","","",""
"4975416","1","","","2011-02-12 00:25:21","0","2845","<p>I am new to Android and have the SDK up and running fine.  I am looking for some model code to make an app with a 15-item questionnaire (yes/no) and score it.  </p><p>Suggestions?</p><p>Thanks</p>","613806","","","","","2011-02-12 00:31:43","How To Code a Basic Questionnaire","<android>","1","0","","2012-03-01 18:55:53",""
"4975443","1","","","2011-02-12 00:31:26","4","6382","<p>The Android Dev website provides an example of doing speech input using the built-in Google Speech Input Activity.  The activity displays a pre-configured pop-up with the mic and passes its results using onActivityResult()</p><p>My question:Is there a way to use the SpeechRecognizer class directly to do speech input without displaying the canned activity?  This would let me build my own Activity for voice input. </p>","448449","","","","","2013-04-03 11:35:17","Is there a way to use the SpeechRecognizer API directly for speech input?","<android><speech-recognition><speech-to-text>","2","0","3","",""
"4975549","1","4975653","","2011-02-12 00:54:19","2","357","<p>I'm doing Example 3 on the <a href=""http://developer.android.com/resources/tutorials/notepad/notepad-ex3.html"" rel=""nofollow"">Notepad tutorial</a> on developer.android.com.</p><p>It's time to run my code, but I can't even compile, because I have errors on lines that call <code>R.layout.*something*</code> or <code>R.string.*something*</code>. Every error is of the type...</p><p>""<em>something</em> cannot be resolved or is not a field.""</p><p>...which signals to me that maybe I named something wrong or forgot to name it in the XML. So I check my XML files and do a little cleanup. Everything seems to be normal. No red Xs.</p><p>I go back to the class, where I see what looks odd to me. In two separate lines that call to two separate elements in the same layout file, one yields an error and one doesn't:</p><pre><code>mTitleText = (EditText) findViewById(R.id.title); // no errormBodyText = (EditText) findViewById(R.id.body); // error: ""body cannot be resolved or is not a field""</code></pre><p><img src=""http://i.stack.imgur.com/86C5X.png"" alt=""Two lines calling to the same XML file; one gives an error.""></p><p>Again, Eclipse isn't showing me any errors on the XML file:</p><p><img src=""http://i.stack.imgur.com/LaHm3.png"" alt=""I don't see any glaring errors in my XML.""></p><p>What might I have done wrong that some of the resources are resolving in the code and some aren't? Is this something Eclipse can sort out, similar to <strong>Project -> Clean...</strong>?</p><p>If it makes any difference, I picked Android 2.1 as a build target. And I <strong>am</strong> importing android.R.</p><p>Thanks in advance for any help.</p>","472783","","1228","","2013-08-13 14:33:46","2013-08-13 14:33:46","How can I get Android to resolve XML resources?","<android><xml>","2","1","","",""
"4975636","1","","","2011-02-12 01:11:45","1","12561","<p>I have written the most basic application I can think of to try to play an mp3 file, but it is not working.  I don't get any errors, but when the application starts up, the sound is not played.</p><pre><code>public class soundtest extends Activity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        MediaPlayer mp = new MediaPlayer();        mp.create(getApplicationContext(), R.raw.norm_iphone_money);        mp.start();    }}</code></pre><p>What am I missing?  I have ""norm_iphone_money.mp3"" inside the res/raw folder.  The file plays fine in Windows Media Player and iTunes.</p><p>I'm using the latest versions of Java SDK and Eclipse for Java.  The app is targeted for Android 2.2 and runs fine in the emulator despite no sound.</p>","613832","","","","","2014-03-27 05:11:44","android MediaPlayer not playing mp3 file","<android><audio><mp3><media-player>","5","1","2","",""
"4975646","1","","","2011-02-12 01:13:24","1","299","<p>I am currently working in an image processing library for Android, but I wonder which way would be the best to unit test the library methods.</p><p>I know that the way images are loaded inside and outside of the device may lead to different numbers in the values of the pixels, so comparing matrices directly: previously processed outside android environment, with the ones inside, doesn't seem to be a good nor reliable way to do this.</p><p>Any hints and suggestions are welcome.</p><p>Thanks in advance.</p>","371388","","371388","","2011-02-12 01:18:44","2011-02-12 01:18:59","How to Unit Test an image processing library for the Android platform?","<java><android><junit>","1","0","1","",""
"4975650","1","5905408","","2011-02-12 01:14:15","1","632","<p>I built a simple game engine using SurfaceView.</p><p>I use a RectF as a 'camera' window, to represent the scaled pixel width and height of the SurfaceView canvas, and to figure out what is on screen.</p><p>I use canvas.translate to move to where the camera is 'pointing' at.Here is the draw loop:</p><pre><code>mCamera.UpdateCamera();scaleWorld(c, mCamera);c.translate(-mScreen.left, mScreen.top - miHeight* (1 / mCamera.getScaleLevel()));drawBehavior.drawGame(c);</code></pre><p>Any way, if I shoot a projectile, the game renders smoothly, and I see no visual flashes of black, which is the color I am using to flush the canvas.</p><p>However, if I instantly change what the camera can see, perhaps 3 or more 'screens' away, there is often, but not always, flashes of black. Sometimes I get 'lucky' and the transition is seamless. </p><p>These flashes are usually in the positions of my bitmaps, as I draw the ground and background recursively using one or two bitmaps.</p><p>It seemed to me that the sudden change was the issue, so I tried to essentially trash the gameLoop thread to stop everything, then set the new Rect coordinates, then restart with another thread, but this does not work.</p><p>I suppose on reflection, I was simply delaying the 'shock' to the system by doing this, not treating it.</p><p>Before attempting to sweep this perhaps atrocious design under the rug by perhaps a fade out or other visual trick, I am wondering if anyone has a deeper understanding of the issue and could lead me to a more elegant solution.</p>","434400","","","","","2011-05-05 23:58:17","Android gameLoop using SurfaceView; quickly changing camera 'shots' results in black flashes, etc","<android><surfaceview><gameloop>","1","0","","",""
"4975773","1","5455175","","2011-02-12 01:43:58","0","242","<p>I compiled the master branch and run it in the emulator. The ""Battery History"" item in the ""Spare Parts"" menu, does not work. It results in ""Force close"" of ""Spare parts"".</p><p>DDMS log shows error message like: </p><pre><code>04-11 11:13:14.080: E/AndroidRuntime(9593): android.content.ActivityNotFoundException: Unable to find explicit activity class {com.android.settings/com.android.settings.battery_history.BatteryHistory}; have you declared this activity in your AndroidManifest.xml?</code></pre><p>I found that ""Battery History"" uses the class <code>com.android.settings.battery_history.BatteryHistory</code> but this class does not exist any more. It was in the repository <code>platform/packages/apps/Settings.git</code> before. I search the whole code base and couldn't find this class.</p><p>Has this file become not open-source any more and been put into some JAR files?</p>","313294","","128421","","2012-04-11 19:24:50","2012-04-11 19:24:50","BatteryHistory.java: file cannot be found in the master branch of the Android source code","<android><debugging><debug-symbols><android-source>","1","0","0","",""
"4975810","1","","","2011-02-12 01:55:15","0","238","<p>I'm having a problem with an EditText (only on QVGA devices, I've tested it on the QVGA emulator and on a Samsung i5500).</p><p>When the user clicks on the EditText and the soft keyboard comes up, only the first letter that the user enters appears on the field. The others only show up when the user closes the keyboard or some other event happens.</p><p>I don't know if this is a bug (it works on the higher res emulator), but is there any workaround I can use to give a better experience to my users right now?</p><p>My (messy) code is here:<a href=""https://github.com/bani/SMS-Denuncia/tree/master/android/"" rel=""nofollow"">https://github.com/bani/SMS-Denuncia/tree/master/android/</a></p><p>And the EditText I'm having a problem with is at<a href=""https://github.com/bani/SMS-Denuncia/blob/master/android/res/layout/local.xml"" rel=""nofollow"">https://github.com/bani/SMS-Denuncia/blob/master/android/res/layout/local.xml</a></p><pre><code>&lt;EditText android:id=""@+id/vagao2""android:layout_width=""wrap_content""android:layout_height=""wrap_content""android:maxLength=""12""android:textSize=""18sp""android:text=""""android:imeOptions=""actionSend""android:visibility=""invisible"" /&gt;</code></pre>","210762","","","","","2011-03-03 17:18:52","EditText not updating with soft keyboard on QVGA devices","<android><android-edittext>","1","0","","",""
"4975827","1","5000193","","2011-02-12 01:58:19","13","2536","<p>Has anyone ever solved this issue? The auto complete stalls so frequently and for so long, I quit using it altogether. I've only seen one other post for this and the answer did not help. Any guidance would be greatly appreciated.</p>","607118","","5821","","2011-02-15 13:58:56","2011-03-24 07:05:28","Eclipse 3.6 frequently stalls on auto complete","<java><android><eclipse><autocomplete><content-assist>","4","3","10","",""
"4975857","1","4976758","","2011-02-12 02:06:03","3","3196","<p>In my android application i would like to use secure connection from client to server.Could anyone please suggest as how i can do it in android?</p><p>Please forward your valuable suggestions.</p><p>Thanks in advance :)</p>","420261","","","","","2011-02-12 06:48:06","Secure connection in android","<android>","1","1","","",""
"4975894","1","","","2011-02-12 02:16:49","0","446","<p>just looking through the <a href=""http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;f=graphics/java/android/renderscript/RenderScript.java;h=f1e5af1eb5405bcd11c9fe4061af5b4ce73c5555;hb=9df3331836144c494524d56ca3248916e02b0d3a"" rel=""nofollow"">source for renderscript</a>.I think I spotted a mistake, on line 36     </p><pre><code>private static final boolean LOG_ENABLED = DEBUG ? Config.LOGD : Config.LOGV;</code></pre><p>Think that needs to be a double == but don't have enough coding experience to be sure.</p>","613863","","142162","","2011-02-12 02:22:56","2011-02-12 12:53:00","possibly a slight bug in android renderscript source","<android><renderscript>","2","0","","",""
"4975960","1","","","2011-02-12 02:37:22","0","135","<p>My first problem is that any string longer that 1 word screws with the contact. For example: if I send ""yo man"", instead of coming up ""5554: yo man"" on the other emulator, it comes up as ""yo: man"". Second is the ""sendMultipartTextMessage"" I call when to string is too long (over 150 chars). It sends the proper amount of messages, but the messages themselves are just sequences of weird characters. What am I doing wrong?</p>","595425","","244296","","2011-02-12 15:43:03","2011-02-12 15:43:03","Spliting Android SendSMS","<android><sms>","1","2","","",""
"4975975","1","4976024","","2011-02-12 02:42:54","1","686","<pre><code>String[] array =     getContext().getResources().getStringArray(R.array.DevCategories);</code></pre><p>to get an array. I the call this:</p><pre><code>Arrays.binarySearch(array,""Plan""));</code></pre><p>it returns <code>-5</code>, I am sure the first value of the array is Plan. What happend?</p><p>By the way, the current class is extended from <code>ContentProvider</code>. I am writing a Provider.</p><p>I use this code get -5</p><p><code>String.format(""%d"",Arrays.binarySearch(array,""Plan"")));</code><code>String.valueOf(Arrays.binarySearch(array,""Plan"")));</code></p><p>both are -5</p><p>R.array.DevCategories from string.xml file.<code>&lt;string-array name=""DevCategories""&gt;        &lt;item&gt;Plan&lt;/item&gt;        &lt;item&gt;Design&lt;/item&gt;        &lt;item&gt;Coding&lt;/item&gt;        &lt;item&gt;Debug&lt;/item&gt;        &lt;item&gt;Test&lt;/item&gt;        &lt;item&gt;Release&lt;/item&gt;    &lt;/string-array&gt;</code></p>","576472","","6144","","2011-02-12 03:42:27","2011-02-12 03:42:27","android Arrays.binarySearch issue","<android><arrays>","1","0","0","",""
"4976038","1","5334047","","2011-02-12 03:00:47","1","2816","<p>I'm having trouble reading in XML data from an XML resource located in /res/xml/testxml.xml. For some reason using examples from my book and online, I'm not able to read the data properly. The following method is simple; read the XML resource and print the lines within it. </p><pre><code>public InputStream fetchLocalStream(String file){    InputStream in = null;    try {        //in = Global.gContext.openFileInput(""testxml.xml"");        in = Global.gContext.getResources().openRawResource(R.xml.testxml);        try {             if (in != null) {                  // prepare the file for reading                  InputStreamReader inputreader = new InputStreamReader(in);                  BufferedReader buffreader = new BufferedReader(inputreader);                  String line;                  // read every line of the file into the line-variable, on line at the time                  while (( line = buffreader.readLine()) != null) {                      Log.d(Global.TAG,""--&gt;Line:"" + line);                    // do something with the settings from the file                  }                }            } catch (Exception e){}            return in;    }catch (Exception e){ Log.d(Global.TAG,""--&gt; Failed!!!!"" + e); }    return in;}</code></pre><p>Any help would be greatly appreciated.</p><pre><code>Line:+Ç+Ç+Çn++n++n++n++?+Ç+Ç+Ç#+Ç+Ç+Ç¶+Ç¶+Ç+Ç+Ç+Ç+Ç+Ç+Ç+Ç+Ç???+Ç?+Ç+Ç+ÇLine:+Ç+Ç+Çn++n++n++n++$+Ç+Ç++Ç+Ç+Ç+Ç+Ç+Ç+Ç???+Ç?+Ç+Ç+ÇLine:+Ç+Ç+Çn++n++n++n++?+Ç+Ç+Ç#+Ç+Ç+Ç???+Ç$+Ç+Ç+ÇLine:+Ç+Ç+Çn++n++n++n++?+Ç+Ç+Ç%+Ç+Ç+Ç¶+Ç¶+Ç+Ç+Ç+Ç+Ç+Ç+Ç+Ç+Ç???+Ç?+Ç+Ç+ÇLine:+Ç+Ç+Çn++n++n++n++&amp;+Ç+Ç++Ç+Ç+Ç+Ç+Ç+Ç+Ç???+Ç?+Ç+Ç+ÇLine:+Ç+Ç+Çn++n++n++n++?+Ç+Ç+Ç%+Ç+Ç+Ç???+ÇL+Ç+Ç+Ç</code></pre>","568508","","1560062","","2013-11-03 08:58:43","2013-11-03 08:58:43","Reading XML file from /res/xml using InputStream reader yields invalid characters / encoded data","<java><android><xml>","2","0","","",""
"4976098","1","4976492","","2011-02-12 03:14:50","2","756","<p>I am trying to figure out the right architecture for a list view that loads information from an http endpoint. My problem is that the information to be displayed has both text and image content. If I only load the text content the the UI is very responsive but if I also load the image content then it takes a few seconds for the list to be populated. I parse the content as it comes in and build up a list adapter but what I want to do is build up the list adapter incrementally so that the user sees the information as it becomes available instead of waiting until the last item is processed before any information is displayed. Currently I do everything with the help of AsyncTask so I'm aware of threads and how they can be helpful so I'd like to know how other people have worked around the issue of displaying list based information as quickly as possible.</p>","165198","","","","","2011-12-23 08:25:22","Android ListView with an incrementally built ListAdapter","<android><listview><listadapter>","2","0","1","",""
"4976291","1","4977232","","2011-02-12 04:18:41","2","1947","<p>I writing an application that draws in openGL es 1.0 in the Android NDK and renders it on an android phone. So far, I can draw two lines. The problem is that those two lines are rainbow. I was trying to debug where coordinates are on screen (where 0,0 and 1,1 are) so I added color to the two lines I am drawing. One should be drawn in red, the other in green. The code I use to draw them is as follows:</p><pre><code>void appInit(){    glEnable(GL_CULL_FACE);}void appRender(jint width, jint height){    prepareFrame(width, height);    drawLines();}void drawLines(){    glLoadIdentity();    glPushMatrix();    GLfloat color1[] = {0.0f,1.0f,0.0f,1.0f};    drawLine( 1.0f,1.0f,2.0f,2.0f,color1);    glPopMatrix();    glPushMatrix();    GLfloat color2[] = {1.0f,0.0f,0.0f,1.0f};    drawLine(0.0f,0.0f,1.0f,1.0f, color2);    glPopMatrix();}void drawLine(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2, GLfloat * color){    GLfloat vVertices[] =    {x1, y1,    x2, y2};    glEnableClientState(GL_VERTEX_ARRAY);    glEnableClientState(GL_COLOR_ARRAY);    //glColor4f(color[0],color[1],color[2],color[3]);    glColorPointer(4,GL_FLOAT,0,color);    glVertexPointer(2, GL_FLOAT, 0, vVertices);    glDrawArrays(GL_LINES, 0, 4);    glDisableClientState(GL_COLOR_ARRAY);    glDisableClientState(GL_VERTEX_ARRAY);}void prepareFrame(int width, int height){    glViewport(0, 0, width, height);    glClearColor(0.0,0.0,0.0,0.0);    glClear(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT);    glLoadIdentity();}</code></pre><p>appInit is called, then appRender is called over and over again with the screen dimensions. The result is this:</p><p><a href=""http://i.stack.imgur.com/G91oX.png"" rel=""nofollow"">http://i.stack.imgur.com/G91oX.png</a></p><p>If anyone knows why they are drawing rainbows instead of the colors I specified, that would be wonderful. Bonus points if you can tell me what the coordinate system is like by default on android (no gluperspective or lookat is used).</p>","523412","","","","","2011-02-12 08:59:04","Rainbow lines in openGL es","<android><opengl-es><android-ndk>","1","0","","",""
"4976350","1","4976386","","2011-02-12 04:34:27","2","903","<p>I have created an app and it runs successfully in the emulator. When I was trying to run it in any of my devices it shows the following error:</p><pre>[2011-02-12 09:57:06 - FirstImage] Android Launch![2011-02-12 09:57:06 - FirstImage] adb is running normally.[2011-02-12 09:57:06 - FirstImage] Performing com.gis.image.FirstImage activity launch[2011-02-12 09:57:23 - FirstImage] Uploading FirstImage.apk onto device 'HT96WKF01291'[2011-02-12 09:57:32 - FirstImage] Installing FirstImage.apk...[2011-02-12 09:57:52 - FirstImage] Re-installation failed due to different application signatures.[2011-02-12 09:57:52 - FirstImage] You must perform a full uninstall of the application. WARNING: This will remove the application data![2011-02-12 09:57:52 - FirstImage] Please execute 'adb uninstall com.gis.image' in a shell.[2011-02-12 09:57:52 - FirstImage] Launch canceled!</pre><p>What is the issue and how can I overcome it?</p>","596364","","23897","","2011-02-12 04:37:56","2011-02-12 05:42:00","runtime error in android devices","<java><android>","3","2","1","",""
"4976470","1","","","2011-02-12 05:10:31","0","101","<p>Can anybody tell me what the <strong>difference is between a new group</strong> (one you now create) <strong>and old groups</strong> (one you created a couple of months ago) <strong>on Facebook</strong>?</p><p>I notice that , in the Facebook for Android application , the new style groups are visible , but the old ones aren't.</p>","231181","","","","","2011-02-12 05:10:31","What is the difference between old groups and new groups in Facebook","<android><facebook>","0","4","","",""
"4976502","1","4976525","","2011-02-12 05:21:38","0","789","<p>I would like to do a news application that operates on Android, and I want to create my own login page that connects to Facebook and then can post something about news to facebook wall.</p><p>Questions:</p><ol><li>Can I create my own login page and send my username, password, app_key to Facebook?</li><li>Is there an API reference you can recommend? </li></ol>","473659","","102937","","2011-02-12 05:27:18","2011-02-12 06:51:37","How can I login to facebook with my application?","<android><facebook>","1","3","","",""
"4976523","1","","","2011-02-12 05:28:08","2","3993","<p>Sometimes we see the device restarts automatically, while few other times I had found it switching off after long time, even battery was not low.So if we want to trace back of what actually has caused this, does we have any log file in device memory which has the cause of shutdown or restart ?</p><p>Like we get the dump for the other O.S. for any errors occured causing it to restart/shutdown in specific error log file. Similarly does android has such ?</p><p>It may be anywhere , even in internal memory, so with root privileges I can go into looking for it.Any thoughts ? Thanks.</p>","315619","","","","","2011-02-12 05:38:26","Does android mobile has any error log file to debug cause for auto switch off?","<android><shutdown><logfiles><system-shutdown>","1","0","1","",""
"4976566","1","4976731","","2011-02-12 05:41:06","52","23693","<p>If you see the Android logs, you may see a lot of those things.</p><p>What do they mean, knowing those may help us doing better memory allocations.</p><p>Example:</p><pre><code> 28470               dalvikvm  D  GC_FOR_MALLOC freed 665 objects / 239992 bytes in 71ms 28470               dalvikvm  D  GC_FOR_MALLOC freed 673 objects / 240288 bytes in 87ms 21940               dalvikvm  D  GC_EXPLICIT freed 4802 objects / 185320 bytes in 78ms 28470               dalvikvm  D  GC_FOR_MALLOC freed 666 objects / 240536 bytes in 63ms</code></pre>","11238","","11238","","2011-06-13 10:31:25","2013-10-16 10:12:10","What do GC_FOR_MALLOC, GC_EXPLICIT, and other GC_* mean in Android Logcat?","<android><garbage-collection><logcat>","3","0","41","",""
"4976691","1","11455009","","2011-02-12 06:26:13","3","4328","<p>Below is a my Contact_Picker class.  I am going to be using this class to create a list of contacts with checkboxes, giving the user the option to select multiple contacts from their phonebook.  I have a layout xml that I am using that has 2 buttons at the bottom:  Clear All and Done.  </p><p>When 'Done' is pressed, I need it to get all of the names that are checked, and save them in a list/preferences file.  Right now, I can find what POSITIONS are checked, but I don't know how to retrieve the corresponding information associated with them (the name/phone number of the selected contact).  I have searched for days on a method that will work, and have not come up with anything.  Any code/pseudo code/ideas are greatly appreciated.</p><p>Contact_Picker Class:</p><pre><code>public class Contact_Picker extends ListActivity {    protected static final String TAG = null;    public String[] Contacts = {};    public int[] to = {};    public ListView myListView;    /** Called when the activity is first created. */        @Override        public void onCreate(Bundle savedInstanceState) {            super.onCreate(savedInstanceState);            setContentView(R.layout.contacts_list);            final Button done_Button = (Button) findViewById(R.id.done_Button);            final Button clear_Button =(Button) findViewById(R.id.clear_Button);            Cursor mCursor = getContacts();            startManagingCursor(mCursor);            ListAdapter adapter = new SimpleCursorAdapter(this, android.R.layout.simple_list_item_multiple_choice, mCursor,                    Contacts = new String[] {ContactsContract.Contacts.DISPLAY_NAME },                    to = new int[] { android.R.id.text1 });            setListAdapter(adapter);            myListView = getListView();            myListView.setItemsCanFocus(false);            myListView.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);            clear_Button.setOnClickListener(new View.OnClickListener() {                public void onClick(View v) {                    Toast.makeText(getApplicationContext(),""Selections Cleared"", Toast.LENGTH_SHORT).show();                    ClearSelections();                }            });            /** When 'Done' Button Pushed: **/            done_Button.setOnClickListener(new View.OnClickListener() {                public void onClick (View v){                    Log.i(TAG,"":Done Button Selected:"");                    SparseBooleanArray checkedPositions = myListView.getCheckedItemPositions();                    Log.i(TAG,""Number of Checked Positions: "" + checkedPositions.size());                    if (checkedPositions != null)                    {                        int count = myListView.getCount();                        for ( int i=0;i&lt;count;i++)                        {                            Log.i(TAG,""Selected items: "" + checkedPositions.get(i));                        }                    }                }            }); //&lt;-- End of Done_Button        } //&lt;-- end of onCreate();        private void ClearSelections() {                        int count = this.myListView.getAdapter().getCount();            for (int i = 0; i &lt; count; i++) {                this.myListView.setItemChecked(i, false);            }        }        private Cursor getContacts() {            // Run query            Uri uri = ContactsContract.Contacts.CONTENT_URI;            String[] projection = new String[] { ContactsContract.Contacts._ID,                    ContactsContract.Contacts.DISPLAY_NAME };            String selection = ContactsContract.Contacts.IN_VISIBLE_GROUP + "" = '""                    + (""1"") + ""'"";            String[] selectionArgs = null;            String sortOrder = ContactsContract.Contacts.DISPLAY_NAME                    + "" COLLATE LOCALIZED ASC"";            return managedQuery(uri, projection, selection, selectionArgs,                    sortOrder);        } //&lt;-- end of getContacts();}</code></pre><p>Will Create Output Such As:</p><pre><code>Sele02-12 01:25:09.733: INFO/(219): :Done Button Selected:02-12 01:25:09.743: INFO/(219): Number of Checked Positions: 202-12 01:25:09.743: INFO/(219): Selected items: true02-12 01:25:09.743: INFO/(219): Selected items: false02-12 01:25:09.743: INFO/(219): Selected items: true02-12 01:25:09.752: INFO/(219): Selected items: false</code></pre>","586859","","","","","2012-07-12 15:14:47","Multiple Contact Picker List [getCheckedItemPositions()]","<android>","4","1","3","",""
"4976801","1","","","2011-02-12 06:59:43","0","469","<p>I created a simple app that has nothing except an EditText element. When I run the app, I type text into the element and then press Ctrl-F11 to change the emulator's orientation. I've added logging information to make sure that the activity gets destroyed and re-created when I change orientation. I haven't added any code to save the text in the EditText element and yet, after the change of orientation, the text that I typed stays in the EditText element. What mechanism in Android is saving and then restoring the element's text (is it savedInstanceState) and how can I see for myself the details of this saving operation?</p>","605019","","","","","2011-02-12 07:22:40","How is my EditText content being saved?","<android>","1","0","","",""
"4976903","1","4978043","","2011-02-12 07:22:46","1","336","<p>This title may seem strange, so let me try to explain what I'm trying to do. I have several activity classes, each representing a different view in my application. My initial activity class gets loaded when the application launches. The user enters values and eventually a TCP socket is opened, and I then use <code>AsyncTask</code> to listen for and respond to messages from the server. I'd like for this <code>AsyncTask</code> class to essentially listen until the app is closed/error condition reached, and be able to update values in other activity classes after they are started. Does this make sense (it's been a long, frustrating night)? I know that static activity class references are bad practice, and touching the UI thread from other activities is bad as well, but I'm having trouble finding a clean solution to this problem. Maybe using <code>AsyncTask</code> is not the best approach here? Should I be using a service instead or something else entirely?</p><p>Thanks in advance.</p>","483402","","","","","2011-02-12 12:24:50","Allowing AsyncTask to Manipulate Values in Different Activity Classes","<android><activity><android-asynctask>","1","0","","",""
"4976910","1","","","2011-02-12 07:26:09","2","281","<p>I have a custom title bar in an Android application that just has a simple <code>TextView</code> in it at the moment. I'm wondering what the best class/method to use to update the title from any activity would be? For example, I have a <code>TabActivity</code> that has this title bar in it and I need to change the title when one of the Tab Activities changes. I'd also want to change the title bar in other activities that aren't in a tab context. </p><p>I've looked at <code>BroadcastReceivers</code> and <code>Intents</code>, but I'm not really understanding the nomenclature, so I'm not sure what the equivalent of something like Actionscript's <code>Event</code> broadcasting is. I'd like my title bar class to listen for a ""global"" application event that recieves a <code>String</code> and update the title when it receives that event. How would I do that?</p><p>In another example, in iOS I'd use <code>NSNotificationCenter</code> and use <code>postNotification</code> to fire an ""event"". Then I'd have a view controller <code>addObserver</code> and listen for that event and respond to it. How is something like this accomplished within the Android framework?</p><p>For example's sake, I've got my ""main"" Activity:</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;!-- here's my header--&gt;    &lt;include layout=""@layout/header""/&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;FrameLayout                android:id=""@android:id/tabcontent""                android:layout_width=""fill_parent""                android:layout_height=""0dip""                android:layout_weight=""1""/&gt;            &lt;TabWidget                style=""@style/TabWidget""                android:id=""@android:id/tabs""                android:layout_width=""fill_parent""                android:layout_height=""wrap_content""/&gt;        &lt;/LinearLayout&gt;    &lt;/TabHost&gt;</code></pre><p></p><p>And the header include has the text field I want to change:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    style=""@style/Header""&gt;    &lt;TextView        style=""@style/HeaderTitle""        android:text=""@string/app_name""/&gt;&lt;/LinearLayout&gt;</code></pre><p>So, basically I'm looking for a way to pass up notifications to the header from any of the activities in the TabHost or other activities that have the header included.</p>","53653","","53653","","2011-02-14 15:10:33","2011-02-14 15:10:33","What is the equivalent of ActionScript 3's Event broadcasting in Android?","<android><events>","1","3","1","",""
"4977002","1","4978025","","2011-02-12 07:49:35","1","1630","<p>I am trying to launch an alert dialog when not in a class that extends activity, but I am on the GUI thread. I have access to my applications context and attempt to launch the alert dialog with that but get an error: </p><blockquote>  <p>02-12 00:48:07.412: ERROR/AndroidRuntime(1322): android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an application</p></blockquote><p>Does anybody know what I am doing wrong on this one?</p>","467569","","","","","2011-02-12 12:20:52","Launch AlertDialog not from an Activity","<android><alertdialog>","1","1","1","",""
"4977043","1","","","2011-02-12 08:00:08","0","3149","<p>Such as when I use the ArrayAdapter class, I want to know what is be done in the class. Sometimes I want to go the source code to find answer. So, my question is where can get the source code ? </p>","610967","","881229","","2014-02-28 23:42:13","2014-02-28 23:42:13","Where can get the Android source code?","<android>","3","2","","",""
"4977051","1","4977127","","2011-02-12 08:02:38","0","409","<p>Ok I updated eclipse ADT plain and the SDK platforms and it gave all of my current projects errors. If I click in the project there are no errors with in the projects files but an error on the actual project file. Thinly happen after I updated.what am I suppose do now?!?</p><p>Example</p><p>App1  -  error</p><p>Src - no error</p><p>Gen - no error</p><p>Res - no error</p><p>Manifest - no error</p>","583952","","","","","2013-07-23 15:53:01","error in every project after sdk and adt update!","<android>","4","1","","",""
"4977110","1","4977285","","2011-02-12 08:21:57","0","731","<p>i am creating media recorder demo application. for that i have take two button start and stop.<br>i want to display timer when click on start button and want to stop on stop button.</p><p>any idea?</p><p>Thanks</p>","472882","","","","","2011-10-14 00:04:15","Android:voice recording with timer","<android><avaudiorecorder>","1","0","","",""
"4977134","1","4978021","","2011-02-12 08:30:05","0","350","<p>I have a widget and I want to save its state when it's being clicked.</p><p>Currently I'm saving the state with SharedPreferences.</p><p>This works but it is relatively slow to commit updates to the preferences.</p><p>Are there any better solutions?</p><p>Thanks.</p>","445114","","","","","2011-02-12 12:19:44","Saving state with BroadcastReceiver","<android><state><broadcastreceiver>","1","0","1","",""
"4977138","1","","","2011-02-12 08:31:14","3","21904","<p>I want to have an animation with various steps that do moves (translations) and rotations like ""straight on, turn left, straight on, ...."" of a car. </p><p>I am able to do this in an <code>AnimationSet</code>, but fail at rotating around the center of my car image with the ""RELATIVE_TO_SELF"" setting. I know about</p><pre><code>Animation a = new RotateAnimation(0,90,Animation.RELATIVE_TO_SELF,0.5f,... )</code></pre><p>for this purpose. Still the rotation occurs around the upper left corner of the screen (or canvas?).</p><p>Currently I am solving this by manually keeping track of the position after each animation step, but this is suboptimal.</p><p>I suspect that my initial layout setup is bogus:</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;FrameLayout            android:layout_height=""wrap_content""            android:layout_width=""fill_parent""&gt;        &lt;!-- view that draws some background --&gt;        &lt;de.bsd.turtlecar.SampleView android:id=""@+id/graph_view""              android:layout_height=""350px""              android:layout_width=""fill_parent""              android:visibility=""invisible""              /&gt;        &lt;!-- the car --&gt;        &lt;ImageView android:id=""@+id/car_view""                   android:src=""@drawable/turtle_car""                   android:layout_height=""wrap_content""                   android:layout_width=""wrap_content""                   android:visibility=""invisible""/&gt;    &lt;/FrameLayout&gt;   &lt;Button ... onClick=""run"" ... /&gt;&lt;/LinearLayout&gt;</code></pre><p>This shows the car in the upper left corner (should show up in a different place -- basically where the animation later starts. And it should be move later).</p><p>In my code that is triggered through the run button I do:</p><pre><code>    ImageView carView = (ImageView) findViewById(R.id.car_view);    print(carView);    AnimationSet animationSet = new AnimationSet(true);    TranslateAnimation a = new TranslateAnimation(            Animation.ABSOLUTE,200, Animation.ABSOLUTE,200,            Animation.ABSOLUTE,200, Animation.ABSOLUTE,200);    a.setDuration(1000);    animationSet.addAnimation(a);    RotateAnimation r = new RotateAnimation(0f, -90f,200,200); // HERE     r.setStartOffset(1000);    r.setDuration(1000);    animationSet.addAnimation(r);    ...</code></pre><p>So at the point with here, the rotation works, but I have to keep track. if I rotate RELATIVE_TO_SELF, the rotation happens around (0,0) of the screen.</p><p>Additional question: what can I do in order to keep the car on screen after the animation has finished?</p><p>Or am I completely on the wrong track?</p>","100957","","","","","2011-12-01 10:20:26","Full example of how to programmatically do RotateAnimations?","<android><animation>","1","0","2","",""
"4977147","1","","","2011-02-12 08:33:54","15","1481","<p>I'm developing an application for Android, and I'm thinking that it's functionality might be useful on other (Java-running) platforms (say a regular desktop app -- although I hope that the other platform(s) involved are immaterial to the question at hand).</p><p>It's unlikely that the UI will be in any way portable (there's just too much of a difference between a good touch-capable, 4in screen UI, and a mouse-and-keyboard 19in screen UI), so I'm happy enough reimplementing that separately.</p><p>However, the core ""business logic"" (ugh, horrid word) and model (data storage) classes could, in theory, be reused in managing the core app.  I've noticed that there aren't a lot of classes I'm writing that don't end up referencing some Android-specific bits (I've got XML resources files, images, and SQLite databases, as examples).  Basically everything I've written so far has at least one Android-related import.</p><p>My question is twofold:</p><ul><li>What tools are available out there to help me use Android-related classes and features (eg resources, databases) on non-Android platforms; and</li><li>What classes, features, etc of the Android platform should I completely avoid using (for the sake of simplicity, let's exclude UI-related items) due to non-portability, and what should I use instead to improve portability.</li></ul><p>Answers that consist of ""hahahaha, you're doomed"" are OK, as long as there's some rationale provided.</p><p>(P.S. I'd make this community wiki if that was still available; this seems like a perfect CW question to me -- a list of Android portability tips and tools)</p>","60003","","","","","2012-01-03 09:30:10","Recommended ways to produce app portable between Android and ""other platforms""","<java><android><portability>","8","1","2","",""
"4977165","1","4977229","","2011-02-12 08:40:11","0","614","<p>I want to compare the value which i already stored in database with current system value.and pls give answer for following question</p><p>SQLite query for comparing database value and system time</p>","555910","","457982","","2011-02-12 09:14:37","2011-02-12 09:14:37","SQLite query for comparing database value and system time","<android><database><sqlite><time>","1","0","1","",""
"4977174","1","","","2011-02-12 08:42:07","0","348","<p>The application seems to crash when I try and get the text from the EditText:</p><pre><code>package com.example.helloandroid;import android.content.Intent;import android.view.LayoutInflater;import android.view.View;import android.view.View.OnClickListener;import android.widget.EditText;import android.app.AlertDialog;import android.content.DialogInterface;import android.util.Log;import android.app.Activity;import android.os.Bundle;public class MatrixMultiply extends Activity implements OnClickListener {/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    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);}public void onClick(View v) {     switch (v.getId()) {     case R.id.about_button:        Intent i = new Intent(this, About.class);        startActivity(i);        break;    case R.id.new_button:        openNewGameDialog();        break;    case R.id.exit_button:        finish();        break;// More buttons go here (if any) ...}}private static final String TAG = ""Matrix"";private void openNewGameDialog() {     LayoutInflater factory = LayoutInflater.from(this);                    final View textEntryView = factory.inflate(R.layout.text, null);        AlertDialog.Builder alert = new AlertDialog.Builder(this);         alert.setTitle(""Matrices"");         alert.setMessage(""Please enter the size of the matrix"");         // Set an EditText view to get user input          alert.setView(textEntryView);         AlertDialog matrixSize = alert.create();        final EditText height1 = (EditText) matrixSize.findViewById(R.id.h1);        final EditText width1 = (EditText) MatrixMultiply.this.findViewById(R.id.w1);        final EditText height2 = (EditText) MatrixMultiply.this.findViewById(R.id.h2);        final EditText width2 = (EditText) MatrixMultiply.this.findViewById(R.id.w2);        alert.setPositiveButton(""Ok"", new DialogInterface.OnClickListener() {         public void onClick(DialogInterface dialog, int whichButton) {             String h1 = height1.getText().toString();            String w1 = width1.getText().toString();            String h2 = height2.getText().toString();            String w2 = width2.getText().toString();        }         });         alert.setNegativeButton(""Cancel"", new DialogInterface.OnClickListener() {           public void onClick(DialogInterface dialog, int whichButton) {             // Canceled.           }         });         alert.show(); }private void startGame(int i) { Log.d(TAG, ""clicked on "" + i); // Start game here...}}</code></pre>","596335","","596335","","2011-02-12 18:45:27","2011-02-12 18:45:27","Help with AlertDialog in Android","<android>","2","1","","",""
"4977308","1","","","2011-02-12 09:23:04","1","3272","<p>I am using ant packaged my software, I need to lay the resolution of several different packages, such as (240 * 320 480 * 800 640 * 960), I see htc g4 with 240 * 320 separate package of resources file is drawable-ldpi(they are installed at different resolutions in different resolutions resources apk), I need 240 * 320.apk 320 * 480.apk 480 * 800.apk, 240 * 320.apk only contain resources drawable-ldpi, 320 * 480.apk only contain image resource drawable-mdpi .. .. I've looked at aapt parameters, but did not find a way ....</p><p>Thanks...</p><p>                    Generating R.java / Manifest.java from the resources...                                                                                                                                            </p>","295275","","295275","","2011-02-12 09:34:31","2011-09-23 08:22:43","android aapt problem","<android><ant><aapt>","1","1","1","",""
"4977322","1","","","2011-02-12 09:26:56","31","12426","<p>Clicked on create filter could not figure out from docs how to create a filter for say two or more tags.  If I have two tags  <code>com.test.TestClassA</code> and <code>com.test.TestClassB</code> how do I create a filter that shows log for both of these classes?   I saw how you can start ADB for only certain tags, but how can this be done in eclipse?  Please provide details thanks.  What exactly do I need to enter on the tag line when creating a new filter in eclipse?</p>","602260","","457982","","2011-02-12 10:43:59","2013-02-07 06:48:54","Android LogCat Filter for multiple tags in Eclipse","<android><filter><filtering><logcat>","7","0","17","",""
"4977323","1","","","2011-02-12 09:27:05","0","84","<p>I coded an Android application under eclipseI run this applicationThe emulators starts and show the Android desktopBut my application is not shown/added on it.Neither the main activity is started.What to do ?</p>","614095","","","","","2011-02-12 11:48:39","Android application is not copied to the device memory under Eclipse","<java><android><eclipse><android-emulator><emulator>","2","1","","",""
"4977351","1","","","2011-02-12 09:33:19","1","5521","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/1222269/how-to-delete-files-created-by-the-application-on-uninstall"">How to delete files created by the application on uninstall?</a>  </p></blockquote><p>we have a made a streaming media player in android. in my application send a event file in every 15 min to over server. may be some of the file store in phone memory.</p><p>how to delete all file when application uninstall??</p><p>please help me out.</p><p>Thanks </p>","562296","","562296","","2011-02-12 09:43:27","2012-03-21 11:12:24","how to delete a file's on uninstall the android application?","<android><uninstall>","1","2","0","2012-03-21 11:52:38",""
"4977420","1","","","2011-02-12 09:54:50","0","2740","<p>i have an application with a widget. I created some preferences to let the user change the background of my widget. For this i imported 4 .png files to the drawable-hdpi folder.If i'm using LinearLayout in my xml i cannot change the background:</p><pre><code>&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""vertical""    android:layout_width=""146dip""    android:layout_height=""72dip""    android:layout_gravity=""center""    android:background=""@drawable/goldgreenbg""    android:id=""@+id/widgetlayout""&gt;&lt;TextView android:id=""@+id/widget_textview""    android:text=""@string/widget_text""    android:layout_height=""wrap_content""    android:layout_width=""wrap_content""    android:layout_gravity=""center_horizontal|center""    android:gravity=""center_horizontal""    android:layout_marginTop=""0dip""    android:padding=""0dip""    android:textColor=""#0B3B0B""    android:textSize=""11sp""/&gt;&lt;TextView android:id=""@+id/widget_textview2""    android:text=""@string/widget_text""    android:layout_height=""wrap_content""    android:layout_width=""wrap_content""    android:layout_gravity=""center_horizontal|center""    android:gravity=""center_horizontal""    android:layout_marginTop=""0dip""    android:padding=""0dip""    android:textSize=""12sp""    android:textColor=""#FFFFFF""/&gt;&lt;TextView android:id=""@+id/widget_textview3""    android:text=""@string/widget_text""    android:layout_height=""wrap_content""    android:layout_width=""wrap_content""    android:layout_gravity=""center_horizontal|center""    android:layout_marginTop=""0dip""    android:padding=""0dip""    android:textSize=""9sp""    android:textColor=""#0B3B0B""/&gt;&lt;/LinearLayout&gt;</code></pre><p>In EditPreferences.java i set the background like this:</p><pre><code>final Preference listpref = getPreferenceScreen().findPreference(""listPref"");        listpref.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener()         {         public boolean onPreferenceChange(Preference p, Object newValue)          {          String color = (String) newValue;          if (color.equals(""color1""))          {              Toast.makeText(EditPreferences.this, ""Black"", Toast.LENGTH_SHORT);              RemoteViews updateViews = new RemoteViews(EditPreferences.this.getPackageName(), R.layout.main);              updateViews.setTextColor(R.id.widget_textview, Color.rgb(215, 215, 215));              updateViews.setTextColor(R.id.widget_textview2, Color.WHITE);              updateViews.setTextColor(R.id.widget_textview3, Color.rgb(155, 155, 155));        //    updateViews.setImageViewResource(R.id.ImageView01, R.drawable.blackbg);              ComponentName thisWidget = new ComponentName(EditPreferences.this, HelloWidget.class);              AppWidgetManager manager = AppWidgetManager.getInstance(EditPreferences.this);              manager.updateAppWidget(thisWidget, updateViews);          }          else if (color.equals(""color2""))          {              Toast.makeText(EditPreferences.this, ""Brown"", Toast.LENGTH_SHORT);              RemoteViews updateViews = new RemoteViews(EditPreferences.this.getPackageName(), R.layout.main);              updateViews.setTextColor(R.id.widget_textview, Color.rgb(23, 81, 11));              updateViews.setTextColor(R.id.widget_textview2, Color.WHITE);              updateViews.setTextColor(R.id.widget_textview3, Color.rgb(23, 81, 11));        //    updateViews.setImageViewResource(R.id.ImageView01, R.drawable.brownbg);                         ComponentName thisWidget = new ComponentName(EditPreferences.this, HelloWidget.class);              AppWidgetManager manager = AppWidgetManager.getInstance(EditPreferences.this);              manager.updateAppWidget(thisWidget, updateViews);          }  return true;         }        });</code></pre><p>As you can see i was using an ImageView in the xml file like this:</p><pre><code>&lt;ImageView android:id=""@+id/ImageView01""     android:layout_width=""86dip""      android:layout_height=""72dip""     android:background=""@drawable/pinkwhitebg""&gt; &lt;/ImageView&gt;</code></pre><p>But i cannot align it to cover the whole layout unless i use RelativeLayout. Or can I?</p><p>If i am using RelativeLayout with the ImageView the imageview is smaller than the image!</p><pre><code>&lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""vertical""    android:layout_width=""146dip""    android:layout_height=""72dip""    android:layout_gravity=""center""    android:id=""@+id/widgetlayout""&gt;&lt;ImageView android:id=""@+id/ImageView01""     android:layout_width=""146dip""      android:layout_height=""72dip""     android:layout_marginLeft=""3dip""     android:layout_marginRight=""30dip""&gt; &lt;/ImageView&gt;&lt;TextView android:id=""@+id/widget_textview""    android:text=""@string/widget_text""    android:layout_height=""wrap_content""    android:layout_width=""wrap_content""    android:layout_gravity=""center_horizontal|center""    android:gravity=""center_horizontal""    android:layout_marginTop=""0dip""    android:layout_marginLeft=""40dip""    android:paddingLeft=""0dip""    android:textColor=""#0B3B0B""    android:textSize=""11sp""/&gt; &lt;TextView android:id=""@+id/widget_textview2""    android:text=""@string/widget_text""    android:layout_height=""wrap_content""    android:layout_width=""wrap_content""    android:layout_gravity=""center_horizontal|center""    android:gravity=""center_horizontal""    android:layout_marginTop=""0dip""    android:layout_marginLeft=""0dip""    android:paddingLeft=""30dip""    android:textSize=""12sp""    android:textColor=""#E8E86B""    android:layout_below=""@+id/widget_textview""/&gt;&lt;TextView android:id=""@+id/widget_textview3""    android:text=""@string/widget_text""    android:layout_height=""wrap_content""    android:layout_width=""wrap_content""    android:layout_gravity=""center_horizontal|center""    android:layout_marginTop=""0dip""    android:layout_marginLeft=""0dip""    android:paddingLeft=""30dip""    android:textSize=""9sp""    android:textColor=""#0B3B0B""    android:layout_below=""@+id/widget_textview2""/&gt;&lt;/RelativeLayout&gt;</code></pre><p>So it's very strange as i am using the same width and height here as in the linearlayout but the background is thinner..</p><p>I've also tried to this very easy method but this way in place of the widget i just get the text ""Problem loading widget"":</p><pre><code>  RemoteViews updateViews = new RemoteViews(EditPreferences.this.getPackageName(), R.layout.main);              updateViews.setTextColor(R.id.widget_textview, Color.rgb(23, 81, 11));              updateViews.setTextColor(R.id.widget_textview2, Color.WHITE);              updateViews.setTextColor(R.id.widget_textview3, Color.rgb(23, 81, 11));              updateViews.setImageViewBitmap(R.id.widgetlayout, ((BitmapDrawable)EditPreferences.this.getResources().getDrawable(R.drawable.brownbg)).getBitmap());              ComponentName thisWidget = new ComponentName(EditPreferences.this, HelloWidget.class);              AppWidgetManager manager = AppWidgetManager.getInstance(EditPreferences.this);              manager.updateAppWidget(thisWidget, updateViews);</code></pre><p>Question 1: Can i change the background of the widget without using ImageView? How? (this would be the best solution)</p><p>Question 2: Can i cover the whole LinearLayout with ImageView?</p><p>Question 3: Why is the background image smaller in the ImageView in case of RelativeLayout?</p><p>What do you suggest?</p>","571648","","571648","","2011-02-12 10:25:18","2011-02-12 10:25:18","Android widget background","<android><android-widget>","1","0","","",""
"4977499","1","4977519","","2011-02-12 10:14:47","1","154","<p>hi i am a new programmer i have created an app of my own. i am trying to give a name for the app to be displayed in my device, i think it must be given somewhere at manifest file, am i right, if not pls guide me....</p>","596364","","","","","2012-08-27 11:04:45","App name in device","<java><android>","2","0","","",""
"4977540","1","","","2011-02-12 10:25:38","0","356","<p>Widget Provider is a specialized BroadcastReceiver. </p><p>Assuming there exists an Application, 1-n  android service,1-k activities, and potentially additional 0-n broadcast receivers that are not widgets, I would like to verify what belongs and does not belong logically inside the broadcast receiver.  Here are some items ..</p><p>And assuming that generally what gets launched is the widget first.</p><p>Please comment on any of the items as to whether they belong inside or outside the widget and why.  Thanks.</p><p>1) If the application needs to always listen for certain events whether they show up in the widget or not where should this go?  In the Widget?  If not what would keep the broadcast receiver available to listen to the events for the application?</p><p>2) Should the widget issue notification? or request a service to issue them? ie should the notification logic reside in the widget itself or in the service.</p><p>3)  Should the widget issue broadcasts or ask a service to do this?</p><p>4)  Should the widget ever access any system services like like Notification Manager, PowerManager etc  Why, Why not?</p><p>5) Should the widget keep any of its own state?  If it should not keep state how can it change what it displays?  Like a different text or icon?</p><p>6) Should the widget start off activities or let a service handle this?</p><p>7) is it ok to user the context passed to update and receiver or should one use ctx.getApplicationContext() to do things like context.startService? ( Perhaps the one passed in is the application context ? )</p>","602260","","","","","2011-02-12 12:15:44","What does/does not belongs in WidgetProvider","<android><widget>","1","0","","",""
"4977641","1","4977981","","2011-02-12 10:50:51","0","477","<p>I am a working on an Android app and am a bit confused about the way the Activity stack specifically handles state information. I looked on the activity documentation about the matter and found this:</p><p>If an activity in the foreground of the screen (at the top of the stack), it is active or running.</p><p>If an activity has lost focus but is still visible (that is, a new non-full-sized or transparent activity has focus on top of your activity), it is paused. A paused activity is completely alive (it maintains all state and member information and remains attached to the window manager), but can be killed by the system in extreme low memory situations.</p><p>If an activity is completely obscured by another activity, it is stopped. It still retains all state and member information, however, it is no longer visible to the user so its window is hidden and it will often be killed by the system when memory is needed elsewhere.</p><p>If an activity is paused or stopped, the system can drop the activity from memory by either asking it to finish, or simply killing its process. When it is displayed again to the user, it must be completely restarted and restored to its previous state.</p><p>I have an activity called SongList which is only initiated from one other activity and with the intent that initiates it, receives some state information. It also may move the user to a few other individual activities but each one has a back button that takes them back to SongList and is implemented with moveTaskToBack(true);</p><p>My question is how do I know what is happening with the state variables in SongList? Since none of the back buttons actually carry the state information, it seems if the user moves on to some of these other activities, when they hit back, it may either not take them back to SongList, or have lost all the state information and as such work improperly. Do I need to manually handle saving all this state information?</p><p>Can anyone point me in the right direction on resolving this issue, or perhaps just fill me in on anything that I might have missed in the documentation that addresses my concern.</p><p>Thanks in advance.</p><p>Avtar</p>","614142","","","","","2011-02-12 12:11:09","Keeping track of an Activity's State Information","<android>","1","0","","",""
"4977657","1","","","2011-02-12 10:54:42","0","87","<p>how can I put an array where soundID is at, and be recognized by android/java?</p><p>String filename=""(SoundID)""+"".ogg"";         string;</p><p>hope theres a way, thanks</p>","604037","","","","","2011-02-12 12:05:40","string array inside of string","<android><arrays><string>","1","1","","",""
"4977684","1","5063580","","2011-02-12 11:02:59","0","567","<p>I had problems with getWidth methods on layouts and views so I tried separating creation and placing of views inside parent. At start, activity starts the method loadResources() which gets all favicons from database, creates imageviews for them and in other loop after assigning them to relativeLayout parent tries placing them on screen. But nothing is on screen??</p><p>Here's the code:</p><pre><code>private void loadResources() {    cursor = managedQuery(Browser.BOOKMARKS_URI, projection, selection,    null, Browser.BookmarkColumns.VISITS + "" DESC"");    if(cursor.moveToFirst()) {        bookmarkCounter = 1;        ByteArrayInputStream blobImage;        do{           bookmark = new ImageView(this);           bookmark.setId(bookmarkCounter++);           bookmark.setBackgroundColor(Color.WHITE);           blobImage = new ByteArrayInputStream(                   cursor.getBlob(cursor.getColumnIndex(BookmarkColumns.FAVICON)));           bookmark.setImageDrawable(                   Drawable.createFromStream(blobImage, """" + bookmark.getId()));           params = new RelativeLayout.LayoutParams(                   (int) (40 * scale), (int) (40 * scale));           params.topMargin = (int) (scale * 20);           params.leftMargin = (int) (scale * 20);           relativeLayout.addView(bookmark, params);        } while (cursor.moveToNext());        int idOfViewToTheLeft = 1;        for(int counter = 1; counter &lt; bookmarkCounter; counter++) {            bookmark = (ImageView) findViewById(counter);            Log.v(""WIDTH"", """" + relativeLayout.getWidth());            if(bookmarkCounter &gt; 1) {               if(relativeLayout.getWidth() &gt; (bookmark.getLeft() + bookmark.getWidth())) {                   params.addRule(RelativeLayout.RIGHT_OF, bookmark.getId() - 1);               } else {                   params.addRule(RelativeLayout.BELOW, idOfViewToTheLeft);                   idOfViewToTheLeft = bookmark.getId();               }            }            bookmark.setScaleType(ScaleType.CENTER_CROP);            bookmark.setLayoutParams(params);        }        setContentView(R.layout.main);     }    }</code></pre><p>}</p>","607767","","","","","2011-07-25 21:13:50","Dynamic creation of views and getWidth methods on android","<android><dynamic><view><views><relativelayout>","2","4","","",""
"4977696","1","4977767","","2011-02-12 11:07:45","2","209","<p>I'm a beginner in Android.I created two interfaces with DroiDraw, then I added them <strong>res/layout/a.xml</strong> and <strong>res/layout/b.xml</strong> </p><p>My goal is passing from interface <strong>a</strong> to <strong>b</strong> .</p><p>How can I do??</p><p>Thanks.</p><p>Ali</p>","604156","","","","","2011-02-12 11:23:37","How to pass from an interface to other in Android","<android><interface>","2","1","3","",""
"4977728","1","","","2011-02-12 11:14:11","1","4296","<p>How to get the amplitude when blowing into MIC in android device.</p><pre><code>MediaRecorder recorder = new MediaRecorder();   recorder.setAudioSource(MediaRecorder.AudioSource.MIC);   Timer timer = new Timer();   timer.scheduleAtFixedRate(new RecorderTask(recorder), 0, 1000);private class RecorderTask extends TimerTask {private MediaRecorder recorder;public RecorderTask(MediaRecorder recorder) {    this.recorder = recorder;}public void run() {    Log.v("""", ""amplitude is"" + recorder.getMaxAmplitude());}}</code></pre><p>I am getting an error: </p><pre><code>ERROR/AndroidRuntime(20927): Caused by: java.lang.RuntimeException: setAudioSource failed.ERROR/AndroidRuntime(20927): at android.media.MediaRecorder.setAudioSource(Native Method)</code></pre>","614146","","637362","","2012-02-01 12:44:21","2013-01-15 09:28:59","How to get the amplitude when blowing into MIC on android device","<android>","3","0","5","",""
"4977856","1","4978073","","2011-02-12 11:45:14","2","3723","<p>i have the following 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=""Ringtone preference"" android:key=""ringtone_option_preference""&gt;    &lt;RingtonePreference     android:key=""ring_tone_pref""    android:title=""Set Ringtone Preference""    android:showSilent=""true""    android:ringtoneType=""notification""    android:summary=""Set Ringtone""/&gt; &lt;/PreferenceScreen&gt;</code></pre><p>And i want every time a notification is about to show, to look at the value of the ringtone and beep accordingly :)...To be more precise my notifications are generated in a broadcastReceiver class and each time the receiver catches something it creates a new notification...I just want the ringtone of the notification to change based on the ringtone set in the preferences..</p><p>How can I do that?</p><p>Thanks</p><p>Mike</p>","582665","","","","","2012-03-10 19:14:48","How to get ringtone preference at runtime?","<android><preferences><android-preferences><ringtone>","1","0","1","",""
"4977874","1","4977910","","2011-02-12 11:50:50","0","78","<p>Hello i have created a sample application in <strong>android using eclipse</strong> IDE</p><p>my code was working perfect and i have seen output on emulator</p><p>suddenly in eclipse my project seems <strong>with red cross icon</strong> and when i am trying to run application at that time it is showing me following error</p><pre><code>your project contains error(s), please fix them before running your application</code></pre><p>i have seen my code lots of time and not even single file is having any error message.</p><p>How to solve this problem??  </p>","491978","","","","","2011-02-12 11:58:32","Problem in executing application","<java><android><eclipse>","1","1","","",""
"4977935","1","","","2011-02-12 12:01:37","4","2302","<p>I have an application that contains a couple of listviews. The listviews contains items that consist of imageviews and textviews.</p><p>All images are thumbnail sized on a server and the pattern used for loading them is like this:</p><ul><li>Instantiate a DrawableManager<br /> </li><li><p>in the getView() method I do the following:</p><ol><li><p>Pass the thumb uri and the ImageView instance to the DrawableManagers getImageAsync method</p></li><li><p>The method will first look on sd card if the image exists if so load it from SD card and save a softreference + update imageview drawable</p></li><li><p>If not exists on sd. Fetch from HTTP and save on SD (if there is enough space) put as softreference and update imageview drawable.</p></li></ol></li></ul><p>When the images exists on sd card everything works fine. But first time (or when using the app without sd card) the images seems to be populated into the wrong listviews rows when scrolling. When i stop scroll the problem fixes it self after a couple of seconds.</p><p>Its almost like if the ImageView references are pooled or something.</p><p>Any ideas?</p><p>I also include the getView method:</p><pre><code>public View getView(int position, View convertView, ViewGroup parent) {    ViewHolder vh;    if (convertView == null) {        convertView = inflater.inflate(R.layout.informationrow, null);        vh = new ViewHolder();        vh.imageView = (ImageView) convertView.findViewById(R.id.rowInformationIcon);        vh.textView = (TextView) convertView.findViewById(R.id.rowInformationTitleLine);        convertView.setTag(vh);    }    else {         vh = (ViewHolder) convertView.getTag();    }    CustomCategory cc = items.get(position);    if (cc != null) {        vh.textView.setText(cc.get_name());        if (cc.getMediaUrl() != null) {            _drawMgr.fetchDrawableOnThread(cc.getMediaUrl(), vh.imageView);             vh.imageView.setBackgroundDrawable(getResources().getDrawable(R.drawable.imageframe));        }        else {             vh.imageView.setImageDrawable(getResources().getDrawable(R.drawable.trans4040));            vh.imageView.setBackgroundDrawable(null);        }    }    return convertView;}</code></pre>","600655","","440602","","2011-02-12 13:25:32","2013-02-28 14:12:54","Android listview image loading problem","<android><listview><imageview>","2","0","1","",""
"4977959","1","4978029","","2011-02-12 12:05:18","0","444","<p>hi when i am trying to run my app in either emulator or any device it shows us</p><pre><code>[2011-02-12 17:27:14 - FirstImage] ------------------------------[2011-02-12 17:27:14 - FirstImage] Android Launch![2011-02-12 17:27:14 - FirstImage] adb is running normally.[2011-02-12 17:27:14 - FirstImage] Performing com.gis.image.FirstImage activity launch[2011-02-12 17:27:14 - FirstImage] Automatic Target Mode: Unable to detect device compatibility. Please select a target device.[2011-02-12 17:27:16 - FirstImage] Uploading FirstImage.apk onto device '04038F041500E00A'[2011-02-12 17:27:27 - FirstImage] Installing FirstImage.apk...[2011-02-12 17:27:35 - FirstImage] Installation error: INSTALL_FAILED_INSUFFICIENT_STORAGE[2011-02-12 17:27:35 - FirstImage] Please check logcat output for more details.[2011-02-12 17:27:35 - FirstImage] Launch canceled!</code></pre><p>in logcat it shows as</p><pre><code>02-12 16:53:53.685: ERROR/CalWidget(3574): Hardware.isScreenOn=false but App.bIsScreenOn=true02-12 16:54:13.679: ERROR/WeatherEngine(1403): queryString = http://motor.accu-weather.com/widget/motor/weather-data.asp?location=ASI|IN|IN031|MADURAI&amp;metric=102-12 16:55:13.056: ERROR/smtp(1485): is not yahoo com02-12 16:55:14.423: ERROR/smtp(1485): is not yahoo com02-12 17:19:54.212: ERROR/WeatherEngine(1403): queryString = http://motor.accu-weather.com/widget/motor/weather-data.asp?location=ASI|IN|IN031|MADURAI&amp;metric=102-12 17:21:25.775: ERROR/ConnectivityService(1276): connected default network is not mActiveDefaultNetwork!02-12 17:21:25.783: ERROR/WeatherEngine(1403): queryString = http://motor.accu-weather.com/widget/motor/weather-data.asp?location=ASI|IN|IN031|MADURAI&amp;metric=102-12 17:21:26.791: ERROR/WeatherEngine(1403): queryString = http://motor.accu-weather.com/widget/motor/weather-data.asp?location=ASI|IN|IN031|MADURAI&amp;metric=102-12 17:24:34.783: ERROR/WeatherEngine(1403): Error Happen02-12 17:24:34.783: ERROR/WeatherWidgetProvider(1403): failed to get weather info from server02-12 17:24:39.791: ERROR/WeatherUpdateService(1403): Failed to get Weather info, retryCount=202-12 17:24:39.799: ERROR/WeatherEngine(1403): queryString = http://motor.accu-weather.com/widget/motor/weather-data.asp?location=ASI|IN|IN031|MADURAI&amp;metric=102-12 17:25:25.463: ERROR/smtp(1485): is not yahoo com02-12 17:25:26.822: ERROR/smtp(1485): is not yahoo com02-12 17:31:45.471: ERROR/PackageManager(1276): Couldn't copy package file to temp file.02-12 17:31:45.580: ERROR/AndroidRuntime(3715): ERROR: thread attach failed02-12 17:32:30.580: ERROR/PackageManager(1276): Couldn't copy package file to temp file.02-12 17:32:30.689: ERROR/AndroidRuntime(3729): ERROR: thread attach failed</code></pre><p>what is the error pls help me</p>","596364","","350685","","2011-02-12 12:32:11","2011-02-12 12:36:59","run time error in android devices","<java><android>","1","0","","",""
"4977997","1","10810449","","2011-02-12 12:14:41","2","1077","<p>onCreateMethod of a Base class:</p><pre><code>setListAdapter(new EfficientAdapter(this));</code></pre><p>Efficient Base Adapter class:</p><pre><code>    private class EfficientAdapter extends BaseAdapter {        private LayoutInflater mInflater;        Friends obj;        Friends object;        FriendsPictures pictureObject;        ArrayList&lt;FriendsPictures&gt; arrayFriendsPictures;        public EfficientAdapter(Context context) {            // Cache the LayoutInflate to avoid asking for a new one each time.            mInflater = LayoutInflater.from(context);         }        /**         * 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 arrFriendsObject.size();        }        /**         * 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;        }        private final ImageDownloader imageDownloader = new ImageDownloader();//        private final DrawableManager drawable= new DrawableManager();        /**         * 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.            final ViewHolder holder;            obj = arrFriendsObject.get(position);            // 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.Friendslistview, 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.FriendsText);                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(obj.FriendsTitle);//            holder.icon.setImageBitmap((position &amp; 1) == 1 ? mIcon1 : mIcon2);            //            _mLoadImage =  new GetImageAsyncTask();//            _mLoadImage.execute(urls[position]);            object = new Friends();            object =  arrFriendsObject.get(position);            arrayFriendsPictures = new ArrayList&lt;FriendsPictures&gt;();            pictureObject = new FriendsPictures();            arrayFriendsPictures =  object.arrFriendsPictures;            pictureObject = arrayFriendsPictures.get(0);            if(pictureObject.Image == null){                                pictureObject.Image = imageDownloader.download(pictureObject.ImageUrl, (ImageView) holder.icon);//              pictureObject.Image = drawable.fetchDrawableOnThread(pictureObject.ImageUrl, (ImageView) holder.icon);                                                                              object.arrFriendsPictures.set(0,pictureObject);                arrFriendsObject.set(position, object);            } else {                holder.icon.setImageBitmap(arrFriendsObject.get(position).arrFriendsPictures.get(0).Image);            }//            holder.icon.setBackgroundResource(R.drawable.photo1);                    convertView.setOnClickListener(mShowDetails);            return convertView;        }        class ViewHolder {            TextView text;            ImageView icon;//          ProgressBar showProgress;        }                    }</code></pre><p>ImageDownloader class:</p><pre><code>public class ImageDownloader {    private ProgressDialog dialog;    private static final String LOG_TAG = ""ImageDownloader"";    public Bitmap download(String url, ImageView imageView) {               resetPurgeTimer();        Bitmap bitmap = getBitmapFromCache(url);        if (bitmap == null) {            bitmap = forceDownload(url, imageView);        } else {            cancelPotentialDownload(url, imageView);            imageView.setImageBitmap(bitmap);        }        return bitmap;    }    private Bitmap forceDownload(String url, ImageView imageView) {        Bitmap bitmap = null;                // State sanity: url is guaranteed to never be null in DownloadedDrawable and cache keys.        if (url == null) {            imageView.setImageDrawable(null);            return null;        }        if (cancelPotentialDownload(url, imageView)) {                               BitmapDownloaderTask task = new BitmapDownloaderTask(imageView);                    DownloadedDrawable downloadedDrawable = new DownloadedDrawable(task);                    imageView.setImageDrawable(downloadedDrawable);                    imageView.setMinimumHeight(156);                    task.execute(url);                       try {                        bitmap =  task.get();                    } catch (InterruptedException e) {                        // TODO Auto-generated catch block                        e.printStackTrace();                    } catch (ExecutionException e) {                        // TODO Auto-generated catch block                        e.printStackTrace();                    }                           }        return bitmap;    }    private static boolean cancelPotentialDownload(String url, ImageView imageView) {        BitmapDownloaderTask bitmapDownloaderTask = getBitmapDownloaderTask(imageView);        if (bitmapDownloaderTask != null) {            String bitmapUrl = bitmapDownloaderTask.url;            if ((bitmapUrl == null) || (!bitmapUrl.equals(url))) {                bitmapDownloaderTask.cancel(true);            } else {                // The same URL is already being downloaded.                return false;            }        }        return true;    }    private static BitmapDownloaderTask getBitmapDownloaderTask(ImageView imageView) {        if (imageView != null) {            Drawable drawable = imageView.getDrawable();            if (drawable instanceof DownloadedDrawable) {                DownloadedDrawable downloadedDrawable = (DownloadedDrawable)drawable;                return downloadedDrawable.getBitmapDownloaderTask();            }        }        return null;    }    Bitmap downloadBitmap(String url) {        final int IO_BUFFER_SIZE = 4 * 1024;        // AndroidHttpClient is not allowed to be used from the main thread        final HttpClient client = new DefaultHttpClient();        final HttpGet getRequest = new HttpGet(url);        try {            HttpResponse response = client.execute(getRequest);            final int statusCode = response.getStatusLine().getStatusCode();            if (statusCode != HttpStatus.SC_OK) {                Log.w(""ImageDownloader"", ""Error "" + statusCode +                        "" while retrieving bitmap from "" + url);                return null;            }            final HttpEntity entity = response.getEntity();            if (entity != null) {                InputStream inputStream = null;                try {                    inputStream = entity.getContent();                    // return BitmapFactory.decodeStream(inputStream);                    // Bug on slow connections, fixed in future release.                    return BitmapFactory.decodeStream(new FlushedInputStream(inputStream));                } finally {                    if (inputStream != null) {                        inputStream.close();                    }                    entity.consumeContent();                }            }        } catch (IOException e) {            getRequest.abort();            Log.w(LOG_TAG, ""I/O error while retrieving bitmap from "" + url, e);        } catch (IllegalStateException e) {            getRequest.abort();            Log.w(LOG_TAG, ""Incorrect URL: "" + url);        } catch (Exception e) {            getRequest.abort();            Log.w(LOG_TAG, ""Error while retrieving bitmap from "" + url, e);        } finally {        }        return null;    }    static class FlushedInputStream extends FilterInputStream {        public FlushedInputStream(InputStream inputStream) {            super(inputStream);        }        @Override        public long skip(long n) throws IOException {            long totalBytesSkipped = 0L;            while (totalBytesSkipped &lt; n) {                long bytesSkipped = in.skip(n - totalBytesSkipped);                if (bytesSkipped == 0L) {                    int b = read();                    if (b &lt; 0) {                        break;  // we reached EOF                    } else {                        bytesSkipped = 1; // we read one byte                    }                }                totalBytesSkipped += bytesSkipped;            }            return totalBytesSkipped;        }    }    public class BitmapDownloaderTask extends AsyncTask&lt;String, Void, Bitmap&gt; {        private String url;        Bitmap bitmap;        private final WeakReference&lt;ImageView&gt; imageViewReference;        public BitmapDownloaderTask(ImageView imageView) {            imageViewReference = new WeakReference&lt;ImageView&gt;(imageView);        }        @Override        // can use UI thread here        protected void onPreExecute() {          if(dialog!=null)          {                     dialog.setMessage(""loading.."");                     dialog.show();          }        }        @Override        protected Bitmap doInBackground(String... params) {            url = params[0];            return downloadBitmap(url);        }        @Override        protected void onPostExecute(Bitmap bitmap) {            if (isCancelled()) {                bitmap = null;            }            if(dialog!=null)            {              dialog.dismiss();            }            addBitmapToCache(url, bitmap);            if (imageViewReference != null) {                ImageView imageView = imageViewReference.get();                BitmapDownloaderTask bitmapDownloaderTask = getBitmapDownloaderTask(imageView);                // Change bitmap only if this process is still associated with it                // Or if we don't use any bitmap to task association (NO_DOWNLOADED_DRAWABLE mode)                if ((this == bitmapDownloaderTask)) {                    imageView.setImageBitmap(bitmap);                }            }        }    }    static class DownloadedDrawable extends ColorDrawable {        private final WeakReference&lt;BitmapDownloaderTask&gt; bitmapDownloaderTaskReference;        public DownloadedDrawable(BitmapDownloaderTask bitmapDownloaderTask) {            super(Color.BLACK);            bitmapDownloaderTaskReference =                new WeakReference&lt;BitmapDownloaderTask&gt;(bitmapDownloaderTask);        }        public BitmapDownloaderTask getBitmapDownloaderTask() {            return bitmapDownloaderTaskReference.get();        }    }    private static final int HARD_CACHE_CAPACITY = 10;    private static final int DELAY_BEFORE_PURGE = 10 * 1000; // in milliseconds    // Hard cache, with a fixed maximum capacity and a life duration    private final HashMap&lt;String, Bitmap&gt; sHardBitmapCache =        new LinkedHashMap&lt;String, Bitmap&gt;(HARD_CACHE_CAPACITY / 2, 0.75f, true) {        @Override        protected boolean removeEldestEntry(LinkedHashMap.Entry&lt;String, Bitmap&gt; eldest) {            if (size() &gt; HARD_CACHE_CAPACITY) {                // Entries push-out of hard reference cache are transferred to soft reference cache                sSoftBitmapCache.put(eldest.getKey(), new SoftReference&lt;Bitmap&gt;(eldest.getValue()));                return true;            } else                return false;        }    };    // Soft cache for bitmaps kicked out of hard cache    private final static ConcurrentHashMap&lt;String, SoftReference&lt;Bitmap&gt;&gt; sSoftBitmapCache =        new ConcurrentHashMap&lt;String, SoftReference&lt;Bitmap&gt;&gt;(HARD_CACHE_CAPACITY / 2);    private final Handler purgeHandler = new Handler();    private final Runnable purger = new Runnable() {        public void run() {            clearCache();        }    };    private void addBitmapToCache(String url, Bitmap bitmap) {        if (bitmap != null) {            synchronized (sHardBitmapCache) {                sHardBitmapCache.put(url, bitmap);            }        }    }    private Bitmap getBitmapFromCache(String url) {        // First try the hard reference cache        synchronized (sHardBitmapCache) {            final Bitmap bitmap = sHardBitmapCache.get(url);            if (bitmap != null) {                // Bitmap found in hard cache                // Move element to first position, so that it is removed last                sHardBitmapCache.remove(url);                sHardBitmapCache.put(url, bitmap);                return bitmap;            }        }        // Then try the soft reference cache        SoftReference&lt;Bitmap&gt; bitmapReference = sSoftBitmapCache.get(url);        if (bitmapReference != null) {            final Bitmap bitmap = bitmapReference.get();            if (bitmap != null) {                // Bitmap found in soft cache                return bitmap;            } else {                // Soft reference has been Garbage Collected                sSoftBitmapCache.remove(url);            }        }        return null;    }    public void clearCache() {        sHardBitmapCache.clear();        sSoftBitmapCache.clear();    }    private void resetPurgeTimer() {        purgeHandler.removeCallbacks(purger);        purgeHandler.postDelayed(purger, DELAY_BEFORE_PURGE);    }}</code></pre>","457146","","457146","","2011-02-12 12:26:10","2012-05-30 05:27:49","black screen appears when data loading takes long time in android","<android><listview>","1","0","","",""
"4978103","1","4978150","","2011-02-12 12:39:14","1","828","<p>What is the best practice - let each Activity maintain its own connection to Service, or create a static class that holds a single Service connection?</p>","223122","","","","","2011-02-12 12:50:49","Android service connection policy","<android><service><activity>","1","0","1","",""
"4978113","1","4978128","","2011-02-12 12:40:58","3","304","<p>Android SDK seems to have a good wrapper interfaces in package android.database.sqlite, can this wrapper (jar?) be used in for example a ms windows environment?</p>","531984","","","","","2011-02-12 12:47:31","Can the android sqlite interface be used outside android","<java><android><sqlite>","2","0","1","",""
"4978141","1","4979496","","2011-02-12 12:48:06","0","455","<p>I have a crash report from a user which i couldn't recreate same error myself on my test device.</p><p>Here is the relevant code :</p><pre><code>        for(File f : sessionDirectory.listFiles()){        Date lastModDate = new Date(f.lastModified());    /*Line 53*/ Session ss = new Session(lastModDate.toLocaleString() , f.getName()) ;        sessionArrayList.add(ss ) ;    }</code></pre><p>and here are the stack traces : </p><pre><code>java.lang.RuntimeException: Unable to start activity ComponentInfo{com.mydomain/com.mydomain.myActivity}: java.lang.NullPointerExceptionat android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2787)at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2803)at android.app.ActivityThread.access$2300(ActivityThread.java:135)at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2136)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)Caused by: java.lang.NullPointerExceptionat com.mydomain.myActivity.onCreate(myActivity.java:53)at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1069)at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2751)</code></pre>","426815","","512958","","2011-02-12 13:00:04","2011-02-12 17:35:21","Weird NullPointerException with Date object","<java><android><date><nullpointerexception>","2","0","","",""
"4978167","1","9950673","","2011-02-12 12:56:33","12","4002","<p>In onResume() I do:</p><pre><code>registerReceiver(timeTickReceiver, new IntentFilter(Intent.ACTION_TIME_TICK));</code></pre><p>and in onPause():</p><pre><code>unregisterReceiver(timeTickReceiver);</code></pre><p>I see ""java.lang.IllegalArgumentException: Receiver not registered"" reports in Android Developer Console (there are only 2 reports and my app has thousands of users). The exception is triggered by unregisterReceiver(). What can be happening? I don't feel very confident to just surround it with try-catch.</p>","243225","","217283","","2011-06-23 07:44:06","2013-10-19 14:08:08","Weird ""Receiver not registered"" exception","<android><broadcastreceiver>","4","4","1","",""
"4978267","1","5968742","","2011-02-12 13:23:20","0","437","<p>i had a working application until i changed the package name in the AndroidManifest.xml. I changed it back, but then i found that i had two files in the gen folder.I usually (as now) have sg like this:</p><p><img src=""http://i.stack.imgur.com/Et2EP.png"" alt=""enter image description here""></p><p>But that time had something else in my gen folder: just ""com.bfarago"" as far as i remember and another R.java inside that was complaining about the package name. I deleted this package with the R.java and since then i cannot launch the application.I exited and restarted eclipse and at the launch its stuck at this point:</p><pre><code>[2011-02-12 14:04:55 - Nevnap] Android Launch![2011-02-12 14:04:55 - Nevnap] adb is running normally.[2011-02-12 14:04:55 - Nevnap] Performing com.bfarago.nevnap.MainActivity activity launch[2011-02-12 14:04:55 - Nevnap] Automatic Target Mode: launching new emulator with compatible AVD 'my_avd'[2011-02-12 14:04:55 - Nevnap] Launching a new emulator with Virtual Device 'my_avd'[2011-02-12 14:04:55 - Emulator] emulator: ERROR: the user data image is used by another emulator. aborting[2011-02-12 14:04:59 - Nevnap] New emulator found: emulator-5554[2011-02-12 14:04:59 - Nevnap] Waiting for HOME ('android.process.acore') to be launched...</code></pre><p>Logcat:</p><pre><code>02-12 14:06:21.795: WARN/MountService(65): Waiting too long for mReady!</code></pre><p>Later i will need to recreate the whole app but now i want this to work again.</p><p>Please help me..</p>","571648","","571648","","2011-02-12 13:31:36","2011-05-11 18:17:58","Android app is not launching","<android>","2","2","1","",""
"4978352","1","4979206","","2011-02-12 13:39:29","3","332","<p>I'm using the voice recognition feature in android, I can speak into my device and be presented with a list of possible words.</p><p>When I say ""start"" it gives me the following words it thought it heard : </p><ol><li>stocks </li><li>stock </li><li>stop </li><li>start </li><li>stops </li><li>starks</li></ol><p>That list will depend on user accents amongst various other factors. Is there an easy way I can check that list for a specific word?</p><p>If a user issues the command ""start"" or ""stop"" I need to be able to tell the difference between the two commands.</p><p>My initial thought was to use a regex to check for ""sta"" or ""sto"" in any of the responses, is there a more effective way?</p>","155695","","155695","","2011-02-12 15:45:28","2011-02-12 16:41:35","Voice recognition, is there a way I can determine what the user says, possibly via regex?","<java><android><regex><android-sdk-2.2><voice-recognition>","1","1","1","",""
"4978436","1","","","2011-02-12 14:02:07","0","830","<p>My layout consists of an EditText and a subclass of WebView:</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;EditText android:id=""@+id/addressbar""               android:layout_width=""fill_parent""               android:layout_height=""wrap_content""               android:background=""@android:drawable/editbox_background""               /&gt; &lt;com.android.ibrowser.myWebView      xmlns:android=""http://schemas.android.com/apk/res/android""    android:id=""@+id/browser""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""/&gt;&lt;/LinearLayout&gt;</code></pre><p>When the user scrolls down the WebView I would like the EditText to move up and disappear, So I override the onScrollChanged method in WebView:</p><pre><code>protected void onScrollChanged (int l, int t, int oldl, int oldt){    super.onScrollChanged(l, t, oldl, oldt);    if (addressBar.getBottom() &gt; 0){        AnimationSet animation = new AnimationSet(true);        TranslateAnimation translateAnimation = new TranslateAnimation(0, 0                , -t + oldt, -t + oldt);        translateAnimation.setDuration(100);        animation.addAnimation(translateAnimation);        animation.setFillAfter(true);        animation.setAnimationListener(new AnimationListener() {            @Override            public void onAnimationEnd(Animation arg0) {                addressBar.clearAnimation();                // Change view to state B by modifying its layout params and scroll            }            @Override            public void onAnimationRepeat(Animation animation) {                // TODO Auto-generated method stub            }            @Override            public void onAnimationStart(Animation animation) {                // TODO Auto-generated method stub            }        });        addressBar.startAnimation(animation);    }}</code></pre><p>But the effect achieved is that the EditText moves to the top but immediately goes back to its original position. What do you think?  </p>","171911","","","","","2011-08-03 06:40:46","Android: Help animating views?","<android><animation><webview><move><translate>","2","0","1","",""
"4978522","1","4978609","","2011-02-12 14:17:10","0","1121","<p>I want to make it so that when I click a Button, it takes the text from the <code>EditText</code> and adds it to an <code>SQLiteDatabase</code>. I've read it somewhere before, but I forgot how to do it.</p>","560096","","","","","2013-06-11 08:37:47","Add Text From EditText to SQLite","<android><sqlite><button><edittext>","2","0","","",""
"4978541","1","","","2011-02-12 14:19:54","0","725","<p>I'm trying to write a test app which connects to BlackBerry 655+ bluetooth headset. Basically what i want to do in this app is connect to the headset and catch button pressures on it. I think that could be done by reading the socket's inputstream. Anyway, i get some errors right when i try to connect to the socket. Here's the code:</p><pre><code>BluetoothSocket tmp = null;try {    tmp = mDevice.createRfcommSocketToServiceRecord(                   UUID.fromString(""00001101-0000-1000-8000-00805F9B34FB""));} catch(IOException e) {}mSocket = tmp;mBtAdapter.cancelDiscovery();try {    mSocket.connect();   // THIS ONE GIVES A ""Service discovery failed"" exception} catch (IOException e1) {Method m = null;try {    m = mDevice.getClass().getMethod(          ""createRfcommSocket"", new Class[] {int.class});} catch (SecurityException e) {    e.printStackTrace();} catch (NoSuchMethodException e) {    e.printStackTrace();}try {    tmp = (BluetoothSocket) m.invoke(mDevice, 1);} catch (IllegalArgumentException e) {            e.printStackTrace();} catch (IllegalAccessException e) {            e.printStackTrace();} catch (InvocationTargetException e) {            e.printStackTrace();}mSocket = tmp;try {    mSocket.connect();  // THIS ONE GIVES A ""Connection refused"" EXCEPTION} catch (IOException e) {    e.printStackTrace();}}</code></pre><p>What am i doing wrong? I already tried different ports in the m.invoke(mDevice, X) instruction but it always gives ""Connection refused""</p>","614255","","","","","2011-11-10 10:48:26","Android connect to Blackberry 655+ bluetooth headset","<android><bluetooth><headset>","2","0","","",""
"4978659","1","4978710","","2011-02-12 14:44:43","0","423","<p>I am new to Android services so please excuse the ""noobish"" question. How could I bind a <code>Service</code> to any incoming SMS, calls, or email? Should I use the <code>onBind</code> method? Or should I use a <code>BroadcastReciever</code>?</p>","200477","","","","","2011-02-12 14:57:37","Bind service to any incoming SMS/Emails/Calls?","<java><android><service><broadcastreceiver>","1","1","","",""
"4978666","1","4979009","","2011-02-12 14:47:22","0","637","<p>I am trying to implement database upgrading for my android app. I tried to use following code:</p><pre><code>// Create a table that is equivalent to the existing one but with one column as TEXT instead of INTEGERdb.execSQL(""CREATE VIRTUAL TABLE distributors_new USING FTS3 (fname TEXT, lname TEXT, phoneNumber TEXT, email TEXT, notes TEXT, parentid INTEGER, customid TEXT FOREIGN KEY (parentid) REFERENCES distributors(rowid) ON DELETE CASCADE ON UPDATE CASCADE);"");//Insert all data from the old table to the new one.db.execSQL(""INSERT INTO distributors_new SELECT * FROM distributors;"");// Drop the old tabledb.execSQL(""DROP TABLE distributors;"");// Rename the new tabledb.execSQL(""ALTER TABLE distributors_new RENAME TO distributors;"");</code></pre><p>However I got an error after the onUpgrade method is executed.</p><pre><code>02-12 16:31:16.324: ERROR/Database(1456): Failure 1 (SQL logic error or missing database) on 0x26b338 when executing 'COMMIT;'02-12 16:31:16.334: ERROR/SQLiteOpenHelper(1456): Couldn't open mlmDB for writing (will try read-only):02-12 16:31:16.334: ERROR/SQLiteOpenHelper(1456): android.database.sqlite.SQLiteException: SQL logic error or missing database: COMMIT;02-12 16:31:16.334: ERROR/SQLiteOpenHelper(1456)</code></pre><p>What am I doing wrong?</p>","143923","","","","","2011-02-12 16:22:03","Error when upgrading SQLite database","<android><sqlite><sqlite3>","4","0","","",""
"4978689","1","4978841","","2011-02-12 14:54:11","3","1417","<p>What custom button should I use which could be slided right and left such as on turn on/off location button on android's twitter app as the picture below:</p><p><img src=""http://i.stack.imgur.com/zzMpq.jpg"" alt=""enter image description here""></p><p><img src=""http://i.stack.imgur.com/4xLEA.jpg"" alt=""enter image description here""></p><p>and also any link or guide to create such button ?</p><p>Thanks</p>","436498","","418183","","2011-02-12 15:27:59","2011-02-12 15:27:59","How can I create a toggle button similar to the Twitter apps location toggle button?","<android><togglebutton>","1","0","1","",""
"4978743","1","4979552","","2011-02-12 15:05:46","0","605","<p>Hey all,I know that this question has been asked many times in this forum itself. But I am not able to get a working solution out of any one of them.</p><p>My problem is that I need to create a list view with images. The content is static. Eg: Lets say i need to display 5 rows of data and I have 5 images to go with these rows. All i need to do is to display them in a list format!</p><p>Simple right??</p><p>Thanks in advance!</p>","614285","","","","","2011-03-09 06:38:50","Image in a List view in Android","<android><image><android-listview>","2","3","","",""
"4978861","1","6215430","","2011-02-12 15:29:46","0","108","<p>I have multiple listviews, all of them with scrollbars. Everything works great, tested in alot of emulators and a couple of phones... except in Motorola Milestone with 2.1. As i said, i tried it with the emulator in 2.1 and newer (i'm using 1.6 SDK) and i had no problem whatsoever, except when i try it with a physical Milestone. There, the scrollbar doesn't shows and, more important, i can't even scroll on the ListView.</p><p>Anyone has a clue on why is this happening?</p>","495904","","495904","","2011-02-12 15:36:12","2011-06-02 13:49:37","ScrollView problem in Motorola Milestone","<java><android>","1","2","","",""
"4978942","1","4979422","","2011-02-12 15:48:26","0","676","<p>I am performing an HTTP POST of a name/value pair and then trying to obtain the HTTP response body (and place it into the String called description). </p><p>I'm unable to find a way to access the body of the response message. What I have below is the best I've come up with so far but it doesn't work. The ""description"" variable just ends up empty. </p><p>The end goal is to have code on the sever-side which takes the post data and returns a message body containing useful information. For now I just have a stub html in place that always returns the same thing (see html below). In other words, the app will send a DTC (Diagnostic Trouble Code, from a car) to the server and the server will look it up and send back the description text inside of the HTML body. </p><p>Source code to the method: </p><pre><code>public String getDTCDescription (String DTC) {    String description = """";    String url = ""http://site/test.html"";    List&lt;NameValuePair&gt; args = new ArrayList&lt;NameValuePair&gt;();    args.add(new BasicNameValuePair(""testkey"",""testValue""));     HttpResponse h;    h = postData(url, args);    BufferedInputStream content = null;     try {        content = new BufferedInputStream(h.getEntity().getContent());    } catch (Exception e) {        Log.e(""NetDTCInfo"",e.getMessage());    }    if (content == null) {        return """";    }    // try and loop through all the data waiting on the input stream.     try {        while (content.available() &gt; 0) {            Log.d(""NetDTCInfo"",""Reading a byte..."");            description = description + (char) content.read();            Log.d(""NetDTCInfo"",""Description is now: "" + description);        }    } catch (IOException e) {        Log.e(""NetDTCInfo"",""Error while reading. "" + e.getMessage());    }    return description;}</code></pre><p>Source code to the file test.html</p><pre><code>&lt;html&gt;        &lt;body&gt;                &lt;pre&gt;                        P0521|This is a description of DTC code P0521.                &lt;/pre&gt;        &lt;/body&gt;&lt;/html&gt;</code></pre>","268803","","","","","2011-02-12 17:20:45","Unable to find body data from http response","<android><http><networking>","1","0","","",""
"4979075","1","4979492","","2011-02-12 16:15:19","0","2033","<p>I'm trying to make a button in my App open the built in gallery. </p><pre><code>public void onClick(View v) {                Intent intentBrowseFiles = new Intent(Intent.ACTION_VIEW);                intentBrowseFiles.setType(""image/*"");                intentBrowseFiles.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);                startActivity(intentBrowseFiles);                               }</code></pre><p>This results in an error message ""The application Camera (process com.android.gallery) has stopped unexpectedly.""</p><p>If I set the Intent action to ACTION_GET_CONTENT it manages to open the gallery but then simply returns the image to my app when a picture is selected which is not what I want. </p>","612168","","612168","","2011-02-13 12:59:49","2011-06-28 16:04:12","Button to start the Gallery on Android","<java><android><android-intent><gallery>","1","0","","",""
"4979078","1","4979241","","2011-02-12 16:15:45","0","1354","<p>I code abide by <a href=""http://android-er.blogspot.com/2009/10/multi-language-translate.html"" rel=""nofollow"">http://android-er.blogspot.com/2009/10/multi-language-translate.html</a></p><p>and it force close</p><pre><code>private void showLang() {    db.open();    cursor = db.getLang();    cursor.moveToFirst();    startManagingCursor(cursor);    SimpleCursorAdapter qc = new SimpleCursorAdapter(            this,            android.R.layout.simple_spinner_item,            cursor,            new String[] {DBAdapter.KEY_LANG},            new int[] {android.R.id.text1});        qc.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);        Language_Spinner.setAdapter(qc);        TranslateButton.setOnClickListener(new OnClickListener() {            public void onClick(View arg0) {                String InputString;                String OutputString = null;                InputString = Thai_word.getText().toString();                String language = (String)Language_Spinner                .getItemAtPosition((int) Language_Spinner.getSelectedItemId());                try {                    Translate.setHttpReferrer(""http://android-er.blogspot.com/"");                    OutputString = Translate.execute(InputString,                            Language.ENGLISH,Language.THAI);                } catch (Exception ex) {                    ex.printStackTrace();                    OutputString = ""Error"";              }                Target_word.setText(OutputString+language);            }               });}</code></pre><p>}</p><p>this is my logcat</p><blockquote>  <p>02-12 21:45:44.701: ERROR/AndroidRuntime(437): FATAL EXCEPTION: main  02-12 21:45:44.701: ERROR/AndroidRuntime(437): java.lang.ClassCastException: android.database.sqlite.SQLiteCursor  02-12 21:45:44.701: ERROR/AndroidRuntime(437):     at com.android.proj.Sens_Create$1.onClick(Sens_Create.java:133)  02-12 21:45:44.701: ERROR/AndroidRuntime(437):     at android.view.View.performClick(View.java:2408)  02-12 21:45:44.701: ERROR/AndroidRuntime(437):     at android.view.View$PerformClick.run(View.java:8816)  02-12 21:45:44.701: ERROR/AndroidRuntime(437):     at android.os.Handler.handleCallback(Handler.java:587)  02-12 21:45:44.701: ERROR/AndroidRuntime(437):     at android.os.Handler.dispatchMessage(Handler.java:92)  02-12 21:45:44.701: ERROR/AndroidRuntime(437):     at android.os.Looper.loop(Looper.java:123)  02-12 21:45:44.701: ERROR/AndroidRuntime(437):     at android.app.ActivityThread.main(ActivityThread.java:4627)  02-12 21:45:44.701: ERROR/AndroidRuntime(437):     at java.lang.reflect.Method.invokeNative(Native Method)  02-12 21:45:44.701: ERROR/AndroidRuntime(437):     at java.lang.reflect.Method.invoke(Method.java:521)  02-12 21:45:44.701: ERROR/AndroidRuntime(437):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)  02-12 21:45:44.701: ERROR/AndroidRuntime(437):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)  02-12 21:45:44.701: ERROR/AndroidRuntime(437):     at dalvik.system.NativeStart.main(Native Method)</p></blockquote><p>please help</p>","605358","","605358","","2011-02-12 18:36:17","2011-02-12 18:36:17","Google Translator in Android","<android><google-translate>","1","1","1","",""
"4979087","1","4979954","","2011-02-12 16:17:05","5","800","<p>I have a bunch of objects (balloons) that move upwards, hit the roof (i.e. object.yPos &lt;= 0), and stop. Balloons that follow them hit the existing balloons and stop. Now, I shoot at balloons and remove those that are hit ... easy enough if they are already on the bottom. However, <b> I also have to remove those balloons that are left hanging after their supporting Anchor is hit and removed i.e. they are not attached to the roof OR any of the other balls anymore. </b> Relevant to this, I have following supporting methods in my Balloon Object:</p><p><i>balloon.getAdjacentList() -> Returns ArrayList of all the Balloons that are attached to balloon</p><p>balloon.getX() -> Returns X Pos of balloon</p><p>balloon.getY() -> Returns Y Pos of balloon</i></p><p>One way of detecting ""hanging in the air"" balloon that I can think of is to use ""Graph traversal"" with DFS or BFS where origin would be all adjacent balls of the one that is hit (and removed) and destination would be ... if any of the adjacent ball (or ""adjacent's adjacent"" ball OR ""adjacent's adjacent's adjacent"" and so on) has getY() &lt;= 0 i.e. find path to the roof.</p><p>This check seems very expensive to run especially when, to remove one or two hanging balls, I have to run dozens of searches. Also keep in mind that, in theory, a balloon might have many others attached to it and still have its Anchor (the one supporting them all to roof) hit and removed and therefore all of them have to go ... so ... if ( getAdjacent().size() == 0) would not work. </p><p>1- Any better idea of something that seems so easy to visualize and is implemented in so many games?2- Any supporting methods that I can add to help me detect the balls?</p><p>Thanks in advance for any help</p>","614346","","","","","2011-02-12 19:10:57","Android Game Development (Programming/Algorithm) Question","<java><android><algorithm>","3","0","3","",""
"4979165","1","","","2011-02-12 16:33:04","3","3950","<p>I have a cluster marker that defines a bounding rectangle containing a group of markers. The cluster has a center (lat,lon), a marker count and a latitude and longitude span to calculate the bounds.</p><p>The Google Maps API (JS) has a function called ""getBoundsZoomLevel(bounds)"" but I cannot find an equivalent method in the Google Maps SDK for Android. How can I estimate the zoom level for given bounds (especially on different devices with different resolutions/densitys)?</p><p>I've planned that an user can touch a cluster marker and the map view will be centered to the center and the bounds of that cluster.</p><p>Has anybody a working code snippet or some suggestions for me?</p><p>Thanks in advanceRegards Thorsten.</p>","594894","","97160","","2012-07-02 18:06:27","2012-07-02 18:06:27","Getting map zoom level for given bounds on Android like on JS Google Maps API: map.getBoundsZoomLevel(bounds)","<android><google-maps><maps><zoom><bounds>","2","0","4","",""
"4979172","1","4979404","","2011-02-12 16:34:42","1","435","<p>I'm looking at the <code>ListActivity</code> source code, and I'm seeing that a private <code>Handler</code> is being defined, and that a <code>Runnable</code> is posted to this handler in the <code>onContentChanged()</code> method.</p><p>I don't quite get the point of this, as the handlers, as I understand it, are there for inter-thread communication. Here, the definition of the handler and the posting is happening on the same thread, and no delay is specified in the post() call. I can't see the handler being used for anything else, either.</p><p>I've probably misunderstood something about the use of handlers here. Why is it done the way it is here, and not by just running <code>mList.focusableViewAvailable()</code> (the call inside the runnable) directly? Wouldn't the result be the same?</p><p>Beneath is what I believe are the relevant portions of the <code>ListActivity</code> source code:</p><pre><code>public class ListActivity extends Activity {    protected ListView mList;    private Handler mHandler = new Handler();    private Runnable mRequestFocus = new Runnable() {        public void run() {            mList.focusableViewAvailable(mList);        }    };    /**     * Updates the screen state (current list and other views) when the     * content changes.     *     * @see Activity#onContentChanged()     */    @Override    public void onContentChanged() {        super.onContentChanged();        View emptyView = findViewById(com.android.internal.R.id.empty);        mList = (ListView)findViewById(com.android.internal.R.id.list);        if (mList == null) {            throw new RuntimeException(                    ""Your content must have a ListView whose id attribute is "" +                    ""'android.R.id.list'"");        }        if (emptyView != null) {            mList.setEmptyView(emptyView);        }        mList.setOnItemClickListener(mOnClickListener);        if (mFinishedStart) {            setListAdapter(mAdapter);        }        mHandler.post(mRequestFocus);        mFinishedStart = true;    }}</code></pre>","543617","","","","","2011-02-12 17:16:16","Understanding the Handler in ListActivity","<android><handler><listactivity>","1","2","0","",""
"4979212","1","4983670","","2011-02-12 16:42:02","21","38625","<p>I'm adding two buttons to the UI, but they appear on top of one another. I want them to appear next to each other. What am I missing in this code?</p><pre><code>m_btnCrown = new ImageButton(this);m_btnCrown.setImageResource(R.drawable.king_crown_thumb);m_btnCrown.setAlpha(100);RelativeLayout.LayoutParams lp = new RelativeLayout.LayoutParams(    RelativeLayout.LayoutParams.WRAP_CONTENT, RelativeLayout.LayoutParams.WRAP_CONTENT);lp.addRule(RelativeLayout.ALIGN_PARENT_TOP);addContentView(m_btnCrown, lp);m_btnMonkey = new ImageButton(this);m_btnMonkey.setImageResource(R.drawable.monkey_small);m_btnMonkey.setAlpha(100);lp = new RelativeLayout.LayoutParams(    RelativeLayout.LayoutParams.WRAP_CONTENT, RelativeLayout.LayoutParams.WRAP_CONTENT);lp.addRule(RelativeLayout.ALIGN_PARENT_TOP);lp.addRule(RelativeLayout.RIGHT_OF, m_btnCrown.getId());   addContentView(m_btnMonkey, lp);</code></pre>","547491","","418183","","2011-02-12 17:12:35","2011-02-13 11:03:24","Programmatically creating a RelativeLayout in Android","<android><relativelayout>","2","0","10","",""
"4979253","1","4983449","","2011-02-12 16:49:07","0","3062","<p>I've been trying to add configuration screen for my widget and I'm having problems getting it to work.  The configuration screen comes up fine when I first add the widget to my home screen, but it's supposed to also come up when the user clicks on the widget.  That's the part that is not working.</p><p>Here's the onUpdate code:  </p><pre><code>Intent intent = new Intent(context, WidgetConfiguration.class);            PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, intent, 0);  RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.widget);            views.setOnClickPendingIntent(R.id.temperatureWidget, pendingIntent); </code></pre><p>Here's the xml for the widget layout (widget.xml):</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""android:background=""@drawable/frame""android:clickable=""true""android:focusable=""true""android:id=""@+id/temperatureWidget""&gt;&lt;ImageView    android:layout_marginTop=""15px""    android:layout_marginLeft=""25px""    android:layout_width=""wrap_content""     android:layout_height=""wrap_content""    android:src=""@drawable/img_thermometer""/&gt;&lt;TextView     android:id=""@+id/TextView01""     android:layout_marginTop=""35px""    android:layout_width=""wrap_content""     android:layout_height=""wrap_content""     android:textSize=""12pt""    android:textColor=""@color/black""    android:text=""  Temp: ""/&gt;&lt;TextView     android:layout_width=""wrap_content""     android:layout_height=""wrap_content""     android:layout_marginTop=""35px""    android:textSize=""12pt""    android:textColor=""@color/black""    android:id=""@+id/txtTemperature""/&gt;&lt;/LinearLayout&gt;</code></pre><p>When I click on the widget, nothing happens.  Any ideas?</p>","582021","","582021","","2011-02-13 04:14:20","2011-02-13 09:34:33","Android widget click not working","<android><android-widget>","2","2","","",""
"4979256","1","","","2011-02-12 16:49:51","5","965","<p>I am developing a game for Android (2.1+), using the accelerometer as user input. I use a sensor listener that I register at the beginning of the activity with the sensor manager, as follows:</p><pre><code>mSensorManager.registerListener(SystemRegistry.inputSystem.mSensorListener,                                accSensor, SensorManager.SENSOR_DELAY_UI);  </code></pre><p>That works well and I just read the accelerometer values in <code>onSensorChanged(SensorEvent event)</code> in order to use it in my game loop:</p><pre><code>public void onSensorChanged(SensorEvent event){     accX = event.values[0];     accY = event.values[1];     accY = event.values[2]; }</code></pre><p>I am writing a real-time game so I am trying to avoid any memory allocation in my code, since I want to minimize the garbage collection. The problem is that every time there is a <code>SensorEvent</code>, the sensor manager actually allocates memory. Here is for example the output of the ddms allocation tracker:</p><pre><code>51  28  android.hardware.SensorEvent    9   android.hardware.SensorManager$ListenerDelegate createSensorEvent   50  28  float[] 9   android.hardware.SensorEvent    &lt;init&gt;  </code></pre><p>which shows 28*2=56 bytes allocated at every event. This seems to have the effect of triggering the garbage collector quite often, which induces some lags... So here is my question: is there a way to achieve the same thing (getting the current acceleration vector), without allocating any memory? Is there a way to actually read on demand the values of this vector without waiting for an event?</p>","614363","","","","","2011-02-12 23:30:03","Android: reading accelerometer without memory allocation?","<android><performance><memory><accelerometer>","2","0","4","",""
"4979375","1","4979845","","2011-02-12 17:12:47","0","1500","<p>Is that even possible? I doubt it, but want to make sure. </p>","428024","","524566","","2011-02-12 18:58:14","2012-02-27 20:58:39","Is it possible to lock the orientation on android through JavaScript?","<android>","3","2","0","",""
"4979418","1","","","2011-02-12 17:20:09","1","905","<p>I am trying to invoke InstalledAppDetails using the following code. I get the error message saying there is no such activity.</p><pre><code>Intent intent = Intent.parseUri(""dat=package:com.example.android.jetboy cmp=com.android.settings/.applications.InstalledAppDetails"", 0);intent.setAction(""android.settings.APPLICATION_DETAILS_SETTINGS"");startActivity(intent);</code></pre><p>java.lang.RuntimeException: Unable to start activity ComponentInfo{com.dds.test/com.dds.test.TestLayout}: android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.settings.APPLICATION_DETAILS_SETTINGS dat=dat=package:com.example.android.jetboy cmp=com.android.settings/.applications.InstalledAppDetails }</p>","349161","","349161","","2011-02-14 21:08:08","2011-04-23 14:19:27","How can I invoke InstalledAppDetails that is under com.android.settings?","<android>","1","0","1","",""
"4979444","1","4979718","","2011-02-12 17:25:00","1","930","<p>Could anyone please advise me what would be the best way to display the performance of a particular stock in an android app. I would be interested to know if any one has used any particular libraries. </p><p>I use a yahoo finance CSV parser to fetch the stock info. </p><p>Thanks. </p>","570217","","","","","2011-12-08 00:09:51","Display stock performance in android","<android><graph><yahoo-finance>","1","0","","",""
"4979452","1","4979527","","2011-02-12 17:26:20","2","1456","<p>Is there a way to either </p><p>A) start the activity without opening up the GUIB) start the VoiceRecognitionActivity behind my current activity, so the user does not notice?</p><p>Essentially, I'm not fond of how Voice Recognition disrupts the UX and would rather the user just see the words ""listening"" in my activity.  Android's a great OS and I think it deserves more beautiful apps!</p><p>I'm an Android newbie (as you can see from my question history) and very much appreciate your help.</p>","91377","","","","","2012-09-23 04:14:46","Hide Android Voice Recognition Activity to run in background?","<android><android-layout><voice-recognition>","2","0","","",""
"4979454","1","4981694","","2011-02-12 17:26:30","4","14469","<p>I'm new to Android development and I'm trying to code a little app which allows me to grab an external JSON file and parse it. I got this to work, however it wont work if I try to execute it in the background as an <code>AsyncTask</code>. Eclipse gives me the error</p><blockquote>  <p>The method findViewById(int) is undefined for the type LongOperation</p></blockquote><p>in this line:</p><blockquote>  <p>TextView txtView1 = (TextView)findViewById(R.id.TextView01);</p></blockquote><p>Here is my code:</p><pre><code>public class Main extends Activity {    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        new LongOperation().execute();    }}class LongOperation extends AsyncTask&lt;String, Void, String&gt; {    private final Context LongOperation = null;    @Override    protected String doInBackground(String... params) {        try {            URL json = new URL(""http://www.corps-marchia.de/jsontest.php"");            URLConnection tc = json.openConnection();            BufferedReader in = new BufferedReader(new InputStreamReader(tc.getInputStream()));            String line;            while ((line = in.readLine()) != null) {                    JSONArray ja = new JSONArray(line);                    JSONObject jo = (JSONObject) ja.get(0);                    TextView txtView1 = (TextView)findViewById(R.id.TextView01);                    txtView1.setText(jo.getString(""text"") + "" - "" + jo.getString(""secondtest""));            }        } catch (MalformedURLException e) {            Toast.makeText(this.LongOperation, ""Malformed URL Exception: "" + e, Toast.LENGTH_LONG).show();        } catch (IOException e) {            Toast.makeText(this.LongOperation, ""IO Exception: "" + e, Toast.LENGTH_LONG).show();        } catch (JSONException e) {            Toast.makeText(this.LongOperation, ""JSON Exception: "" + e, Toast.LENGTH_LONG).show();        }        return null;    }    @Override    protected void onPostExecute(String result) {    }    protected void onPreExecute() {    }    @Override    protected void onProgressUpdate(Void... values) {        ProgressDialog pd = new ProgressDialog(LongOperation);        pd.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);        pd.setMessage(""Working..."");        pd.setIndeterminate(true);        pd.setCancelable(false);    }    }</code></pre><p>Any ideas on how to fix this?</p>","563020","","418183","","2011-02-12 17:31:00","2011-02-13 00:49:27","The method findViewById(int) is undefined","<android><android-asynctask>","4","0","3","",""
"4979461","1","","","2011-02-12 17:27:16","2","849","<p>I read somewhere on stackoverflow previously that cvBlobLib had been integrated into opencv2.0 but i definitely can't find it and there's no mention of it in the <a href=""http://opencv.willowgarage.com/documentation/cpp/index.html"" rel=""nofollow"">documentation</a>. </p><p>I'm trying to do simple blob labelling on a static image. Writing an algorithm to do this from scratch is harder than it sounds so I was wondering if anyone had any other knowledge on this. I have seen cvBlob on Google Code but that's very much an external library.  </p><p>While i'm testing on a PC, my code needs to be used on an Android phone, so using external libraries (other than OpenCV) would be a massive pain. </p><p>Thanks for reading</p>","568355","","","","","2011-02-15 11:18:28","Blob labelling in OpenCv2.0","<c++><android><opencv><blob><tracking>","0","1","1","",""
"4979503","1","4980035","","2011-02-12 17:36:34","0","624","<p>I have looked around and cannot find any documentation or tutorials on how to run the Mages game engine in android:</p><p><a href=""http://code.google.com/p/mages/downloads/list"" rel=""nofollow"">http://code.google.com/p/mages/downloads/list</a></p><p>From the list above could someone please explain what I need to download. I need to make a simple game between 2 emulators. I noticed that the installation files in the link above has a clien.apk and a GASP file which is for Tomcat. I already have tomcat installed so this would be ideal. </p><p>Please help I am really stuck on how and which one to use.</p><p>Edit: Would it be easier just to use engine for this, is it possible to create a game between 2 players using andengine? </p><p>Thanks</p>","608658","","797390","","2011-11-18 12:36:24","2011-11-18 12:36:24","Mages game engine with tomcat or use Andengine","<android><andengine>","1","0","","",""
"4979511","1","4979577","","2011-02-12 17:38:13","6","3940","<p>i'm currently programming an iPhone game and I would like to create an online multiplayer mode. In the future, this app will be port to Android devices, so I was wondering how to create the game-server ?</p><p>First at all, which language should I choose ? How to make a server able to communicate both with programs written in objective-c and Java ?</p><p>Then, how to effectively do it ? Is it good if I open a socket by client (there'll be 2) ? What kind of information should I send to the server ? to the clients ?</p><p>Thanks for your time.</p>","317689","","246246","","2012-10-02 03:13:41","2012-10-02 03:13:41","Game server for an android/iOS turn-based board-game","<android><iphone><multiplayer>","2","2","6","",""
"4979520","1","","","2011-02-12 17:40:06","0","655","<p>I have a button in a web view with an onClick js event used to trigger a dialog box in android. It seems to work fine in all the phones that I can test, but I have users complaining that they are getting a force quit error.</p><p>Here's my code. Does anything stand out as wrong?I suspect that I'm using something that only works in 2.2 &amp; the users that are having problems are using 2.1, but I don't know how to verify if this is alright.</p><p>In the the webpage that appears in the webview:</p><pre><code>&lt;script type=""text/javascript""&gt;function showAndroidToast(toast) {    Android.showToast(toast);}&lt;/script&gt;&lt;a href=""javascript:;"" onClick=""showAndroidToast('http://mysite.com/image.jpg')""&gt;Options&lt;/a&gt;</code></pre><p>In the android activity:</p><pre><code>public static final int DIALOG_IMAGES_ID = 0;public class JavaScriptInterface {   Context mContext;   /** Instantiate the interface and set the context */   JavaScriptInterface(Context c) {      mContext = c;   }   /** Show a toast from the web page */   public void showToast(String toast) {      showDialog(DIALOG_IMAGES_ID);      browserImage = toast;   }}    @Override    protected Dialog onCreateDialog(int id) {        Dialog dialog = null;        switch(id) {        case DIALOG_IMAGES_ID:            // do the work to define the pause Dialog            final CharSequence[] items = {""Save Image"", ""Set Wallpaper"", ""Share Image""};            AlertDialog.Builder builder = new AlertDialog.Builder(this);            builder.setTitle(""Use this image"");            builder.setItems(items, new DialogInterface.OnClickListener() {                public void onClick(DialogInterface dialog, int item) {                    if(items[item]==""Save Image""){                        // do something                    }else if(items[item]==""Share Image""){                        // do something                    }else if(items[item]==""Set Wallpaper""){                        // do something                    }                }            });            AlertDialog alert = builder.create();            alert.show();            break;        default:            dialog = null;        }        return dialog;    }</code></pre>","401183","","","","","2011-02-12 17:40:06","Android, launching a dialog through JavaScriptInterface from a webview","<android><dialog><webview>","0","2","","",""
"4979642","1","4979685","","2011-02-12 17:59:52","2","6125","<p>I am just trying to understand what is going on here. I have a textured quad on the screen but I am really confused why it takes up the entire screen. If my texture is 64X64 and I wanted a quad at the top left of the screen that was 64X64 what would I need to change? Is my viewport or my vertices positions causing it to take up the whole screen?</p><p>With changes so far:</p><pre><code>public void onSurfaceCreated(GL10 gl, EGLConfig config) {        myquad.loadGLTexture(gl, this.context);        gl.glEnable(GL10.GL_BLEND);        gl.glBlendFunc(gl.GL_SRC_ALPHA, GL10.GL_ONE_MINUS_SRC_ALPHA);        gl.glEnable(GL10.GL_TEXTURE_2D);        gl.glEnableClientState(GL10.GL_VERTEX_ARRAY);        gl.glEnableClientState(GL10.GL_TEXTURE_COORD_ARRAY);        gl.glHint(GL10.GL_PERSPECTIVE_CORRECTION_HINT, GL10.GL_FASTEST);        gl.glDisable(GL10.GL_DEPTH_TEST);    }    public void onSurfaceChanged(GL10 gl, int w, int h) {        width=w;        height=h;        gl.glViewport(0, 0, w, h);        gl.glLoadIdentity();        gl.glOrthof(0.0f, w, 0, h, -1.0f, 1.0f);            }    public void onDrawFrame(GL10 gl) {        // define the color we want to be displayed as the ""clipping wall""        gl.glClearColor(0.0f, 0.0f, 0.0f, 1.0f);        // clear the color buffer to show the ClearColor we called above...        gl.glClear(GL10.GL_COLOR_BUFFER_BIT);        gl.glLoadIdentity();        myquad.Draw(gl);        //gl.glTranslatef(.5f, 2.0f, 0.0f);        //gl.glScalef(.5f, .5f, 0);    }private float vertices[] = {         // Vertices for the square          -1.0f, -1.0f,  0.0f,  // 0. left-bottom           1.0f, -1.0f,  0.0f,  // 1. right-bottom          -1.0f,  1.0f,  0.0f,  // 2. left-top           1.0f,  1.0f,  0.0f   // 3. right-top};private float texture[] = {                  //Mapping coordinates for the vertices        0.0f, 1.0f,        1.0f, 0.0f,        1.0f, 1.0f,        0.0f, 1.0f, };public void Draw(GL10 gl){       // set the color for the triangle    gl.glColor4f(0.0f, 1.0f, 0.0f, 0.5f);    //Enable the vertex and texture state    gl.glTexCoordPointer(2, GL10.GL_FLOAT, 0, texturebuffer);    gl.glVertexPointer(3, GL10.GL_FLOAT, 0, vertexbuffer);    //gl.glTranslatex(-20, 0, 0);    // Draw the vertices as triangle strip    gl.glDrawArrays(GL10.GL_TRIANGLE_STRIP, 0, vertices.length / 3);}</code></pre>","614406","","614406","","2011-02-12 19:51:31","2011-02-12 21:53:24","Drawing quad in OpenGL ES on Android","<android><opengl-es>","1","0","2","",""
"4979769","1","4979837","","2011-02-12 18:21:16","3","411","<p>I have 3 Activities...the first Activity have a button that start third Activity. The problem is:   When I am in 3 - rd activity press ""back"" button its navigate me back to 1 - st Activity, but i need to 2 - nd one. My stack of Activities always should look like : 1. first Activity2. second Activity3. third Activity</p><p>How to do that ? Thanks...</p>","602011","","","","","2011-02-12 18:39:53","Activity Navigation Logic","<android>","2","0","1","",""
"4979790","1","4980042","","2011-02-12 18:25:34","0","2023","<p>I have a simple <code>BroadcastReceiver</code> set up to do something when the user gets an incoming SMS. But I need it to run in the background and when the device is asleep. So would I use a <code>Service</code> that starts the <code>BroadcastReceiver</code>? If so, can someone give me some pseudo-code? And how would this work if the device is asleep?</p>","200477","","","","","2011-02-12 19:14:54","Run BroadcastReceiver in the background and when device is alseep?","<java><android><service><broadcastreceiver>","2","0","","",""
"4979848","1","4980632","","2011-02-12 18:35:00","1","483","<p>I have been directed here by someone from the Google Blogger Developer group.  My question is basically, what is the best way to authenticate with the Blogger service within Android.</p><p>Initially I used HTTPURLConnect in Java and sent requests and received responses, this worked fine when the correct username and password were provided, however, when an incorrect password was supplied rather than being given the response <code>Error=BadAuthentication</code>, Java threw a <code>FileNotFoundException</code> for https:// www.google.com/accounts/ClientLogin.  My plan obviously being to parse the response given by Google (according to this list: <a href=""http://code.google.com/apis/accounts/docs/AuthForInstalledApps.html#Response"" rel=""nofollow"">http://code.google.com/apis/accounts/docs/AuthForInstalledApps.html#Response</a>)</p><p>The second attempt I have used this library:</p><p><a href=""http://code.google.com/p/google-api-java-client/"" rel=""nofollow"">http://code.google.com/p/google-api-java-client/</a></p><p>However, here I get the following error (regardless of credentials):</p><pre><code>02-11 16:57:46.515: INFO/dalvikvm(294): Could not find method org.codehaus.jackson.JsonParser.getCurrentToken, referenced from method com.google.api.client.googleapis.json.JsonCParser.parserForResponse </code></pre><p>If anyone could provide any insight at all into these errors OR a better way to implement an application where user on Android can login and then read/view/create/edit blog posts on Blogger using the GData API, I'd be hugely grateful.</p><p>Thanks,</p><p>Tim.</p>","614442","","","","","2011-02-12 21:06:29","Android - Blogger (Best method of authentication - ClientLogin, etc)","<java><android><http><blogger>","1","0","","",""
"4979889","1","4979938","","2011-02-12 18:43:40","8","4784","<p>If I want to to label some buttons with "">"" and ""&lt;"" symbols, what's the correct way to escape them out in the XML file?   The presence of either "">"" or ""&amp;"" (as in ""&amp;gt"") produces ""invalid token"" errors.</p><p>Thanks in advance.</p>","424690","","380609","","2013-04-30 04:14:34","2013-04-30 04:14:34","Escaping Angle Brackets in XML in Eclipse / Android","<android><xml>","1","2","","",""
"4979913","1","","","2011-02-12 18:49:18","0","1427","<p>I wanna use spinner (which show data from database) can return String to me from this case it work</p><pre><code>spinner_InputLanguage = (Spinner)findViewById(R.id.spinner_InputLanguage);    ArrayAdapter&lt;CharSequence&gt; adapter      = ArrayAdapter.createFromResource(this,        R.array.language, android.R.layout.simple_spinner_item);      spinner_InputLanguage = (Spinner) findViewById(R.id.spinner_InputLanguage);      adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);      spinner_InputLanguage.setAdapter(adapter);    String language = (String)spinner_InputLanguage                .getItemAtPosition((int) spinner_InputLanguage                        .getSelectedItemId());</code></pre><p>So I try to do it by myself but it forceclose</p><pre><code>cursor = db.getLang();    cursor.moveToFirst();    startManagingCursor(cursor);    SimpleCursorAdapter qc = new SimpleCursorAdapter(            this,            android.R.layout.simple_spinner_item,            cursor,            new String[] {DBAdapter.KEY_LANG},            new int[] {android.R.id.text1});        qc.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);    String language = (String)Language_Spinner.getItemAtPosition((int) Language_Spinner.getSelectedItemId());        Language_Spinner.setAdapter(qc);</code></pre><p>and this is my logcat</p><blockquote>  <p>02-13 01:42:06.453: ERROR/AndroidRuntime(703): java.lang.ClassCastException: android.database.sqlite.SQLiteCursor  02-13 01:42:06.453: ERROR/AndroidRuntime(703):     at com.android.proj.Sens_Create$2.onClick(Sens_Create.java:97)  02-13 01:42:06.453: ERROR/AndroidRuntime(703):     at android.view.View.performClick(View.java:2408)  02-13 01:42:06.453: ERROR/AndroidRuntime(703):     at android.view.View$PerformClick.run(View.java:8816)  02-13 01:42:06.453: ERROR/AndroidRuntime(703):     at android.os.Handler.handleCallback(Handler.java:587)  02-13 01:42:06.453: ERROR/AndroidRuntime(703):     at android.os.Handler.dispatchMessage(Handler.java:92)  02-13 01:42:06.453: ERROR/AndroidRuntime(703):     at android.os.Looper.loop(Looper.java:123)  02-13 01:42:06.453: ERROR/AndroidRuntime(703):     at android.app.ActivityThread.main(ActivityThread.java:4627)  02-13 01:42:06.453: ERROR/AndroidRuntime(703):     at java.lang.reflect.Method.invokeNative(Native Method)  02-13 01:42:06.453: ERROR/AndroidRuntime(703):     at java.lang.reflect.Method.invoke(Method.java:521)  02-13 01:42:06.453: ERROR/AndroidRuntime(703):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)  02-13 01:42:06.453: ERROR/AndroidRuntime(703):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)  02-13 01:42:06.453: ERROR/AndroidRuntime(703):     at dalvik.system.NativeStart.main(Native Method)</p></blockquote><p>Please help...</p>","605358","","","","","2012-05-20 16:57:15","spinner show data from database","<android><sqlite><sqlite3><spinner>","1","0","2","",""
"4979919","1","4980207","","2011-02-12 18:51:13","0","194","<p>I've only been using Eclipse since installing it to use for Android development. I was previously using Galileo, but the other day downloaded Helios (the ""Classic"" config as recommended on the Android site).</p><p>My project builds and everything is OK except that I no longer get the code-completion dropdowns when typing. In other words, when I type ""this."", I do not see the popup list of all the members and methods. Eclipse does know everything about the classes, as hovering the cursor over anything pops up the expected info.</p><p>Am I missing a preference setting or something else? The preferences are pretty complex and I'm not sure what the feature that's lacking is called in Eclipse nomenclature.</p><p>Doug Gordon</p>","446874","","","","","2011-02-12 19:45:05","Android/Eclipse - How to get class member dropdowns, etc","<android><eclipse>","1","0","","",""
"4979953","1","","","2011-02-12 18:58:11","0","1171","<p>Sometimes my Widget/widgetProvider turns into a flat toast message ""Problem Loading Widget"" on the home screen does not even say which Widget.  What should be done in code to handle this error and remedy it.  I don't want to leave the widget sitting in this state.  Thanks</p><p>PS for those looking for a reason why this is happening its often a resource and not necessary an error in LogCat. Sometimes its expressed as a Warning.  I warning seems like an understatement for what has happened to the Widget however.</p><p>The question is when can this happen and how can one handle it when it does?  Is there an Intent broadcast about this and what could one to to recover?</p>","602260","","","","","2011-05-27 09:04:00","""Problem Loading Widget"" Can Load Error be detected and handled somehow?","<android><error-handling><widget>","1","1","","",""
"4979975","1","4979990","","2011-02-12 19:00:58","0","1808","<p>I have written this small app and it works perfectly. But I am new to java and assume there must be a better way to write this so that the variables can be read in both functions. Is there?</p><pre><code>package max.multiplebuttons.com;import android.app.Activity;import android.os.Bundle;import android.view.View;import android.widget.Button;import android.widget.TextView;import android.view.View.OnClickListener;public class multibuttons extends Activity implements OnClickListener {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        TextView question = (TextView)findViewById(R.id.question);        TextView textView = (TextView)findViewById(R.id.textView);        Button answer1 = (Button)findViewById(R.id.answer1);        Button answer2 = (Button)findViewById(R.id.answer2);        answer1.setText(""button1"");        answer2.setText(""button2"");        question.setText(""click a button"");        textView.setText(""Some Text"");        answer1.setOnClickListener(this);        answer2.setOnClickListener(this);    }    public void onClick(View v){        TextView textView = (TextView)findViewById(R.id.textView);        Button answer1 = (Button)findViewById(R.id.answer1);        Button answer2 = (Button)findViewById(R.id.answer2);        if(v==answer1){            textView.setText(""1"");        }        if(v==answer2){            textView.setText(""2"");        }    }}</code></pre>","614460","","177800","","2013-02-22 19:11:44","2013-02-22 19:11:44","How to access variables in separate functions - Android","<java><android><function><variables><shared>","1","0","","",""
"4980002","1","4985254","","2011-02-12 19:06:01","6","2388","<p>When I start a new android project and use native android methods and components and java methods and components, I can't read their description because javadoc send me this message:</p><p><em><strong>Note: This element has no attached source and the Javadoc could not be found in the attached Javadoc.</em></strong></p><p>I have the latest android documentation in my android-sdk folder and javadoc works when I work with standard java projects, but not with android project. Have you got any ideas why does it happen and how can I fix this issue?</p>","556337","","556337","","2011-02-12 19:14:57","2011-07-05 11:34:08","Problems with javadoc","<android><eclipse>","3","0","2","",""
"4980047","1","4984041","","2011-02-12 19:15:40","1","2351","<p>I'm getting a strange error while trying to make a Proguard version of my Android app.  The error is:</p><pre><code>[proguard] Optimizing...  [proguard]Unexpected error while evaluatinginstruction:  [proguard]   Class      = [net/domain/packagename/service/ExifEditor][proguard]   Method      =[setGpsLocation(DDDJ)V]  [proguard]  Instruction = [294] aload_3 v3 [proguard]   Exception   =[java.lang.IllegalArgumentException](Value is not a reference value[proguard.evaluation.value.UnknownDoubleValue])[proguard] Unexpected error whileperforming partial evaluation: [proguard]   Class       =[net/domain/packagename/service/ExifEditor][proguard]   Method      =[setGpsLocation(DDDJ)V]  [proguard]  Exception   =[java.lang.IllegalArgumentException](Value is not a reference value[proguard.evaluation.value.UnknownDoubleValue])BUILD FAILEDD:\sdk\google\android-sdk-windows\tools\ant\main_rules.xml:430: java.lang.IllegalArgumentException:Value is not a reference value[proguard.evaluation.value.UnknownDoubleValue]        at proguard.evaluation.value.Value.referenceValue(Value.java:97)        at proguard.evaluation.Variables.aload(Variables.java:264)        at proguard.evaluation.Processor.visitVariableInstruction(Processor.java:677)        at proguard.classfile.instruction.VariableInstruction.accept(VariableInstruction.java:306)        at proguard.optimize.evaluation.PartialEvaluator.evaluateSingleInstructionBlock(PartialEvaluator.java:729)        at proguard.optimize.evaluation.PartialEvaluator.evaluateInstructionBlock(PartialEvaluator.java:560)        at proguard.optimize.evaluation.PartialEvaluator.evaluateInstructionBlockAndExceptionHandlers(PartialEvaluator.java:533)...and so on...</code></pre><p>The method ""setGpsLocation"" has this signature:</p><pre><code>public void setGpsLocation(double longitude, double latitude, double altitude, long gpsTime) throws IOException</code></pre><p>I ended up getting rid of the error, by changing the method to this:</p><pre><code>public void setGpsLocation(Location location)</code></pre><p>and the error goes away.  While this gets me past it, I don't understand what was wrong with the first method signature.  My proguard.cfg has -optimizationpasses 2.  If I increase this value to 3 or more, I start seeing similar errors with other areas of code.  Here's what happens if I use 3:</p><pre><code>[proguard] Optimizing...   [proguard]Unexpected error while evaluatinginstruction:   [proguard]   Class     = [org/apache/commons/fileupload/util/Streams][proguard]   Method      =[copy(Ljava/io/InputStream;Ljava/io/OutputStream;Z[B)J][proguard]   Instruction = [75]aload_2 v2   [proguard]   Exception  = [java.lang.IllegalArgumentException] (Value is not a reference value[proguard.evaluation.value.UnknownIntegerValue])[proguard] Unexpected error whileperforming partial evaluation: [proguard]   Class       =[org/apache/commons/fileupload/util/Streams][proguard]   Method      =[copy(Ljava/io/InputStream;Ljava/io/OutputStream;Z[B)J][proguard]   Exception   =[java.lang.IllegalArgumentException](Value is not a reference value[proguard.evaluation.value.UnknownIntegerValue])</code></pre><p>I'm having a hard time finding information about what this error can mean.  </p><p>Has anyone else seen something similar?</p><p><strong>Update</strong></p><p>While changing the signature appeared to solve the issue, I was getting a runtime crash:</p><pre><code>I/dalvikvm(30523): Could not find method a.b.a.b.d.b, referenced from method a.b.a.b.d.aW/dalvikvm(30523): VFY: unable to resolve direct method 440: La/b/a/b/d;.b (Ljava/lang/String;[BII)La/b/a/b/a;D/dalvikvm(30523): VFY: replacing opcode 0x70 at 0x0039D/dalvikvm(30523): VFY: dead code 0x003c-0041 in La/b/a/b/d;.a (Ljava/lang/String;[BII)[La/b/a/b/a;W/dalvikvm(30523): VFY: 'this' arg 'Ljava/lang/Object;' not instance of 'Ljava/io/InputStream;'W/dalvikvm(30523): VFY:  rejecting opcode 0x6e at 0x0045W/dalvikvm(30523): VFY:  rejected La/b/a/a/a/b;.a (La/b/a/b/a/a;La/b/a/a;)La/b/a/a/a/c;W/dalvikvm(30523): Verifier rejected class La/b/a/a/a/b;W/dalvikvm(30523): threadid=10: thread exiting with uncaught exception (group=0x400259f8)</code></pre><p>I started reading more of the Proguard manual, and found by adding -dontoptimize, the build-time errors and runtime crashes go away.  Sort of defeats the purpose of using Proguard, doesn't it?  </p><p>-Kevin</p>","271177","","271177","","2011-02-13 04:39:37","2011-02-13 12:12:23","Proguard error with method signatures","<android><proguard>","2","0","","",""
"4980086","1","","","2011-02-12 19:23:19","4","1110","<p>Is it possible for an Android application with a given minimum API level (say 8 ""Froyo"") to conditionally use APIs that are only in higher API levels (e.g. the NFC APIs in level 10) for example by detecting for the presence of the API or API level at run-time?</p><p>Thanks.</p>","110638","","","","","2012-10-10 01:55:53","Can an Android application or activity call APIs in higher API levels?","<java><android>","2","0","2","",""
"4980089","1","","","2011-02-12 19:24:04","0","135","<p>Widget Launches the Applications Main Activity unexpectedly.  Should I just not have a Main activity when I have an app that hosts a widget?  Not clear why it launches, but this is not the behavior I want.  I want no activities to Launch unless they are specifically requested by intent to do so?</p>","602260","","","","","2011-08-11 17:45:27","Clicking Widget mistakenly causes main Activity to launch","<android><activity><widget>","1","2","","",""
"4980106","1","6696083","","2011-02-12 19:27:07","5","2059","<p>I would like to ask for some example, where two different activities (button in first activity open second activity), are communicating with one service (AIDL, etc.)I've tried many different tutorials, but they are only about how to make one activity -> one service.Thanks.</p>","112534","","","","","2011-07-14 15:49:16","How to bind two Android Activites to one Service?","<android><activity>","2","0","2","",""
"4980142","1","","","2011-02-12 19:34:23","0","675","<p>I have this SQLite query:</p><pre><code>    Cursor orgiCursor = orgiDb.rawQuery(""select task,taskDate from meeting where exists (select `meeting.taskId from Task, meeting where meeting.taskId = Task.taskId and task.name='""+profName+""')UNION  SELECT subject,date from taskDeadline where exists (select taskDeadline.taskId from taskDeadline,Task where taskDeadline.taskId=Task.taskId and Task.name='""+profName+""') union select specificOccassion,setDate from AnnualTask where exists (select taskId from Task,AnnualTask where Task.taskId = AnnualTask.taskId and Task.name = '""+profName+""' and AnnualTask.setDate&lt;&gt;'--')"", null);</code></pre><p>It's quite long really, but it works flawlessly on SQLite Manager. My problem is I get an error in retrieving the data. here is a snippet of my code:</p><pre><code>try {        if (orgiCursor != null )         {            if (orgiCursor.moveToFirst()) {                do {                    String annualTask = orgiCursor.getString(orgiCursor.getColumnIndex(""specificOccassion""));                    String annualDate = orgiCursor.getString(orgiCursor.getColumnIndex(""setDate""));                    String meetingTask = orgiCursor.getString(orgiCursor.getColumnIndex(""task""));                    String meetingDate = orgiCursor.getString(orgiCursor.getColumnIndex(""taskDate""));                    String deadlineTask = orgiCursor.getString(orgiCursor.getColumnIndex(""subject""));                    String deadlineDate = orgiCursor.getString(orgiCursor.getColumnIndex(""date""));                    SearchResults sr2=new SearchResults();                    sr2.setName(meetingTask);                    sr2.settDate(meetingDate);                    results.add(sr2);                    SearchResults sr3 = new SearchResults();                    sr3.setName(deadlineTask);                    sr3.settDate(deadlineDate);                    results.add(sr3);                    SearchResults sr1 = new SearchResults();                    sr1.setName(annualTask);                    sr1.settDate(annualDate);                    Log.i(""Home"",""added""+annualTask + "" &amp; "" +annualDate);                    results.add(sr1);                } while (orgiCursor.moveToNext());            }        }    } catch (SQLiteException se) {        displayError1(se.toString());        Log.e(getClass().getSimpleName(), se.toString());    } finally {        if (orgiDb != null) {            orgiDb.close();            Log.e(getClass().getSimpleName(),""orgiDB closed()"");        }    }    return results;</code></pre><p>It returns this error. :( Please help me.</p><pre><code>02-12 19:28:00.809: INFO/Database(14515): sqlite returned: error code = 1, msg = ambiguous column name: taskId02-12 19:28:00.849: ERROR/AndroidRuntime(14515): Caused by: android.database.sqlite.SQLiteException: ambiguous column name: taskId: , while compiling: select task,taskDate from meeting where exists (select meeting.taskId from Task, meeting where meeting.taskId = Task.taskId and task.name='Maria Ozawa')UNION  SELECT subject,date from taskDeadline where exists (select taskDeadline.taskId from taskDeadline,Task where taskDeadline.taskId=Task.taskId and Task.name='Maria Ozawa') union select specificOccassion,setDate from AnnualTask where exists (select taskId from Task,AnnualTask where Task.taskId = AnnualTask.taskId and Task.name = 'Maria Ozawa' and AnnualTask.setDate&lt;&gt;'--')    02-12 19:28:01.059: ERROR/Database(14515): close() was never explicitly called on database '/data/data/orgy.organizer.home/databases/orgi' 02-12 19:28:01.059: ERROR/Database(14515): android.database.sqlite.DatabaseObjectNotClosedException: Application did not close the cursor or database object that was opened here</code></pre><p>Any help would be greatly appreciated... :(So my questions are:<br>1. Which part of the code do I exactly need to close the connection/cursor?<br>2. Why does eclipse give me this error? I tried running this same statement in SQLite <br>manager and it gave me flawless results. <br>I am so desperate right now. Please help. T_T </p>","614480","","","","","2011-02-12 19:38:19","android sqlite union, how to retrive results from the tables?","<android><sqlite><union>","1","0","","",""
"4980199","1","","","2011-02-12 19:43:09","0","230","<p>this is my language table    </p><pre><code>/*         * initialValues in Languages(          * KEY_LANG_ID,          * KEY_LANG, \\ language name         * KEY_ACT) \\ 0= not active, 1= active         */        ContentValues initialValues3 = new ContentValues();        initialValues3.put(KEY_LANG, ""English"");        initialValues3.put(KEY_ACT, ""1"");        db.insert(LANGS_TABLE, null, initialValues3);        initialValues3.put(KEY_LANG, ""German"");        initialValues3.put(KEY_ACT, ""1"");        db.insert(LANGS_TABLE, null, initialValues3);        initialValues3.put(KEY_LANG, ""Spain"");        initialValues3.put(KEY_ACT, ""0"");        db.insert(LANGS_TABLE, null, initialValues3);        initialValues3.put(KEY_LANG, ""Italy"");        initialValues3.put(KEY_ACT, ""0"");        db.insert(LANGS_TABLE, null, initialValues3);        initialValues3.put(KEY_LANG, ""China"");        initialValues3.put(KEY_ACT, ""0"");        db.insert(LANGS_TABLE, null, initialValues3);</code></pre><p>this is my sentences table</p><pre><code>/*initialValues in Sentences( * KEY_SEN_ID, * KEY_SEN_ID_TH_SEN, * KEY_SEN_ID_LANG, * KEY_SEN, * KEY_SEN_READING, * KEY_ACT_VOL)* */</code></pre><p>I want to show sentences in my list view and sentence must check KEY_ACT from language table if KEY_ACT =1 then sentence show from above in list view must only have English and German sentence so I try to query like this</p><pre><code>public Cursor getSen_List(long id_thsen ) {    String strTmp = ""select ""        +SENS_TABLE+"".""+KEY_SEN_ID+"",""
        +SENS_TABLE+"".""+KEY_SEN_ID_TH_SEN+"",""
        +SENS_TABLE+"".""+KEY_SEN_ID_LANG+"",""
        +SENS_TABLE+"".""+KEY_SEN+"",""
        +SENS_TABLE+"".""+KEY_SEN_READING+"",""
        +SENS_TABLE+"".""+KEY_ACT_VOL+"",""
        +LANGS_TABLE+"".""+KEY_LANG        +"" from ""+SENS_TABLE+ "",""+LANGS_TABLE        +"" where ""+SENS_TABLE+"".""+KEY_SEN_ID_TH_SEN + ""="" + id_thsen+ "" and ""         +SENS_TABLE+"".""+KEY_LANG_ID+""=(select ""                                    +LANGS_TABLE+"".""+KEY_LANG_ID                                    +"" from ""+LANGS_TABLE                                    +"" where ""+LANGS_TABLE+"".""+KEY_ACT+""=1)"";        return db.rawQuery(strTmp,null); }</code></pre><p>but the result is show only same English sentence for 5 time</p><p>Does anybody have any idea?</p><p>please help.....</p>","605358","","605358","","2011-02-13 06:24:38","2011-02-13 06:24:38","Query data from database with condition","<android><sqlite>","1","0","","",""
"4980260","1","","","2011-02-12 19:54:38","2","3955","<p>I'm trying to make something like a drum machine that plays sounds when you press the buttons. However, I'm having trouble making it change sounds for each button, since one onTouch method handles all the events. Here's the code so far:</p><p><pre>package com.henzl0l.drummaschine;</p><p>import java.io.IOException;</p><p>import android.app.Activity;import android.media.MediaPlayer;import android.media.MediaPlayer.OnCompletionListener;import android.os.Bundle;import android.view.View;import android.view.View.OnClickListener;import android.view.View.OnTouchListener;import android.widget.Button;import android.view.MotionEvent;</p><p>public class DrumMaschine extends Activity {    /** Called when the activity is first created. */    final String[] sList = new String[] {""/sdcard/Music/kick.wav"",""/sdcard/Music/hat.wav"" };    final MediaPlayer mPlayer1 = new MediaPlayer();    final MediaPlayer mPlayer2 = new MediaPlayer();    @Override    public void onCreate(Bundle savedInstanceState)     {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);</p><code>    Button btn_main1 = (Button) findViewById(R.id.cmd_main1);    Button btn_main2 = (Button) findViewById(R.id.cmd_main2);    btn_main1.setOnTouchListener(tListener1);    btn_main2.setOnTouchListener(tListener1);}private OnTouchListener tListener1 = new OnTouchListener(){     public boolean onTouch(View v, MotionEvent event) {        switch ( event.getAction() ) {         case MotionEvent.ACTION_DOWN:             sPlay(0,true);         }        return false;     }  };private void sPlay(Integer num, Boolean loop){    try {        mPlayer1.reset();        mPlayer1.setDataSource(sList[num]);        mPlayer1.prepare();        mPlayer1.start();    } catch (IllegalArgumentException e) {        // TODO Auto-generated catch block        e.printStackTrace();    } catch (IllegalStateException e) {        // TODO Auto-generated catch block        e.printStackTrace();    } catch (IOException e) {        // TODO Auto-generated catch block        e.printStackTrace();    }};</code></pre><p>}</p><p>I can't seem to get the button's text (Which is right now, '1', '2', etc.) using v, so I'm pretty much stumped. I've only been playing with android for two days now. Sorry if nothing makes sense hehe.</p>","614502","","","","","2013-08-13 11:47:01","Android getting touched button's text with onTouch()","<java><android><view>","1","0","1","",""
"4980264","1","","","2011-02-12 19:55:07","0","3037","<p>In my android application i am recording and saving the file in sdcard.Now i would like to convert this saved file to byte array and sent it to the server.</p><p>Could anyone please let me know as how can i convert video files to byte array</p><p>Please forward your valuable suggestions.</p><p>Thanks in advance :)</p>","420261","","","","","2011-12-14 05:02:56","convert video files to byte array in android","<android>","1","2","","",""
"4980334","1","5815080","","2011-02-12 20:08:39","0","480","<p>Is it possible to change the domain extension (.com) on the Android Keyboard when you have an EditText field that is specified to be android:inputType=""textEmailAddress""?</p>","536673","","","","","2011-04-28 07:20:09","How to change the domain extension on the Android Keyboard","<android><email><keyboard><dns><edittext>","1","0","","",""
"4980345","1","","","2011-02-12 20:10:52","0","172","<p>The widget/WidgetProvider  lifecycle is not entirely clear to me or what control you have over the how long the widget remains active. By Active I mean able to respond to events and update its remote views.  How can you detect when it is no longer responding.  I've run my thru the debugger and found that sometimes it stops printing log messages in update, receive etc even when events should be handled. The click no longer passes to receive etc. How do you know detect these changes programatically?  I want to be able to detect changes to the widget which would render cause it to be unloaded, or to otherwise stop running.  I might want to request that android reload the widget. How would I tell Android to try to reload the widget or get rid of the problem loading widget message? Thanks</p>","602260","","","","","2011-02-12 21:25:41","Keeping Widget Alive and Responding","<android><widget><lifecycle>","1","0","","",""
"4980357","1","","","2011-02-12 20:12:52","0","604","<p>I'm listening for an HTTP POST on a port (on Android mobile). The post should contain some xml.</p><pre><code>private final class ListeningThread implements Runnable {    private ServerSocket serverSocket;    private Socket socket;    private InputStream in;    private BufferedReader reader;    @Override    public void run() {        try {            serverSocket = new ServerSocket(port);        } catch (IOException e) {            // ...            finish();        }        while(true) {            try {                socket = serverSocket.accept();            } catch (IOException e) {                // ...                finish();            }            try {                in = socket.getInputStream();            } catch (IOException e) {                // ...                finish();            }            reader = new BufferedReader(new InputStreamReader(in));            String line;            String response = """";            try {                int j = 1;                while((line = reader.readLine()) != null) {                    response += line + ""\n"";                    Log.v(String.valueOf(j++), line);                }                Log.v(""end reached"", """");            } catch (IOException e) {                response = e.toString();            }            // ...            }        }    // ...}</code></pre><p>}</p><p>I have two questions:</p><ol><li>Is the above the right idea, and if so how do I best extract the xml from the InputStream? This is the actual problem, and if this can solved without solving 2 then 2 need not be solved (for me).</li><li>It seems like the end of the InputStream is never reached. I get 23 posts in the log with the lines read, then ""end reached"" is never logged. The entire xml is read, then it seems like reader.ReadLine() never returns. How do I solve this?</li></ol>","614515","","","","","2011-02-12 20:12:52","Listening to Android port for a HTTP POST (containing xml)","<java><android><sockets>","0","2","","",""
"4980371","1","","","2011-02-12 20:15:45","0","98","<p>What are the best, or most common, ways of employing ""auto finding"" for a device/computer over wifi? Do you just do a UDP broadcast and response? When broadcasting do you only broadcast to your subnet or to everything? or Arp? or scan through every IP for the host-part and hope t connect? I was thinking of doing a UDP broadcast only to whatever subnet the device is connected to. Specifically, I'm working on an android-pc solution.</p>","180590","","","","","2011-02-18 04:24:59","Common practices for device auto finding?","<android><network-programming>","1","0","","",""
"4980388","1","","","2011-02-12 20:20:05","0","966","<p>I am hoping to create a multi-player game using AndEngine. I looked through <a href=""http://www.youtube.com/watch?v=q-genimutmQ&amp;feature=player_embedded"" rel=""nofollow"">this tutorial</a> on how to set it up but I get errors.</p><p>The errors are because the imports are not being recognized in eclipse. The imports which I am having problems with are:</p><pre><code>import org.anddev.andengine.entity.scene.background.ColorBackground; import org.anddev.andengine.entity.util.FPSLogger;import org.anddev.andengine.entity.scene.Scene;import org.anddev.andengine.entity.scene.transition.FadeTransitionScene;</code></pre><p>I also tried <a href=""http://droidcake.com/2010/12/30/how-to-create-classic-game-on-android/"" rel=""nofollow"">this tutorial</a> which has raw code and I have the same problem. </p><p>Does anyone have a clue about what is going on, I followed the tutorial perfectly up to this point where I had to press <kbd>ctrl</kbd>+<kbd>shift</kbd>+<kbd>o</kbd> and they were not importing. </p><p>Would appreciate any advice on this. Thanks </p>","608658","","2589983","","2013-09-02 06:21:35","2013-09-02 06:21:35","How to set up AndEngine?","<android><andengine>","1","4","","",""
"4980398","1","","","2011-02-12 20:22:08","1","4000","<p>Where's the right place to register/unregister an intent receiver in an Activity? Usually I would put stuff like this here:</p><pre><code>class MyActivity {    private BroadcastReceiver mMyReceiver = new BroadcastReceiver() {        @Override        public void onReceive(Context context, Intent intent) {            Log.v(TAG, ""Do something."");        }    };    @Override    public void onResume() {        super.onResume();        registerReceiver(mMyReceiver, new IntentFilter(...));    }    @Override    public void onPause() {        super.onPause();        unregisterReceiver(mMyReceiver);    }}</code></pre><p>The problem is that my activity can then no longer respond to the broadcast if it happens while it's in the pause state. Where's the right place to do something like this then?</p><p>Thanks</p>","291701","","","","","2013-06-03 08:49:12","Where to register a BroadcastReceiver (Activity lifecycle fun)","<android>","3","0","","",""
"4980451","1","4981320","","2011-02-12 20:30:26","3","3127","<p>I am developing an Android application as an Eclipse project that uses classes from another Eclipse Android project I already have. When I originally imported it (<code>New Project &gt; Android Project &gt; From Existing Source</code>), it had a bunch of errors, but when I did <code>Project &gt; Properties &gt; Java Build Path</code> and went to the projects tab and added the other project, the errors went away.  Unfortunately, when I ran the application, I got the following error in DDMS:</p><blockquote><pre><code>java.lang.NoClassDefFoundError: [package name].Config[stack trace]</code></pre></blockquote><p>Is there something I'm supposed to add to the manifest telling it to look at the other package? If so, where would that be added?</p><p>Thanks in advance</p>","614529","","","","","2011-02-12 23:27:35","Problem with linking to other project in Android Eclipse environment","<java><android><eclipse><classpath>","3","0","2","",""
"4980470","1","4980875","","2011-02-12 20:33:12","0","572","<p>I asked this question about using the system-drawables in an Android-app some time ago:<br /><a href=""http://stackoverflow.com/questions/4891598/android-access-system-drawables"">Android: access ""system""-drawables</a></p><p>I finally found out, that there actually is a way to access those drawables, but especially concerning the battery-icons, there's a catch: it doesn't work as expected. :)</p><p>As e.g. trying to acccess the ""empty battery""-icon with <code>R.drawable.stat_sys_battery_0</code> did not work, I found this: <code>intent.getIntExtra(BatteryManager.EXTRA_ICON_SMALL, -1)</code> which actually does return the integer-ID of ""stat_sys_battery_0"" and let's me access it, but the documentation states it <em>should</em> return an ""icon indicating the current battery state"". But actually, I'm <strong>always</strong> getting the icon for the empty battery no matter what the battery-level is. This happens in the emulator as well as on my phone.</p><p>What I tried:<br />The drawable-ID I get from <code>getIntExtra</code> is ""17302150"" (in the emulator and on the phone). Using this ID, I get the ""empty battery""-icon. I played around with the IDs, and found some other battery icons by using random IDs, so my thought was to just try and find the IDs of all needed icons and put them in my code statically.</p><p>Now, two questions:<br />1. Is it safe to use static IDs in an app or are the drawable-IDs subject to change throughout SDK-levels or on different devices?<br />2. As that's just a workaround: Does anybody know why I keep getting the same drawable from <code>getIntExtra</code>?</p><p>Any help is appreciated.</p>","255905","","255905","","2011-02-12 20:38:36","2011-02-12 21:57:14","Android: do system drawables have static IDs?","<android><drawable>","1","0","","",""
"4980529","1","4980821","","2011-02-12 20:46:58","4","3517","<p>Here is my code:</p><pre><code>import android.content.BroadcastReceiver;import android.content.Context;import android.content.Intent;import android.speech.tts.TextToSpeech;import android.telephony.SmsMessage;import android.util.Log;public class SmsBroadcastReceiver extends BroadcastReceiver {    @Override    public void onReceive(Context context, Intent intent) {        Object[] rawMsgs = (Object[])intent.getExtras().get(""pdus"");        for (Object raw : rawMsgs) {            SmsMessage message  = SmsMessage.createFromPdu((byte[])raw);            Log.v(""[SMS]:"", message.getMessageBody());            TextToSpeech tts = new TextToSpeech(context, null);        }    }}</code></pre><p>I get an error when I try to initialize <code>TextToSpeech</code>. Apparently, I can't bind to services when in a <code>BroadcastReceiver</code>. Is there any workaround for this?</p>","200477","","168868","","2012-01-01 21:31:25","2012-01-01 21:31:25","IntentReceiver components are not allowed to bind to services","<java><android><broadcastreceiver><text-to-speech>","2","0","2","",""
"4980716","1","4985579","","2011-02-12 21:22:12","0","592","<p>I'm trying to develop a full screen application on ViewSonic gTablet(Android 2.2).The application works perfectly on the emulator, but the status bar lays over the application on the actual hardware(Refer the picture from URL below).</p><p><a href=""http://i54.tinypic.com/1iy1r7.jpg"" rel=""nofollow"">http://i54.tinypic.com/1iy1r7.jpg</a></p><p>I have tried both ways to hide status bar but could not solve it.</p><p>1) Hide the Status bar through AndroidManifest.xm</p><pre><code>`&lt;activity android:name="".HelloAndroid""          android:label=""@string/app_name""          android:theme=""@android:style/Theme.NoTitleBar.Fullscreen""&gt;`</code></pre><p>2) Hide the Status bar through code</p><pre><code>`public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN); //For fullscreen}`</code></pre><p>Could anyone help me?Your comment is appreciated.</p><p>Regards,</p>","614564","","","","","2011-02-13 17:19:26","How can I solve a behavior that status bar lays over the full screen activity on ViewSonic gTablet?","<android><layout><fullscreen><statusbar>","1","0","","",""
"4980720","1","4980776","","2011-02-12 21:23:25","5","7591","<p>how can i sort this array by date or name?</p><pre><code>String[][] datetable= new String[21][2];datetable[0][0] = ""2011.01.01"";datetable[0][1] = ""Name1"";datetable[1][0] = ""2011.01.03"";datetable[1][1] = ""Name2"";...datetable[20][0] = ""2011.02.16"";datetable[20][1] = ""Name3"";</code></pre>","571648","","512958","","2011-02-13 00:14:10","2011-02-13 00:14:10","Android sort array","<java><android><multidimensional-array>","2","1","","",""
"4980728","1","4980747","","2011-02-12 21:25:03","2","1876","<p>Specifically in the com/android/providers/telephony/SmsProvider.java</p><p>what does ICC stand for?</p>","180590","","","","","2012-02-27 15:28:14","Android SmsProvider, what does ICC stand for?","<android><sms><icc>","2","0","1","",""
"4980741","1","4982232","","2011-02-12 21:27:09","0","1516","<p>I am trying to use Google's unofficial weather API in an Android Application.</p><p>I use this code:</p><pre><code>//get the text from the edit text    userZip = zipCode.getText().toString();    //create a link using the zip code    //TODO sanitize input    System.out.println(userZip);    link = ""http://www.google.com/ig/api?weather="" + userZip;    System.out.println(link);    //connect to the link    URL googleWeatherService = null;    try {        googleWeatherService = new URL(link);    } catch (MalformedURLException e1) {        // TODO Auto-generated catch block        e1.printStackTrace();    }     SAXBuilder parser = new SAXBuilder();    try {        doc = parser.build(googleWeatherService);    } catch (JDOMException e) {        // TODO Auto-generated catch block        e.printStackTrace();    } catch (IOException e) {        // TODO Auto-generated catch block        e.printStackTrace();    }</code></pre><p>But I get the error java.io.IOException Couldn't open <a href=""http://www.google.com/ig/api?weather=08003"" rel=""nofollow"">http://www.google.com/ig/api?weather=08003</a> (just using 08003 as an example).   </p><p>If you go to the link in FF you get a nice XML file of weather, so what am I doing wrong?</p>","324977","","","","","2011-02-13 14:40:49","Problem fetching XML file in Java","<java><android><xml><api>","3","0","2","",""
"4980779","1","4980787","","2011-02-12 21:35:53","1","4655","<p>I currently have the code below it works fine up until I actually try to physically call the data queried. Also can someone given an example on how to query a single ID using a WHERE clause. I tried, but that causes an error before I can even try to pull anything back out.</p><p>All help appriciated.Max</p><pre><code>String questionval;    String answer1val;    String answer2val;    private final String SAMPLE_DB_NAME = ""QnA"";    private final String SAMPLE_TABLE_NAME = ""friends"";    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        SQLiteDatabase db;        db =  this.openOrCreateDatabase(SAMPLE_DB_NAME, MODE_PRIVATE, null);        db.execSQL(""CREATE TABLE IF NOT EXISTS "" +                SAMPLE_TABLE_NAME +                "" (ID INT(3), Questions VARCHAR, Answer1 VARCHAR,"" +                "" Answer2 VARCHAR, Answer3 VARCHAR,"" +                "" Answer4 VARCHAR, CorrectAnswer INT(1), Reason VARCHAR);"");        db.execSQL(""INSERT INTO "" +                SAMPLE_TABLE_NAME +                "" Values ('1','"" +                ""Question?',"" +                ""'Answer1',"" +                ""'Answer2',"" +                ""'Answer3',"" +                ""'Answer4',"" +                ""'2',"" +                ""'Reason');"");        Cursor c = db.rawQuery(""SELECT * FROM "" +                SAMPLE_TABLE_NAME , null);                    questionval = c.getString(c.getColumnIndex(""Question""));                    answer1val = c.getString(c.getColumnIndex(""Answer1""));                    answer2val = c.getString(c.getColumnIndex(""Answer2""));</code></pre>","614460","","","","","2011-02-12 21:59:28","How to pull a single row from a database","<android><sqlite>","2","0","","",""
"4980911","1","4980936","","2011-02-12 22:03:46","1","575","<p>My current application has one Activity, the main one which extends ListActivity (listview of course).The main Activity also holds most of the app functions.</p><p>I want to add an option for the user to select between 2 views: the current listView and a gridView.I also want to reuse my code - most functions can be used for both Views.</p><p>Before I ask the actual question, note that my question is NOT how to add a gridView - it's already added and works great (when commenting out all Listview lines).</p><p>My question is - how should I do it?</p><ul><li><p>2 different Views means I have to have 2 different Activities? one extends ""ListActivity"" and one extends ""Activity""?</p></li><li><p>Should I create 4 classes (3 Activities and functions class in this case) where the main Activity will call one of the other Activities according to what the user selected?</p></li><li><p>Is there a way using the same main Activity for both Views? (right now I extend ""ListActivity"" to get ""getListView()"" which causes the gridView to force close as the Activity looks for a ListView with the ID ""list"").</p></li><li><p>Any other way?</p></li></ul><p>Thank you!</p>","444324","","","","","2011-02-12 22:08:41","Android: 2 different Views means 2 different Activities?","<android><android-listview><android-gridview>","1","0","0","",""
"4980962","1","4981002","","2011-02-12 22:12:24","1","431","<p>Seen a lot of tutorials with all different types of layout, but not clear on how a layout could be dynamically applied based on the item.  </p><p>Lets assume a list with items that derive from a common type like book, but a different subclass of book like paperback or audio book would get a completely different layout. So we would have one layout per class/type of object in the list.  Evey item has some common properties but others have some additional properties.  </p><p>So for example</p><p>Row 1  Description Text   Clickable Button     ItemType = ARow 2  Description Text   CheckBox             ItemType = CRow 3  Description Text   Spinner              ItemType = BRow 4  Description Text   Clickable Button     ItemType = ARow 5  Description Text   Checkbox             ItemType = C</p><p>So essentially the item type is determining the layout.  ItemType A always have Clickable Item, ItemType C always CheckBox, ItemType B always a Spinner, and all layouts have a description text.  I have not seen how the layout would be dynamically applied to list elements based on an element of the array of data.  How could this be done or better yet is there a good example on this.  Thanks</p>","602260","","","","","2011-02-12 22:19:35","ListView with dyamically selected per row layout","<android><listview><layout><listactivity>","1","2","","",""
"4981103","1","4981260","","2011-02-12 22:42:32","0","418","<p>I'm trying to build a simple app to get to grips with android as I'm new. I have programmed for years in PHP and MySQL so it's not completely unfamiliar to me, but one concept is at the moment confusing to me.</p><p>If I wanted to create this app with 100's of questions how would I create the database like this. What I mean is at the moment my app runs and creates the database. Would I need to do this everytime the app runs as i'm guessing if it was a lot bigger it would mean a slow load evert time.Or is there a way to create the database once and then when the app runs there is no need to populate it.</p><p>Max</p>","614460","","","","","2011-02-12 23:21:55","Android Database","<android><database><sqlite>","3","0","1","",""
"4981116","1","","","2011-02-12 22:46:22","3","100","<p>I'm looking for a guide for development on the Android which is specifically aimed at expert iPhone developers - where can I find a quality one, online or otherwise?</p>","173773","","","","","2011-02-13 00:21:45","Where can I find an easy-to-follow transition recipe for an iphone developer looking to switch to working on android phones?","<java><iphone><android><ios>","1","0","4","",""
"4981366","1","6589452","","2011-02-12 23:39:04","1","734","<p>I'm a little bit stuck with the new ContactsContract-API here. I think I don't fully understand the API and hope someone can give me a hint.</p><p>I red in the documentation that Android is aggregating several RawContacts to so called ""aggregated contacts"". Thats a pretty nice new feature with the 2.x Androidrelease.</p><p>What I'm not able to do is, to access this ""aggregated contact"". For example a user has a normal phonecontact with realname and phone saved in his phonebook and he has the same person as facebookcontact with his nickname and his birthday. Now he joins those two contacts and has his nice aggregated contact with the realname, phone <em>and</em> birthday which he can access.</p><p>My question: How can I as a developer access this aggregated contact?</p><p>I thought about getting all RawContacts associated with one Contact like this:</p><pre><code> Cursor c = getContentResolver().query(RawContacts.CONTENT_URI,      new String[]{RawContacts._ID},      RawContacts.CONTACT_ID + ""=?"",      new String[]{String.valueOf(contactId)}, null);</code></pre><p>But then I would not be able to decide which name is the ""real name"" of the Contact and other problems. And I disliked my other hackish ideas how to aggregated those RawContacts myself, because Android with the help of the user already did this job.</p><p>Any hint how I can query those aggregated Contacts is very much appreciated!</p>","539884","","","","","2011-07-05 22:10:17","Aggregated View on Contacts with ContactsContract-API","<android><contactscontract>","2","0","","",""
"4981367","1","","","2011-02-12 23:39:06","1","1717","<p>I want to get the home wallpaper set and put it as my background for my activity. Is this possible ?</p><p>I searched on the internet with </p><pre><code>WallpaperInfo v = w.getWallpaperInfo();String name = v.getServiceName();</code></pre><p>I have the service name (because the wallpaper is a live service) for example, I have <code>com.android.wallpaper.grass.GrassWallpaper</code>...can I use this to start service into my activity? </p><p>If so, how?</p>","612165","","13249","","2011-02-13 13:28:58","2012-05-25 08:03:48","Get home wallpaper and set it to my activity","<android><desktop-wallpaper>","2","1","","",""
"4981377","1","","","2011-02-12 23:41:37","0","376","<p>I hope someone has experienced this error before and let me know what I need to do. </p><p>I have one error from using the multiplayerexample.java. This error is in addEntity and the error shown is The method addEntity(Sprite) is undefined for the type Layer. </p><p>This is in the following method:</p><pre><code>  public void addFace(final Scene pScene, final float pX, final float pY) {        /* Create the face and add it to the scene. */        final Sprite face = new Sprite(pX, pY, this.mFaceTextureRegion);        pScene.getTopLayer().addEntity(face);}</code></pre><p>Also the getTopLayer() method shows as - The method getTopLayer() from the type Scene is deprecated</p><p>Any help on this will be appreciated. Thanks</p>","608658","","","","","2011-02-12 23:49:36","Multiplayer AndEngine Error","<android><andengine>","1","0","","",""
"4981430","1","4981681","","2011-02-12 23:50:06","1","2735","<p>I'm trying to position two buttons one below the other one with some padding. Unfortunately, the bottom one fills up the whole screen and goes behind the top one. :-S</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=""match_parent""    android:layout_height=""match_parent""     android:padding=""6dip""&gt;    &lt;LinearLayout         android:id=""@+id/linearLayout1""         android:layout_width=""match_parent""         android:layout_height=""match_parent""         android:orientation=""horizontal""        android:padding=""6dip""        android:layout_weight=""1""&gt;        &lt;ImageButton             android:layout_width=""wrap_content""             android:src=""@drawable/gallery""             android:layout_height=""wrap_content""             android:scaleType=""centerInside""             android:id=""@+id/gallery_btn""&gt;&lt;/ImageButton&gt;     &lt;/LinearLayout&gt;    &lt;LinearLayout         android:id=""@+id/linearLayout2""        android:orientation=""horizontal""        android:layout_height=""match_parent""        android:layout_width=""match_parent""        android:padding=""6dip""        android:layout_weight=""1""&gt;        &lt;ImageButton android:id=""@+id/camera_btn""             android:layout_width=""wrap_content""             android:layout_height=""wrap_content""            android:src=""@drawable/camera""             android:scaleType=""centerInside"" /&gt;    &lt;/LinearLayout&gt;&lt;/LinearLayout&gt;</code></pre>","338825","","","","","2011-12-11 18:40:43","dashboard layout pattern","<android><layout>","2","1","3","",""
"4981437","1","4981771","","2011-02-12 23:50:40","0","5335","<p>I am relatively new to programming for Androids and I have a back ground in PHP. I have written a script that at the moment pulls a single row from a database and populates 2 buttons and a textview. I know what to have another button that when clicked queries the database again and changes the buttons and textviews.</p><p>I'm guessing I need to create a function that when the button is clicked it runs the query i already have and the setText of each element again.</p><p>How do i create a function i can pass variables to and run from wherever.</p><p>Max</p>","614460","","","","","2011-02-13 01:04:43","Functions in Android?","<android><function><methods>","2","1","","",""
"4981441","1","6501328","","2011-02-12 23:51:04","4","489","<p>So, I'm working with an Android SQLite database, with <code>SQLiteOpenHelper</code>.  It seems to have a concept of database versions and upgrading... but it looks like you're supposed to roll your own code to actually do the upgrades, and keep your <code>onCreate</code> method up-to-date with your updates.</p><p>Coming from a Rails development background, this seems a little primitive.  For the uninitiated, Rails allows you to just write a class-per-version-upgrade, and Rails takes care of applying whichever versions need to be... this applies for DB creation, too; you only have <em>one</em> representation of your database schema, the set of migrations.  Rails also does a DB-independent representation of the schema changes, but that isn't necessary for Android because it only supports SQLite (which is fine).</p><p>Has anyone written a decent schema migration helper class for Android that allows me to get closer to DB schema management nirvana (RailsEdition(TM))?  It'll save me rolling my own ugly implementation.</p>","60003","","","","","2011-06-28 03:48:15","Rails-like database schema version upgrades for Android","<android><database><schema>","1","3","2","",""
"4981540","1","4983006","","2011-02-13 00:10:31","2","908","<p>So this is a bit complicated situation, so I will try to explain what is going on as best I can. I have a sqlite db which populates a listview. Each item in the listview contains the name of the item, along with two buttons. I want these two buttons to be able to use the sqlite db row id of the item they're contained in order to execute their purpose. So I need to get the id of the item, but I don't think using <code>onListItemClick(ListView l, View v, int position, long id)</code> will work for me, becuase I'm not clicking the entire item, rather, buttons within it. If I'm misunderstanding this point, please let me know. In order for the buttons to be clicked, I've created a class which extends SimpleCursorAdapter, which correctly handles clicks. Here are the two classes in question. First, the listactivity, and second, the custom listadapter.</p><pre><code>import android.app.ListActivity;import android.content.Intent;import android.content.SharedPreferences;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;public class FriendRequestList extends ListActivity implements OnClickListener {    private Button m_closeButton;    private TagDBAdapter mDbAdapter;    private Cursor mCursor;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        mDbAdapter = new TagDBAdapter(this);        mDbAdapter.open();        this.initLayout();        fillData();    }    private void initLayout() {        setContentView(R.layout.request_list);        m_closeButton = (Button)findViewById(R.id.request_window_close_button);        m_closeButton.setOnClickListener(this);    }    private void fillData() {        SharedPreferences prefs = this.getSharedPreferences(""Prefs"", MODE_WORLD_READABLE);        String username = prefs.getString(""keyUsername"", """");        RestClient.getRequests(username, this);        mCursor = mDbAdapter.fetchAllRequests();        startManagingCursor(mCursor);        String[] from = new String[] {TagDBAdapter.KEY_NAME};        int[] to = new int[] {R.id.requester};        SimpleCursorAdapter requests = new FriendRequestListAdapter(this, R.layout.request_view, mCursor, from, to);        this.setListAdapter(requests);    }    public String getRequester() {        return null;    }    @Override    public void onClick(View v) {        SharedPreferences prefs = this.getSharedPreferences(""Prefs"", MODE_WORLD_READABLE);        String username = prefs.getString(""keyUsername"", """");        RestClient.getUpdates(username, this);        Intent intent = new Intent(this, MainMenu.class);        this.startActivity(intent);    }    @Override    public void onDestroy() {        super.onDestroy();        mDbAdapter.close();    }}</code></pre><p>And the adapter class:</p><pre><code>import android.app.Activity;import android.content.Context;import android.content.SharedPreferences;import android.database.Cursor;import android.util.Log;import android.view.View;import android.view.View.OnClickListener;import android.view.ViewGroup;import android.widget.Button;import android.widget.SimpleCursorAdapter;public class FriendRequestListAdapter extends SimpleCursorAdapter implements OnClickListener {    private Context mContext;    public FriendRequestListAdapter(Context context, int layout, Cursor c,            String[] from, int[] to) {        super(context, layout, c, from, to);        mContext = context;    }    public View getView(int position, View convertView, ViewGroup parent) {        View view = super.getView(position, convertView, parent);        Button confirm = (Button)view.findViewById(R.id.confirm_request);        confirm.setOnClickListener(this);        Button deny = (Button)view.findViewById(R.id.deny_request);        deny.setOnClickListener(this);        return view;    }    @Override    public void onClick(View v) {        SharedPreferences prefs = mContext.getSharedPreferences(""Prefs"", Activity.MODE_WORLD_READABLE);        String username = prefs.getString(""keyUsername"", """");        //want to get the id here so i can do stuff with the buttons        switch(v.getId()) {        case R.id.confirm_request :            String confirmState = ""2"";            //these buttons both work            break;        case R.id.deny_request :            String denyState = ""3"";            //these buttons both work            Log.e(""TESTING"", ""deny"");            break;        }    }}</code></pre><p>I hope I've made my question clear enough. To summarize, I don't know how I would get the rowId of the item a pair of buttons is nested in, because I'm not ever using the onListItemClick method, which is, as far as I'm aware, the way one would normally get the id of the item. Thank you for reading and thank you for your answers. Please let me know if there is any clarifications I can make.</p>","588758","","","","","2011-05-24 08:10:17","Question on logistics of a multiple button listview item which can use the id of the item in an SQLite DB","<android><sqlite><listview>","3","0","","",""
"4981640","1","4982102","","2011-02-13 00:37:09","0","152","<p>I wrote a static method that uses 4 inner loops set-up like the ones below. I have been doing lots and lots of testing on the heap used when it runs. It seems to generate thousands and thousands of ""int[]"" objects, I think that these are coming from the loops I have put in place. </p><p>I can't seem to find a way around this memory problem, I need the loops but I don't need lots of int[] objects created for every loop its just a waste! Are these the loops themselves that are causing these errors? And is there anything I can do to reduce the memory usage, I was thinking about enhanced-for-loop, but that might be the same problem...</p><p>Thank you!</p><pre><code>    public static double[] calculateHand(final int card1, final int card2, final int card3,        final int card4, final int card5){    int ahead = 0, tied = 1, behind = 2;    int[][] HP = new int[3][3];    int[] HPTotal = new int[3];    int ourrank = HandEval.hand5Eval(HandEval.encode(card1, card2, card3, card4, card5));    int[] remainingCards = filterCardsFromDeck(card1, card2, card3, card4, card5);    int kM = 1    for (int i = 0; i &lt; remainingCards.length; i++)    {        for (int k = kM; k &lt; remainingCards.length; k++)        {            int index = -1;            int oCard1 = remainingCards[i];            int oCard2 = remainingCards[k];            int opprank = HandEval.hand5Eval(HandEval                    .encode(oCard1, oCard2, card3, card4, card5));            if (ourrank &gt; opprank)            {                index = ahead;            }            else if (ourrank == opprank)            {                index = tied;            }            else            {                index = behind;            }            HPTotal[index]++;            int[] newArray = filter2Cards(remainingCards, oCard1, oCard2);            int riverMinimumIndex = 1;            for (int turnIndex = 0; turnIndex &lt; newArray.length; turnIndex++)            {                for (int riverIndex = riverMinimumIndex; riverIndex &lt; newArray.length; riverIndex++)                {                    int turnCard = newArray[turnIndex];                    int riverCard = newArray[riverIndex];                    int ourbest = HandEval.hand7Eval(HandEval.encode7(card1, card2, card3, card4,                            card5, turnCard, riverCard));                    int oppbest = HandEval.hand7Eval(HandEval.encode7(oCard1, oCard2, card3, card4,                            card5, turnCard, riverCard));                    if (ourbest &gt; oppbest)                    {                        HP[index][ahead]++;                    }                    else if (ourbest == oppbest)                    {                        HP[index][tied]++;                    }                    else                    {                        HP[index][behind]++;                    }                }                riverMinimumIndex++;            }        }        kM++;    }    .....    return result;}</code></pre>","258415","","1900417","","2013-02-24 13:09:14","2013-02-24 13:09:14","massive memory being used in several inner loops","<java><android><for-loop><int><heap-memory>","2","5","","",""
"4981659","1","4982390","","2011-02-13 00:39:26","2","1451","<p>I'm looking for a <strong>LateX library</strong> to render formulas. </p><p>The project is an offline database of math\physic formulas for a Smartphone application. I need the application to be <strong>not too heavy</strong>, and that users can enter their own formulas. So i want the program to render written formulas more than to display PNG files that are heavier.</p><p>The second tricky part is that the application will be both on Android (my part) and IPhone (another developper will do it).</p><p>The database will be the same in the two cases (SQLite), so we need to render the same written formulas, and preferably it will be Latex. But it can be different libraries.</p></p><p>Do you have any idea ?</p>","543691","","11343","","2011-10-20 09:45:13","2011-10-20 09:45:13","LateX rendering for both Java and Objective C","<java><iphone><android><objective-c><latex>","2","2","3","",""
"4981669","1","4981755","","2011-02-13 00:41:41","0","545","<p>Hey guys i am new to android development, I am developing a project which uses XML file from web to list data.But as i said its advance, i am displaying a list of item from index.XML(this file have index of topics) which is displayed on app. i am able to display the data from index.xml. </p><p>now i want that when someone click on the item it downloads another XML and shows it. I am not able to make these index data clickable nor i am getting any idea how to display the data from other (you can call sub xml file) XMl files.</p><p>help me please</p><p>INDEX XML(don't go with name) <a href=""http://aakashqq.x10.mx/temp.xml"" rel=""nofollow"">http://aakashqq.x10.mx/temp.xml</a></p><p>Sub XML files:InspireProgress.com/cricket.xmlInspireProgress.com/hockey.xmlInspireProgress.com/lacrosse.xml</p><p>AIM:in short i want app to display index from main XML file, when user clicks on any item it open up's a new sub XML and displayProb: how do i get items click-able and how do i show a new sub XML accordingly </p>","614681","","","","","2011-02-14 05:44:32","Advance XML parsing in android","<android><xml><parsing><sax>","2","0","","",""
"4981680","1","4981741","","2011-02-13 00:46:07","0","693","<p>I have an Android app with 2 activities defined below. In the <code>MainMenu.oncreate()</code>, I have an <code>AlarmManager</code> kicked off to periodically query a server for data and update the text of a button in the <code>PlayBack</code> UI. Can I access the <code>Playback</code> object via a global reference or do I need to kick off the <code>AlarmManager</code> in the <code>Playback.oncreate()</code> instead so I can pass a reference to it? If so, should this be done with a <code>BroadcastReceiver</code> and <code>Intent</code> as I'm doing in the <code>MainMenu</code> shown below?</p><pre><code>&lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;&lt;activity android:name="".MainMenu""          android:label=""@string/app_name""&gt;&lt;/activity&gt;    &lt;activity android:name="".Playing"" android:label=""@string/playing_title""&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="".NotificationUpdateReceiver"" android:process="":remote"" /&gt;    &lt;service android:name=""org.chirpradio.mobile.PlaybackService""</code></pre><p></p><pre><code>public class MainMenu extends Activity implements OnClickListener {    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main_menu);        View playingButton = findViewById(R.id.playing_button);        playingButton.setOnClickListener(this);        try {            Long firstTime = SystemClock.elapsedRealtime();            // create an intent that will call NotificationUpdateReceiver            Intent intent  = new Intent(this, NotificationUpdateReceiver.class);            // create the event if it does not exist            PendingIntent sender = PendingIntent.getBroadcast(this, 1, intent, PendingIntent.FLAG_UPDATE_CURRENT);            // call the receiver every 10 seconds            AlarmManager am = (AlarmManager) getSystemService(ALARM_SERVICE);            am.setRepeating(AlarmManager.ELAPSED_REALTIME, firstTime, 10000, sender);       } catch (Exception e) {            Log.e(""MainMenu"", e.toString());       }          }}</code></pre>","135414","","","","","2011-02-13 00:57:04","How can I access an Activity from another class globally in an Android app?","<java><android><android-manifest><android-intent><android-ui>","1","0","","",""
"4981707","1","","","2011-02-13 00:51:59","9","1313","<p>I'm in the process of writing an Android game and I seem to be having performance issues with drawing to the Canvas. My game has multiple levels, and each has (obviously) a different number of objects in it.</p><p>The strange thing is that in one level, which contains 45 images, runs flawlessly (almost 60 fps). However, another level, which contains 81 images, barely runs at all (11 fps); it is pretty much unplayable. Does this seem odd to anybody besides me?</p><p>All of the images that I use are .png's and the only difference between the aforementioned levels is the number of images.</p><p>What's going on here? Can the Canvas simply not draw this many images each game loop? How would you guys recommend that I improve this performance?</p><p>Thanks in advance.</p>","614687","","","","","2012-09-15 19:03:33","Android drawBitmap Performance For Lots of Bitmaps?","<android><performance><bitmap><drawing>","3","0","3","",""
"4981745","1","4981964","","2011-02-13 00:57:27","0","152","<p>I'm currently developing an Android journal/diary application that allows the user to create entries and store them by day.To accomplish this, I was considering having a folder for each day and a subfolder in each day folder for each entry.  This probably demonstrates that better:</p><p>day->journal entry->journal entry data   ->other journal entry for that day->journal entry data   -> etc.</p><p>Now, with a folder for each day I'm already at 365 directories, and possibly many more within those.This makes me doubt feasibility of implementing so many subdirectories.</p><p>This comes with the caveat that I would not be going through EVERY directory at once, but at most loading perhaps 31 days to display on a calendar.</p><p>The final question is would my application be slowed to oblivion navigating large amounts of directories, or should I not even have to worry about that at all?What's holding me back from just making SQL database solutions for the application is the fact that I know absolutely no SQL at the moment, and don't know how easy/quick it is to learn.</p><p>Help/comments/ideas are all appreciatedThanks! </p>","450153","","","","","2011-02-13 05:08:23","Feasibility of Nested Directories on Android","<android><navigation><directories>","1","2","","",""
"4981752","1","6856110","","2011-02-13 01:00:21","1","584","<p>I am trying to create a listview with add button on the side as shown in the right image <a href=""http://developer.android.com/resources/articles/images/android.png"" rel=""nofollow"">http://developer.android.com/resources/articles/images/android.png</a></p><p>Is it possible to reuse this existing layout object. If so what is it called exactly? All I can find in the default listview is simple checkboxes and other listviews without buttons.</p>","614689","","","","","2011-07-28 08:33:23","Reusing android listview","<android><listview><user-interface>","1","0","","",""
"4981819","1","","","2011-02-13 01:20:03","0","1202","<p>I would like to create an Android custom component for a game.  The basic idea is that the custom component would be square in shape and contain other square ImageView components inside it.  The ImageView components inside may be scaled and/or cropped as needed, but must remain square.  The number of rows == columns, always.  The difficulty level determines the exact value of rows and columns at runtime.  As the game gets more difficult, the number of rows and columns will increase equally, but the scaled size of each ImageView will shrink accordingly.  I would like the components to have some fixed small spacing between them, mostly so it looks nice.  The display won't be scrollable, all items must fit on the display at the same time.  </p><p>After a bunch of failed attempts, I'm getting frustrated and I'm not sure what is the best approach is to make this custom component.  </p><p>My latest idea would be to do roughly the following:  </p><p>I create my custom component class by ""extends FrameLayout"".  In my constructor, I create an arbitrary small square ImageView object in code.  I'd like others to reuse my custom component someday, so I do it in code rather than XML so that the custom component doesn't rely on any external XML drawable having to be defined.  I set the scale type so that the ImageView retains it's ""squareness"" (I think I want fitStart?).  I set the square ImageView's layout_width and layout_height to ""fill_parent"", so the ImageView fills in as big a space as is available in the containing FrameLayout.  I add the now large and square ImageView to my layout using addView().  </p><p>Next I create a RelativeLayout object and also programmatically add it to myself using addView().  Because my base class is a FrameLayout, I think this will make the size of the RelativeLayout the same as the square ImageView previously added.  At least that's how I read the documentation.  </p><p>Next I measure the ImageView to see how large it is.  I don't think I can measure myself because my previous attempts failed at this.  I kept getting 0 for my size.  My research said this was because I can't measure myself during construction.  This turned into a Catch-22.  When I tried to scale my image to the available space, I couldn't because there was no space available yet.  My hope is that because I changed to using the FrameLayout as my base class and I add the ImageView to it, I will be able to measure my newly created and correctly scaled large square ImageView.  </p><p>If all goes as planned, I now know how big the space available is on the user's device for my RelativeLayout because it's the same as my ImageView.  By knowing how much space is available and how many rows and columns need to be displayed, I can correctly scale each ImageView I add accordingly, assuming I remember to account for the spacing between the ImageViews I add.  Now I no longer need the square ImageView and can make it go away if I want.  </p><p>If reasonable, I would like the large ImageView to have rounded corners and each ImageView added also have rounded corners.  With a small gap between ImageViews added, this would look cool for gameplay.  This way I can leave it as a background.  </p><p>This seems like a good solution, and better than my previous attempts that didn't work, but if there's a better way..., I'm listening.  </p><p>Here's some psuedo-code that says mostly the same thing as above to the best of my understanding:</p><pre>construct(){    ImageView squareImageView = new ImageView(Square);    LayoutParams squareImageLayoutParams = new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT);    squareImageLayoutParams.addRule(fitStart);    addView(squareImageView, squareImageLayoutParams);    RelativeLayout relativeLayout = new RelativeLayout(context);    LayoutParams relativeLayoutParams = new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT);    addView(relativeLayout, relativeLayoutParams);    int size = squareImageView.getWidth(); // Should be the scaled size and square.      squareImageView.setVisibility(INVISIBLE); // maybe?    loop for each row and col    {        crop, scale and add each image to the relativeLayout object.      }}</pre><p>My most basic question is if this seems like a reasonable solution?  If so, there's a bunch of things in the psuedocode I don't know how to do (yet).  </p><ul><li>How do I create a small square ImageView in code?</li><li>How do I set the scaleType in code?</li><li>Will I be able to measure my square ImageView and get the correct size?</li><li>Is there a better way to remove the square ImageView other than making it invisible?</li><li>Will making my square ImageView invisible make it unmeasurable?  </li><li>I see something called a ShapeDrawable, would this be better than an ImageView for making a square?  </li><li>How do I crop an ImageView to be square, distributing the loss equally to both sides?  </li></ul><p>I certainly don't expect anyone to know all these answers, but if you know any answers you can share, I would appreciate it.  </p><p>Thanks.</p>","405821","","","","","2011-05-24 09:47:43","Android Custom Compoent extending FrameLayout in Code","<android><custom-controls><android-layout><imageview><android-custom-view>","1","1","","",""
"4981821","1","4987140","","2011-02-13 00:27:09","1","123","<p>I am now downloading the android source code in ubuntu 10.10. </p><p>Just wanted to be sure that, I can build the OS from the source and test run it in the emulator just like any other Android application I run in emulator?</p><p>Thanks for your help.</p>","474986","newcomer","","","","2011-02-13 21:52:16","Do I need a physical phone to test run the build from android source or can do it in emulator?","<emulator><android>","1","0","","",""
"4981824","1","4984269","","2011-02-13 00:58:33","0","654","<p>I have a slow &amp; erroneous Internet connection which disconnects now &amp; then.</p><p>So I like to know, if there is a way to download the android source directly rather thanrepo sync</p><p>Or If I download the source in another machine, how can I configure/setup in my machine?</p>","474986","newcomer","648313","","2011-07-13 21:00:43","2011-07-13 21:00:43","AOSP Downloading and Moving the android source code","<android><android-source>","2","0","1","",""
"4981851","1","4981927","","2011-02-13 01:30:05","14","11343","<p>I've been bothered by this ""characteristics"": When I use Back button to leave my app, I can tell onDestroy() is called, but the next time I run my app, all the static members of the Activity class still retain their values. See the code below:</p><pre><code>public class HelloAndroid extends Activity {private static int mValue;   // a static member herepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    TextView tv = new TextView(this);    tv.setText((mValue != 0) ?         (""Left-over value = "" + mValue) : ""This is a new instance"");    setContentView(tv);}public void onDestroy() {    super.onDestroy();    mValue++;}</code></pre><p>}</p><p>The above code displays the left-over value in mValue, and it increments when the session ends so that I know for sure the onDestroy() is called. </p><p>I found a <a href=""http://stackoverflow.com/questions/4461999/android-is-ondestroy-supposed-to-destroy-the-activity-its-variables-and-free"">useful answer</a> on this forum, and I understand in the above code mValue is a class member, instead of an instance member. But isn't it true that, in this particular case, I have only one single HelloAndroid activity, and so When he dies, everything is cleaned up, and the next time I come back, everything starts over again? (Or, is there some other misterious thing in the system still holds on to it after onDestroy() so that it just won't die???)</p><p>(The above is just a variable, what if it's a bunch of objec references? Each piece is a separately re-collectable memory. Is there a chance that GC collects some of them but not all-or-none? This really bugs me.)</p>","593407","","194894","","2011-09-03 10:11:15","2011-09-03 10:11:15","What exactly does onDestroy() destroy?","<android><ondestroy>","2","0","2","",""
"4981907","1","4982740","","2011-02-13 01:43:44","1","218","<p>Can the Geocoder class provide reverse lookups outside of the United States? I basically want to know what country my user is in (for law stuff).</p><p><a href=""http://developer.android.com/reference/android/location/Geocoder.html"" rel=""nofollow"">http://developer.android.com/reference/android/location/Geocoder.html</a></p><p>If it can't, is there another way of determining this?</p><p>Thanks</p>","291701","","935627","","2012-10-24 15:05:51","2012-10-24 15:05:51","Does Geocoder work outside the United States?","<android><google-geocoder>","1","4","","",""
"4982044","1","4982155","","2011-02-13 02:26:29","1","1144","<p>When using a custom adapter, with a BindView method, is it possible to obtain the ContextMenu object associated with the view being bound?</p><p>I would like to change the items displayed in the context menu depending on the item being displayed and I can't find a way to obtain the corresponding ContextMenu.</p><p>Thanks</p>","87191","","","","","2011-02-13 02:55:12","Get ContextMenu associated with a ListView Item in BindView","<android><listview><contextmenu>","1","0","","",""
"4982096","1","7797073","","2011-02-13 02:40:58","0","472","<p>How do I invoke dialog than allows user select default tts engine from code. Using tutorial on developer.android.com I achieved only that it uses internal pico. I'd like to use svox/TTS extended.</p><p>On 2.2 phones default engine can be selected in setting but on my 2.1 android it's not possible.</p><p>Thx</p>","605816","","168868","","2012-01-01 22:02:28","2014-01-26 12:27:19","Android 2.1 tts dialog","<android><text-to-speech>","1","0","","",""
"4982181","1","5148674","","2011-02-13 03:02:07","3","1298","<p>If you were to install a Home Screen application that does not give you access to the System Settings screen (to go to Manage Applications), and also does not let you launch Apps (such as the Market App or 3rd party install/unistallers), is there ANY way to uninstall such an application?</p><p>I know that Android requires your permission before letting a new App take over the home screen privilege.  But say you're trying a newly published Launcher app that is buggy (or malicious).  You are of course still going to tell Android it's ok to give this App the Home screen privilege.  Now once it is installed, your phone is now effectively useless?</p><p>Is there a way for a typical end user (who doesn't have Eclipse/ADB) to get out of this situation?  Other than doing a complete factory reset?</p><p>I realize there are ways to uninstall an App via ADB (""adb uninstall package.name"")</p><p>But it seems like a typical end user is potentially screwed if they ever install such a malicious/buggy app.  This seems like a gaping security hole in Android, no?</p>","569091","","569091","","2011-02-13 03:18:36","2011-03-15 12:33:47","How would you uninstall a rogue Home (Launcher) application?","<android><uninstall><google-play><launcher><homescreen>","3","6","","",""
"4982229","1","5221488","","2011-02-13 03:21:27","2","1019","<p>When getting the column names of content://sms there are two that appear to be the same column? One is named ""read"" and one is named ""seen"" does anyone know the difference(s) between them?</p>","180590","","","","","2011-03-07 15:29:11","Android SMS read vs seen column?","<android><sms>","1","0","","",""
"4982274","1","","","2011-02-13 03:34:12","2","513","<p>I have a layout with graphics drawn in custom Views using the Canvas drawing primitives, plus a TextView and 2 buttons.    The emulator is set to the same pixel width as the phone (400 pixels) and the 2D graphics are specified in pixel dimensions.</p><p><img src=""http://i.stack.imgur.com/k312d.jpg"" alt=""Here's a picture."">    (Emulator on the left, phone on the right.)   </p><p>Note the the graphics match.  (the actual content of the graphics are different because the data is different )   <strong>But the TextView and buttons are radically different.</strong>  Here's the XML - </p><pre><code>    &lt;LinearLayout  xmlns:android=""http://schemas.android.com/apk/res/android""  android:orientation=""horizontal""  android:background=""#303080""  android:layout_width=""fill_parent""  android:layout_height=""wrap_content""&gt;    &lt;TextView android:id=""@+id/eventSummary""     android:layout_width=""250dp""    android:background=""#202090""        android:layout_height=""fill_parent""     android:minLines=""4""     android:singleLine=""false""    android:text=""text"" /&gt;   &lt;Button android:id=""@+id/PrevButton""    android:layout_width=""wrap_content""     android:layout_height=""wrap_content""    android:onClick=""prevButtonHandler""    android:text=""&amp;lt;""   /&gt;   &lt;Button android:id=""@+id/NextButton""    android:layout_width=""wrap_content""     android:layout_height=""wrap_content""     android:onClick=""nextButtonHandler""    android:text=""&amp;gt;""   /&gt;  &lt;/LinearLayout&gt;</code></pre><p>... I've tried specifying the TextView width using SP's and DP's.    Why is there such a big difference and how can I get the Emulator and phone to match?  (FWIW the phone is an HTC Droid Incredible).</p><p>Thanks in advance!</p>","424690","","","","","2011-07-25 15:45:31","Android Emulator doesn't match phone","<android>","2","2","","",""
"4982348","1","4982392","","2011-02-13 03:56:08","0","723","<p>I've developed an app that records audio and saves sample on sd card. i'd like to add a bit more functionality for example at the moment it save the sample automatically, whereas i'd like the user to be able to specify a filename and then that sample is saved under that name on the sd card. also when playing a sample i'd like the user to be able to choose a sample from a list generated from the available samples on the sd card. this is my problem, i'm not sure which android components to use to generate a list from the samples on the sd card. can anyone point me in the right direction?</p><p>thanks</p>","532462","","321697","","2011-02-13 03:57:13","2011-02-14 18:28:58","which android list component to use?","<android><android-widget>","2","0","","",""
"4982468","1","4982537","","2011-02-13 04:46:51","0","720","<p>I'm trying to play around with Android development, but I can't seem to get passed this error when I try to parse some JSON coming from an API:</p><pre><code>org.json.JSONException: Value true at 0 of type java.lang.Boolean cannot be converted to JSONObject</code></pre><p>So, it can't handle ""true""? That just seems silly. Here's the first part of the response, where it's failing:</p><pre><code>[true,{""total"":84,""results"": ...</code></pre><p>And here's how I'm trying to do the parsing:</p><pre><code>new JSONArray(json);</code></pre>","131854","","59501","","2011-02-13 07:29:21","2011-02-13 07:29:21","JSON Parsing with Android, problems with boolean","<java><android><json>","1","0","","",""
"4982483","1","","","2011-02-13 04:50:56","1","198","<p>I don't know if this is possible but it seems like it should be. My app uses things that are blocked in the latest API levels, except to apps that declare certain permissions that you cannot get unless you are the main android system. </p><p>I've only scratched the surface of rooted development, I'm seeking advice of what is the best method to have your whole app treated as system level for permission puposes. I've searched a significant amount for some type of tutorial or open source project illustrating this goal but haven't been successful.</p>","246883","","","","","2011-02-13 04:50:56","gaining permissions normally locked to system level on rooted devices","<android>","0","0","1","",""
"4982535","1","","","2011-02-13 05:06:28","0","102","<p>Is there a way I can have a bookmark inside a textviewer?For example, if I have a textviewer with a long html text in it, I would like to scroll to a certain location\bookmark. Not to a certain % but to a certain line\word.</p><p>Any suggestions?</p>","380490","","","","","2011-02-13 05:42:46","TextViewer bookmarks","<android><uitextview>","1","0","","",""
"4982593","1","4982638","","2011-02-13 05:23:00","0","751","<p>I have an app that downloads a file from an FTP server upon tapping the file in a listview. Once the tap is received the download starts. This causes my app to become unresponsive, in logcat it is giving me the debugging info from the server and it is downloading just fine, the issue is this. If the download takes too long say over a minute or so android thinks the application is froze and asks if the user wants to Force Close or Wait. How do I prevent this?</p>","614820","","","","","2011-02-13 05:38:31","Downloading large file from FTP server on Android causes a prompt for ""Force Close"" or ""Wait""","<java><android><ftp>","4","0","","",""
"4982705","1","","","2011-02-13 05:55:10","1","880","<p>I need to implement a ListAdapter for multiple row types.  So pick a layout per row based on the content of that row.  I would like to hear some opinions on the merits of the different types of ListAdapters for accomplishing this.  I don't expect to have thousands of rows or even a hundred, but I may potentially have quite a few different layouts and need a flexible easy to understand implementation.  </p><p>So I am considering </p><p>BaseAdapter</p><p>ArrayAdapter </p><p>CursorAdapter</p><p>SimpleCursorAdapter</p><p>What are some of the advantages/disadvantages of these adapters.  Would a cursor based adapter be better?</p><p>I want a it to be flexible, easy to change and work reliably. </p>","602260","","","","","2011-02-13 08:29:14","Best ListViewAdapter for multiple row types?","<android><listadapter>","1","0","1","",""
"4982736","1","4982907","","2011-02-13 06:05:08","1","759","<p>I'm trying to get my Android tests running on headless emulator for future use on CI servers.But non of the TouchUtils methods, like ""<em>clickView()</em>"" etc.. seem work this way. </p><p>I'm always getting SecurityException: </p><blockquote>  <p>""Injecting to another application requires INJECT_EVENTS permission"". </p></blockquote><p>Looks like it doesn't click the right objects in the first place. In normal GUI mode everything works fine.</p><p>Is there any way around this?<br>If no, which setup would you recommend to run all the tests on remote machines?</p><p>Thank you!</p>","614845","","","","","2011-02-13 06:59:35","Android.test.TouchUtils methods don't work on headless emulator, help!","<android><android-emulator><android-widget><android-manifest>","1","0","","",""
"4982799","1","4983616","","2011-02-13 06:29:10","0","3485","<p>I have the following situation </p><pre><code>TabActivity&gt;group activiyt&gt;(A-&gt;B-&gt;C)</code></pre><p>Here A,B and C are activities. And me loading like this</p><pre><code> setContentView(this,getLocalActivityManager().startActivity(""zero"",intent.addFlags(Intent.FLG_ACTIVITY_CLEAR_TOP)) .getDecorView());</code></pre><p><strong>What i need is to set animation (Slide from left/Right) when i change one activity to another?</strong><br>Currently me used the following animation, after <code>setContentView</code> to new view   </p><pre><code>public static Animation inFromRightAnimation() {        Animation inFromRight = new TranslateAnimation(Animation.RELATIVE_TO_PARENT, +1.0f, Animation.RELATIVE_TO_PARENT, 0.0f, Animation.RELATIVE_TO_PARENT, 0.0f, Animation.RELATIVE_TO_PARENT, 0.0f);        inFromRight.setDuration(ANIMATIION_DURATION);        inFromRight.setInterpolator(new AccelerateInterpolator());        return inFromRight;    }  </code></pre><p>but it only do animation to new view.<br>I need like current move left at the same time new move from right<br><strong>Is there any way to set <code>setInAnimation</code> and <code>setOutAnimation</code> in startActivity like view flipper?</strong><br>Thank you </p>","609646","","609646","","2011-02-13 06:55:11","2011-02-13 11:32:53","set setInAnimation and setOutAnimation while starting activity","<android>","1","0","1","",""
"4982811","1","6379896","","2011-02-13 06:33:16","2","702","<p>So this is a pretty general question, but I've been wondering about it for a while now and wanted to see if anyone had a suggestion on this.</p><p>In my previous experiences, as with some people's, using SurfaceViews and/or CanvasViews to display graphics, draw pixels, and do animations is very easy and straightforward. I personally use SurfaceViews more for animations since they are more optimized for it. I've realized from doing tests that SurfaceViews tent to lag a lot on certain phones (example: Motorola Droid) but run smoothly on others (example: Droid Incredible). I was wondering if anyone knows of views or display methods that run smoothly and are more efficient than SurfaceViews and/or CanvasViews, especially for animiations. Thanks a lot.</p><p>I primarily want to  know this because I don't understand how some games can run so smoothly on my slower phones even though they have tons more animations than my simple game using a SurfaceView.</p>","394933","","","","","2011-06-16 23:43:29","SurfaceView/CanvasView General Question","<android><animation><surfaceview>","2","0","","",""
"4982812","1","4983279","","2011-02-13 06:33:32","1","1404","<p>So I'm really at a loss here. I have my main onCreate try and load a file, if the file doesn't exist I want to call a startActivityForResult to get some input.  My code completely skips over the startActivityForResult,though.  I get nothing from LogCat and code just continues onward.  Calling the startActivityForResult in a handler or something works, but it's not going to work for my app.  Here's my code.</p><p>My main onCreate:</p><pre><code>@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    findViews();      setListeners();    Stuffs stuffs = DomUtil.getFullDom(this);    if (stuffs != null) {        // do stuff    }    else {        startActivityForResult(new Intent(this, SelectType.class), 0);        addNew(1, null);    }    currentScreen = 1;}</code></pre><p>The onCreate for SelectType I'm trying to call:</p><pre><code>@Overrideprotected void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.selecttype);    findView();    setListeners();}</code></pre><p>What am I doing wrong here?  The only thing I can think is calling startActivityForResult in onCreate, but I've seen tutorials where it's done.  What's going on here?</p>","546489","","","","","2012-12-14 07:56:14","startActivityForResult in onCreate getting skipped","<android>","2","3","","",""
"4982822","1","","","2011-02-13 06:37:22","1","293","<p>hey everyone first off im using eclipse program and im working on an android application.</p><p>Here is what I'm trying to do::</p><p>i want to have a gallery of images and then when they select the image they can press menu and select either send mms, share, set as wallpaper, or about. Then when they click send mms it goes to another page that has the picture they chose and a text box then a button that has poems they can click on and pick from a list of poems and when they click on a poem it goes to the text box then they can press send (there is also going to be a button to go back if they choose to cancel the mms). and then the Share, set as wallpaper, and about i pretty obvious.</p><p>I have the gallery set up and the options menu i just cant link the option menu buttons together with everything... i have tried to search and but most stuff i find is to make a regular button to set wall paper and all that good stuff.</p><p>Please if someone can help me that would be great this is my first app to build.</p><p>Thanks in advance</p>","614860","","12707","","2011-02-13 06:43:02","2011-02-13 06:43:02","Send MMS, Share, and Set as wallpaper help","<java><android><set><mms><wallpaper>","0","0","","",""
"4982855","1","4983031","","2011-02-13 06:45:29","0","533","<p>In my AVD, I hit the keyboard keys to switch the orientation of my AVD, and I have a regular main.xml in my res/layout/ folder and another main.xml in my res/layout-land/ folder. The orientation change is handled by my application, but when it is switched back to portrait, the application remains in the landscape view. What am I doing wrong?</p>","499323","","","","","2011-02-13 07:33:42","Android orientation handling?","<android><gui><screen-orientation>","1","0","","",""
"4982920","1","4985054","","2011-02-13 07:03:52","3","1660","<p>Should alarm manager send PendingIntent to IntentService or is it better to send it to a broadcast receiver which then issues startService() targeting the pending intent?  </p>","602260","","","","","2011-02-13 15:39:47","IntentService and AlarmManager communication","<android><alarmmanager>","1","0","","",""
"4983032","1","","","2011-02-13 07:33:44","8","1796","<p>I searched on the Internet alot but cant find a proper answer to this.</p><p>I have used apps like 3G watchdog and Advanced task killer on my android phone. I noticed that they always have an icon up when the status bar is minimized and also have a notification( Upon clicking opens the app) which cant be cleared from the status bar.</p><p>I like to use something like this in my app.</p><p>I know how to get an image and everything in the status bar, but how to keep one that cant be cleared till my app is running in the background and is not explicitly turned off is a problem.</p><p>Please Help.Thanks.</p>","614897","","","","","2012-11-06 19:56:30","How to get a PERMANENT application notifier in the status bar?","<java><android><activity><notifications><multitasking>","1","0","4","",""
"4983122","1","","","2011-02-13 08:00:49","1","574","<p>If i open:<br>content://com.android.htmlfileprovider/sdcard/vik_book_temp/oebps/ch01.htm<br>in an android browser the same opens correctly, but when I open a anchor tag page like <br><br>content://com.android.htmlfileprovider/sdcard/vik_book_temp/oebps/ch01.htm#s01c02 <br><br>the android browser fails to open the relevant section within the html page. <br><br>Whereascontent://com.android.htmlfileprovider/sdcard/vik_book_temp/oebps/ch01.htm?s01c02 opens the top of the html page. Is this is a bug in the android browser or incompatibility issue with anchor tags in android browser. If  yes then what is a way around? How do I set anchor tags or change the ""#"" symbol to what symbol at runtime to enable navigation to a section?</p>","602838","","709626","","2012-06-10 13:28:44","2012-06-10 13:28:44","Anchor tags in android ""WebKit"" browser","<android><webview><webkit><anchor>","0","1","","",""
"4983129","1","4983257","","2011-02-13 08:03:14","0","815","<p>I am Unable to use shared preference values in a class-say Class A that extends BroadcastReceiver. I do a commit in another class- an activity class, now I want to retrieve those set of values inside Class A that extends BroadcastReceiver.</p>","492439","","","","","2011-02-13 08:45:25","Unable to use shared preference values in class A extends BroadcastReceiver , Android","<android>","1","0","","",""
"4983605","1","4985481","","2011-02-13 10:19:42","0","1602","<p>developing for Android phone(ver 1.5)I would like to know if there is an option to add listener when long-press Send button occurs. and also the same question about voulme-mute action ?</p><p>thanks,ray.</p>","260511","","","","","2011-02-13 16:53:25","Send button/Volume button Action listeners","<android>","1","0","2","",""
"4983657","1","","","2011-02-13 10:30:11","1","863","<p>I have this code in C from this <a href=""http://iphonedevelopment.blogspot.com/2009/05/opengl-es-from-ground-up-part-4-let.html"" rel=""nofollow"">source</a>:</p><pre><code>#import &lt;Foundation/Foundation.h&gt;#import ""OpenGLCommon.h""int main (int argc, const char * argv[]) {    NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];    NSMutableString *result = [NSMutableString string];    static const Vertex3D vertices[]= {        {0, -0.525731, 0.850651},             // vertices[0]        {0.850651, 0, 0.525731},              // vertices[1]        {0.850651, 0, -0.525731},             // vertices[2]        {-0.850651, 0, -0.525731},            // vertices[3]        {-0.850651, 0, 0.525731},             // vertices[4]        {-0.525731, 0.850651, 0},             // vertices[5]        {0.525731, 0.850651, 0},              // vertices[6]        {0.525731, -0.850651, 0},             // vertices[7]        {-0.525731, -0.850651, 0},            // vertices[8]        {0, -0.525731, -0.850651},            // vertices[9]        {0, 0.525731, -0.850651},             // vertices[10]        {0, 0.525731, 0.850651}               // vertices[11]    };    static const GLubyte icosahedronFaces[] = {        1, 2, 6,        1, 7, 2,        3, 4, 5,        4, 3, 8,        6, 5, 11,        5, 6, 10,        9, 10, 2,        10, 9, 3,        7, 8, 9,        8, 7, 0,        11, 0, 1,        0, 11, 4,        6, 2, 10,        1, 6, 11,        3, 5, 10,        5, 4, 11,        2, 7, 9,        7, 1, 0,        3, 9, 8,        4, 8, 0,    };    Vector3D *surfaceNormals = calloc(20, sizeof(Vector3D));    // Calculate the surface normal for each triangle    for (int i = 0; i &lt; 20; i++)    {        Vertex3D vertex1 = vertices[icosahedronFaces[(i*3)]];        Vertex3D vertex2 = vertices[icosahedronFaces[(i*3)+1]];        Vertex3D vertex3 = vertices[icosahedronFaces[(i*3)+2]];        Triangle3D triangle = Triangle3DMake(vertex1, vertex2, vertex3);        Vector3D surfaceNormal = Triangle3DCalculateSurfaceNormal(triangle);        Vector3DNormalize(&amp;surfaceNormal);        surfaceNormals[i] = surfaceNormal;    }    Vertex3D *normals = calloc(12, sizeof(Vertex3D));    [result appendString:@""static const Vector3D normals[] = {\n""];    for (int i = 0; i &lt; 12; i++)    {        int faceCount = 0;        for (int j = 0; j &lt; 20; j++)        {            BOOL contains = NO;            for (int k = 0; k &lt; 3; k++)            {                if (icosahedronFaces[(j * 3) + k] == i)                    contains = YES;            }            if (contains)            {                faceCount++;                normals[i] = Vector3DAdd(normals[i], surfaceNormals[j]);            }        }        normals[i].x /= (GLfloat)faceCount;        normals[i].y /= (GLfloat)faceCount;        normals[i].z /= (GLfloat)faceCount;        [result appendFormat:@""\t{%f, %f, %f},\n"", normals[i].x, normals[i].y, normals[i].z];    }    [result appendString:@""};\n""];    NSLog(result);    [pool drain];    return 0;}</code></pre><p>Can some one point me to Java code that does the same thing as above? I would also need to modify it so that it works not just for isohadron but for any vertex array with associated index array.</p>","574122","","19679","","2011-02-17 19:31:29","2011-02-17 19:31:29","Code for finding the vertex normals in Java?","<java><android><objective-c><opengl-es>","1","1","","",""
"4983790","1","4985014","","2011-02-13 11:11:42","0","181","<p>hi i have installed the Java eclipse in my system according to the instructions given in <a href=""http://developer.android.com"" rel=""nofollow"">http://developer.android.com</a>. After the installation when i was to develop my new project the build target space seems to be empty. One of my friend instructed me to go to windows->Preferences->Android and in the SDK location i have entered the dir where sdk is been loaded (ie in my pc D:\Program Files\android-sdk-windows), but then also no change pls help me to clear my issue...</p>","596364","","53897","","2011-02-13 11:43:05","2011-02-13 15:32:51","Error in installing Android Eclipse","<java><android><eclipse><sdk>","2","1","","",""
"4983910","1","5047218","","2011-02-13 11:43:55","2","7237","<p>I want to hide bar and only want to show thumb. I did it with max-height=0dip but it did not completely work. I also want to set text on thumb and create thumb with multiple images. For example thumb which i button like image and has text and this button has tail downword, which increases with row increment.</p>","532774","","","","","2012-03-16 06:21:25","Android SeekBar thumb Customization","<android><progress-bar><seekbar><thumb>","2","0","1","",""
"4983926","1","","","2011-02-13 11:47:34","1","1174","<p>i have made images for an mdpi phone in android. i want to resize those images for hdpi and ldpi screens.what is the conversion factor for the dimesions? i have heard that we multiply the height and width of the mdpi image by 1.5 to convert it to a hdpi screen.what is the accurate conversion factor- for both mdpi to hpdi and mdpi to ldpi?thank you in advance.</p>","590849","","","","","2011-02-13 12:02:59","resource size for different densities in android","<android><multiscreen>","1","0","1","",""
"4983933","1","","","2011-02-13 11:49:35","1","514","<p>I have an android app that reads some classes from external JARs at runtime. I am using the PathClassLoader.</p><p>I'm getting an instantiation exception with classes in JARs that depend on things in other JARs. In Android I can't find any way to add multiple sources for a classloader that works, nor does chaining the classloaders together as child and parent seem to work.</p><p>I could move all the classes into one JAR for my deployment, or maybe unpack all the classes at runtime, however it would be far better if I could find some more convenient and less 'brute force' way to solve this.</p><p>Thanks in advance for any info.</p>","","user595447","","user595447","2011-02-14 07:33:36","2011-06-02 16:18:36","JAR interdependencies in Android","<android><jar><dependencies><runtime><classloader>","1","0","","",""
"4983959","1","4984017","","2011-02-13 11:55:55","0","786","<p>I have a texture. It is JPEG file, with a red RGB(255,0,0) background. What is the best way, to load this texture(or show) where my RGB(255,0,0) colors be TRANSPARENT?</p>","472537","","","","","2011-02-13 12:06:15","Android Opengl ES transparent a color on a texture","<android><opengl-es>","1","0","","",""
"4984033","1","4984460","","2011-02-13 12:10:11","0","912","<p>I am writing an Android storytelling app to create and edit stories with texts, pictures, sounds etc. So far I have one story, one database, one table, and everything works fine. Now I will move to multiple stories and I am thinking of whether to keep a single database with one table per story, or having multiple databases, or a combination of the two (like 10 tables per database). I will need to up/download stories to/from a storage service.</p>","577629","","","","","2011-02-13 13:43:25","Multiple tables or multiple dbs in Android app?","<android><database><table>","2","0","","",""
"4984036","1","","","2011-02-13 12:11:42","7","2126","<p>I have written an install receiver to determine when an app has been installed via the Market. However, I also want to pass the INSTALL_REFERRER broadcast onto other receivers such as the Google Analytics <code>AnalyticsReceiver</code> if it is installed within the app. Importantly, I do NOT know if other receivers are installed as my receiver will be used by other developers within their apps.</p><p>Currently, I receive the broadcast and when complete I call:</p><p><code>AnalyticsReceiver receiver = new AnalyticsReceiver();</code></p><p><code>receiver.onReceive(context, intent);</code></p><p>The issue is the <code>AnalyticsReceiver</code> class may not be present.</p><p><strong>So how do I pass on the broadcast if I'm not sure whether the app uses the <code>AnalyticsReceiver</code>?</strong></p><p>Or will Android itself make sure each receiver installed gets the broadcast?</p><p>Many thanks!</p>","605333","","172322","","2011-02-13 13:42:55","2011-11-30 18:43:56","Intercept INSTALL_REFERRER and then forward on to Google AnalyticsReceiver","<android><google-analytics><install><broadcastreceiver>","2","1","1","",""
"4984149","1","","","2011-02-13 12:32:38","0","205","<p>Using <code>openstreetmap</code>, <code>CLOUDEMADE</code> and <code>NUTITEQ</code>, how can I locate the position of my phone using a certain code thru the use of my phone?</p>","505797","","180538","","2011-02-13 12:37:05","2011-02-13 12:37:05","Locate the position of the phone using Android","<java><android><geolocation><location><openstreetmap>","0","3","","",""
"4984173","1","","","2011-02-13 12:39:39","0","550","<p>I'm a newbie to Android and I'm having some problems with the AsyncTask class. I have a lot of (over 100) check boxes which I want to select or deselect with a ""select all"" check box.Unfortunately this takes quite some time, noticeable for the user, so I want to use the ProgressDialog to show that the selecting is in progress. </p><p>Now I know that updates of the UI elements are supposed to be done in the UI thread so I have the selecting code in the onProgressUpdate method but the ProgressDialog doesn't show up not until the processing (select or deselecting all checkboxes) is finished... </p><p>How is this supposed to be done? Is there any workaround or any other solution? I also tried to go through all the check boxes in the doInBackground() method but I get lots of weird errors (I guess it's because of the UI).</p><p>This is my code:</p><pre><code>customPref.setOnPreferenceChangeListener(new OnPreferenceChangeListener() {      @Override      public boolean onPreferenceChange(final Preference preference, final Object object) {          new CbSelection().execute(preference);          return true;      }});private class CbSelection extends AsyncTask&lt;Preference, Boolean, Void&gt; {             private ProgressDialog Dialog = new ProgressDialog(Preferences.this);          @Override          protected void onPreExecute() {                 Dialog.setMessage(""Please wait..."");               Dialog.setCanceledOnTouchOutside(true);              Dialog.setCancelable(true);              Dialog.show();             }             @Override          protected Void doInBackground(Preference... pref) {                 PreferenceScreen screen = (PreferenceScreen)getPreferenceScreen().getRootAdapter().getItem(2);              Preference preference = pref[0];              if(preference.getKey().compareTo(""select_all"") == 0){                  publishProgress(true);              }               return null;           }             @Override          protected void onProgressUpdate(Boolean... ok) {              if(ok[0]== true) {                  PreferenceScreen screen = (PreferenceScreen)getPreferenceScreen().getRootAdapter().getItem(2);                  for(int i = 0; i &lt; screen.getPreferenceCount(); ++i) {                      //Dialog.show();                       /* select or deselect all checkboxes here... */                  }              }          }          @Override          protected void onPostExecute(Void v) {                 Dialog.cancel();           }   } </code></pre>","615031","","","","","2011-02-13 12:56:37","Android ProgressDialog while selecting and deselecting checkboxes using AsyncTask","<android><android-asynctask><progressdialog>","1","0","","",""
"4984214","1","5418335","","2011-02-13 12:49:45","6","6107","<p>I show dialog of checkboxes (list retrieved from DB) to allow user select, which rows remove. Because android dialog caching, I need to refresh count and names of checkboxes.In my onCreateDialog:</p><pre><code>dialog =  new AlertDialog.Builder( this )       .setTitle( ""Remove Items"" )       .setMultiChoiceItems( items, _selections, new OnMultiChoiceClickListener(){public void onClick (DialogInterface dialog, int which, boolean isChecked){}} )       .setPositiveButton(""Smazat"", new DialogInterface.OnClickListener() {        public void onClick(DialogInterface dialog, int id) {             dialog.dismiss();             deleteRow(_selections);            } })        .setNegativeButton(""Storno"", new DialogInterface.OnClickListener() {        public void onClick(DialogInterface dialog, int id) {             dialog.dismiss();             } })       .create();</code></pre><p>How refresh values (items,_selections) in onPrepareDialog?I tried invalidate views, hoping that force android to load items againg(dont work neither), but I think its bad choice as well as removing dialog and recreating.</p><pre><code>protected void onPrepareDialog(final int id, final Dialog dialog) {          switch (id) {          case REMOVE_DIALOG_ID:              ListView lv = ((AlertDialog) dialog).getListView();                lv.invalidateViews();          break;          }</code></pre><p>Thanks for any ideas!</p>","581567","","","","","2012-01-05 09:38:42","How actualize setMultiChoiceItems items values in onPrepareDialog?","<android><dialog>","4","0","2","",""
"4984308","1","4984334","","2011-02-13 13:09:12","4","3144","<p>I'm currently programming very simple game for Android (API level 7) to discover and learn the android SDK. This game involve drawing shape on the screen that will change colour when touched.</p><p>Some shapes may embed one or several holes. My issue is : if I touch the shape, the whole thing's colour change, even the holes'. Here is the pseudo code I use, shape is the polygon I want to draw, boundary it's outer boundary, holes an array of its holes. Hole and boundary hold an array of their points.</p><pre><code>Path MyPath = Path();Path.moveTo(boundary.points[0].x, boundary.point[0].x);for (point in boundary) {  MyPath.lineTo(point.x, point.y);}Path.close();for (hole in shape.holes) {  MyPath.moveTo(hole.points[0].x,hole.points[0].y);  for (point in hole) {    MyPath.lineTo(point.x, point.y);  }  MyPath.close();}// setting Paint here...canvas.drawPath(MyPath, MyPaint);</code></pre><p>Is their something I'm missing regarding Path in Android or do you have some alternative way to do it?</p>","110742","","244296","","2011-02-13 13:13:57","2011-02-13 13:16:17","How fill an Android Path that contain holes without filling the holes?","<android><graphics>","1","0","0","",""
"4984313","1","5309871","","2011-02-13 13:10:31","97","46467","<p>I tried to use marginBottom on the listView to make space between listView Item, but still the items are attached together.</p><p>is it even possible? if yes, is there a specific way to do it?</p><p>my code is below</p><pre><code>&lt;LinearLayoutandroid:id=""@+id/alarm_occurences""android:layout_width=""fill_parent"" android:orientation=""vertical""android:layout_height=""fill_parent""android:background=""#EEEEFF""xmlns:android=""http://schemas.android.com/apk/res/android""&gt;&lt;ListViewandroid:id=""@+id/occurences""android:layout_width=""fill_parent""android:layout_height=""fill_parent""/&gt;&lt;/LinearLayout&gt;</code></pre><p>My custom List item:</p><pre><code>&lt;com.android.alarm.listItems.AlarmListItemxmlns:android=""http://schemas.android.com/apk/res/android""android:orientation=""vertical""android:layout_width=""fill_parent""android:layout_height=""fill_parent"" android:background=""@drawable/alarm_item_background""android:layout_marginBottom=""10dp""    &gt;&lt;CheckedTextView         android:id=""@android:id/text1""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:gravity=""center_vertical""    android:checkMark=""?android:attr/listChoiceIndicatorMultiple""    android:textSize=""20sp""    android:textStyle=""bold""    android:typeface=""serif""    android:padding=""10dp""/&gt;&lt;/com.android.alarm.listItems.AlarmListItem&gt;</code></pre><p>how can I make spacing between list items in this case?</p><p>Thanks in advance.</p>","341191","","341191","","2011-02-13 13:25:25","2014-02-03 12:59:21","Spacing between listView Items Android","<android><listview><listviewitem>","9","1","31","",""
"4984373","1","4984402","","2011-02-13 13:24:16","0","210","<p>I'm developing an ebook app for Android. when the text length given in string.xml is very large (around 500 words) it is not shown in the text view. </p><p>It took a while for me to figure this out. I have two text views and one is working propoerly as it is a small paragragh with 100 words but the secound TextView is larger and when the event is triggered it shows an empty screen.</p><p>Any char limitation in TextView?? wot would be the alternative?? Please help me.</p><p>Thanks in advance.</p>","348301","","","","","2012-09-13 10:45:38","TextView doesn't show text","<java><android><mobile><textview>","1","1","","",""
"4984473","1","","","2011-02-13 13:45:54","2","4112","<p>Ive had a look at the following sample code: <a href=""http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/app/VoiceRecognition.html"" rel=""nofollow"">http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/app/VoiceRecognition.html</a></p><p>But i cant get it to run on the emulator. Is the layout.xml avaible for this file? Do i need to install another app in order for this one to work? All i want is a simple demo that prints out the words that the app have recognized. Thanks</p>","597192","","432209","","2011-02-13 13:54:13","2012-05-15 06:36:57","Android: Speech to text?","<android><sample>","3","2","","",""
"4984493","1","4984575","","2011-02-13 13:51:08","1","997","<p>I have a application with a WebView, most of the time it stays portrait mode, but but certain time, I want to force to landscape mode, for example, for image display. How should I do this?</p>","428024","","","","","2011-02-13 14:08:10","Initiate a WebView rotation on Android","<android>","1","0","","",""
"4984499","1","4984605","","2011-02-13 13:51:43","0","2142","<p>Im having some problems with an IllegalStateException. I have a function that creates removes all the views from a LinearLayout and recreates and re-adds them. One of these TextViews must be static so that it can interface with a custom view I have created. When that TextView is added to the layout for the second time, the program throws the IllegalStateException. After stepping through the program a bit, It seems that the parent LinearLayout has removed the view from its children, but the TextView itself still ""thinks"" that it has a parent. Here is my code: (Only the important bits)</p><pre><code> public static TextView latchingText; private LinearLayout layout; private void recreateLayout(){      layout.removeView(latchingText);      layout.addView(latchingtext); }</code></pre><p>Does anyone have any clue whats going on?</p><p>EDIT:Here is the Log:</p><pre><code>02-13 09:04:41.012: ERROR/AndroidRuntime(10489): FATAL EXCEPTION: main02-13 09:04:41.012: ERROR/AndroidRuntime(10489): java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first.02-13 09:04:41.012: ERROR/AndroidRuntime(10489):     at android.view.ViewGroup.addViewInner(ViewGroup.java:2012)02-13 09:04:41.012: ERROR/AndroidRuntime(10489):     at android.view.ViewGroup.addView(ViewGroup.java:1907)02-13 09:04:41.012: ERROR/AndroidRuntime(10489):     at android.view.ViewGroup.addView(ViewGroup.java:1864)02-13 09:04:41.012: ERROR/AndroidRuntime(10489):     at android.view.ViewGroup.addView(ViewGroup.java:1844)02-13 09:04:41.012: ERROR/AndroidRuntime(10489):     at android.PhysicsEngine.Diagram.createTraceLayout(Diagram.java:357)02-13 09:04:41.012: ERROR/AndroidRuntime(10489):     at android.PhysicsEngine.Diagram.access$3(Diagram.java:173)02-13 09:04:41.012: ERROR/AndroidRuntime(10489):     at android.PhysicsEngine.Diagram$2.onClick(Diagram.java:270)02-13 09:04:41.012: ERROR/AndroidRuntime(10489):     at android.view.View.performClick(View.java:2405)02-13 09:04:41.012: ERROR/AndroidRuntime(10489):     at android.view.View$PerformClick.run(View.java:8813)02-13 09:04:41.012: ERROR/AndroidRuntime(10489):     at android.os.Handler.handleCallback(Handler.java:587)02-13 09:04:41.012: ERROR/AndroidRuntime(10489):     at android.os.Handler.dispatchMessage(Handler.java:92)02-13 09:04:41.012: ERROR/AndroidRuntime(10489):     at android.os.Looper.loop(Looper.java:123)02-13 09:04:41.012: ERROR/AndroidRuntime(10489):     at android.app.ActivityThread.main(ActivityThread.java:4627)02-13 09:04:41.012: ERROR/AndroidRuntime(10489):     at java.lang.reflect.Method.invokeNative(Native Method)02-13 09:04:41.012: ERROR/AndroidRuntime(10489):     at java.lang.reflect.Method.invoke(Method.java:521)02-13 09:04:41.012: ERROR/AndroidRuntime(10489):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)02-13 09:04:41.012: ERROR/AndroidRuntime(10489):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)02-13 09:04:41.012: ERROR/AndroidRuntime(10489):     at dalvik.system.NativeStart.main(Native Method)</code></pre>","583082","","71034","","2011-02-13 14:09:59","2011-02-13 14:21:10","IllegalStateException In Android","<android><static><view><illegalstateexception>","1","6","","",""
"4984500","1","4985024","","2011-02-13 13:52:01","0","611","<p>I'm a little confused of the handling between the java Date Class and GregorianCalendar in Android (2.1).In this example, the year, month, day, hour, minute values are coming from Date and Time pickers.</p><pre><code>Date date = new Date(year, month, day, hour, minute);GregorianCalendar senddate = new GregorianCalendar(year, month, day, hour, minute);Log.v(LOG_TAG, senddate.getTimeInMillis() + """");Log.v(LOG_TAG, date.getTime() + """");</code></pre><p>output from the logging:</p><pre><code>129760434000061255744740000</code></pre><p>why is the date object so far off. what did i miss?</p><p><strong>edit:</strong></p><p>I ran my sample code again.  </p><blockquote>  <p>1297609440000<br>  61255749840000<br>  2011 - 1 - 13 - 16 - 4 (year - month - dayofmonth - hour - minute)</p></blockquote><p>getting the values from:</p><pre><code>int month = dpDate.getMonth();int day = dpDate.getDayOfMonth();int year = dpDate.getYear();int hour = dpTime.getCurrentHour();int minute = dpTime.getCurrentMinute();</code></pre>","190439","","115145","","2011-02-13 15:35:21","2011-02-13 15:35:21","Date and GregorianCalendar millisecond handling","<java><android><date>","1","1","","",""
"4984529","1","7329204","","2011-02-13 13:59:31","3","1616","<p>I have a project requirement which requires android to be always powered on with service running in background. While I can handle service part, as from 2.2 by using START_STICKY, still there is no way I can guarantee the device always is on. Or at-least if connected to power-supply should boot automatically, if switched off.</p><p>Is there any solution for this in real world ? Except for going to  make a new firmware, I need some ideas or a workaround.Thanks.</p><p>UPDATE: I thought to be better more clear. In my case I am not using android as a mobile and there will be no user. Its use is like an hardware equipment running android which once installed with my app, no one has access to it. And is always connected to power supply and internet. Also user will have access to its power-supply controls.</p><p>I agree it cannot be done from inside application or using Android APIs. But this is a real world problem, and I desperately need a solution on this. Any thing even not related to programming, may be mechanical or anything.</p>","315619","","315619","","2011-02-13 14:46:03","2012-12-19 09:21:48","How to ensure android is always powered on?","<android><boot><autostart>","5","0","1","",""
"4984536","1","","","2011-02-13 14:00:05","0","5874","<p>How can I use android the SIP API?Can anyone give an example of that please?</p>","595067","","180538","","2011-02-13 14:34:26","2012-03-07 04:35:03","I want to use android SIP API","<android><sip>","4","0","1","",""
"4984634","1","9345080","","2011-02-13 14:20:12","0","605","<p>When setting a service to go off at particular time, I use the AlarmManager system service.Everything goes off without a problem, service is called and actions take place.</p><p>When the alarm time is reached, the service starts, and at this point I get the system time (System.currentTimeMillis()). I'm guessing this wont be the actual time the service start. Is there a way to get the time that was set for this PendingIntent?</p><p>ie  </p><blockquote>  <p>Set alarm for 9am.<br>  DoStuffService starts at 9am.<br>  DoStuffService knows it was supposed to start at 9am, and uses this value for future functions.   </p></blockquote>","190439","","","","","2012-02-18 23:18:58","pendingintent on alarms for android","<android><alarm><android-pendingintent>","2","0","","",""
"4984681","1","","","2011-02-13 14:29:12","4","3433","<p>As stated in the Android Dev Guide, if you want a widget to update more often you should use the <code>AlarmManager</code> to set alarms that do not wake the device.</p><p>In principle: do not use the standard mechanisms provided by the <code>AppWidgetProvider</code> class and its easy set up with android:updatePeriodMillis in the xml file.</p><p>I am sorry to ask, but the guide just states ""use AlarmManager, use <code>RTC</code> or <code>ELAPSED_REALTIME</code>, ..."" but HOW EXACTLY do I send an intent to just update my widget is missing!!!</p><p>Could anybody please state the code I need to form the <code>PendingIntent</code> that mimics the default behaviour? I don't have a clue how to get the widget ids, which action I should use and so on... Sad the dev guide stops explaining at that point!What is needed as extras to which action?</p><p>In case somebody is interested why I want to update more frequently than 30 minutes: my widget shows when the next bus departs at a station. There is a bus every 20 minutes, so I got two options: update the widget every minute, displaying the departure time of the next bus (that's what I want!!) or, not that good, state the departure time of the next bus so I will have to update at least every 20 minutes!</p><p>Now: when the device is asleep, of course, this should never wake it up - so my understanding of this section in the dev guide is that this is the correct way to implement it; anybody thinks I'm wrong?Oh, another thing I would like to find out: if the device is asleep when the widget should be updated and my alarm is not issued due to the sleeping device, will it be updated IMMEDIATELY when it wakes up???</p><p>Thanks for your help!!</p><p>PS: I really wonder why the xml definition of a widget provider does not allow to simply state ""don't wake the device"" by a boolean switch... that would make life so much easier in the first place! What kind of a widget needs to wake device anyhow??? ;-)</p><p>This is how far I came up to now, but it does not work - nothing happens:</p><pre><code>private void startAlarm(Context pContext) {    Log.d(TAG, ""startAlarm"");    AlarmManager am = (AlarmManager) pContext.getSystemService(Context.ALARM_SERVICE);    Intent intent = new Intent(""android.appwidget.action.APPWIDGET_UPDATE"");    intent.setClass(pContext, getClass());    PendingIntent pi = PendingIntent.getBroadcast(pContext, 0, intent, PendingIntent.FLAG_CANCEL_CURRENT);    am.set(AlarmManager.ELAPSED_REALTIME, SystemClock.elapsedRealtime() + 1000, pi);}</code></pre>","273456","","273456","","2011-02-13 14:38:18","2012-06-20 22:35:47","Using AlarmManager to update widgets manually","<android><widget><android-intent><alarmmanager><android-pendingintent>","2","0","2","",""
"4984802","1","4998295","","2011-02-13 14:56:33","2","672","<p>I am developing an android game and I would like to implement a method that onTouchEvent follows the finger of the user and along that path draws a line.</p><p>There is an example on the SDK, though it is using Canvas. How can I do the same on OpenGL-ES?</p><p>Thanks :)</p>","615124","","","","","2012-08-23 18:59:43","FingerPaint on Android and OpenGL-ES","<android><opengl-es><ontouchevent>","2","0","1","",""
"4984860","1","4984967","","2011-02-13 15:06:23","0","904","<p>is there a way I can show an image in my app, and detect when a certain part of it has been clicked; like you can do in HTML with an image map - defining areas of the image in co-ordinates?Thank you in advance for your help.</p>","355375","","1104926","","2011-12-19 13:43:03","2011-12-19 13:43:03","Android version of html image map","<android><html>","1","0","2","",""
"4984864","1","4984936","","2011-02-13 15:07:10","0","4636","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/1567601/android-ftp-library"">Android FTP Library</a>  </p></blockquote><p>hi, How can we implement an FTP client in android? as i want to upload image file from my android application using FTP </p>","508377","","","","","2011-02-13 15:19:32","how to make FTP connection in in Android?","<android><ftp>","1","1","","2011-02-13 21:03:07",""
"4984868","1","","","2011-02-13 15:07:33","3","18664","<p>I did an SDK update last night and it moved adb.exe.  In its place it left a file called ""adb_has_moved.txt"" saying </p><blockquote>  <p>The adb tool has moved to platform-tools/</p>    <p>If you don't see this directory in your SDK, launch the SDK and AVD  Manager (execute the android tool) and install ""Android SDK Platform-tools""</p>    <p>Please also update your PATH environment variable to include the  platform-tools/ directory, so you can execute adb from any location.</p></blockquote><p>So I did all that, including the PATH and now I can start adb.exe from any DOS prompt.   But I <strong>still</strong> can't start it from Eclipse (Galileo 3.52).   When I try it says </p><blockquote>  <p>Location of the Android SDK has not been set up in the preferences</p></blockquote><p>... which is not true.   The SDK IS set up in Preferences.  The real problem is at the top of the Preferences window where it says ""<em>Could not find C:\SDK\android-sdk-windows\ <strong>tools</strong> \adb.exe!</em>""    ...No kidding  -  the update moved it to C:\SDK\android-sdk-windows\ <strong>platform-tools</strong>.    Because it's specifying a specific (wrong) path Eclipse is bypassing the PATH variable.  So how do I get Eclipse to look in the right place?</p>","424690","","","","","2012-12-08 20:04:27","Android ADB has moved and Eclipse is looking in the old place","<android>","2","0","1","",""
"4984944","1","","","2011-02-13 15:20:39","0","420","<p>I'm in the middle of an android app that need to check whether the device is connected to another system or pendrive through usb and if it is connected i need to send a copy of my database file through usb port. This sis for backing up my database. I have no idea how to prompt for usb connections. I searched the net. But no results!.Can anyone please help. Because i'm stuck here at my project.</p><p>Thanks in advance.</p>","615154","","","","","2011-02-13 15:32:42","Android-USB Connectivity","<android>","1","0","","",""
"4984951","1","4984991","","2011-02-13 15:21:32","0","5201","<p>I would like to develop an application which runs as a <strong>background service</strong>. Once it gets installed, it can be controlled <strong>remotely</strong> by <strong>control messages</strong>. I don't want the application to be shown on the menu or the task list. Any help is appreciated. Any alternate ideas are appreciated as well.. Thank you.</p>","527053","","","","","2011-02-13 15:33:09","Android: How to make application invisible to task managers and in the menu","<android><hidden>","2","0","","",""
"4984958","1","4992011","","2011-02-13 15:22:59","1","456","<p>I want to use GeoCoder class in my app. I followed the steps as in this question</p><p><a href=""http://stackoverflow.com/questions/3574644/how-can-i-find-latitude-and-longitude-using-address/3574792#3574792"">How can I find the latitude and longitude from address?</a></p><p>but received the error: <code>java.io.IOException</code> in the emulator, despite I included the required permissions.</p><p>I'm using Google APIs 2.3.1 API level 9.</p><p>Is there a solution for this ?</p>","235123","","469983","","2012-09-24 14:07:30","2012-09-24 14:07:30","Android Geocode error:java.io.IOException on emulator, SDK 2.3","<android>","1","0","","",""
"4985002","1","4985033","","2011-02-13 15:31:33","1","6348","<p>hey,i'm new to android and i'm trying to code an app which fetches json data off the web, creates a list. if you click on a list item a new activity starts which shows the details of the activity. however i cant seem to start the second activty, i keep getting the error ""The method startActivityForResult(Intent, int) is undefined for the type new AdapterView.OnItemClickListener(){}"" in eclipse. here is the full source.any ideas?</p><pre><code>public class Main extends Activity {    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        new LongOperation(this).execute();    }    public boolean onCreateOptionsMenu(Menu menu) {        MenuInflater inflater = getMenuInflater();        inflater.inflate(R.menu.menu, menu);        return true;    }    @Override    public boolean onOptionsItemSelected(MenuItem item) {        new LongOperation(this).execute();        return true;    }}class LongOperation extends AsyncTask&lt;String, Void, String&gt; {    private Main longOperationContext = null;    ProgressDialog pd = null;    TextView tv = null;    ListView lv1 = null;    String [] lv_arr;    String [] lv_arr_id;    private static final int ACTIVITY_CREATE = 0;    public LongOperation(Main context) {        longOperationContext = context;        Log.v(""LongOper"", ""Konstuktor"");    }    @Override    protected String doInBackground(String... params) {        Log.v(""doInBackground"", ""inside"");        try {            URL json = new URL(""http://www.ytmusicplayer.com/jsontest.php"");            URLConnection tc = json.openConnection();            BufferedReader in = new BufferedReader(new InputStreamReader(tc.getInputStream()));            String line;            while ((line = in.readLine()) != null) {                    JSONArray ja = new JSONArray(line);                    Log.v(""line = "", "" "" + ja.length());                    lv_arr = new String[ja.length()];                    lv_arr_id = new String[ja.length()];                    for (int i=0;i&lt;ja.length();i++) {                        JSONObject jo = (JSONObject) ja.get(i);                        lv_arr[i] = jo.getString(""name"");                        lv_arr_id[i] = jo.getString(""id"");                    }            }        } catch (MalformedURLException e) {            e.printStackTrace();            Log.v(""Error"", ""URL exc"");        } catch (IOException e) {            e.printStackTrace();            Log.v(""ERROR"", ""IOEXECPTOIn"");        } catch (JSONException e) {            e.printStackTrace();            Log.v(""Error"", ""JsonException"");        }        Log.v(""Line: "", lv_arr[0] + "" - "" + lv_arr[1]);        return null;    }    @Override    protected void onPostExecute(String result) {        lv1.setAdapter(new ArrayAdapter&lt;String&gt;(longOperationContext,android.R.layout.simple_list_item_1 , lv_arr));        lv1.setTextFilterEnabled(true);        lv1.setOnItemClickListener(new OnItemClickListener() {                @Override                public void onItemClick(AdapterView&lt;?&gt; a, View v, int position, long id) {                        Intent i = new Intent(longOperationContext, Details.class);                        i.putExtra(""id"", lv_arr_id[position]);                        startActivityForResult(i, ACTIVITY_CREATE);                }        });        pd.hide();    }    protected void onPreExecute() {        lv1 = (ListView)longOperationContext.findViewById(R.id.ListView01);        pd = new ProgressDialog(longOperationContext);        pd.setProgressStyle(ProgressDialog.STYLE_SPINNER);        pd.setMessage(""Loading..."");        pd.setIndeterminate(true);        pd.setCancelable(false);        pd.show();    }    @Override    protected void onProgressUpdate(Void... values) {    }}</code></pre><p>thanks in advance</p>","563020","","","","","2011-02-13 15:42:18","The method startActivityForResult(Intent, int) is undefined for the type new AdapterView.OnItemClickListener","<android><listview><activity><android-intent><android-asynctask>","1","0","","",""
"4985115","1","4985134","","2011-02-13 15:48:09","0","82","<p>I have starting learning Java and android application development side-by-side. Currently, I a String-array colorsArray which I am trying to print using Log.v</p><pre><code>    &lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;resources&gt;    &lt;string name=""hello""&gt;Hello World, defaultActivity!&lt;/string&gt;    &lt;string name=""app_name""&gt;Challenge&lt;/string&gt;    &lt;string name=""red""&gt;Red&lt;/string&gt;      &lt;string name=""orange""&gt;Orange&lt;/string&gt;      &lt;string name=""yellow""&gt;Yellow&lt;/string&gt;      &lt;string name=""green""&gt;Green&lt;/string&gt;      &lt;string name=""blue""&gt;Blue&lt;/string&gt;      &lt;string name=""indigo""&gt;Indigo&lt;/string&gt;      &lt;string name=""violet""&gt;Violet&lt;/string&gt;      &lt;string-array name=""colorsArray""&gt;          &lt;item&gt;@string/red&lt;/item&gt;          &lt;item&gt;@string/orange&lt;/item&gt;          &lt;item&gt;@string/yellow&lt;/item&gt;          &lt;item&gt;@string/green&lt;/item&gt;          &lt;item&gt;@string/blue&lt;/item&gt;          &lt;item&gt;@string/indigo&lt;/item&gt;          &lt;item&gt;@string/violet&lt;/item&gt;      &lt;/string-array&gt;  &lt;/resources&gt;</code></pre><p>Now I am trying to print that array in different ways, just for practice.</p><pre><code>package com.gaurish.challenge;import android.app.Activity;import android.os.Bundle;import android.util.Log;public class defaultActivity extends Activity {    /** Called when the activity is first created. */    public static final String DEBUG_TAG = ""PracticeApp"";@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    String aColors[] = getResources().getStringArray(R.array.colorsArray);    printUsingForEach(aColors);    printUsingWhile(aColors);    printReverse(aColors);}private void printUsingForEach(String[] aColors) {    for(String i : aColors) {        Log.v(DEBUG_TAG, ""String array printed using for each loop: "" + i);    }}private void printUsingWhile(String[] aColors) {    byte i=0;    while(i&lt;=aColors.length) {        Log.v(DEBUG_TAG, ""String array printed using While loop: "" + aColors[i++]);    }}private void printReverse(String[] aColors) {    int i=aColors.length -1;    while(i&gt; (-1) ) {        Log.v(DEBUG_TAG, ""String array printed in reverse order -&gt; "" + aColors[i--]);    }}}</code></pre><p>printUsingForEach() &amp; printUsingWhile() run just fine but printReverse method just not run, the application force quits before reaching. <a href=""https://gist.github.com/824787"" rel=""nofollow"">here is the log</a> I am building against android 1.6</p><p>Please guide this n00b, why this is happening</p>","367985","","244296","","2011-02-13 16:22:42","2011-02-13 16:22:42","Why this code Force Quits?","<java><android>","1","2","","",""
"4985512","1","4985945","","2011-02-13 17:01:11","0","2484","<p>I've got inflating vertical linear layout in my gridView.When I display only the vertical layout element, there's no space between the two images of my layout.</p><p>But when I display the grid, there's a spacing between two grid lines and between my two images (verticaly) in each grid box.</p><p>How can I remove these spaces ?</p><h2>Here is my main layout wich contains my grid :</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_height=""wrap_content""     android:layout_width=""wrap_content"" android:layout_gravity=""center""&gt;&lt;GridView android:id=""@+id/GridView01""     android:verticalSpacing=""0px""     android:layout_height=""wrap_content""     android:layout_width=""wrap_content""     android:numColumns=""3""     android:horizontalSpacing=""0px""     android:stretchMode=""none""     android:columnWidth=""90px""&gt;&lt;/GridView&gt;&lt;/LinearLayout&gt;</code></pre><hr><h2>Here is my vertical layout of each elements grid :</h2><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout android:id=""@+id/LayoutP""  xmlns:android=""http://schemas.android.com/apk/res/android""  android:orientation=""vertical""   android:layout_width=""wrap_content""   android:layout_height=""wrap_content""&gt;  &lt;ImageView android:id=""@+id/ImageView01""     android:layout_width=""wrap_content""     android:layout_height=""wrap_content""     android:src=""@drawable/greyr""&gt;&lt;/ImageView&gt;  &lt;ImageView android:id=""@+id/ImageView02""   android:layout_width=""wrap_content""   android:layout_height=""wrap_content""   android:src=""@drawable/greyp""&gt;&lt;/ImageView&gt;&lt;/LinearLayout&gt;</code></pre><hr><p>Thanks in advanced.</p>","348175","","","","","2012-12-12 12:38:52","How to remove blank between two gridView lines","<android><gridview><spaces><android-linearlayout>","1","2","0","",""
"4985518","1","4985537","","2011-02-13 17:03:03","0","161","<p>I am trying to pass two variables from one screen to another. From the previous screeen you click a button, 1 or 2 and it passes that value on. It also passes the value 2 as the correct value. I know they are both working as I output each variable on the next screen. Here is the code. It always outputs wrong though.</p><pre><code>Intent i = getIntent();Bundle b = i.getExtras();String newText = b.getString(""PICKED"");String correct = b.getString(""CORRECT"");TextView titles = (TextView)findViewById(R.id.TextView01);if(newText == correct){titles.setText(""Correct"" + newText + "" "" + correct + """");}else{    titles.setText(""Wrong"" + newText + "" "" + correct + """");}</code></pre>","614460","","","","","2011-02-13 17:10:09","Simple If Statement","<android><comparison><instance>","3","1","","",""
"4985529","1","4985857","","2011-02-13 17:05:11","6","2300","<p>I am using Eclipse to write and debug an Android application. One of the things I need to do is to update the location of the device, and so I have tried to use the Location Controls panel in the Emulator control window. On the Manual tab, I select Decimal, enter a valid latitude and longitude, and then click Send.</p><p>Unfortunately, what happens next is that the emulator crashes (logcat output below). Is this a known issue, and if so, is there a workaround? Thanks for any help, Martin</p><pre><code>02-13 08:54:23.128: INFO/DEBUG(30): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***02-13 08:54:23.128: INFO/DEBUG(30): Build fingerprint: 'generic/sdk/generic:2.3.3/GRI34/101070:eng/test-keys'02-13 08:54:23.138: INFO/DEBUG(30): pid: 74, tid: 219  &gt;&gt;&gt; system_server &lt;&lt;&lt;02-13 08:54:23.138: INFO/DEBUG(30): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0000000002-13 08:54:23.138: INFO/DEBUG(30):  r0 00000000  r1 4081c038  r2 41ae0114  r3 473d9c7402-13 08:54:23.148: INFO/DEBUG(30):  r4 0000012e  r5 00000000  r6 4081c038  r7 41ae011402-13 08:54:23.148: INFO/DEBUG(30):  r8 80701321  r9 80702240  10 00100000  fp 0000000102-13 08:54:23.158: INFO/DEBUG(30):  ip ae20e7ec  sp 473d9c60  lr ae20acd7  pc ae207dfe  cpsr 0000003002-13 08:54:23.358: DEBUG/dalvikvm(258): GC_EXPLICIT freed 352K, 56% free 2969K/6727K, external 1625K/2137K, paused 126ms02-13 08:54:23.748: INFO/DEBUG(30):          #00  pc 00007dfe  /system/lib/libandroid_servers.so02-13 08:54:23.748: INFO/DEBUG(30):          #01  pc 0000acd2  /system/lib/libandroid_servers.so02-13 08:54:23.758: INFO/DEBUG(30):          #02  pc 000012ca  /system/lib/hw/gps.goldfish.so02-13 08:54:23.768: INFO/DEBUG(30):          #03  pc 000014ae  /system/lib/hw/gps.goldfish.so02-13 08:54:23.768: INFO/DEBUG(30):          #04  pc 00011a7c  /system/lib/libc.so02-13 08:54:23.778: INFO/DEBUG(30):          #05  pc 00011640  /system/lib/libc.so02-13 08:54:23.788: INFO/DEBUG(30): code around pc:02-13 08:54:23.788: INFO/DEBUG(30): ae207ddc ab04b082 9301cb04 6f646804 b00247a0 02-13 08:54:23.799: INFO/DEBUG(30): ae207dec bc08bc10 4718b002 b510b40c ab04b082 02-13 08:54:23.799: INFO/DEBUG(30): ae207dfc 6804cb04 34f89301 47a06824 bc10b002 02-13 08:54:23.808: INFO/DEBUG(30): ae207e0c b002bc08 46c04718 b510b40c ab04b082 02-13 08:54:23.818: INFO/DEBUG(30): ae207e1c 9301cb04 34986804 47a06824 bc10b002 02-13 08:54:23.818: INFO/DEBUG(30): code around lr:02-13 08:54:23.818: INFO/DEBUG(30): ae20acb4 91099008 f7fb6aa0 900aeab6 1c3a910b 02-13 08:54:23.830: INFO/DEBUG(30): ae20acc4 6b646b23 930c1c28 1c31940d f7fd9b0f 02-13 08:54:23.838: INFO/DEBUG(30): ae20acd4 4906f88f 44791c28 f7ff3150 b011fe1d 02-13 08:54:23.838: INFO/DEBUG(30): ae20ace4 46c0bdf0 000043cc 00004148 00000786 02-13 08:54:23.848: INFO/DEBUG(30): ae20acf4 f7fbb510 bd10ec24 4802b510 f7fb4478 02-13 08:54:23.848: INFO/DEBUG(30): stack:02-13 08:54:23.858: INFO/DEBUG(30):     473d9c20  d97f62b7  02-13 08:54:23.858: INFO/DEBUG(30):     473d9c24  40c7d685  02-13 08:54:23.868: INFO/DEBUG(30):     473d9c28  0000000a  02-13 08:54:23.868: INFO/DEBUG(30):     473d9c2c  00000000  02-13 08:54:23.878: INFO/DEBUG(30):     473d9c30  0000ab90  [heap]02-13 08:54:23.878: INFO/DEBUG(30):     473d9c34  80048c1b  /system/lib/libdvm.so02-13 08:54:23.888: INFO/DEBUG(30):     473d9c38  0000ab90  [heap]02-13 08:54:23.888: INFO/DEBUG(30):     473d9c3c  473d9c6c  02-13 08:54:23.888: INFO/DEBUG(30):     473d9c40  00010004  [heap]02-13 08:54:23.898: INFO/DEBUG(30):     473d9c44  80037667  /system/lib/libdvm.so02-13 08:54:23.898: INFO/DEBUG(30):     473d9c48  00000000  02-13 08:54:23.898: INFO/DEBUG(30):     473d9c4c  afd0dcc4  /system/lib/libc.so02-13 08:54:23.898: INFO/DEBUG(30):     473d9c50  00000000  02-13 08:54:23.898: INFO/DEBUG(30):     473d9c54  473d9e00  02-13 08:54:23.898: INFO/DEBUG(30):     473d9c58  df002777  02-13 08:54:23.908: INFO/DEBUG(30):     473d9c5c  e3a070ad  02-13 08:54:23.908: INFO/DEBUG(30): #00 473d9c60  00000001  02-13 08:54:23.908: INFO/DEBUG(30):     473d9c64  ad331275  /system/lib/libandroid_runtime.so02-13 08:54:23.908: INFO/DEBUG(30):     473d9c68  0000012e  02-13 08:54:23.918: INFO/DEBUG(30):     473d9c6c  ae20acd7  /system/lib/libandroid_servers.so02-13 08:54:23.918: INFO/DEBUG(30):     473d9c70  41ae0114  /dev/ashmem/dalvik-LinearAlloc (deleted)02-13 08:54:23.918: INFO/DEBUG(30):     473d9c74  00000003  02-13 08:54:23.928: INFO/DEBUG(30): #01 473d9c78  4284dfce  /data/dalvik-cache/system@framework@framework.jar@classes.dex02-13 08:54:23.928: INFO/DEBUG(30):     473d9c7c  4042b604  /dev/ashmem/dalvik-heap (deleted)02-13 08:54:23.928: INFO/DEBUG(30):     473d9c80  cffeb075  02-13 08:54:23.928: INFO/DEBUG(30):     473d9c84  c05e8561  02-13 08:54:23.928: INFO/DEBUG(30):     473d9c88  00000000  02-13 08:54:23.928: INFO/DEBUG(30):     473d9c8c  00000000  02-13 08:54:23.928: INFO/DEBUG(30):     473d9c90  00000000  02-13 08:54:23.928: INFO/DEBUG(30):     473d9c94  00000000  02-13 08:54:23.928: INFO/DEBUG(30):     473d9c98  00000000  02-13 08:54:23.928: INFO/DEBUG(30):     473d9c9c  00000000  02-13 08:54:23.928: INFO/DEBUG(30):     473d9ca0  00000000  02-13 08:54:23.928: INFO/DEBUG(30):     473d9ca4  00000000  02-13 08:54:23.928: INFO/DEBUG(30):     473d9ca8  1e088c00  02-13 08:54:23.928: INFO/DEBUG(30):     473d9cac  0000012e  02-13 08:54:23.928: INFO/DEBUG(30):     473d9cb0  473d9e56  02-13 08:54:23.928: INFO/DEBUG(30):     473d9cb4  00000003  02-13 08:54:23.928: INFO/DEBUG(30):     473d9cb8  0000000a  02-13 08:54:23.928: INFO/DEBUG(30):     473d9cbc  473d9de8  02-13 08:54:23.928: INFO/DEBUG(30):     473d9cc0  00000000  02-13 08:54:23.928: INFO/DEBUG(30):     473d9cc4  473d9e6c  02-13 08:54:23.928: INFO/DEBUG(30):     473d9cc8  00000001  02-13 08:54:23.928: INFO/DEBUG(30):     473d9ccc  807012cd  /system/lib/hw/gps.goldfish.so</code></pre>","304582","","2934866","","2014-01-09 06:16:27","2014-01-09 06:16:27","Android 2.3 emulator crashes when updating location","<android><crash><location><emulator>","1","1","2","",""
"4985553","1","","","2011-02-13 17:09:44","0","220","<p>I have a list of about 100 items. In each list item I need a framelayout with 2 relative layouts. When a button called ""Flip"" is clicked then one relative layout will flip out and the other relative layout will flip in. And each item has full width of the screen. So, I need to show the item in a horizontal scroll view. Now, I want to keep at most 3 items every moment. When user scrolls to the first item then we have to update the 3 items. The first item will be the 2nd item. And we have to add another item at the front. In this way we have to update the items when user scrolls to the last item. I have tried many ways. I have used Gallery for the horizontal scroll view. And used the onItemSelected method. But, if I scroll the Gallery fast then it crashes. So, please someone help me to implement the 3 items idea.</p>","523118","","","","","2011-02-13 18:41:39","Memory efficient list for android","<android>","1","0","","",""
"4985563","1","5028039","","2011-02-13 17:10:53","3","3655","<p>I have a little experimentation app (essentially a <em>very</em> cut-down version of the <a href=""http://developer.android.com/resources/samples/LunarLander/index.html"" rel=""nofollow"">LunarLander</a> demo in the Android SDK), with a single <code>SurfaceView</code>.  I have a <code>Drawable</code> ""sprite"" which I periodically draw into the <code>SurfaceView</code>'s <code>Canvas</code> object in different locations, without attempting to erase the previous image.  Thus:</p><pre><code>private class MyThread extends Thread {    SurfaceHolder holder;  // Initialised in ctor (acquired via getHolder())    Drawable      sprite;  // Initialised in ctor    Rect          bounds;  // Initialised in ctor    ...    @Override    public void run() {        while (true) {            Canvas c = holder.lockCanvas();            synchronized (bounds) {                sprite.setBounds(bounds);            }            sprite.draw(c);            holder.unlockCanvasAndPost(c);        }    }    /**     * Periodically called from activity thread     */    public void updatePos(int dx, int dy) {        synchronized (bounds) {            bounds.offset(dx, dy);        }    }}</code></pre><p>Running in the emulator, what I'm seeing is that after a few updates have occurred, several old ""copies"" of the image begin to flicker, i.e. appearing and disappearing.  I initially assumed that perhaps I was misunderstanding the semantics of a <code>Canvas</code>, and that it somehow maintains ""layers"", and that I was thrashing it to death.  However, I then discovered that I only get this effect if I try to update faster than roughly every 200 ms.  So my next best theory is that this is perhaps an artifact of the emulator not being able to keep up, and tearing the display.  (I don't have a physical device to test on, yet.)</p><p>Is either of these theories correct?</p><p><em>Note: I don't actually want to do this in practice (i.e. draw hundreds of overlaid copies of the same thing).  However, I would like to understand why this is happening.</em></p><p><strong>Environment:</strong></p><ul><li>Eclipse 3.6.1 (Helios) on Windows 7</li><li>JDK 6</li><li>Android SDK Tools r9</li><li>App is targetting Android 2.3.1</li></ul><p><strong>Tangential question:</strong></p><p>My <code>run()</code> method is essentially a stripped-down version of how the LunarLander example works (with all the excess logic removed).  I don't quite understand why this isn't going to saturate the CPU, as there seems to be nothing to prevent it running at full pelt.  Can anyone clarify this?</p>","129570","","129570","","2011-02-17 15:37:55","2011-02-18 09:12:42","Preventing ""flickering"" when calling Drawable.draw()","<android><android-emulator><surfaceview>","2","4","2","",""
"4985585","1","","","2011-02-13 17:14:39","0","200","<p>I would like to use third party classes for which I have no source code. How do I instantiate these classes (which are in an APK on the phone) if I have no source code. Is it possible to do in Java? If not, how can it be done?</p>","615240","","","","","2011-02-13 18:13:51","How to include third party classes without JAR file","<android>","2","0","","",""
"4985621","1","4985653","","2011-02-13 17:21:03","0","1150","<p>i have executed the following code </p><pre><code>public class Activity_Threads_Handler extends Activity {private int mSec;TextView tv;protected void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    tv = (TextView) findViewById(R.id.TextView01);    startHeavyDutyStuff();}void startHeavyDutyStuff() {    // Here is the heavy-duty thread    Thread t = new Thread() {        public void run() {            try {                while (true) {                    mSec = Calendar.getInstance().get(Calendar.MINUTE);                    // Send update to the main thread                    messageHandler.sendMessage(Message.obtain(                            messageHandler, mSec));                    Thread.sleep(1000);                }            } catch (InterruptedException e) {                e.printStackTrace();            }        }    };    t.start();}// Instantiating the Handler associated with the main thread.private Handler messageHandler = new Handler() {    @Override    public void handleMessage(Message msg) {        tv.setText(msg.what);    }};</code></pre><p>}</p><p>the above code is to display the current second on to a TextView continually updating it ... </p><p>and i got the following error in my logcat</p><blockquote>  <p>FATAL EXCEPTION: main  android.content.res.Resources$NotFoundException: String resource ID #x22  at android.content.res.Resources.getText(Resources.java:201)  at android.widget.TextView.setText(TextView.java:2857)  at com.kpj4s.Threads_Handler.Activity_Threads_Handler$1.handleMessage(Activity_Threads_Handler.java:56)  at android.os.Handler.dispatchMessage(Handler.java:99)  at android.os.Looper.loop(Looper.java:123)  at android.app.ActivityThread.main(ActivityThread.java:3647)  at java.lang.reflect.Method.invokeNative(Native Method)  at java.lang.reflect.Method.invoke(Method.java:507)  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)  at dalvik.system.NativeStart.main(Native Method)</p></blockquote><p>can some one help me out pls ..thanks :)</p>","601142","","","","","2013-02-05 12:45:44","Programing Threads and handlers in android?","<android><multithreading><handler>","2","0","","",""
"4985728","1","4985998","","2011-02-13 17:38:58","3","1826","<p>We want to develop and extensible Android application, and are looking for a way to handle plugins.</p><p>What do you think would be the best approach:</p><ul><li><p>Using Android's PackageManager. The problem here is that the PM isn't designed with plugins in mind, so we'd have to implement functionalities such as dependency checks ourselves.</p></li><li><p>Using an existing Java framework such as JPF (Java Plugin Framework) or OSGi. OSGi looks too massive for us, and there's isn't too much information available about JPF on Android.</p></li><li><p>Other ideas?</p></li></ul>","318557","","","","","2011-02-13 22:42:42","Plugin Management for an Android application","<android><plugins><osgi><jpf>","2","0","3","",""
"4985729","1","","","2011-02-13 17:39:09","0","233","<p>Ok, so I have this method, by which i grap html code from any input url:</p><pre><code>private String GetURL(String f)throws Exception{ //return html code for input url f                String k="""";        String l="""";                URL url = new URL(f);        HttpURLConnection conn = (HttpURLConnection) url.openConnection();        conn.setConnectTimeout(5000);    // 5 seconds        conn.setRequestMethod(""GET"");               conn.connect();        BufferedReader rd  = new BufferedReader(new InputStreamReader(                                                      conn.getInputStream()));        while ((k = rd.readLine()) != null) {            l = l + k;        }        conn.disconnect();         return l;        }</code></pre><p>It works fine for me. I am using it in an android application on its Main UI. So that when user launches the application, it fetches data from internet using above method and then displays it.  </p><p>I want to know, is there any way that Java caches this information so that if it is retrieved too soon, it can return result from cache then going online again.  </p><p>Because the problem is, whenever the user changes the layout, vertical to horizontal; the main display is reset and again user gets the progress bar prompt (which I've designed till the data is loaded). I want to avoid this without using any database complexity.  </p><p>So want to know if Java offers any cache option automatically or not?</p>","615259","","244296","","2011-02-13 17:40:52","2011-02-13 18:01:10","Java Question, fetching data from Internet","<java><android><sockets>","3","1","","",""
"4985760","1","4987130","","2011-02-13 17:43:11","4","12119","<p>What is the proper way to override onLayout method in a custom layout extending the RelativeLayout?I'm trying to place all views in sort of a table. The idea is to fill one row with ImageViews until it's full and then continue in the new row.</p><pre><code>@Overrideprotected void onLayout(boolean changed, int l, int t, int r, int b) {        super.onLayout(changed, l, t, r, b);        int idOfViewToTheLeft = 1;        RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(getContext(),);        ImageView bookmark;        for(int counter = 1; counter &lt; getChildCount(); counter++) {            bookmark = (ImageView) findViewById(counter);            if(counter &gt; 1) {               if(this.getWidth() &gt; (bookmark.getLeft() + bookmark.getWidth())) {                   params.addRule(RelativeLayout.RIGHT_OF, bookmark.getId() - 1);               } else {                   params.addRule(RelativeLayout.BELOW, idOfViewToTheLeft);                   idOfViewToTheLeft = bookmark.getId();               }            }            bookmark.setScaleType(ScaleType.CENTER_CROP);        }    }    }</code></pre>","607767","","607767","","2013-08-20 19:41:26","2013-08-20 19:41:26","Onlayout method on custom layout extending RelativeLayout","<android><relativelayout>","1","0","7","",""
"4985805","1","4986481","","2011-02-13 17:51:34","30","16087","<p>My app supports 3 (soon 4) languages. Since several locales are quite similar I'd like to give the user the option to change locale in my application, for instance an Italian person might prefer Spanish over English.</p><p>Is there a way for the user to select among the locales that are available for the application and then change what locale is used? I don't see it as a problem to set locale for each Activity since it is a simple task to perform in a base class.</p>","435267","","648313","","2012-05-22 15:25:41","2013-09-24 12:00:51","Set Locale programatically","<android><locale><user-defined>","1","0","13","",""
"4985823","1","","","2011-02-13 17:55:27","1","664","<p>I am trying to produce an activity with an interface somewhat like that of the 'add contact' activity in the standard people application - ie something with a number of lists (email addresses, phone numbers, etc) each of which has a variable number of entries and an 'add' button. The lists themselves don't scroll (ie all entries are shown all of the time), but the overall interface does scroll.</p><p>My first attempt uses several listviews inside a linearlayout inside a scrollview; the code adds elements to the listviews as required. However, I cannot find a way to prevent the lists from being scrolled, rather than being shown full length.</p><p>Can anyone suggest how I might stop the listviews from scrolling ? Or perhaps suggest a better container than the listview (I don't want to re-invent the wheel) ?</p><p>Thanks,    Richard</p>","615280","","","","","2011-02-13 18:44:18","How do I set up non-scrolling lists?","<android><android-layout>","3","0","","",""
"4985859","1","4986081","","2011-02-13 18:02:39","10","4192","<p>I am a little bit confused about the ComponentName class in Android.</p><p>There are different ways to get to a component name object, but I don't know when to use which... and why!</p><p>Example:</p><ul><li>Application package is <code>de.zordid.sampleapp</code></li><li>but widget provider class is <code>de.zordid.sampleapp.widget.WidgetProvider</code></li></ul><p>Using </p><pre><code>ComponentName cn = new ComponentName(""de.zordid.sampleapp.widget"",    ""WidgetProvider"");</code></pre><p>I got this component info: <code>ComponentInfo{de.zordid.sampleapp.widget/WidgetProvider}</code>, but I could not use this - the component is unknown!But the JavaDoc says I should give the package and the class within that package - and that is what I did, didn't I??</p><p>Using</p><pre><code>ComponentName cn = new ComponentName(context, WidgetProvider.class);</code></pre><p>yields <code>ComponentInfo{de.zordid.sampleapp/de.zordid.sampleapp.widget.WidgetProvider}</code> - and that works fine!!</p><p>There is even another way to get a ComponentName - by context and a string.Which one should be used where and when??</p><p>Thanks!</p>","273456","","","","","2012-02-13 20:35:58","When to use which constructor for ComponentName in Android?","<android><constructor><components>","2","0","2","",""
"4985904","1","4985948","","2011-02-13 18:10:07","5","1607","<p>I want to create .nomedia file in the internal cache directory where I will store images and tried the following..</p><pre><code>File dir = getCacheDir();File output = new File(dir, "".nomedia"");boolean fileCreated = output.createNewFile();</code></pre><p>When I try this fileCreated is false and the file doesn't get created.If I used nomedia without a dot the file gets created but this is no use as the MediaScanner is looking if the .nomedia file exists.</p><p>I also tried this with a FileOutputStream and to write data in the file in case it was because I was only created an empty file but this doesn't work either.</p><p>Anyone have an idea why this could be failing?</p>","358338","","","","","2013-05-03 23:16:15","Writing hidden file .nomedia fails on internal storage","<android>","1","0","","",""
"4985936","1","4985973","","2011-02-13 18:15:55","0","16845","<p>I want to make it so that there is a <code>ListView</code> with a <code>Button</code> above it. The users clicks that button, and it opens a <code>dialog</code> with an <code>EditText</code> and an OK and Cancel button. When the user clicks OK, whatever text is entered into the <code>EditText</code> gets put into the <code>SQLiteDatabase</code>, which is reflected in the <code>ListView</code>.</p><p>I've already set up my <code>SQLiteDatabase</code> and have set an <code>adapter</code> for the List to show the <code>SQLiteDatabase</code>, but I need to figure out how to use the <code>edittext.getText().toString()</code> method to add to the <code>SQLiteDatabase</code>. <strong>I will need a code example</strong>.</p><p>If you need it, here's my main .java:</p><pre><code>package com.gantt.shoppinglist;import android.app.Dialog;import android.app.ListActivity;import android.database.Cursor;import android.database.sqlite.SQLiteDatabase;import android.os.Bundle;import android.view.View;import android.view.View.OnClickListener;import android.widget.Button;import android.widget.EditText;import android.widget.ListView;import android.widget.SimpleCursorAdapter;public class ShoppingList extends ListActivity {    /** Called when the activity is first created. */    @Override    protected void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        final DataHelper dataHelper = new DataHelper(this);        ListView lv = (ListView) findViewById(android.R.id.list);        SimpleCursorAdapter adapter = null;        final SQLiteDatabase db = dataHelper.selectAll();        Cursor c = db.rawQuery(""SELECT DISTINCT oid as _id,name FROM table1 ORDER BY name"", null);        if (c.moveToFirst()) {            String[] columnNames = new String[]{""name""};            int[] list = new int[]{android.R.id.list};            adapter = new SimpleCursorAdapter(this, R.layout.rowlayout, c, columnNames, list);        }        lv.setAdapter(adapter);        Button button1main = (Button) findViewById(R.id.add);        button1main.setOnClickListener(new OnClickListener()  {            @Override            public void onClick(View v)  {            final Dialog additem = new Dialog(ShoppingList.this);            additem.setContentView(R.layout.maindialog);            final EditText et = (EditText)additem.findViewById(R.id.edittext);            additem.setTitle(""Type your item"");            additem.setCancelable(true);            et.setHint(""Type the name of an item..."");            Button button = (Button) additem.findViewById(R.id.cancel);            button.setOnClickListener(new OnClickListener()  {                @Override                public void onClick(View v)  {                    additem.dismiss();                }            });            additem.show();            Button ok = (Button) additem.findViewById(R.id.ok);            ok.setOnClickListener(new OnClickListener() {                @Override                public void onClick(View v) {                    et.getText().toString();                    additem.dismiss();                    et.setText("""");                }            });       }        });    }}</code></pre><p>Here is my DataHelper class:</p><pre><code>package com.gantt.shoppinglist;import java.util.ArrayList;import java.util.List;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;public class DataHelper {       public static final String DATABASE_NAME = ""items.db"";       public static final int DATABASE_VERSION = 1;       public static final String TABLE_NAME = ""table1"";       public static final String KEY_ROWID = ""_id"";       private Context context;       private SQLiteDatabase db;       private SQLiteStatement insertStmt;       private static final String INSERT = ""insert into ""           + TABLE_NAME + ""(name) values (?)"";       public DataHelper(Context context) {          this.context = context;          OpenHelper openHelper = new OpenHelper(this.context);          this.db = openHelper.getWritableDatabase();          this.insertStmt = this.db.compileStatement(INSERT);       }       public long insert(String name) {          this.insertStmt.bindString(1, name);          return this.insertStmt.executeInsert();       }       public void deleteAll() {          this.db.delete(TABLE_NAME, null, null);       }       public SQLiteDatabase selectAll() {          List&lt;String&gt; list = new ArrayList&lt;String&gt;();          Cursor cursor = this.db.query(TABLE_NAME, new String[] { ""name"" },             null, null, null, null, ""name desc"");          if (cursor.moveToFirst()) {             do {                list.add(cursor.getString(0));              } while (cursor.moveToNext());          }          if (cursor != null &amp;&amp; !cursor.isClosed()) {             cursor.close();          }          return db;       }       public static String getDatabaseName() {        return DATABASE_NAME;    }    private static class OpenHelper extends SQLiteOpenHelper {          OpenHelper(Context context) {             super(context, getDatabaseName(), null, DATABASE_VERSION);          }          @Override          public void onCreate(SQLiteDatabase db) {              db.execSQL(""CREATE TABLE "" + TABLE_NAME + ""(id INTEGER PRIMARY KEY, name TEXT"");          }          @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 "" + TABLE_NAME);             onCreate(db);          }       }    }</code></pre>","560096","","","","","2011-02-13 19:45:44","How to use edittext.getText().toString()","<android><sqlite><listview><edittext><adapter>","2","1","","",""
"4986021","1","4986218","","2011-02-13 18:32:47","0","486","<p>Is there a URI used by the Navigation application to go to a specific latitude, longitude point? Or is this limited to only to an address?</p>","200477","","","","","2011-02-13 19:07:42","Navigate to latitude, longitude point via Navigation Content URI?","<java><android><navigation><gps>","1","0","","",""
"4986103","1","4986292","","2011-02-13 18:47:49","0","348","<p>I have an activity that requires various conditional updates to a TableLayout (do/don't show lines with a '0' value, create a new line item... etc).  I have the Dynamic TableLayout working wonderfully, but as you can imagine the permutations of this continue to grow.  I want to move the various TableRow management methods out to a separate class but am having trouble with the transition.  </p><p>The first problem is when I attempt to call <code>BuildTable.testTable();</code> from my main activity it wants the method to be static.  This makes sense but when I make testTable static, then I get the complaint ""cannot make a static reference to the non-static method <code>findViewById(int)</code> from the type Activity"".  It seemed like I drew very close to a solution when I followed the advice <a href=""http://stackoverflow.com/questions/2218773/cannot-make-a-static-reference-to-a-non-static-method-in-android"">here</a>, but it just didn't quite come together.  I need help... and would sincerely appreciate anything you can offer.</p><p>I have boiled it down to the basics below with only a single TextView inserted... I have:</p><pre><code>public class BuildTable extends Activity {public void  testTable() {    TableLayout tl = (TableLayout)findViewById(R.id.InvoiceTable); // Find TableLayout defined in main.xml        TableRow trDivider = new TableRow(getParent());            TextView tvDivider = new TextView(getParent()); //Create a divider view between rows            tvDivider.setText(""test"");        trDivider.addView(tvDivider); //Add tvDivider to the new row    tl.addView(trDivider); //Add trDivider to the TableLayout}</code></pre>","593078","","","","","2011-02-13 19:20:22","Moving dynamic TableLayout methods to separate class","<android><class><tablelayout>","3","0","","",""
"4986230","1","5060464","","2011-02-13 19:10:06","3","679","<p>I'm having a really weird layout problem... basically the first button in this RadioGroup is losing it's first letter, as per this screenshot (it should say ""Booked Off"", not ""ooked Off""):</p><p><img src=""http://i.stack.imgur.com/hK9zA.png"" alt=""mangled RadioButton text screenshot""></p><p>The XML fragment is fairly simple (and I've got nothing funny in an external style or anything):</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;RadioGroup android:orientation=""vertical""      android:layout_width=""wrap_content""      android:layout_height=""wrap_content""&gt;        &lt;RadioButton android:id=""@+shift_edit/bookoff""          android:layout_width=""wrap_content""          android:layout_height=""wrap_content""          android:text=""Booked Off"" /&gt;        &lt;RadioButton android:id=""@+shift_edit/ado""          android:layout_width=""wrap_content""          android:layout_height=""wrap_content""          android:text=""ADO"" /&gt;        &lt;RadioButton android:id=""@+shift_edit/working""          android:layout_width=""wrap_content""          android:layout_height=""wrap_content""          android:text=""Working"" /&gt;    &lt;/RadioGroup&gt;&lt;/LinearLayout&gt;</code></pre><p>Does anyone recognise the problem here and can offer a solution?  I'm using 1.6 if it matters, because the device I'm targetting only has a 1.6 ROM.</p>","60003","","60003","","2011-02-14 00:39:05","2011-02-20 22:19:33","Why is my android RadioButton text being truncated at the beginning?","<android><android-layout>","2","0","1","",""
"4986305","1","4986580","","2011-02-13 19:22:44","0","509","<p>I am trying to change screens from the first to second and back again, but with some extra variables passed. At the moment I go from 1 to 2, but when I click from 2 back to 1 it causes an error that the application stopped unexpectantly. I have issolated the problem to this part of the code. I'm not at the moment trying to pass any other variables with it just get it to change.</p><p>1st page package = max.multiplebuttons.comActivity         = multibuttons</p><p>1st page package = max.reason.comActivity         = reason_screen</p><pre><code>public void nextquestion(){    Intent a = new Intent();    a.setClassName(""max.reason.com"", ""max.multiplebuttons.com.multibuttons"");    startActivity(a);}</code></pre>","614460","","614460","","2011-02-13 19:52:43","2011-02-14 02:39:17","Changing Screen / New Intent","<android>","1","1","","",""
"4986489","1","4986516","","2011-02-13 19:55:33","0","591","<p>I've got an app that records audio. i'm trying to get the filenames that are stored on the sd card so i can put them in a listview. i know that it's probably not best practice to save file at the root of the sd card but i have:) (the same level as dcim, sounds ect). i'm getting a nullpointerexception regarding the listFiles() method. here's my code. any ideas on the exception?</p><pre><code>File sdCardRoot = Environment.getExternalStorageDirectory();    Log.i(""root on sd ="", """"+ sdCardRoot.getPath());    for (File f : sdCardRoot.listFiles()) {        if (f.isFile()){            String name = f.getName();            Log.i(""arr names******"", """"+arr.get(0));            arr.add(name);         }else             {             Log.i(""file"", "" no file"");             }    Log.i(""arr******"", """"+arr.size());    }</code></pre><hr><pre><code>02-13 19:16:19.063: INFO/ActivityManager(1903): Starting activity: Intent { cmp=com.tecmark/.SdGetList }02-13 19:16:19.118: INFO/root on sd =(10308): /sdcard02-13 19:16:19.123: INFO/file(10308):  no file02-13 19:16:19.128: DEBUG/AndroidRuntime(10308): Shutting down VM02-13 19:16:19.128: WARN/dalvikvm(10308): threadid=3: thread exiting with uncaught exception (group=0x4001b180)02-13 19:16:19.128: ERROR/AndroidRuntime(10308): Uncaught handler: thread main exiting due to uncaught exception02-13 19:16:19.138: ERROR/AndroidRuntime(10308): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.tecmark/com.tecmark.SdGetList}: java.lang.NullPointerException02-13 19:16:19.138: ERROR/AndroidRuntime(10308):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2496)02-13 19:16:19.138: ERROR/AndroidRuntime(10308):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512)02-13 19:16:19.138: ERROR/AndroidRuntime(10308):     at android.app.ActivityThread.access$2200(ActivityThread.java:119)02-13 19:16:19.138: ERROR/AndroidRuntime(10308):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863)02-13 19:16:19.138: ERROR/AndroidRuntime(10308):     at android.os.Handler.dispatchMessage(Handler.java:99)02-13 19:16:19.138: ERROR/AndroidRuntime(10308):     at android.os.Looper.loop(Looper.java:123)02-13 19:16:19.138: ERROR/AndroidRuntime(10308):     at android.app.ActivityThread.main(ActivityThread.java:4363)02-13 19:16:19.138: ERROR/AndroidRuntime(10308):     at java.lang.reflect.Method.invokeNative(Native Method)02-13 19:16:19.138: ERROR/AndroidRuntime(10308):     at java.lang.reflect.Method.invoke(Method.java:521)02-13 19:16:19.138: ERROR/AndroidRuntime(10308):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)02-13 19:16:19.138: ERROR/AndroidRuntime(10308):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)02-13 19:16:19.138: ERROR/AndroidRuntime(10308):     at dalvik.system.NativeStart.main(Native Method)02-13 19:16:19.138: ERROR/AndroidRuntime(10308): Caused by: java.lang.NullPointerException02-13 19:16:19.138: ERROR/AndroidRuntime(10308):     at com.tecmark.SdGetList.onCreate(SdGetList.java:38)</code></pre>","532462","","244296","","2011-02-13 19:59:24","2011-02-13 20:00:36","can't get file names from sd card","<android><file><nullpointerexception>","1","0","","",""
"4986586","1","4986715","","2011-02-13 20:15:04","7","13925","<p>I'm pulling my hair out over this one.</p><p>I have an app that when you press a menu item, I want it to show an input alert dialog. When the user taps ""OK"" then the text they've entered into the EditText in the dialog wants to be returned to be used later in the activity.</p><p>So I thought putting:</p><pre><code>name = input.getText().toString(); //input is an EditView which is the setView() of the dialog</code></pre><p>Inside the onClick of the ""Ok"" button would work but it doesn't. Eclipse tells me I cant set name inside the onClick because it isn't final, but if I change name's definition to final it can't be changed obviously and so can't be set inside the onClick().</p><p>Here is the full code for this bit: </p><pre><code>String routeName = """";        AlertDialog.Builder alert = new AlertDialog.Builder(this);          alert.setTitle(""Title"");          alert.setMessage(""Message"");          // Set an EditText view to get user input           final EditText inputName = new EditText(this);          alert.setView(inputName);          alert.setPositiveButton(""Set Route Name"", new DialogInterface.OnClickListener() {          public void onClick(DialogInterface dialog, int whichButton) {              routeName = inputName.getText().toString();            }          });         alert.show();</code></pre><p>I must be doing something really stupid here because I've googled around for ages and found no-one else with the same problem.</p><p>Can anyone please enlighten me?</p><p>Thank you for your time,</p><p>InfinitiFizz</p>","224216","","224216","","2011-02-13 20:31:22","2011-02-13 20:40:55","Android Input Dialog Return Input Value","<android><android-widget><edittext><alertdialog>","2","2","","",""
"4986612","1","4986736","","2011-02-13 20:19:51","7","2548","<p>I can hook my app into the ""Share page"" feature using the following intent-filter:</p><pre><code>&lt;intent-filter&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;</code></pre><p>But I would like to go a little further and limit the filter to intents with specific URLs in them, for example URL of a YouTube video. I tried something like this but it doesn't work:</p><pre><code>&lt;intent-filter&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""    android:scheme=""http""    android:host=""m.youtube.com""  /&gt;</code></pre><p>Any suggestions?</p>","139298","","","","","2012-03-14 21:58:01","How to catch Android share intents limited to specific URLs using intent-filter?","<android><android-intent><share><intentfilter>","1","0","2","",""
"4986668","1","4986721","","2011-02-13 20:28:04","0","178","<p>I need to know if I can increment a string in another class. The class is called within an onclick method and each time the button is clicked I want the text to show the next string. Is this possible, if so I would appreciate any guidance on this. </p><p>Thanks. </p>","608658","","","","","2011-02-13 21:14:45","Increment string in Textview each time class is called","<android>","2","0","","",""
"4986786","1","4986941","","2011-02-13 20:48:56","1","5644","<p>I'm using a random number generator to select an item out of an Android string array.  Is there a way to set my integer as the length of the array without actually counting the number of items in the array?</p><p>Here's an example of the random number code I'm using:</p><pre><code>private Random random = new Random();private int n = random.nextInt(4);private String randText;public Object(Context contex){String[] string = context.getResources().getStringArray(R.array.text);randText = ""Stuff to display "" + string[n] +""."";}public String getRandText{return randText}</code></pre><p>I would like to define the ""4"" above as the length of a specific array list.  Anyone know how?</p>","615423","","615423","","2011-02-13 22:35:10","2011-02-13 22:35:10","Using string-array list length as an integer","<java><android><random><string-array>","2","0","","",""
"4986816","1","4986846","","2011-02-13 20:54:42","0","4336","<p>I have a database holding a lot of static data for my current application.  One of the tables in the database gives various information about a list of items.  It would make sense for it to hold a reference to the graphic for each item, too.  The graphics are stored in a drawable folder and referenced by R.drawable in the application.  Am I able to reference them by their name so that I can store the names as strings in the database?  If not, is there an obvious method for doing this that I'm missing?</p>","574740","","","","","2011-02-13 21:00:42","Reference drawable by name","<android><drawable>","1","0","","",""
"4986861","1","4987097","","2011-02-13 21:03:16","65","71911","<p>I am new to Android development and I have a question about setting weight in a linear layout.  </p><p>I am trying to create a row with two custom buttons and a custom edit text.  The edit text should only take up as much room as its content, and the two buttons should expand horizontally to fill the rest of the available space in the row. Like this...</p><pre><code>| [#Button++#] [#Button--#] [et] |</code></pre><p>After several attempts this is the closest I can get to what I want, even though it seems overly complicated.</p><pre><code>| [Button] [Button] [###ET###] |</code></pre><hr><pre><code>&lt;LinearLayout     android:orientation=""horizontal""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:gravity=""center_horizontal|center_vertical""    android:layout_weight=""1""    &gt;    &lt;LinearLayout         android:orientation=""horizontal""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:layout_weight=""1""        android:gravity=""center_horizontal|center_vertical""        &gt;        &lt;RelativeLayout             android:id=""@+id/btn_plus_container""             android:layout_width=""fill_parent""             android:layout_height=""wrap_content""            &gt;            &lt;ImageButton                 android:layout_height=""wrap_content""                android:layout_width=""fill_parent""                 android:id=""@+id/btn_plus""                 android:background=""@drawable/btn""                android:layout_centerInParent=""true""                &gt;&lt;/ImageButton&gt;            &lt;TextView                 android:textColor=""#FAFAF4""                android:id=""@+id/tv_dice_plus""                 android:text=""@string/tv_plus""                 android:layout_width=""wrap_content""                 android:layout_height=""wrap_content""                android:layout_centerInParent=""true""                &gt;&lt;/TextView&gt;        &lt;/RelativeLayout&gt;    &lt;/LinearLayout&gt;    &lt;LinearLayout         android:orientation=""horizontal""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:layout_weight=""1""        android:gravity=""center_horizontal|center_vertical""        &gt;        &lt;RelativeLayout             android:id=""@+id/btn_minus_container""             android:layout_width=""fill_parent""             android:layout_height=""wrap_content""            &gt;            &lt;ImageButton                 android:layout_height=""wrap_content""                android:layout_width=""fill_parent""                 android:id=""@+id/btn_minus""                 android:background=""@drawable/btn""                android:layout_centerInParent=""true""                &gt;&lt;/ImageButton&gt;            &lt;TextView                 android:textColor=""#FAFAF4""                android:id=""@+id/btn_minus""                 android:text=""@string/tv_minus""                 android:layout_width=""wrap_content""                 android:layout_height=""wrap_content""                android:layout_centerInParent=""true""                &gt;&lt;/TextView&gt;        &lt;/RelativeLayout&gt;    &lt;/LinearLayout&gt;    &lt;LinearLayout         android:orientation=""horizontal""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:layout_weight=""1""        android:gravity=""center_horizontal|center_vertical""        &gt;        &lt;EditText             android:textColor=""#FAFAF4""            android:text=""@string/et_output""             android:id=""@+id/et_output""             android:layout_width=""wrap_content""             android:layout_height=""wrap_content""            android:inputType=""number""            android:selectAllOnFocus=""true""             android:minWidth=""50sp""                     android:maxWidth=""50sp""            android:background=""@drawable/tv_black_background3""            android:textColorHighlight=""#c30505""            &gt;&lt;/EditText&gt;    &lt;/LinearLayout&gt;&lt;/LinearLayout&gt;</code></pre><p>As I understand setting [android:layout_weight=""2""] for the linear layouts holding the buttons should make them take up more room than the edit text, but it does the opposite for me, making them both half the size.</p><pre><code>| [Btn] [Btn] [#####et#####] |</code></pre><p>I have tried so many different combinations I can't even remember them, and none have worked.</p>","583826","","244296","","2011-02-13 21:08:09","2014-01-18 19:53:31","Android Layout Weight","<android><layout>","6","0","14","",""
"4986916","1","4986933","","2011-02-13 21:15:48","0","185","<p>I am trying to create a browser app, and right now I'm trying to create the layout - which is basically, an EditText (as address bar), a WebView and a bar in the bottom. The problem that I can't make the bottom bar appear. Here is 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;EditText android:id=""@+id/addressbar""                   android:layout_width=""fill_parent""                   android:layout_height=""wrap_content""                   android:background=""@android:drawable/editbox_background""                   /&gt;     &lt;com.android.ibrowser.myWebView          xmlns:android=""http://schemas.android.com/apk/res/android""        android:id=""@+id/browser""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""    /&gt;    &lt;View xmlns:android=""http://schemas.android.com/apk/res/android""        android:id=""@+id/downBar""        android:layout_width=""fill_parent""        android:layout_height = ""60px""/&gt; </code></pre><p>What do you think?</p>","171911","","","","","2011-02-13 21:18:37","Android: Help with the xml Layout","<android><xml><layout>","1","0","","",""
"4987069","1","4987086","","2011-02-13 21:39:12","1","234","<p>Not really an immediate source code question per se....but Im looking into doing some casual Android Programming, nothing heavy.</p><p>But it seems to use alot of XML and Java......what I wonder though is why is it that android is written mostly in C and XML (along with C++ and Java) with it being closely related to the Linux OS......but why is the ""main"" language for programming in android Java?</p><p>Just out of curiosity of course.</p>","475353","","","","","2011-02-14 01:42:50","Quick Question Regarding Android Programming","<android><android-emulator>","3","0","","",""
"4987218","1","","","2011-02-13 22:06:25","0","802","<p>I would like for my application to not show any activity except on launch or specifically requested by the widget it contains. In other words I want it to find and launch the main activity on Launching the app, but otherwise I don't want any Activity at all to show unless an intent specifically requests it.  I don't want the app coming to the foreground to mean that the main activity always displays.  How can the main activity be supressed except on launch? thanks</p>","602260","","","","","2011-02-14 04:23:35","Android App without a Main Activity?","<android><activity><launch>","1","9","","",""
"4987244","1","4987319","","2011-02-13 22:11:39","0","1533","<p>I am trying to create a menu demo, but I am unable to see the menu.The only things I can see is the ""TextView"" view in the layout. Below is the code:</p><p>menu.xml in (res\menu)</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:title=""@string/new_game""     android:id=""@+id/new_game""&gt;    &lt;/item&gt;    &lt;item     android:title=""@string/quit""     android:id=""@+id/quit""    &gt;    &lt;/item&gt;    &lt;/group&gt;&lt;/menu&gt;</code></pre><p>demomenu.java</p><pre><code>package com.test.demomenu;import android.app.Activity;import android.os.Bundle;import android.view.Menu;import android.view.MenuInflater;import android.view.MenuItem;import android.widget.Toast;public class demomenu extends Activity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);    }    @Override    public boolean onCreateOptionsMenu(Menu menu)    {        //super.onCreateOptionsMenu(menu);        MenuInflater inflater=getMenuInflater();        inflater.inflate(R.menu.game_menu, menu);        return true;    }    @Override    public boolean onOptionsItemSelected(MenuItem item)    {        Toast.makeText(this, ""This is the item"", Toast.LENGTH_LONG).show();        return true;    }}</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;TextView      android:layout_width=""fill_parent""     android:layout_height=""wrap_content""     android:text=""@string/hello""    /&gt;&lt;/LinearLayout&gt;</code></pre><p>strings.xml</p><pre><code>    &lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;resources&gt;    &lt;string name=""hello""&gt;Hello World, demomenu!&lt;/string&gt;    &lt;string name=""app_name""&gt;Demo Menu&lt;/string&gt;    &lt;string name=""new_game""&gt;New Game&lt;/string&gt;    &lt;string name=""quit""&gt;Quit&lt;/string&gt;&lt;/resources&gt;</code></pre><p>When I run the project, I can only see the ""TextView"" and not the menu. I would appreciate if someone can tell me whats is wrong with the application.</p><p>Thanks,Sid</p>","2288136","","","","","2011-02-14 20:17:45","Cannot see Options Menu in Android","<android><menu><options>","3","0","","",""
"4987253","1","4996346","","2011-02-13 22:12:57","1","647","<p>I installed on my Android phone a servlet container app with i-Jetty and created a servlet that exchanges GPS locations. I know that creating an Android application would be easier, but in the end I want to use it in any device, so a servlet is better.</p><p>The problem is that I don't know how to make my get the GPS location of the Android phone in my servlet class. Does anyone have an idea?</p>","610093","","157882","","2011-02-13 22:41:58","2011-04-25 17:04:36","How obtain geo location of Android phone in a servlet?","<android><servlets><geolocation>","3","2","","",""
"4987274","1","4987363","","2011-02-13 22:17:05","1","1645","<p>I'm trying to set-up facebook connect with my program. I had it working before, but I've switched to a new computer and now for some reason permission isn't being granted. Whenever I hit my facebok connect button, an error pops up, ""Application requires permission to access the internet"". My manifest file is below. Anyone see anything wrong?</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.myname.appname"" android:versionCode=""1""android:versionName=""1.0""&gt;&lt;supports-screens android:smallScreens=""false""    android:normalScreens=""true"" android:largeScreens=""false""    android:anyDensity=""false"" /&gt;&lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;    &lt;activity android:name="".LoginPage""        android:screenOrientation=""portrait"" android:label=""@string/login_tag""&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-permission android:name=""android.permission.INTERNET""&gt;    &lt;/uses-permission&gt;    &lt;activity android:name="".mainDisplay"" android:label=""@string/app_name""&gt;&lt;/activity&gt;&lt;/application&gt;</code></pre><p> </p>","544007","","180538","","2011-02-13 22:27:04","2012-11-21 13:08:47","android internet permission not working","<android><permissions><internet><manifest>","2","1","1","",""
"4987479","1","5087592","","2011-02-13 22:53:15","1","2695","<p>I'm new to programing and trying to open a pdf to view in my app.  I'm not trying to include a reader ""in"" my app, but send it to what ever pdf reader the user has.</p><p>I've searched through all the questions here and found this one  <a href=""http://stackoverflow.com/questions/2883355/how-to-render-pdf-in-android"">Render pdf</a>.</p><p>I made a test app and it worked!  The only problem is the end user has to save/launch the file from their SD card.  I would like to include the PDF's ""inside"" the app.</p><p>So my question is:  </p><ol><li>Where should I store the pdfs?</li><li>How would I direct the app to them?</li></ol><p>This is a snippet code for launching from the SD card, I would guess it's what needs changed:  </p><pre><code>public void onClick(View v){File file = new File    (""/sdcard/download/2011_BASIC.pdf""); </code></pre>","615383","","126039","","2011-05-29 06:41:11","2012-12-03 21:18:02","Open PDF from within Android application using any installed reader","<android><pdf>","2","0","","",""
"4987534","1","","","2011-02-13 23:08:11","0","759","<p>My widget is deployed as part of an application that contains a service.  If I deploy the app first and then drop the widget on the home screen all is fine, but if I power the device on off the application is no longer running and the widget does nothing when clicked.  I thought the Widget Manager would start the application of the corresponding Widget when clicked?  But this does not appear to be happening.</p>","602260","","","","","2011-04-02 19:19:40","How to make Widget application launch on click","<android><widget>","0","8","","",""
"4987597","1","11707600","","2011-02-13 23:21:38","3","9724","<p>To link to SHOUTcast/HTTP internet radio streams, traditionally you would link to a playlist file, such as an M3U or PLS.  From there, the browser would launch the audio player registered to handle the playlist.  This works great on any PC, Palm, Blackberry, and iPhone.</p><p>This method does <em>not</em> work in Android without installing extra software.  Sure, <em>Just Playlists</em> or <em>StreamFurious</em> can handle it just fine, but I am assuming there has to be a way to invoke the audio or video player commonly installed by default on Android installations.</p><p>By default, no audio player is capable of handling M3U or PLS.  The player seems to open it, but says ""Unsupported Media Type"".</p><p>To make this more annoying, the browser is capable of streaming MP3 audio over HTTP, simply by opening a link to an MP3 file.  I have tried simply linking directly to the MP3 stream hosted by SHOUTcast, which should end up in the same result, but SHOUTcast detects ""Mozilla"" in the user-agent string, and instead of sending the stream, it sends the information page for the station.</p><p><strong>How should I link to a SHOUTcast stream on Android, from a normal mobile site, without using extra applications?</strong></p>","362536","","","","","2013-04-24 03:08:50","Method for launching audio player on Android from web page for streaming media","<android><shoutcast><android-browser><m3u><android-music-player>","4","3","1","",""
"4987670","1","","","2011-02-13 23:38:11","1","17777","<p>I'm trying to wrap my head around Views, Listeners etc.  I have an Activity with 2 Buttons: buttonplay and buttonstop.  My problem is I can't wrap my head around the Views and Listeners completely enough to generate a working switch statement.</p><p>For example, I would LIKE to create a SINGLE Listener and somehow use it to determine which button is clicked.  Then somehow use the ID of the button clicked in my switch statement,  But everything I find online seems to use SEPARATE listeners for every button and then somehow use the View as the argument to the Switch statement.</p><p>I realize the code below is not correct, but am looking for what changes I would need to accomplish the above.</p><p>I want to control the MediaPlayer depending on which button is clicked.  I have:</p><pre><code>   Button b1 = (Button) findViewById(R.id.buttonplay);           b1.setOnClickListener(new View.OnClickListener()             {        public void onClick(View v) {           // Perform action on click          switch(v.getId()) {          case R.id.buttonplay:          //Play voicefile          MediaPlayer.create(getBaseContext(), R.raw.voicefile).start();          break;          case R.id.buttonstop:          //Stop MediaPlayer              MediaPlayer.create(getBaseContext(), R.raw.voicefile).stop();          break;         }   }    });</code></pre><p>Ultimately I would like the most straighforward way to switch on whatever button is clicked. I believe a big part of my confusion stems from the way onClickListeners and Views are used in this context.</p><p>}</p>","615525","","180538","","2011-02-14 00:25:44","2012-06-05 07:12:22","Using Switch Statement to Handle Button Clicks","<android><button><listener>","3","0","2","",""
"4987677","1","5015835","","2011-02-13 23:40:41","0","333","<p>Is it possible to somehow see if a particular broadcastReceiver is registered and running?</p><p>I'm facing a problem with the emulator. My code works fine on an actual device but not on an emulator. I'm adding proximity alerts and I have a class that implements <code>broadcastReceiver</code>. I register the receiver, but nothing happens when I run it on the emulator (I'm passing in valid location coordinates which should get caught by the proximity broadcast receiver).</p><p>I'm thinking that the <code>broadcastReceiver</code> object might be getting garbage collected. Otherwise I can't explain it.</p><p>Any ideas why this is happening? How can I debug this?</p>","582665","","23897","","2011-02-13 23:42:57","2011-02-16 11:27:23","How to monitor active broadcastReceivers of my app?","<android><debugging><android-emulator><broadcastreceiver><ddms>","1","2","","",""
"4987725","1","4994197","","2011-02-13 23:49:50","1","2062","<p>I have an old computer: Pentium D 2.8 Ghz, 4 gig ram, win7 ult., running eclipse Helios and jdk1.6. I recently started learning android development and was going through some exercises people posted on the web. During one exercise which basically creates an option menu, it asked to create a menu folder under /res and a xml file to define the menu elements. In eclipse, I right click on the res folder to choose to create a new folder --> that's fine but you can hear my computer fan picks up, then I create a black file and name it ""menu.xml"" and double click to open it, my computer processor pick up to max by javaw.exe and eclipse stops responding (indicated by windows). If you watch the javaw.exe in the task manager, the amount of memory it uses just keeps adding up (up to 1gig, i then killed the process manually). </p><p>I did the same thing but this time, rather than create the menu folder, i just created the menu.xml file under ""layout"" folder and everything is fine. So is this a bug in android / eclipse? This is not a one time occurrence, it happens every time when i repeat the steps above -- including after rebooting the computer and start fresh. </p><p>Any ideas? </p>","613514","","","","","2011-03-30 21:18:05","Eclipse crashes on creating a new ""menu"" folder under ""/res"" for android development","<java><android><eclipse>","3","1","","",""
"4987744","1","","","2011-02-13 23:55:28","0","276","<p>I am making an <strong>App</strong> that uses <code>WebView</code> and I want everything to be kept within <code>WebView</code> which I have accomplished, but some of my links lead to file hosting sites (filesavr.com) in which I want my users to be able to download these files. When using the default browser it works, but within <code>WebView</code> nothing happens when you click download. I think it has something to do with not being able to open a new window within <code>WebView</code>.</p>","615545","","1905445","","2013-05-03 15:33:07","2013-05-03 15:33:07","How to imitate how default browser handles downloads with webview?","<android><webview><android-webview>","0","3","","",""
"4987900","1","4994011","","2011-02-14 00:29:55","0","165","<p>I have a custom listview row whose XML has one ImageView and three TextViews inside a LinearLayout.</p><p>I want to align the last two TextViews to the right.</p><p>Help is appreciated.Thanks.</p>","599044","","","","","2011-02-14 15:34:39","aligning views in a custom listview row","<android><listview><layout><alignment>","1","3","","",""
"4987993","1","4988150","","2011-02-14 00:54:16","0","199","<p>I am trying to write this snippit into my onCreate method. But the issue I think is that when the program is first opened it will not have this intent sent to it. It is basicly so I can navigate from the home screen to another and when you come back it changes accordingly. At the moment though on startup it forces the application to close.</p><pre><code>Intent inten = getIntent();Bundle b = inten.getExtras();int newText = b.getInt(""NEXTQUESTION"");</code></pre>","614460","","","","","2011-02-14 01:35:53","Intent at startup","<android><android-intent>","1","0","","",""
"4988011","1","","","2011-02-14 00:57:26","18","5235","<p>I am using addHeaderView to add a view item to the top of a ListView. I also have a TextView to display a message saying there are no items in the list.</p><pre><code>&lt;ListView android:id=""@android:id/list""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""/&gt;          &lt;TextView    android:id=""@android:id/empty""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:text=""@string/list_empty""    android:gravity=""center""    android:textAppearance=""?android:attr/textAppearanceMedium"" /&gt;final ListView listView = getListView();    final View view = getLayoutInflater().inflate(R.layout.list_item_add,            listView, false);    listView.addHeaderView(view, null, true);</code></pre><p>When there are items in the ListView then the header is shown but if I delete all items in the list (except the header view) then the header view disappears.</p><p>I would like the header view to be visible in the list view whether there are items in the list or not.</p><p>Thanks,</p>","128327","","","","","2012-09-21 18:21:40","Android addHeaderView disappears when no items in ListView","<android><listview>","2","2","3","",""
"4988051","1","","","2011-02-14 01:05:50","14","2990","<p>My data is simple property values so I could store either way, but I was wondering which is more reliable?  Are shared preferences auto saved and therefore more reliable?  Or because they are non-transactional is that less reliable?  </p>","602260","","","","","2011-02-14 01:36:31","Shared Preferences vs Database","<android><sqlite><sharedpreferences>","1","0","3","",""
"4988067","1","4988098","","2011-02-14 01:10:24","0","1135","<pre><code>@Override protected void onDraw(Canvas canvas) {        if (mBitmap != null) {            canvas.drawColor(0xFFAAAAAA);            canvas.drawBitmap(background,0,0,mBitmapPaint);            if(isRelevant){                canvas.drawBitmap(mBitmapLast, 0,0, mBitmapLastPaint);            }            canvas.drawBitmap(mBitmap, 0, 0, mBitmapPaint);                canvas.drawPath(mPath, mPaint);        }    }</code></pre><p>I've tried switching around the lines </p><pre><code>canvas.drawColor(0xFFAAAAAA);                canvas.drawBitmap(background,0,0,mBitmapPaint);</code></pre><p>and when <code>canvas.drawColor(0xFFAAAAAA);</code> is second, my paths will show up when I draw them on the screen. Is there a way to make the background (bitmap) show underneath the canvas paths?</p>","413488","","142162","","2011-02-14 01:16:24","2014-03-04 07:50:57","background (image) in canvas while drawing path over the top","<java><android><graphics><path><bitmap>","1","0","","",""
"4988145","1","4992174","","2011-02-14 01:33:22","5","4313","<p>This code is used to generate a XML document from its String representation. It works fine in my small unit tests, but fails in my actual xml data. The line where it triggers is <code>Document doc = db.parse(is);</code></p><p>Any ideas?</p><pre><code>public static Document FromString(String xml){    // from http://www.rgagnon.com/javadetails/java-0573.html    try    {        DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();        DocumentBuilder db = dbf.newDocumentBuilder();        InputSource is = new InputSource();        is.setCharacterStream(new StringReader(xml));        Document doc = db.parse(is);        doc.normalize();        return doc;    }    catch (Exception e)    {        Log.WriteError(""Failed to parse XML"", e, ""XML.FromString(String)"");        return null;    }}</code></pre>","243203","","250260","","2012-07-13 17:58:08","2013-04-25 09:24:08","Why does this code keep triggering the SaxParseException : """"PI must not start with xml""?","<android><xml><saxparseexception>","6","6","","",""
"4988158","1","","","2011-02-14 01:39:02","0","1295","<p>I'm trying to create a geolocation app in android. So far i've been able to locate my current location and have it display on a map. Now i want to get a list of places the are nearest to my location. I know i will have to save the data in a database, and somehow check against it. Trouble is i don't know how to do this.  </p>","522011","","","","","2011-02-14 01:48:40","How to create an app in android that find places nearest your location","<android><database><map><geolocation>","1","0","","",""
"4988193","1","","","2011-02-14 01:47:59","0","234","<p>I want to create a screen that has a column of scrollable images on the left and a similar  column on the right with space in between them. The user selects an image in the left column and based on that selection, the images in the right column get filled up. I can drag images from the right column into the space in between to create a composite image. </p><p>What kind of layout should I use to accomplish this? Is this one view or three views? Is this a Vertical Linear Layout with three columns and do I need to use Grid view in the left and right columns?</p><p>Thanks!</p>","615605","","","","","2011-02-14 14:20:32","Android layout question - multiple widgets","<android>","1","0","","",""
"4988201","1","4990295","","2011-02-14 01:51:44","1","580","<p>I've been looking at the notepad tutorial from the android developer site, I'm sorta stuck with two areas - can anyone help?</p><p>Firstly the tutorial creates a db with 3 columns: id, title and body. I would like to change the body to a decimal value. Secondly I need to total this column with the decimal value.</p><p>So where I have the EditText for the body column is it correct to set the input type to ""numberDecimal"" in the layout xml? Are any other changes necessary?</p><p>How do I then total these the values in this column, should I use be using some sort of loop to go through each record in that column and add them together?</p><p>Such as:</p><pre><code>int total = 0;for(int i = 0; i &lt; mydb.table.NumberOfRows; i++) {     total = total + mydb.table.body[i]}</code></pre><p><em>*</em> apologies I don't even know if a function to count the number of rows exists or how to access a particular part of a table (i suck at SQL and haven't been around java for a while)</p><p>Advice would be great!</p>","590672","","200477","","2011-02-14 02:09:57","2011-02-14 08:57:10","Android SQL - Notepad Tutorial","<android><sql>","3","0","","",""
"4988222","1","4988550","","2011-02-14 01:59:16","1","2741","<p>I'm designing a music player app for Android that will feature pop-up controls. I'm currently trying to get these controls to close after a certain period of inactivity but there doesn't seem to be a clearly documented method of doing this. So far I have managed to cobble the following solution together using a few suggestions both from this site and others.</p><pre><code>private Timer originalTimer = new Timer();@Overridepublic void onCreate(Bundle savedInstanceState){    super.onCreate(savedInstanceState);    setContentView(R.layout.playcontrols);    View exitButton = findViewById(R.id.controls_exit_pane);    exitButton.setOnClickListener(this);    View volUpButton = findViewById(R.id.controls_vol_up);    volUpButton.setOnClickListener(this);    View playButton = findViewById(R.id.controls_play);    playButton.setOnClickListener(this);    View volDownButton = findViewById(R.id.controls_vol_down);    volDownButton.setOnClickListener(this);    musicPlayback();    originalTimer.schedule(closeWindow, 5*1000);    //Closes activity after 10 seconds of inactivity}</code></pre><p>And the code that should close the window</p><pre><code>//Closes activity after 10 seconds of inactivitypublic void onUserInteraction(){    closeWindow.cancel();   //not sure if this is required?    originalTimer.cancel();    originalTimer.schedule(closeWindow, 5*1000);}private TimerTask closeWindow = new TimerTask() {    @Override    public void run() {        finish();    }};</code></pre><p>The above code makes perfect sense to me but it force closes upon any user interaction. It does however close normally if untouched and won't close after interaction if I remove the second schedule, so this seems to be the problem. Also note that I imagine I will be moving this timing task to another thread to help keep the UI snappy. I need to get it working first though :D. If there's any more info I need to supply please ask and thanks for any help...Ye guys are brilliant!</p>","613428","","","","","2014-03-16 19:14:56","How to close a window/activity after a certain amount of inactivity","<java><android>","2","5","2","",""
"4988224","1","4988279","","2011-02-14 01:59:30","7","2049","<p>I am wondering how to handle user input forms in my app. (real budget lite).  Right now this is what I am doing, but I am not sure if this is the best practice:</p><p>I have two soft buttons on most of my activities that take user input: ""save"" and ""cancel"".</p><p>""save"" captures the user input and then finishes the current activity""cancel"" abandons any user input and finishes the current activityHitting the back button on the device does the same thing as ""save""</p><p>It still bothers me a little that the back button performs the function ""save and go back"".  Users who are new to android phones are probably used to web browsers, where the back button means ""forget about this page and go back to the previous page"".  If you were buying something online and you got to the final ""purchase"" page, you would not expect the back button to complete the purchase, would you?  But it seems like that behavior is the way that the built-in applications work, so I am not inclined to do it differently.</p><p>Anyway, I have looked through the official documentation and I cannot find this behavior explicitly spelled out.  Can someone point me to the right place, or at least provide some guidance as to best practice?</p><p>The choices as I see them are:</p><ol><li>Do it the way I am doing it now.</li><li>Get rid of the ""save"" button and count on the users knowing that back equals save.</li><li>Get rid of both buttons and provide a cancel feature from the menu key.</li></ol><p>The google contacts app provides the buttons ""done"" and ""revert"", by the way.  I guess ""revert"" means cancel; is there a difference?  Maybe I should have my buttons labeled ""done"" and ""revert"" instead of ""save"" and ""cancel""?  In gmail, the menu button provides the choices ""save draft"" and ""discard"".  It seems to me that we would be doing the users a favor if we had some consistency here.</p><p>Thanks in advance.</p>","353271","","","","","2011-02-15 16:32:52","how to handle ""save"" and ""cancel"" buttons and the back key","<android>","4","0","6","",""
"4988287","1","4988896","","2011-02-14 02:16:42","0","427","<p>I am making an app that will have images. When the user hits the next button the app will display the next image.</p><p>Would this be done with a server that will host the images and when the next button is hit the image in that server will go to the app,</p><p>How can i do this.</p><p>EXAMPLE OF APP IDEA...</p><p>App1</p><p>Button1 = Previous</p><p>Button2 = Next</p><p>SERVER/HOST</p><p>Image1</p><p>Image2</p><p>Image3</p><p>Image4</p><hr><p>When button2 (NEXT) is clicked it will display Image2 from server</p><p>When Button2 (NEXT) is clicked AGAIN it will display Image3 from server</p><p>-BUT-</p><p>When Button1 (Previous) is clicked it will display the previous image (e.g. Image2)</p><p>-</p><p>Sincerely,</p><p>IntelSoftApps</p><p>intelsoftandroid@gmail.com</p><p>IntelSoftApps.com</p>","583952","","","","","2011-02-14 04:49:02","How to view images in an app from a server?","<android>","1","0","","",""
"4988386","1","4988456","","2011-02-14 02:34:12","3","2140","<p>I have a ListActivity with a custom row layout.  The row layout consists of a checkbox, a textview and an imagebutton.</p><p>Behind this is an ArrayList of a custom object containing simply a String and a boolean.  I want to checkbox to reflect the boolean, the textview to reflect the Sting, and the button on the right will kick off an action.</p><p>I use the last constructor listed on the ArrayAdapter page to try to bind this all together.  <code>ArrayAdapter(Context context, int resource, int textViewResourceId, List&lt;T&gt; objects)</code></p><p>For some reason the textView is populated by the objects toString(), and not by getView.  Therefore the checkbox never gets the boolean value at all.  Any ideas?</p><pre><code>public class ListSelection extends ListActivity {    private ArrayList&lt;ListItem&gt; list;    private ArrayList&lt;String&gt; deleted;      static private final String TAG = ""kinder"";    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        Log.d(TAG, ""ListSelection.onCreate"");           list = new ArrayList&lt;ListItem&gt;();        deleted = new ArrayList&lt;String&gt;();        Intent temp = getIntent();        String[] listNames = temp.getStringArrayExtra(""listNames"");        boolean[] listStatus = temp.getBooleanArrayExtra(""listStatus"");        for (int i = 0; i &lt; listNames.length; i++) {            list.add(new ListItem(listNames[i], listStatus[i]));        }        **setListAdapter(new ArrayAdapter&lt;ListItem&gt;(this, R.layout.selectionlistitem, R.id.text, list));**    }    private class ListItem {        String listName;        Boolean listStatus;             public ListItem(String name, boolean status) {            listName = name;            listStatus = status;        }        @Override        public String toString() {            return listName;        }    }    public class ListItemArrayAdapter extends ArrayAdapter&lt;ListItem&gt; {        int resource;        LayoutInflater vi;        private List&lt;ListItem&gt; items;        public ListItemArrayAdapter(Context context, int _resource, List&lt;ListItem&gt; listitems) {            super(context, _resource, listitems);            Log.d(TAG, ""listItemArrayAdapter"");            vi = (LayoutInflater)getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);            resource = _resource;            this.items = listitems;        }        @Override        public View getView(int position, View convertView, ViewGroup parent) {            Log.d(TAG, ""listItemArrayAdapter.getView"");            LinearLayout newView;            ListItem item = getItem(position);            if (convertView == null) {                newView = new LinearLayout(getContext());                vi.inflate(resource, newView);            } else {                newView = (LinearLayout)convertView;            }            TextView textview = (TextView)newView.findViewById(R.id.text);            Log.d(TAG, item.listName);            textview.setText(item.listName);            CheckBox checkbox = (CheckBox)newView.findViewById(R.id.checkbox);            checkbox.setChecked(item.listStatus);            return newView;        }    }}</code></pre>","615639","","","","","2011-02-14 02:55:21","ListActivity with custom layout does not call getview","<android><listactivity><android-arrayadapter>","1","0","1","",""
"4988460","1","","","2011-02-14 02:56:02","1","3329","<p>My app runs fine in 2.2 OS on Droid, but many users downloaded my app and received errors. All the crash report errors show the below:</p><pre><code>java.lang.RuntimeException: Unable to start activity ComponentInfo{com.simpoware.omgannoyingsounds/com.simpoware.omgannoyingsounds.TabBar}: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.simpoware.omgannoyingsounds/com.simpoware.omgannoyingsounds.Main}: java.lang.NullPointerExceptionat android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2737)at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2753)at android.app.ActivityThread.access$2500(ActivityThread.java:129)at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2107)at android.os.Handler.dispatchMessage(Handler.java:99)at android.os.Looper.loop(Looper.java:143)at android.app.ActivityThread.main(ActivityThread.java:4701)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.RuntimeException: Unable to start activity ComponentInfo{com.simpoware.omgannoyingsounds/com.simpoware.omgannoyingsounds.Main}: java.lang.NullPointerExceptionat android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2737)at android.app.ActivityThread.startActivityNow(ActivityThread.java:2577)at android.app.LocalActivityManager.moveToState(LocalActivityManager.java:127)at android.app.LocalActivityManager.startActivity(LocalActivityManager.java:339)at android.widget.TabHost$IntentContentStrategy.getContentView(TabHost.java:651)at android.widget.TabHost.setCurrentTab(TabHost.java:323)at android.widget.TabHost.addTab(TabHost.java:213)at com.simpoware.omgannoyingsounds.TabBar.onCreate(TabBar.java:39)at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2701)... 11 moreCaused by: java.lang.NullPointerExceptionat com.simpoware.omgannoyingsounds.Main.onCreate(Main.java:58)at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2701)... 20 more</code></pre><p>Here is my code:</p><pre><code>package com.simpoware.omgannoyingsounds;import android.app.Activity;import android.media.MediaPlayer;import android.os.Bundle;import android.util.Log;import android.view.View;import android.view.View.OnClickListener;import android.widget.ImageButton;import com.greystripe.android.sdk.*;public class Main extends Activity implements OnClickListener {    // Greystripe SDK object    //private GSSDK sdk;    private BannerView myBanner;    private static final String TAG = ""AudioDemo"";    private static final String isPlaying = ""Media is Playing"";     private static final String notPlaying = ""Media has stopped Playing"";     MediaPlayer player01,player02,player03,player04,player05,player06,player07,player08,player09,player10,player11,player12;    ImageButton imgButton01=new ImageButton (this);    ImageButton imgButton02=new ImageButton (this);    ImageButton imgButton03=new ImageButton (this);    ImageButton imgButton04=new ImageButton (this);    ImageButton imgButton05=new ImageButton (this);    ImageButton imgButton06=new ImageButton (this);    ImageButton imgButton07=new ImageButton (this);    ImageButton imgButton08=new ImageButton (this);    ImageButton imgButton09=new ImageButton (this);    ImageButton imgButton10=new ImageButton (this);    ImageButton imgButton11=new ImageButton (this);    ImageButton imgButton12=new ImageButton (this);    //imgButton02,imgButton03,imgButton04,imgButton05,imgButton06,imgButton07,imgButton08,imgButton09,imgButton10,imgButton11,imgButton12;    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);                setContentView(R.layout.main);        //greystripe        //sdk = GSSDK.initialize(this.getApplicationContext(), ""ce8dec9e-25e6-45aa-b293-7472e8ba74a0"");        myBanner = (BannerView) findViewById(R.id.gsBanner);        myBanner.refresh();        //set audio player        player01 = MediaPlayer.create(this, R.raw.modem);        player02 = MediaPlayer.create(this, R.raw.high_pitch_dog_whistle);        player03 = MediaPlayer.create(this, R.raw.alarm_clock);        player04 = MediaPlayer.create(this, R.raw.faulty_mechanics_sound);        player05 = MediaPlayer.create(this, R.raw.mosquito);        player06 = MediaPlayer.create(this, R.raw.buzz);        player07 = MediaPlayer.create(this, R.raw.strange_static);        player08 = MediaPlayer.create(this, R.raw.piece_of_crap);        player09 = MediaPlayer.create(this, R.raw.house_fire_alarm);        player10 = MediaPlayer.create(this, R.raw.hailstorm);        player11 = MediaPlayer.create(this, R.raw.electric_toothbrush);        player12 = MediaPlayer.create(this, R.raw.ecg);        player01.setLooping(true); // Set looping        player02.setLooping(true); // Set looping        player03.setLooping(true); // Set looping        player04.setLooping(true); // Set looping        player05.setLooping(true); // Set looping        player06.setLooping(true); // Set looping        player07.setLooping(true); // Set looping        player08.setLooping(true); // Set looping        player09.setLooping(true); // Set looping        player10.setLooping(true); // Set looping        player11.setLooping(true); // Set looping        player12.setLooping(true); // Set looping        // Get the ImageButton from XML        imgButton01 = (ImageButton) this.findViewById(R.id.ImageButton01);        imgButton02 = (ImageButton) this.findViewById(R.id.ImageButton02);        imgButton03 = (ImageButton) this.findViewById(R.id.ImageButton03);        imgButton04 = (ImageButton) this.findViewById(R.id.ImageButton04);        imgButton05 = (ImageButton) this.findViewById(R.id.ImageButton05);        imgButton06 = (ImageButton) this.findViewById(R.id.ImageButton06);        imgButton07 = (ImageButton) this.findViewById(R.id.ImageButton07);        imgButton08 = (ImageButton) this.findViewById(R.id.ImageButton08);        imgButton09 = (ImageButton) this.findViewById(R.id.ImageButton09);        imgButton10 = (ImageButton) this.findViewById(R.id.ImageButton10);        imgButton11 = (ImageButton) this.findViewById(R.id.ImageButton11);        imgButton12 = (ImageButton) this.findViewById(R.id.ImageButton12);        //Set click listener        imgButton01.setOnClickListener(this);        imgButton02.setOnClickListener(this);        imgButton03.setOnClickListener(this);        imgButton04.setOnClickListener(this);        imgButton05.setOnClickListener(this);        imgButton06.setOnClickListener(this);        imgButton07.setOnClickListener(this);        imgButton08.setOnClickListener(this);        imgButton09.setOnClickListener(this);        imgButton10.setOnClickListener(this);        imgButton11.setOnClickListener(this);        imgButton12.setOnClickListener(this);    }//more coding...but I only include the necessary coding}</code></pre>","615613","","375874","","2011-02-14 02:58:22","2011-02-21 08:54:30","java.lang.NullPointerException in Main.onCreate()?","<java><android>","2","9","","",""
"4988570","1","4988590","","2011-02-14 03:21:44","6","2413","<p>Hi I have a layout with 3 button at the top in a row and then a ListView followed by a button below the listView.This is my layout.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=""fill_parent""&gt;&lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""&gt;    &lt;Button android:id=""@+id/btn_top10""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:text=""TOP 10""/&gt;    &lt;Button android:id=""@+id/btn_top100""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:text=""TOP 100""        android:layout_toRightOf=""@id/btn_top10""/&gt;    &lt;Button android:id=""@+id/btn_showAll""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:text=""Show All""        android:layout_toRightOf=""@id/btn_top100""/&gt;    &lt;ListView android:id=""@+id/LV_Device""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:layout_below=""@id/btn_top10""        android:layout_above=""@id/LV_Device""/&gt;    &lt;Button android:id=""@+id/btn_clearResult""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:text=""Clear Results""        android:layout_below=""@id/LV_Device""/&gt;  &lt;/RelativeLayout&gt;</code></pre><p></p><p>This will give a result like this </p><p><img src=""http://i.stack.imgur.com/fCV5W.png"" alt=""enter image description here""></p><p>If i add some values to the ListView then its ok, the button below will be show</p><p><img src=""http://i.stack.imgur.com/yA2XV.png"" alt=""enter image description here""></p><p>But if the listview becomes larger than the screen size then the button below that will not be visible even after scrolling to the bottom of the listView</p><p><img src=""http://i.stack.imgur.com/5WM5I.png"" alt=""enter image description here""></p><p>How to solve this issue?? I don't want button to be fixed at the bottom of the screen. I want the button to be show at the end of the ListView only</p>","466474","","","","","2012-09-11 12:57:45","Missing Button Placed after ListView","<android><listview><android-layout>","5","0","3","",""
"4988676","1","","","2011-02-14 03:47:37","6","6009","<p>In my android application i am opening a webview.I want to hide url that is getting loaded,so the default window progress bar doesnot work for me.</p><p>Is there any way than that i can add progress dialogue on webview.</p><p>I am using the below code.</p><pre><code> mWebView = (WebView) findViewById(R.id.webview);     mWebView.getSettings().setJavaScriptEnabled(true);      final Activity activity = this;      mWebView.setWebChromeClient(new WebChromeClient(){      public void onProgressChanged(WebView view, int progress) {      activity.setTitle(""Loading..."");      activity.setProgress(progress * 100);      if(progress == 100)      activity.setTitle(""My title"");      }      });      mWebView.loadUrl(Url);     mWebView.setWebViewClient(new HelloWebViewClient());    }    catch(Exception e)    {        e.printStackTrace();    }</code></pre><p>}</p><pre><code>private class HelloWebViewClient extends WebViewClient {       ProgressDialog MyDialog=new ProgressDialog(context);    public boolean shouldOverrideUrlLoading(WebView view, String url) {            MyDialog.show();          view.loadUrl(url);          return true;           }</code></pre><p>Please share your valuable suggestions.</p><p>Thanks in advance :)</p>","420261","","545951","","2013-04-23 18:21:38","2013-04-23 18:21:38","show progress dialog on webview","<android>","1","0","1","",""
"4988698","1","5061419","","2011-02-14 03:53:28","1","1283","<p>I've written an iOS app that I want to port to android.  This app is a front-end for a web-based timekeeping system at work.  Unfortunately, the system doesn't have an API, so I'm screen-scraping it using xpath queries in javascript.  In iOS, I only have to load this page once because I get full control over when instances of my UIWebView get destroyed. iOS app only has 3 use cases, each which break into separate Android activities: Login View a list of all reported times Report a new time. Using a naive approach, my android views (including the WebView I need to use to interact with the timekeeping system) will be destroyed and recreated when I switch between views.  If I have to reload the WebView every time I switch activities, my app will appear very slow. Is it possible to share a WebView instance between multiple activities?  I know I can set the launchMode to singleInstance, but ideally, it would be nice to allow separate instances so that the back button would function normally. </p>","9636","","","","","2011-02-21 01:17:50","Share a WebView between activities","<android>","1","0","","",""
"4988774","1","","","2011-02-14 04:15:54","0","549","<p>Is there a way for Android application to detect how it is being launched?  whether by a BOOT or by user launching the application from the application list?</p><p>When my application is launched on boot I don't want any activity to show at all.  When the user specifically launches it from the application list,  then and only then would I want the main activity to show.  If I could detect whether the launch was a user launch or system boot launch I might be able to control this.</p>","602260","","","","","2011-02-14 06:35:50","Android Can Applicaton Detect How it is being Launched?","<android><activity><boot>","1","2","","",""
"4988792","1","5012408","","2011-02-14 04:20:31","0","1700","<p>i am trying my first map application in android but when i run the application, a message in the emulator is displayed saying ""the application <em>APPLICATION NAME</em> stopped unexpectedly"". </p><p>i would appreciate if someone would help me debug, here is the code:</p><p>demomaps.java</p><pre><code>    package com.tutorial.demomaps;//import android.app.Activity;import android.os.Bundle;import android.widget.LinearLayout;import com.google.android.maps.*;public class demomaps extends MapActivity {    /** Called when the activity is first created. */    LinearLayout linearLayout;    MapView mapView;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        mapView = (MapView)findViewById(R.id.mapview);        mapView.setBuiltInZoomControls(true);        setContentView(R.layout.main);    }    @Override    protected boolean isRouteDisplayed()    {        return false;    }}</code></pre><p>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:clickable=""true""    android:apiKey=""00OHG4fs5JkMMURfVtKse-D3wVv1BImlK_3zz3g""&gt;   &lt;/com.google.android.maps.MapView&gt;&lt;/RelativeLayout&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.tutorial.demomaps""      android:versionCode=""1""      android:versionName=""1.0""&gt;    &lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;        &lt;activity android:name="".demomaps""                  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:name=""com.google.android.maps""&gt;&lt;/uses-library&gt;    &lt;/application&gt;    &lt;uses-permission android:name=""android.permission.INTERNET""&gt;&lt;/uses-permission&gt;&lt;/manifest&gt;</code></pre><p>Thanks,Sid</p>","2288136","","","","","2011-02-16 04:01:03","Map Demo application in android now working properly","<android><view><map>","2","0","","",""
"4988819","1","4989191","","2011-02-14 04:27:56","5","3806","<p><br>Me started an activity like this   </p><pre><code>Intent mainIntent = new Intent(v.getContext(), Second.class);startActivity(mainIntent);overridePendingTransition(android.R.anim.slide_out_right,                        android.R.anim.slide_in_left);</code></pre><p>I have set overridePendingTrasition for animation.<br>You can see i have set animation the <em>oposite to the normal</em> android startactivity animation.So now this two animation get collapsed each other.<br> <strong>I want block the default animation (left->right) for while we use start activity</strong><br>Thank you</p>","609646","","","","","2011-02-14 05:43:47","Block the default animation for startActivity","<android>","1","3","6","",""
"4988850","1","4988960","","2011-02-14 04:34:20","4","7369","<p>I have a text view in my layout. My requirement is when I press or focus it, the text should be bold. Otherwise it should be with the normal font. How can I implement it?</p>","504162","","","","","2011-02-14 04:57:19","Android how to make TextView text bold when pressed or focussed","<android><textview>","1","0","","",""
"4988863","1","","","2011-02-14 04:37:12","9","15088","<p>Hi am testing horizontal scrollview i came to a strange problem ,i put one button in horizontal scrollview with layout height and width fill_parent but that tag have no effect in layout ,lets look in to my layout </p><p></p><pre><code>&lt;HorizontalScrollViewandroid:layout_width=""wrap_content""android:layout_height=""fill_parent""android:fillViewport=""true""&gt;    &lt;LinearLayout        android:id=""@+id/linearLayout1""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""        &gt;        &lt;Button                         android:text=""Button""            android:id=""@+id/button1""            android:layout_width=""fill_parent""            android:layout_height=""fill_parent""&gt;        &lt;/Button&gt;    &lt;/LinearLayout&gt;    &lt;/HorizontalScrollView&gt;</code></pre><p></p><p>How can i fill the layout with my button inside horizontal scrollview</p>","487219","","","","","2012-11-21 15:38:39","android horizontal scrollview","<android>","2","3","1","",""
"4988976","1","4988993","","2011-02-14 05:02:20","0","1196","<p>Some that I know are color, layout, drawable,values.<br> layout and drawable for different resolution and density.  </p>","609646","","","","","2011-02-14 05:05:34","What all folder i can add in the 'res' folder?","<android>","1","0","","",""
"4988986","1","","","2011-02-14 05:03:44","0","232","<p>hello i am using java.util.Timer for scheduling task and show notification for appointments only one time but if i cancel schedule appointment with help of timer.cancel(); and timer.purge();<br>it's unable to cancel and it performs on a particular time...</p><p>Please Help....</p>","525175","","","","","2011-02-14 13:22:31","unable to cancel schedule task","<android>","1","1","","",""
"4989000","1","4989286","","2011-02-14 05:08:36","0","4709","<p>I am making an application and I want to design a Loading Starting interface in my aplication . I have an image displaying my application name. what I want is that I have a .gif aniamted loading icon and I want to display it on the first Screen. I have designed my first screen just I needed. Some help that it should display that .gif animated loading image and then wait for some time after that open my next activity. Please help me.... </p><p>Thanks a bunch in advance.</p>","521015","","493193","","2011-02-14 10:25:35","2011-02-14 10:25:35","Needed to make a Loading Screen in Android","<android>","3","0","1","",""
"4989010","1","4989163","","2011-02-14 05:10:33","6","6206","<p>I am developing an app, where an image taken from the native camera app. is to be shown to the user.The code I did is:</p><pre><code>/* Intent */Intent intent = new Intent(""android.media.action.IMAGE_CAPTURE"");startActivityForResult(intent, TAKE_PICTURE);/* Result */onActivityResult(int requestCode, int resultCode,        Intent returnIntent) {    if(requestCode == TAKE_PICTURE) {        //picture from Camera        if (resultCode == Activity.RESULT_OK) {            if(returnIntent != null) {                try {                    // Get the file path where the image is stored.                    // This runs fine on all devices, except Samsung ones.                    Uri selectedImage = returnIntent.getData();                    if(selectedImage == null) {                        if(returnIntent.getExtras() != null &amp;&amp;                            returnIntent.getExtras().get(AppConstants.DATA) != null) {                            // But, I get the image Bitmap here. Means the image is stored in disk.                            Bitmap bmp = (Bitmap) returnIntent.getExtras().get(AppConstants.DATA);                        }                    }                } catch (Exception e) {                    //                }            }        }    }}</code></pre><p>The problem here is, the above code works fine on all devices I tried (HTC's, SE's) but it somehow fails in the Samsung ones. The ""Uri selectedImage = returnIntent.getData();"" never returns anything. As my entire app is built over this logic of file path storing, I am not able to proceed. Is there any solution people. </p>","615731","","114066","","2012-03-28 12:51:20","2012-12-05 10:32:13","Android Samsung: Camera app won't return intent.getData()","<android>","2","1","2","",""
"4989140","1","4989370","","2011-02-14 05:35:00","0","377","<p>I have a tab bar in my application, with third tab named About. When user clicks on this About tab, I want activity to be displayed with blur effect. More specifically, About activity should be on front, while previous tab should be displayed behind with blur effect. I did the following code in the about.java onCreate Method, but it opens new window and the previous windows are not being displayed. </p><pre><code>public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        //This is the code used to add blur effect        getWindow().setFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND,                WindowManager.LayoutParams.FLAG_BLUR_BEHIND);        setContentView(R.layout.about);}</code></pre><p>If I do it without tab bar it works. Any suggestions on what might be going wrong or how to do it in a different way?</p>","521015","","644348","","2012-07-15 08:15:53","2012-07-15 08:15:53","Displaying activity with blur effect in Android Tabs","<android>","1","0","","",""
"4989175","1","","","2011-02-14 05:41:43","0","296","<p>I am new to android. I have a <code>TableLayout</code> define in <code>XML</code> file,and I am adding dynamic row in it in <code>Java</code> file. </p><p>In each row there is a <code>button</code> and a <code>TextView</code>, but in the end I want that particular action should perform on each button click event. But I am getting the click event of  these buttons.</p><p>Here is my code:</p><pre><code>                TableRow row = new TableRow(this);                row.setLayoutParams(new LayoutParams(ViewGroup.LayoutParams.FILL_PARENT, TableRow.LayoutParams.WRAP_CONTENT,position, position));                TextView tv = new TextView(this);                ph_call = new Button(this);                email = new Button(this);                tv.setText(entry.contact_name);                TextView tv1 = new TextView(this);                ph_call.setBackgroundResource(R.drawable.phone1);                email.setBackgroundResource(R.drawable.e_mail_icon);                ph_call.setPadding(20, 10, 5, 5);                tv1.setPadding(10, 10,5, 5);                tv.setPadding(10, 10,90, 5);                tv1.setText(entry.email_id);                row.addView(ph_call);                row.addView(tv);                row.addView(email);                row.addView(tv1);</code></pre>","615751","","559070","","2011-02-14 06:33:17","2011-02-14 06:33:17","click on the button inside a table is not working?","<android><events><button><click>","0","3","","",""
"4989179","1","","","2011-02-14 05:42:35","0","48","<p>I am developing an android application,There are not errors in the application,Nor the application crashes .But i t shows blank screen after Splash ScreenCan anyone help me out</p><p>RegardsThanks in advanceTushar</p>","475349","","524566","","2011-02-14 06:06:54","2011-02-14 06:06:54","application not installing on android simulator","<android>","0","2","","",""
"4989182","1","4989543","","2011-02-14 05:42:51","80","67771","<pre><code>  Bitmap bmp   = intent.getExtras().get(""data"");  int size     = bmp.getRowBytes() * bmp.getHeight();  ByteBuffer b = ByteBuffer.allocate(size);  bmp.copyPixelsToBuffer(b);  byte[] bytes = new byte[size];  try {     b.get(bytes, 0, bytes.length);  } catch (BufferUnderflowException e) {     // always happens  }  // do something with byte[]</code></pre><p>When I look at the buffer after the call to <code>copyPixelsToBuffer</code> the bytes are all 0... The bitmap returned from the camera is immutable... but that shouldn't matter since it's doing a copy. </p><p>What could be wrong with this code?</p>","457577","","457577","","2013-08-05 14:59:12","2013-08-05 14:59:12","converting Java bitmap to byte array","<java><android><serialization><bitmap><bytebuffer>","3","0","36","",""
"4989206","1","4989737","","2011-02-14 05:47:12","3","3919","<p>I have built a database helper class with an open() method and extended sqlite helper with onCreate() overridden. (shown below). Despite all of this, I am getting 'SQLiteException, no such table' error. I do not understand, why is the openHelper not helping?</p><pre><code>public void open() {    try{        db = openHelper.getWritableDatabase();    } catch (SQLiteException e) {        db = openHelper.getReadableDatabase();    }}//other stuffpublic static final String database_create = ""create table "" + database_table + "" ("" + primary_key + "" integer primary key autoincrement, ""     + company_column + "" text not null, "" + product_column + "" text not null);"";    @Override    public void onCreate(SQLiteDatabase _db) {        _db.execSQL(database_create);    }</code></pre><p>the following code is meant to insert an entry temporarily, because the database cannot be empty for other reasons. It seems to execute perfectly, yet the last bit of code, which comes after is what throws the error</p><pre><code>CompanyAndProductDatabaseAdapter cpdAdapter = new CompanyAndProductDatabaseAdapter(this);    cpdAdapter.open();    errorguard = cpdAdapter.insertPair(""Loading"", ""..."");    cpdAdapter.close();//other stuffcpdAdapter.open();    Cursor cursor = cpdAdapter.getAllPairsCursor(); //error here    cursor.requery();    startManagingCursor(cursor);</code></pre>","615759","","","","","2012-05-30 10:57:02","No such table SQLite Android","<android><sqlite>","2","1","","",""
"4989233","1","","","2011-02-14 05:52:03","1","2883","<p>I want to develop an android application which can access USB. But there is no API support for USB in Android. Can anyone suggest me, how can I do this?</p><p>I want to use my android phone as USB host. </p>","615766","","493193","","2011-02-14 10:06:28","2012-09-11 21:09:22","USB programming in Android","<android>","2","3","","",""
"4989300","1","","","2011-02-14 06:03:31","0","3012","<p>I don't understand why I'm not able to copy my db file (index.db) to the application directory ""/data/data/com.cmc.sqlitedb/databases/"") This is my DataBaseHelper class </p><pre><code>package com.cmc.sqlitedb;import java.io.*;import java.util.Arrays;import java.util.zip.ZipEntry;import java.util.zip.ZipInputStream;import android.content.Context;import android.content.res.AssetManager;import android.database.SQLException;import android.database.sqlite.SQLiteDatabase;import android.database.sqlite.SQLiteException;import android.database.sqlite.SQLiteOpenHelper;import android.util.Log;public class DataBaseHelper extends SQLiteOpenHelper{    //The Android's default system path of your application database.    private static String DB_PATH = ""/data/data/com.cmc.sqlitedb/databases/"";    private static String DB_NAME = ""index.db"";    private SQLiteDatabase myDataBase;     //private final Context myContext;    private final Context Ctxt;    /**     * Constructor     * Takes and keeps a reference of the passed context in order to access to the application assets and resources.     * @param context     */    public DataBaseHelper(Context context) {        super(context, DB_NAME, null, 1);        this.Ctxt = context;    }     /**     * Creates a empty database on the system and rewrites it with your own database.     * */    public void createDataBase() throws IOException    {         File Path = Ctxt.getDir(""Data"", 0);         File DBFile = new File(Path, ""Index.db"");         Log.v(""4"",""four"");        boolean dbExist = checkDataBase();        if(dbExist)        {            Log.v(""5"",""five"");            //do nothing - database already exist        }        else        {            Log.v(""6"",""six"");            //By calling this method and empty database will be created into the default system path               //of your application so we are gonna be able to overwrite that database with our database.            this.getReadableDatabase();            try             {                Log.v(""7"",""seven"");               //copyDataBase(Ctxt, DBFile);               copyDataBase();                Log.v(""copyDataBase"",""after copyDataBase"");            }             catch (IOException e)             {                throw new Error(""Error copying database"");            }        }    }    /**     * Check if the database already exist to avoid re-copying the file each time you open the application.     * @return true if it exists, false if it doesn't     */    private boolean checkDataBase(){        SQLiteDatabase checkDB = null;        try{            String myPath = DB_PATH + DB_NAME;            checkDB = SQLiteDatabase.openDatabase(myPath, null, SQLiteDatabase.OPEN_READONLY);        }catch(SQLiteException e){            //database does't exist yet.        }        if(checkDB != null){            checkDB.close();        }        return checkDB != null ? true : false;    }    /**     * Copies your database from your local assets-folder to the just created empty database in the     * system folder, from where it can be accessed and handled.     * This is done by transfering bytestream.     * */    private void copyDataBase() throws IOException{        Log.v(""8"",""eight"");                //Open your local db as the input stream        InputStream myInput = Ctxt.getAssets().open(DB_NAME);        BufferedInputStream bis = new BufferedInputStream(myInput);//      InputStream myInput = myContext.getResources().openRawResource(R.raw.freq_app);        Log.v(""9"",""nine"");        // Path to the just created empty db        String outFileName = DB_PATH + DB_NAME;        Log.v(""DB_PATH"",DB_NAME);        //Open the empty db as the output stream          File f = new File( DB_PATH );          if ( !f.exists() )              f.mkdir();        OutputStream myOutput = new FileOutputStream(outFileName);        //.createNewFile();         Log.v(""OutputStream"",""OutputStream"");        //transfer bytes from the inputfile to the outputfile        byte[] buffer = new byte[6624256];        int length;</code></pre><blockquote>  <p>here it throws error in while loop IOexception</p></blockquote><pre><code>        while ((length = myInput.read(buffer))&gt;0){            myOutput.write(buffer, 0, length);        }                   //Close the streams        myInput.close();        Log.v(""COPY DATA BASE"",""end of copyDataBase"");    }    public void openDataBase() throws SQLException{        //Open the database        String myPath = DB_PATH + DB_NAME;        myDataBase = SQLiteDatabase.openDatabase(myPath, null, SQLiteDatabase.OPEN_READONLY);    }    @Override    public synchronized void close() {            if(myDataBase != null)                myDataBase.close();            super.close();    }    @Override    public void onCreate(SQLiteDatabase db) {    }    @Override    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {    }        // Add your public helper methods to access and get content from the database.       // You could return cursors by doing ""return myDataBase.query(....)"" so it'd be easy       // to you to create adapters for your views.}main class :package com.cmc.sqlitedb;import java.io.IOException;import android.app.Activity;import android.database.Cursor;import android.database.sqlite.SQLiteDatabase;import android.os.Bundle;import android.util.Log;import android.view.View;import android.widget.Button;import android.widget.TextView;import com.cmc.sqlitedb.DataBaseHelper;import com.cmc.sqlitedb.R;public class SqLiteTest extends Activity {    /** Called when the activity is first created. */    private SQLiteDatabase db;    private TextView Colors;    private Button click;    private String result1=null;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        db = openOrCreateDatabase(                ""index.db""                , SQLiteDatabase.CREATE_IF_NECESSARY                , null    );        Log.v(""size of db"", """"+db.getMaximumSize());       DataBaseHelper myDbHelper = new DataBaseHelper(this);            myDbHelper = new DataBaseHelper(this);              try               {                myDbHelper.createDataBase();                Log.v(""done"", ""Done"");              }               catch (IOException ioe)               {              throw new Error(""Unable to create database"");              }         setContentView(R.layout.main);        Colors=(TextView)findViewById(R.id.color);        click=(Button)findViewById(R.id.Button);        click.setOnClickListener(new View.OnClickListener()        {                   public void onClick(View view)             {                               try{                                        //code to connect db  and get data frm db                    result1=colorDetails();                     Log.v(""Result1"",""""+result1);                }                 catch(Exception e)                {                    System.out.println(e);                }               db.close();            }    }); }    public String colorDetails()    {           Log.v(""Reading"", ""reading"");        Cursor cur = db.rawQuery(""select * from chip LIMIT 20"",null);        Log.v(""Reading ok"", ""reading ok"");        Log.v("""",""""+cur.getString(9));                      return result1; }}</code></pre>","606436","","185022","","2011-02-18 11:26:07","2013-02-27 12:02:05","Having problem while copying sqlite database from assets to data folder","<android>","1","2","","",""
"4989342","1","","","2011-02-14 06:13:30","0","941","<p>I am trying to make my program to open the gallery, when I click on an image in my program. The only thing that is really confusing is how to load the image into the gallery, if the image is from the web. Right now i am just making a drawable from URL. Is there a way to start the gallery intent and pass it the url or even a drawable to show the image?</p>","587009","","493193","","2011-02-14 08:05:23","2011-02-14 08:05:23","Open gallery on imagview click","<android><url><gallery><imageview>","1","0","","",""
"4989355","1","","","2011-02-14 06:16:28","2","709","<p>I have an Nook Color (Android 2.1) device and the app which is going to read some huge files (PDFs) from sdcard.I'm going to use FileInputStream for file reading (and it works fine both on emulator and on Android 2.2+ devices).Unfortunately it works painfuly slow (about 25 sec for 125Mb file) while executing the following code:</p><pre><code>FileInputStream fileInputStream = new FileInputStream(filename);fileInputStream.skip(offset);BitmapFactory.Options options = new BitmapFactory.Options();Bitmap bitmap = BitmapFactory.decodeStream(fileInputStream, null, options);fileInputStream.close();return bitmap;</code></pre><p>The file is placed somewhere on sd card. The offset could points to any point at the file (even to the beginning) -- the problem is still in place.</p><p>What could be a reason of this performance problem?</p>","234745","","226086","","2011-03-13 17:18:26","2011-03-13 17:18:26","Android 2.1 file reading is slow","<android><file-io><android-2.1-eclair><nook>","1","0","2","",""
"4989373","1","","","2011-02-14 06:19:17","0","1274","<p>i am using the below code to play song from server.</p><pre><code>mediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);mediaPlayer.setDataSource(playUrl);</code></pre><p>And i am calling start method from <code>public void onPrepared(MediaPlayer mp)</code> method.But what happens is sometimes it's buffering 5 to 6% and starts playing and sometimes it buffers 40 or 60 or sometimes 80%.And i am using <code>prepareAsync ()</code> to prepare player. So, is there any way that I can play song after 5 or 6%?</p><p>thankx</p>","411359","","467900","","2011-02-14 10:54:01","2011-02-14 14:30:44","Controlling the streaming with MediaPlayer","<android><streaming><media-player>","1","0","","",""
"4989425","1","","","2011-02-14 06:28:19","0","1947","<p>I am trying to get the launcher2 source code, but it says use repo and git.</p><p>Does anyone know what to do to do this?</p><p>i have tried multiple times!</p><p>--</p><p>Or if any one has the actual source code i can download from that would also be very helpful!</p>","583952","","648313","","2011-07-13 21:00:45","2013-08-15 09:34:03","GETTING LAUNCHER2 SOURCE CODE?","<android><android-source>","2","0","","",""
"4989545","1","4989573","","2011-02-14 06:50:17","3","992","<p>How to make an EditText look like a TextView that is done in Java but not in XML..</p><p>I have seen how to do it using xml file like</p><pre><code>style=""@android:style/Widget.TextView""android:editable=""false""android:cursorVisible=""false""android:longClickable=""false""</code></pre><p>but i want this to be done in java because i am not using any xml file for the layout..everything is done in code itself ..I am trying to use GestureListener in my code .. it worked fine for TextView but not EditTextSo, anything to do for the EditText so that the GestureEvents can be implemented ?</p><p>Thanks,</p>","598331","","598331","","2011-02-14 07:08:02","2014-03-18 14:50:09","Make EditText behave as a TextView in code","<android>","3","0","2","",""
"4989572","1","","","2011-02-14 06:54:57","1","844","<p>Hi i would like to know how to use the intent ACTION_TIME_TICK for every second rather than for every minute?</p>","596317","","","","","2011-02-14 14:51:27","How to launch intent ACTION_TIME_TICK for every second?","<java><android><time><android-intent>","1","0","","",""
"4989650","1","","","2011-02-14 07:10:44","0","132","<p>My Requirement is to manage the applications operations(install, update, remove) happens in any android device in the cloud. I could get the list all installed app in my deice through PackageManager Class. Also i am able to notified whenever any operations takes place in my device through intents filters like 'ACTION_PACKAGE_ADDED' through BroadCastRecievers. But i am unable get the app information (like name and others stuff) whenever any app installed and updates. I could get only notifications like installation.. update..removal.. not the details abut the app has been installed..updated..</p><p>Please help me out in regarding this...</p><p>Thanks in advance..</p><p>RegardsPrakhs</p>","557012","","17279","","2011-02-14 07:44:07","2011-02-14 07:44:07","To get information about the App just installed","<android>","0","2","","",""
"4989651","1","","","2011-02-14 07:10:59","1","507","<p>Dear all  I have an android activity and a normal .java class which contains an ""onChange"" function(the function is called whenever properties of my skype contact are changed)</p><p>When I try to call an alertdialog.show() in my onChange function, I got error ""Can't create handler inside thread that has not called Looper.prepare()"", what should I do to show a message in my activity? thanks in advance</p>","615842","","","","","2011-02-14 08:05:14","Communicate with android activity in a normal java class","<android>","1","0","","",""
"4989702","1","","","2011-02-14 07:21:09","1","1126","<p>I have to impliment the same logic to generate unique ids in my project for different component created at runtime as R.java does. Some one can help me</p>","613150","","","","","2011-02-14 08:15:14","how do I generate unique ids for different component created at runtime as R.java create unique for all calsses","<android>","1","0","","",""
"4989738","1","","","2011-02-14 07:27:24","3","25050","<p>I loaded a local html in sdcard, and in this html I used tag : </p><pre><code>&lt;video id=""myvideo"" controls width=""120"" height=""60"" poster=""img/img01.jpg"" src=""video/01.mp4""&gt;&lt;/video&gt;</code></pre><p>and then I found that I didn't loaded this html, when I disabled the tag:, the html was working fine, and I tested this in my android avd(2.2) ? </p>","51958","","467900","","2011-10-21 07:41:15","2012-10-19 03:49:12","How to play a video in a webview with android?","<javascript><android><html5><android-widget><android-webview>","2","1","14","",""
"4989743","1","4991333","","2011-02-14 07:28:05","1","6373","<p>I'm trying to connect to a webservice where my querysting holds some data. The bad thing is that this data contains utf-8 charcters, which renders a problem.</p><p>If I simply call HttpGet with the ordinary string I get the ""illegal character"" exception. So I googled and tried some utf-8 magic.</p><pre><code>            HttpClient httpclient = new DefaultHttpClient();        httpclient.getParams().setParameter(""http.protocol.content-charset"", ""UTF-8"");        String utfurl = URLEncoder.encode(url, ""utf-8"");        HttpGet httpGet = new HttpGet(utfurl);        HttpResponse response = httpclient.execute(httpGet);        content = response.getEntity().getContent();            } catch (Exception e) {                Log.d(TAG, ""getInputStream: "" +e.getMessage());</code></pre><p>Now I won't get the illegal charcter, but it seem to mess upp the utfurl completely since I instead get the ""target host must not be null, or set in parameters"". Probably because he doesnt recognize the ""http://"" part in a messed up string.Any advice?</p><p>Regards</p>","498112","","","","","2011-02-14 10:58:05","android httpclient and utf-8","<android><utf-8><httpclient><http-get>","1","3","5","",""
"4989750","1","5117529","","2011-02-14 07:29:01","0","939","<p>I'm writing not so complicated application but I have a big problem;)</p><p>In my application are some activities first, login page than, nfc tag reader and than, some menu. My question is how to catch in my second activity that intent with discoverd tag with out restarting activity? What to use</p>","615855","","","","","2011-04-05 12:15:46","Android NFC App","<android><activity><android-intent><nfc>","2","0","1","",""
"4989754","1","","","2011-02-14 07:29:15","3","205","<p>As a developer of android application that implements part of its functionality using native code (c++), I would like to prioritize my effort based on a per cpu brand and architecture (e.g. ARMv6, ARMv7, etc)</p>","102092","","","","","2011-02-14 21:13:24","Where can I find stats on Android distribution (number of devices) by cpu?","<android>","1","0","1","",""
"4989757","1","","","2011-02-14 07:29:57","5","8101","<p>Hi I am trying to set Alarm in my application Using the AlarmClock class. I am using the code as follows:</p><pre><code> Intent intent = new Intent(); intent.setAction(AlarmClock.ACTION_SET_ALARM); startActivity(intent);</code></pre><p>But I am getting an exception. Can anyone please tell how to use this android new features.</p><p>Thanks in advance.</p>","519846","","537865","","2011-02-14 09:10:12","2012-06-18 13:29:19","How to set Alarm using alarm clock class","<android><clock><alarm>","3","1","4","",""
"4989780","1","4989816","","2011-02-14 07:33:28","0","418","<p>I need to capture the video with standard controls , at present i can capture the video using mediarecorder, I need a timer to show duration of video recording and some standard control to record video. Is there any other class is available?</p>","555806","","","","","2011-02-14 07:39:52","Android Video recording with controls?","<android><video>","1","0","","",""
"4989811","1","5114088","","2011-02-14 07:39:19","0","1020","<p>i have written android code and map(html) code by referring this link <a href=""http://code.google.com/intl/en/apis/maps/articles/android_v3.html#why"" rel=""nofollow"">http://code.google.com/intl/en/apis/maps/articles/android_v3.html#why</a></p><p>i got out put for the same code, but when i changed the html code like this,</p><p><strong>HERE IS MY HTML Code</strong></p><pre><code>&lt;!DOCTYPE html&gt; &lt;html&gt;&lt;head&gt; &lt;meta name=""viewport"" content=""initial-scale=1.0, user-scalable=no""/&gt; &lt;meta http-equiv=""content-type"" content=""text/html; charset=UTF-8""/&gt; &lt;title&gt;Google Maps JavaScript API v3 Example: Directions Simple&lt;/title&gt; &lt;link href=""http://code.google.com/apis/maps/documentation/javascript/examples/default.css"" rel=""stylesheet"" type=""text/css"" /&gt; &lt;script type=""text/javascript"" src=""http://maps.google.com/maps/api/js?sensor=false""&gt;&lt;/script&gt; &lt;script type=""text/javascript""&gt; var directionDisplay;var directionsService = new google.maps.DirectionsService();var map;function initialize() {    directionsDisplay = new google.maps.DirectionsRenderer();    var chicago = new google.maps.LatLng(41.850033, -87.6500523);    var myOptions = {      zoom:7,      mapTypeId: google.maps.MapTypeId.ROADMAP,      center: chicago    }    map = new google.maps.Map(document.getElementById(""map_canvas""), myOptions);    directionsDisplay.setMap(map);}function calcRoute() {    var start ;    var end ;    if (window.android){      start= window.android.getsource();     end = window.android.getdestination();    }    var request = {        origin:start,         destination:end,        travelMode: google.maps.DirectionsTravelMode.DRIVING    };    directionsService.route(request, function(response, status) {    if (status == google.maps.DirectionsStatus.OK) {        directionsDisplay.setDirections(response);    } });}&lt;/script&gt; &lt;/head&gt; &lt;body onload=""initialize()""&gt; &lt;div&gt; &lt;input id=""latlng"" type=""textbox"" value=""Chicago""&gt; &lt;input id=""latlng1"" type=""textbox"" value=""Kingman""&gt;&lt;/div&gt; &lt;div&gt; &lt;input type=""button"" value=""Get Route"" onclick=""calcRoute()""&gt; &lt;/div&gt; &lt;div id=""map_canvas""&gt;&lt;/div&gt; &lt;/body&gt; &lt;/html&gt;</code></pre><p><strong>HERE IS MY ANDROID Code</strong></p><pre><code>package com.example.test;import java.io.FileInputStream;import java.io.FileNotFoundException;import java.io.FileOutputStream;import java.io.IOException;import java.io.InputStreamReader;import android.app.Activity;import android.content.Context;import android.content.pm.ActivityInfo;import android.os.Bundle;import android.webkit.WebView;import android.webkit.WebViewClient;import android.widget.Toast;public class tset extends Activity {private static final String MAP_URL = ""http://192.168.1.119:81/fulfed1.html"";  private WebView webView;     public static String disp;  @Override  /** Called when the activity is first created. */  public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    webView = (WebView) findViewById(R.id.webview);    webView.getSettings().setJavaScriptEnabled(true);    //Wait for the page to load then send the location information    webView.setWebViewClient(new WebViewClient());    webView.loadUrl(MAP_URL);    /** Allows JavaScript calls to access application resources **/    webView.addJavascriptInterface(new JavaScriptInterface(), ""android"");    this.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);  }  /** Sets up the WebView object and loads the URL of the page **/  public class JavaScriptInterface  {    public String getsource(){        return ""Washington"";    }    public String getdestination(){        return  ""Newyork"";    }    }  }</code></pre><p>i am not getting route direction upon click on ""Get route"" button in my html code,please help what's wrong in my code.</p>","505580","","505580","","2011-02-14 09:38:48","2011-02-25 05:51:55","JavaScriptInterface() is not working in android","<javascript><android><html>","2","1","","",""
"4989817","1","4990868","","2011-02-14 07:40:13","5","10955","<p>Hi I want to set the style and size for a text in spinner programatically(Dynamically).I don't use any resources in my app for this.So give me some suggestions for this </p>","479027","","537865","","2011-02-14 08:59:03","2014-02-12 03:50:33","Set the TextSize to a text in spinner in android programatically","<android><spinner>","3","4","1","",""
"4989825","1","","","2011-02-14 07:41:28","0","406","<p>I'm getting error on intents when i m clicking on custom listview item. I ve given the log of the error.</p><pre><code>02-14 12:56:50.514: ERROR/AndroidRuntime(612): FATAL EXCEPTION: main02-14 12:56:50.514: ERROR/AndroidRuntime(612): java.lang.NullPointerException02-14 12:56:50.514: ERROR/AndroidRuntime(612):     at android.content.ContextWrapper.getPackageName(ContextWrapper.java:120)02-14 12:56:50.514: ERROR/AndroidRuntime(612):     at android.content.ComponentName.&lt;init&gt;(ComponentName.java:75)02-14 12:56:50.514: ERROR/AndroidRuntime(612):     at android.content.Intent.&lt;init&gt;(Intent.java:2678)02-14 12:56:50.514: ERROR/AndroidRuntime(612):     at com.pharmarc.vitti.kol.Main.onItemClick(Main.java:182)02-14 12:56:50.514: ERROR/AndroidRuntime(612):     at com.pharmarc.vitti.kol.Main$CustomListAdapter$1.onClick(Main.java:319)02-14 12:56:50.514: ERROR/AndroidRuntime(612):     at android.view.View.performClick(View.java:2408)02-14 12:56:50.514: ERROR/AndroidRuntime(612):     at android.view.View$PerformClick.run(View.java:8816)02-14 12:56:50.514: ERROR/AndroidRuntime(612):     at android.os.Handler.handleCallback(Handler.java:587)02-14 12:56:50.514: ERROR/AndroidRuntime(612):     at android.os.Handler.dispatchMessage(Handler.java:92)02-14 12:56:50.514: ERROR/AndroidRuntime(612):     at android.os.Looper.loop(Looper.java:123)02-14 12:56:50.514: ERROR/AndroidRuntime(612):     at android.app.ActivityThread.main(ActivityThread.java:4627)02-14 12:56:50.514: ERROR/AndroidRuntime(612):     at java.lang.reflect.Method.invokeNative(Native Method)02-14 12:56:50.514: ERROR/AndroidRuntime(612):     at java.lang.reflect.Method.invoke(Method.java:521)02-14 12:56:50.514: ERROR/AndroidRuntime(612):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)02-14 12:56:50.514: ERROR/AndroidRuntime(612):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)02-14 12:56:50.514: ERROR/AndroidRuntime(612):     at dalvik.system.NativeStart.main(Native Method)</code></pre>","818917","","537865","","2011-02-14 08:57:52","2011-02-14 08:57:52","Problem with custom listview item click","<android><crash-reports>","0","3","","",""
"4989883","1","4989927","","2011-02-14 07:51:41","2","9307","<p>Hy!!!</p><p>I have a endless thread that updated the view.</p><p><strong>UpdateState.java</strong>:</p><pre><code>package android.skiptvad;import java.util.List;import org.apache.http.NameValuePair;import android.os.Handler;import android.os.Message;import android.text.NoCopySpan.Concrete;import android.util.Log;import android.widget.TextView;import android.widget.Toast;import android.util.Log;public class UpdateState extends Thread {    public List&lt;NameValuePair&gt; params;    public Handler handler;    public UpdateState(List&lt;NameValuePair&gt; params, Handler handler) {        this.handler = handler;        this.params = params;    }    @Override    public void run() {            while (true)            {                final Handler h = new Handler (){                    @Override                    public void handleMessage(Message msg) {                         Message msg2 = Message.obtain();                        if (msg.obj.toString()!= null)                        {                            JSONParse json = null;                            try                             {                                    Log.e(""Channel_State"",msg.obj.toString());                                    json = new JSONParse(msg.obj.toString());                                    String state = json.getChannelState();                                    msg2.obj = state;                                    UpdateState.this.handler.sendMessage(msg);                            }                             catch (final Exception e)                             {                                    e.printStackTrace();                            }                    }                }                };                    HttpConnection con = new HttpConnection(params, ""http://surfkid.redio.de/getChannelState"", h);                    con.start();                    try {                        Log.e(""Sleep"", ""Begin"");                        UpdateState.sleep(5000);                        Log.e(""Sleep"", ""End"");                    } catch (InterruptedException e) {                        // TODO Auto-generated catch block                        Log.e(""Sleep"", ""Error"");                        e.printStackTrace();                    }            //super.run();        }    }}</code></pre><p><strong>Call</strong>:</p><pre><code>Handler hup = new Handler (){                @Override                public void handleMessage(Message msg) {                    Log.e(""UPDATE"", (String) msg.obj);                    if (msg.obj.equals(""0"")&amp;&amp; msg.obj.equals(""1""))                    {                        tv2.setText(""Channel State: ""+ msg.obj);                    }                    super.handleMessage(msg);                }            };            UpdateState us = new UpdateState(params, hup);            us.start();**</code></pre><p><strong>Log</strong>:</p><pre><code>02-14 07:45:39.690: ERROR/AndroidRuntime(282): Uncaught handler: thread Thread-13 exiting due to uncaught exception02-14 07:45:39.690: ERROR/AndroidRuntime(282): java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare()02-14 07:45:39.690: ERROR/AndroidRuntime(282):     at android.os.Handler.&lt;init&gt;(Handler.java:121)02-14 07:45:39.690: ERROR/AndroidRuntime(282):     at android.skiptvad.UpdateState$1.&lt;init&gt;(UpdateState.java:30)02-14 07:45:39.690: ERROR/AndroidRuntime(282):     at android.skiptvad.UpdateState.run(UpdateState.java:30)</code></pre><p>How to solve my problem?</p>","547995","","547995","","2011-02-14 08:25:08","2011-02-14 08:25:08","Can't create handler inside thread that has not called Looper.prepare()","<java><android><multithreading>","1","3","","",""
"4989902","1","","","2011-02-14 07:54:42","9","31771","<p>For my application I'm trying to programmatically pair a bluetooth device. I'm able to show the pairing dialog for the device I want to pair and I can enter a pincode. When I press ""Pair"" the dialog is removed and nothing happens.</p><p>I only need to support devices with Android 2.0 and newer.</p><p>Currently I am using the following code to start the pairing progress:</p><pre><code>public void pairDevice(BluetoothDevice device) {        String ACTION_PAIRING_REQUEST = ""android.bluetooth.device.action.PAIRING_REQUEST"";        Intent intent = new Intent(ACTION_PAIRING_REQUEST);        String EXTRA_DEVICE = ""android.bluetooth.device.extra.DEVICE"";        intent.putExtra(EXTRA_DEVICE, device);        String EXTRA_PAIRING_VARIANT = ""android.bluetooth.device.extra.PAIRING_VARIANT"";        int PAIRING_VARIANT_PIN = 0;        intent.putExtra(EXTRA_PAIRING_VARIANT, PAIRING_VARIANT_PIN);        intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);        context.startActivity(intent);    }</code></pre><p>Before starting a pairing request I stop scanning for new devices.</p><p>My application has the following bluetooth permissions:</p><ul><li>android.permission.BLUETOOTH_ADMIN</li><li>android.permission.BLUETOOTH</li></ul>","615854","","537865","","2011-02-14 08:50:27","2014-03-07 18:19:07","How to programmatically pair a bluetooth device on Android","<android><bluetooth>","7","4","11","",""
"4989908","1","4989942","","2011-02-14 07:55:40","0","5679","<p>I am using this <a href=""http://www.androidpeople.com/android-custom-listview-tutorial-example-part-2/"" rel=""nofollow"">tutorials</a> and I want to add selectors for this list view. I tried some codes but it doest work. How can I do it. </p><p>I used code as list_selector.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:drawable=""@drawable/list_selector_background_focus"" /&gt;    &lt;item android:state_pressed=""true""        android:drawable=""@drawable/list_selector_background_pressed"" /&gt;&lt;/selector&gt;</code></pre><p>and my List view </p><pre><code>&lt;ListView              android:id=""@+id/select_names_tags_lv""              android:layout_width=""fill_parent""              android:layout_height=""wrap_content""              android:listSelector=""@drawable/list_selector""              android:layout_alignParentTop=""false""              android:layout_gravity=""center_vertical""&gt;            &lt;/ListView&gt;</code></pre>","550966","","550966","","2011-08-03 05:36:12","2011-08-03 05:36:12","Selector for custom list view ""Change ListView background - strange behaviour""","<android><listview><selector>","2","0","1","",""
"4989972","1","","","2011-02-14 08:07:08","0","777","<p>I am developing an android game application.I have implemented the shake listener and the sensor.The Code is not containing any error.But when i deploy the application on android device Sensor is not working.Can anybody tell how should i pursue.Where is my error. I have reffered the url for shaking listener and sensor <a href=""http://www.clingmarks.com/?p=25"" rel=""nofollow"">http://www.clingmarks.com/?p=25</a>Thanks in advanceTushar Sahni</p>","475349","","537865","","2011-02-14 08:56:14","2011-02-14 08:56:14","sensor not working in android game application","<android><accelerometer>","1","0","","",""
"4990260","1","","","2011-02-14 08:52:27","1","4240","<p>I am trying to get a list of facebook events with the name events host and a start time. I am using the official facebook sdk for android.</p><p>But for some reason whenever I click get event in the application it will load then <strong>retrieve no data</strong>.</p><p>Any help at all would be brilliant I have been stuck on this for weeks</p><p>My code:</p><pre><code>public static final String APP_ID = """";private static final String[] PERMISSIONS =    new String[]{ ""offline_access"", ""read_stream"",             ""publish_stream"",""create_event"",""user_events"",""friends_events"",            ""publish_checkins"", ""friends_checkins"",""read_friendlists"" };private TextView mText;private Handler mHandler = new Handler();private ProgressDialog mSpinner;private final ArrayList&lt;Events&gt; events = new ArrayList&lt;Events&gt;();private EventsArrayAdapter eventsArrayAdapter;private ListView listView;private Facebook mFacebook;private AsyncFacebookRunner mAsyncRunner;/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    // Make sure the app client_app has been set    if (APP_ID == null) {        Util.showAlert(this,        ""Warning"", ""Facebook Applicaton ID must be set..."");    }    // Initialize the content view    setContentView(R.layout.main);    // Get the status text line resource    mText = (TextView) workdammit.this.findViewById(R.id.txt);    // Setup the ListView Adapter that is loaded when selecting ""get events""    listView = (ListView) findViewById(R.id.eventsview);    eventsArrayAdapter = new EventsArrayAdapter(this, R.layout.rowlayout, events);    listView.setAdapter(eventsArrayAdapter);    // Define a spinner used when loading the events over the network    mSpinner = new ProgressDialog(listView.getContext());    mSpinner.requestWindowFeature(Window.FEATURE_NO_TITLE);    mSpinner.setMessage(""Loading..."");    // Initialize the Facebook session    mFacebook = new Facebook(APP_ID);    mAsyncRunner = new AsyncFacebookRunner(mFacebook);}//////////////////////////////////////////////////////////////////////public void onActivityResult(int requestCode, int resultCode, Intent data) {  super.onActivityResult(requestCode, resultCode, data);  Log.d(""FB Sample App"", ""onActivityResult(): "" + requestCode);  mFacebook.authorizeCallback(requestCode, resultCode, data);}//////////////////////////////////////////////////////////////////////// Get events request listener///////////////////////////////////////////////////////////////////////** * eventsRequestListener implements a request lister/callback *  for ""get events"" requests */public class EventsRequestListener implements        com.facebook.android.AsyncFacebookRunner.RequestListener {    /**     * Called when the request to get events has been completed.     * Retrieve and parse and display the JSON stream.     */    public void onComplete(final String response) {        mSpinner.dismiss();        try {            // process the response here: executed in background thread            Log.d(""Facebook-Example-events Request"", ""response.length(): "" + response.length());            Log.d(""Facebook-Example-events Request"", ""Response: "" + response);            final JSONObject json = new JSONObject(response);            JSONArray d = json.getJSONArray(""data"");            int l = (d != null ? d.length() : 0);            Log.d(""Facebook-Example-events Request"", ""d.length(): "" + l);            for (int i=0; i&lt;l; i++) {                JSONObject o = d.getJSONObject(i);                String n = o.getString(""name"");                String h = o.getString(""host"");                String L = o.getString(""location"");                Events f = new Events();                f.host = h;                f.name = n;                f.location =L;                events.add(f);            }            // Only the original owner thread can touch its views            workdammit.this.runOnUiThread(new Runnable() {                public void run() {                    eventsArrayAdapter = new EventsArrayAdapter(                            workdammit.this, R.layout.rowlayout, events);                    listView.setAdapter(eventsArrayAdapter);                    eventsArrayAdapter.notifyDataSetChanged();                }            });        } catch (JSONException e) {            Log.w(""Facebook-Example"", ""JSON Error in response"");        }    }    @Override    public void onComplete(String response, Object state) {        mSpinner.dismiss();    }    @Override    public void onIOException(IOException e, Object state) {        mSpinner.dismiss();    }    @Override    public void onFileNotFoundException(FileNotFoundException e,            Object state) {        mSpinner.dismiss();    }    @Override    public void onMalformedURLException(MalformedURLException e,            Object state) {        mSpinner.dismiss();    }    @Override    public void onFacebookError(FacebookError e, Object state) {        mSpinner.dismiss();    }}//////////////////////////////////////////////////////////////////////// Wall Post request listener///////////////////////////////////////////////////////////////////////** * WallPostRequestListener implements a request lister/callback *  for ""wall post requests"" */public class WallPostRequestListener implements        com.facebook.android.AsyncFacebookRunner.RequestListener {    /**     * Called when the wall post request has completed     */    public void onComplete(final String response) {        Log.d(""Facebook-Example"", ""Got response: "" + response);    }    @Override    public void onComplete(String response, Object state) {        // TODO Auto-generated method stub    }    @Override    public void onIOException(IOException e, Object state) {        // TODO Auto-generated method stub    }    @Override    public void onFileNotFoundException(FileNotFoundException e,            Object state) {        // TODO Auto-generated method stub    }    @Override    public void onMalformedURLException(MalformedURLException e,            Object state) {        // TODO Auto-generated method stub    }    @Override    public void onFacebookError(FacebookError e, Object state) {        // TODO Auto-generated method stub    }}//////////////////////////////////////////////////////////////////////// Wall post dialog completion listener///////////////////////////////////////////////////////////////////////** * WallPostDialogListener implements a dialog lister/callback */public class WallPostDialogListener implements        com.facebook.android.Facebook.DialogListener {    /**     * Called when the dialog has completed successfully     */    public void onComplete(Bundle values) {        final String postId = values.getString(""post_id"");        if (postId != null) {            Log.d(""FB Sample App"", ""Dialog Success! post_id="" + postId);            mAsyncRunner.request(postId, new WallPostRequestListener());        } else {            Log.d(""FB Sample App"", ""No wall post made"");        }    }    @Override    public void onCancel() {        // No special processing if dialog has been canceled    }    @Override    public void onError(DialogError e) {        // No special processing if dialog has been canceled    }    @Override    public void onFacebookError(FacebookError e) {        // No special processing if dialog has been canceled    }}/////////////////////////////////////////////////////////// Login / Logout Listeners//////////////////////////////////////////////////////////** * Listener for login dialog completion status */private final class LoginDialogListener implements        com.facebook.android.Facebook.DialogListener {    /**     * Called when the dialog has completed successfully     */    public void onComplete(Bundle values) {        // Process onComplete        Log.d(""FB Sample App"", ""LoginDialogListener.onComplete()"");        // Dispatch on its own thread        mHandler.post(new Runnable() {            public void run() {                mText.setText(""Facebook login successful. Press Menu..."");            }        });    }    /**     *     */    public void onFacebookError(FacebookError error) {        // Process error        Log.d(""FB Sample App"", ""LoginDialogListener.onFacebookError()"");    }    /**     *     */    public void onError(DialogError error) {        // Process error message        Log.d(""FB Sample App"", ""LoginDialogListener.onError()"");    }    /**     *     */    public void onCancel() {        // Process cancel message        Log.d(""FB Sample App"", ""LoginDialogListener.onCancel()"");</code></pre><p>}    }</p><pre><code>/** * Listener for logout status message */private class LogoutRequestListener implements RequestListener {    /** Called when the request completes w/o error */    public void onComplete(String response) {        // Only the original owner thread can touch its views        workdammit.this.runOnUiThread(new Runnable() {            public void run() {                mText.setText(""Thanks for using FB Sample App. Bye bye..."");                events.clear();                eventsArrayAdapter.notifyDataSetChanged();            }        });        // Dispatch on its own thread        mHandler.post(new Runnable() {            public void run() {            }        });    }    @Override    public void onComplete(String response, Object state) {        // TODO Auto-generated method stub    }    @Override    public void onIOException(IOException e, Object state) {        // TODO Auto-generated method stub    }    @Override    public void onFileNotFoundException(FileNotFoundException e,            Object state) {        // TODO Auto-generated method stub    }    @Override    public void onMalformedURLException(MalformedURLException e,            Object state) {        // TODO Auto-generated method stub    }    @Override    public void onFacebookError(FacebookError e, Object state) {        // TODO Auto-generated method stub    }}///////////////////////////////////////////////////////////////////// Menu handlers////////////////////////////////////////////////////////////////////** * Invoked at the time to create the menu * @param menu is the menu to create */@Overridepublic boolean onCreateOptionsMenu(Menu menu) {    MenuInflater inflater = getMenuInflater();    inflater.inflate(R.menu.main_menu, menu);    return true;}/** * Invoked when preparing to display the menu * @param menu is the menu to prepare */@Overridepublic boolean onPrepareOptionsMenu(Menu menu) {    MenuItem loginItem = menu.findItem(R.id.login);    MenuItem postItem = menu.findItem(R.id.wallpost);    MenuItem geteventsItem = menu.findItem(R.id.getevent);    if (mFacebook.isSessionValid()) {        loginItem.setTitle(""Logout"");        postItem.setEnabled(true);        geteventsItem.setEnabled(true);    } else {        loginItem.setTitle(""Login"");        postItem.setEnabled(false);        geteventsItem.setEnabled(false);    }    loginItem.setEnabled(true);    return super.onPrepareOptionsMenu(menu);}/** * Invoked when a menu item has been selected * @param item is the selected menu items */@Overridepublic boolean onOptionsItemSelected(MenuItem item) {    switch (item.getItemId()) {        // Login/logout toggle        case R.id.login:            // Toggle the button state.            //  If coming from login transition to logout.            if (mFacebook.isSessionValid()) {                AsyncFacebookRunner asyncRunner = new AsyncFacebookRunner(mFacebook);                asyncRunner.logout(this.getBaseContext(), new LogoutRequestListener());            } else {                // Toggle the button state.                //  If coming from logout transition to login (authorize).                mFacebook.authorize(this, PERMISSIONS, new LoginDialogListener());            }            break;        // Wall Post        case R.id.wallpost: // Wall Post            mFacebook.dialog(workdammit.this, ""stream.publish"", new WallPostDialogListener());            break;        // Get Friend's List        case R.id.getevents: // Wall Post            // Get the authenticated user's events            mSpinner.show();            mAsyncRunner.request(""me/events"", new EventsRequestListener());            break;        default:            return false;    }    return true;}</code></pre><p>}</p>","604769","","368070","","2011-03-21 06:25:49","2012-09-18 06:16:12","getting facebook events","<android><facebook>","0","3","1","",""
"4990272","1","","","2011-02-14 08:54:05","0","739","<p>I programmed a button into my android app that called the finish() method when I click it. But somehow it does not close until after a 5-6 second delay. </p><p>I am recording sensor values for a particular movement of the phone. The problem is when there is a delay after I close, it records those unnecessary values and the analysis is messed up. </p><p>So any idea why the UI takes so long to respond? I am very new to Android and I can't find this online. I don't do too much computation- as and when sensors change I record the value onto a file in the sdcard memory. Sometimes if I run the program for too long, it just crashes and I don't know why. </p><p>Please help! I would also like to know if there's a manual way to kill through the computer? something like Ctrl+C for DOS? </p>","526223","","526223","","2011-02-15 03:53:01","2011-02-15 03:53:01","Closing application in Android - delay problem","<java><android><eclipse><pulsar>","1","3","","",""
"4990290","1","","","2011-02-14 08:56:20","0","2829","<p>Is it possible to have a custom expandable list view in android with scrollview?</p>","475748","","","","","2011-11-26 15:39:07","Android expandable list with scrollview","<android><scrollview><expandablelistview>","5","0","","",""
"4990390","1","5110346","","2011-02-14 09:09:42","5","6899","<p>I use the <code>MediaStore.ACTION_VIDEO_CAPTURE</code> intent class to capture the video, the video stored in default location(gallery),i want to store the video in specific location with specific name.</p><p>I use <code>MediaStore.EXTRA_MEDIA_TITLE</code> and <code>MediaStore.EXTRA_MEDIA_OUTPUT</code> but I don`t get the video at correct location, at least I need the path of recorded video.</p><p>Thanks in advance.</p>","555806","","222159","","2011-02-14 09:13:36","2012-09-08 17:42:25","Android MediaStore.ACTION_VIDEO_CAPTURE, external path?","<android><video>","2","0","2","",""
"4990513","1","4990564","","2011-02-14 09:22:15","1","629","<p>I can't create layout in which I will have</p><pre><code>&lt;LinearLayout&gt;    &lt;TextView/&gt;    &lt;ExpandableListView/&gt;    &lt;Button/&gt;&lt;/LinearLayout&gt;</code></pre><p>In general I am not able to construct a layout with widget under ExpandableListView, is it possible?</p><p><strong>[edit]</strong></p><p>Now I have another problem. Currently I have something like this:</p><pre><code>---------------------|  some text which  || could be dragable ||-------------------||ExpandableList  [|]||  - item1        | ||  - item2        | ||  - item3        | ||  - item4        | ||  - item5        | ||-------------------| | [button] [button] |---------------------</code></pre><p>I can scroll my expandable list view</p><pre><code>---------------------|  some text which  || could be dragable ||-------------------||  - item4        | ||  - item5        | ||  - item6        | ||  - item7        | ||  - item8        | ||  - item9       [|]||-------------------| | [button] [button] |---------------------</code></pre><p>but in landscape</p><pre><code>------------------------------||   some text which could be  ||          dragable           |   |-----------------------------||-----------------------------| |      [button][button]       |-------------------------------</code></pre><p>i don't have place for extendable list view. What I should to achieve completely scrollable results? </p>","338581","","338581","","2011-02-14 10:28:41","2011-02-14 10:28:41","Is it posible to have something under ExpandableListView?","<android><android-widget>","1","1","","",""
"4990529","1","","","2011-02-14 09:25:01","18","21000","<p>I'm trying to get my app to blend in as much as possible with the ""standard"" with the rest of my android device. It's a stand-alone app, not integrated with the OS or anything, I just want it to look familiar.</p><p>The area I'm interested in is the ""settings"" screen. If I look at Android's standard settings screen, it's well spaced, perfect font size, with neat pin stripes between the menu items.</p><p>How do I do that? Is that a ListView? Is it done with a regular LinearLayout?</p><p>I would love to be able to replicate the look &amp; feel in my app. Can anybody assist?</p><p><img src=""http://i.stack.imgur.com/MFLho.png"" alt=""enter image description here""></p><p>And it's not just the Adroid OS. it's most of the ""professional"" apps out there:</p><p><img src=""http://i.stack.imgur.com/TZfNW.png"" alt=""enter image description here""></p><p>Many thanks</p>","181098","","181098","","2011-02-14 11:15:13","2013-10-04 17:32:11","Android: A good looking (standard) settings menu","<android><gui>","2","1","6","",""
"4990649","1","","","2011-02-14 09:38:52","1","4384","<p>I just want to do a simple thing. I'm using the <a href=""http://code.google.com/p/osmdroid/"" rel=""nofollow"">OSMDroid</a> library for a GPS application. I want to draw a marker showing a retrieved GPS location on OpenStreetMap. I have tried the OSMDroid documentation, but I didn't find the answer. Here is my code:</p><pre><code>import java.util.List;import org.andnav.osm.util.GeoPoint;import org.osmdroid.api.IGeoPoint;import org.osmdroid.tileprovider.tilesource.TileSourceFactory;import org.osmdroid.views.MapController;import org.osmdroid.views.MapView;import org.osmdroid.views.overlay.Overlay;import org.osmdroid.views.overlay.ScaleBarOverlay;import org.osmdroid.views.overlay.SimpleLocationOverlay;import org.andnav.osm.util.GeoPoint;import android.app.Activity;import android.app.AlertDialog;import android.content.Context;import android.content.DialogInterface;import android.content.Intent;import android.graphics.Bitmap;import android.graphics.BitmapFactory;import android.graphics.Canvas;import android.graphics.Point;import android.location.Location;import android.location.LocationListener;import android.location.LocationManager;import android.os.Bundle;public class OsmGps extends Activity {    /** Called when the activity is first created. */    private MapView mapView;    private MapController mapController;    private SimpleLocationOverlay mMyLocationOverlay;    private ScaleBarOverlay mScaleBarOverlay;    private LocationManager locationManager;    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        mapView = (MapView) this.findViewById(R.id.mapview);        mapView.setTileSource(TileSourceFactory.MAPNIK);        mapView.setBuiltInZoomControls(true);        mapView.setMultiTouchControls(true);        mapController = this.mapView.getController();        mapController.setZoom(4);        this.mMyLocationOverlay = new SimpleLocationOverlay(this);        this.mapView.getOverlays().add(mMyLocationOverlay);        this.mScaleBarOverlay = new ScaleBarOverlay(this);        mScaleBarOverlay.setLineWidth(10);        this.mapView.getOverlays().add(mScaleBarOverlay);        locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);        if (!locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER)) {            createGpsDisabledAlert();        } else {            locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0,                    0, new GeoUpdateHandler());        }    }    private void createGpsDisabledAlert() {        AlertDialog.Builder builder = new AlertDialog.Builder(this);        builder            .setMessage(                ""Your GPS is disabled! Would you like to enable it?"")            .setCancelable(false).setPositiveButton(                ""Enable GPS"",                new DialogInterface.OnClickListener() {                    public void onClick(DialogInterface dialog, int id) {                        showGpsOptions();                    }            });            builder.setNegativeButton(                ""Do nothing"",                new DialogInterface.OnClickListener() {                    public void onClick(DialogInterface dialog, int id) {                        dialog.cancel();                    }            });            AlertDialog alert = builder.create();            alert.show();    }    private void showGpsOptions() {        Intent gpsOptionsIntent = new Intent(            android.provider.Settings.ACTION_LOCATION_SOURCE_SETTINGS);        startActivity(gpsOptionsIntent);    }    protected boolean isRouteDisplayed() {        // TODO Auto-generated method stub        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);            Overlay mmapOverlay = new Overlay(null);            mmapOverlay.setPointToDraw(point);            List&lt;Overlay&gt; listOfOverlays = mapView.getOverlays();            listOfOverlays.clear();            listOfOverlays.add(mmapOverlay);        }        @Override        public void onProviderDisabled(String provider) {            // TODO Auto-generated method stub        }        @Override        public void onProviderEnabled(String provider) {        }        @Override        public void onStatusChanged(String provider, int status, Bundle extras) {        }    }    class mMyLocationOverlay extends Overlay    {        public mMyLocationOverlay(Context ctx) {            super(ctx);            // TODO Auto-generated constructor stub        }        private GeoPoint pointToDraw;        public void setPointToDraw(GeoPoint point) {            pointToDraw = point;        }        public GeoPoint getPointToDraw() {            return pointToDraw;        }            // Convert point to pixels            Point screenPts = new Point();            mapView.getProjection().toPixels(pointToDraw, screenPts);            // Add marker            Bitmap bmp = BitmapFactory.decodeResource(getResources(), R.drawable.pen);            @Override            protected void onDraw(Canvas c, MapView arg1) {                // TODO Auto-generated method stub            }            @Override            protected void onDrawFinished(Canvas arg0, MapView arg1) {                // TODO Auto-generated method stub            }            canvas.drawBitmap(bmp, screenPts.x, screenPts.y - 128, null);            return true;        }    }}</code></pre>","615983","","63550","","2012-07-04 20:27:52","2014-02-25 07:03:00","OpenStreetMap GPS location overlay ","<android><gps><openstreetmap>","1","0","1","",""
"4990682","1","4991692","","2011-02-14 09:42:07","0","9357","<p>In my app I want to place a .png file and I want it to be viewed as a scrolled image at both landscape and portrait modes, please, suggest a code or example....</p>","596364","","493193","","2011-02-14 10:05:43","2013-04-18 20:38:14","Images in ScrollView in android","<java><android><scrollview>","3","0","1","",""
"4990694","1","5153494","","2011-02-14 09:44:23","7","1233","<p>I am trying to upload an image from an Android device to a remote server. So far I have the following code but the image being saved on the remote server is always zero bytes.</p><pre><code>     HttpURLConnection conn;     String serverpath = ""http://110.172.27.47:9499"";     String MREPORTER_SERVLET_PATH=""/mreporter/servlet/MReporterServlet"";     url = serverpath + MREPORTER_SERVLET_PATH;     try     {         URL url = new URL( serverpath + MREPORTER_SERVLET_PATH );         conn = (HttpURLConnection) url.openConnection();         conn.setDoInput(true);         conn.setDoOutput(true);         conn.setUseCaches(false);         conn.setRequestMethod(""POST"");         conn.setRequestProperty(""Connection"", ""Keep-Alive"");          conn.setRequestProperty(""Content-Type"", ""multipart/form-data;boundary=""+ ""*****"" );         conn.setRequestProperty(USER_NAME_REQUEST_PARAMETER, ""parth"");         conn.setRequestProperty(EVENT_NAME_REQUEST_PARAMETER, ""null"" );         conn.setRequestProperty(CAMERAID_REQUEST_PARAMETER, ""1"");         conn.setRequestProperty(ACTION_MODE_PARAMETER, ""POST_DATA_ACTION"" );         DataOutputStream dos = new DataOutputStream(conn.getOutputStream());         Log.i(""Response"", conn.getResponseCode() + """" );         int response = conn.getResponseCode();         if ( response == 200 )         {             Log.i(""size"",data.length + """");             if ( data.length &gt; 0 )             {                 dos.write(data);                 Log.i(""200"",""OK"" );             }             else             {                 Log.i( ""Error"", response +  """" );             }         }</code></pre>","595649","","300863","","2012-06-15 06:44:08","2012-06-15 06:44:08","How to capture an image and store on server using android ","<android><image-uploading>","2","0","1","",""
"4990761","1","4990870","","2011-02-14 09:53:59","0","808","<p>In my application  I have to display an image which is about 10000 x 5000 , using small images of 500x500 px. I.e;thru  tiling images.In order to tile all images to one initially am collecting all bitmaps from sdcard in order to draw on canvas.</p><p>But while am loading images from extenal storage using   <code>BitmapFactory.decodeFile(path)</code> i encounterd with error <strong>java-lang-outofmemoryerror-bitmap-size-exceeds-vm-budget-android</strong></p><p>can any one how to avoid this error and gimme an idea how to tile lot of images in to a single image .</p><p>Thanking you,Srinivas</p>","414777","","","","","2011-02-14 10:06:31","Android: ""java-lang-outofmemoryerror-bitmap-size-exceeds-vm-budget-android"" While loading bitmaps from sdcard?","<android><memory-leaks><bitmap>","1","1","1","",""
"4990807","1","","","2011-02-14 09:59:22","0","3155","<p>I am building a C\C++ native application for android, trying to run it on android but I get the following error:</p><pre>02-14 14:05:40.261: INFO/DEBUG(31): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***02-14 14:05:40.261: INFO/DEBUG(31): Build fingerprint: 'generic/sdk/generic/:2.2/FRF91/43546:eng/test-keys'02-14 14:05:40.280: INFO/DEBUG(31): pid: 467, tid: 467  >>> com.keypoint_tech.adaptxt.inputmethod.core.testAdaptxt &lt;&lt;&lt;02-14 14:05:40.280: INFO/DEBUG(31): signal 11 (SIGSEGV), fault addr deadbaad02-14 14:05:40.292: INFO/DEBUG(31):  r0 00000000  r1 00000000  r2 00000027  r3 0000000002-14 14:05:40.292: INFO/DEBUG(31):  r4 00000000  r5 deadbaad  r6 00001728  r7 44f3501002-14 14:05:40.292: INFO/DEBUG(31):  r8 430be000  r9 43170000  10 0000001d  fp beb9272402-14 14:05:40.302: INFO/DEBUG(31):  ip ffffffff  sp beb92448  lr afd154c5  pc afd11dc4  cpsr 4000003002-14 14:05:40.851: INFO/DEBUG(31):          #00  pc 00011dc4  /system/lib/libc.so02-14 14:05:40.851: INFO/DEBUG(31):          #01  pc 00006ecc  /system/lib/libcutils.so02-14 14:05:40.871: INFO/DEBUG(31): code around pc:02-14 14:05:40.881: INFO/DEBUG(31): afd11da4 1c2bd00b 2d00682d e026d1fb 2b0068db 02-14 14:05:40.891: INFO/DEBUG(31): afd11db4 4e17d003 51a02001 4d164798 24002227 02-14 14:05:40.891: INFO/DEBUG(31): afd11dc4 f7fb702a 2106ee14 ef10f7fc 05592380 02-14 14:05:40.900: INFO/DEBUG(31): afd11dd4 6091aa01 1c116054 94012006 eab6f7fc 02-14 14:05:40.910: INFO/DEBUG(31): afd11de4 2200a905 f7fc2002 f7fbeac2 2106ee00 02-14 14:05:40.910: INFO/DEBUG(31): code around lr:02-14 14:05:40.910: INFO/DEBUG(31): afd154a4 b0834a0d 589c447b 26009001 686768a5 02-14 14:05:40.910: INFO/DEBUG(31): afd154b4 220ce008 2b005eab 1c28d003 47889901 02-14 14:05:40.922: INFO/DEBUG(31): afd154c4 35544306 d5f43f01 2c006824 b003d1ee 02-14 14:05:40.922: INFO/DEBUG(31): afd154d4 bdf01c30 0002ae7c 000000d4 1c0fb5f0 02-14 14:05:40.922: INFO/DEBUG(31): afd154e4 43551c3d a904b087 1c16ac01 604d9004 02-14 14:05:40.922: INFO/DEBUG(31): stack:02-14 14:05:40.932: INFO/DEBUG(31):     beb92408  000006fd  02-14 14:05:40.961: INFO/DEBUG(31):     beb9240c  afd1453b  /system/lib/libc.so02-14 14:05:40.961: INFO/DEBUG(31):     beb92410  afd40498  /system/lib/libc.so02-14 14:05:40.961: INFO/DEBUG(31):     beb92414  afd41c14  /system/lib/libc.so02-14 14:05:40.961: INFO/DEBUG(31):     beb92418  00000000  02-14 14:05:40.961: INFO/DEBUG(31):     beb9241c  afd154c5  /system/lib/libc.so02-14 14:05:40.961: INFO/DEBUG(31):     beb92420  6f737265  02-14 14:05:40.981: INFO/DEBUG(31):     beb92424  afd1450d  /system/lib/libc.so02-14 14:05:40.981: INFO/DEBUG(31):     beb92428  50776569  02-14 14:05:40.981: INFO/DEBUG(31):     beb9242c  afd40328  /system/lib/libc.so02-14 14:05:40.981: INFO/DEBUG(31):     beb92430  00000000  02-14 14:05:40.981: INFO/DEBUG(31):     beb92434  00001728  02-14 14:05:40.981: INFO/DEBUG(31):     beb92438  44f35010  /dev/ashmem/mspace/dalvik-heap/2 (deleted)02-14 14:05:40.991: INFO/DEBUG(31):     beb9243c  afd147ab  /system/lib/libc.so02-14 14:05:40.991: INFO/DEBUG(31):     beb92440  df002777  02-14 14:05:40.991: INFO/DEBUG(31):     beb92444  e3a070ad  02-14 14:05:41.002: INFO/DEBUG(31): #00 beb92448  696a202c  02-14 14:05:41.002: INFO/DEBUG(31):     beb9244c  202c746e  02-14 14:05:41.002: INFO/DEBUG(31):     beb92450  746e696a  02-14 14:05:41.002: INFO/DEBUG(31):     beb92454  696a202c  02-14 14:05:41.012: INFO/DEBUG(31):     beb92458  2029746e  02-14 14:05:41.012: INFO/DEBUG(31):     beb9245c  fffffbdf  02-14 14:05:41.012: INFO/DEBUG(31):     beb92460  beb9264c  [stack]02-14 14:05:41.012: INFO/DEBUG(31):     beb92464  400092e8  /dev/ashmem/mspace/dalvik-heap/zygote/0 (deleted)02-14 14:05:41.012: INFO/DEBUG(31):     beb92468  00000002  02-14 14:05:41.012: INFO/DEBUG(31):     beb9246c  af906ecf  /system/lib/libcutils.so02-14 14:05:41.031: INFO/DEBUG(31): #01 beb92470  beb9264c  [stack]02-14 14:05:41.031: INFO/DEBUG(31):     beb92474  af906ecf  /system/lib/libcutils.so02-14 14:05:41.041: INFO/DEBUG(31):     beb92478  00001893  02-14 14:05:41.052: INFO/DEBUG(31):     beb9247c  beb9264c  [stack]02-14 14:05:41.052: INFO/DEBUG(31):     beb92480  400092e8  /dev/ashmem/mspace/dalvik-heap/zygote/0 (deleted)02-14 14:05:41.052: INFO/DEBUG(31):     beb92484  45168728  /dev/ashmem/mspace/dalvik-heap/2 (deleted)02-14 14:05:41.052: INFO/DEBUG(31):     beb92488  0000005f  02-14 14:05:41.052: INFO/DEBUG(31):     beb9248c  8084a30f  /system/lib/libdvm.so02-14 14:05:41.052: INFO/DEBUG(31):     beb92490  44f35018  /dev/ashmem/mspace/dalvik-heap/2 (deleted)02-14 14:05:41.070: INFO/DEBUG(31):     beb92494  00000063  02-14 14:05:41.070: INFO/DEBUG(31):     beb92498  474f6028  02-14 14:05:41.070: INFO/DEBUG(31):     beb9249c  00000063  02-14 14:05:41.080: INFO/DEBUG(31):     beb924a0  00000063  02-14 14:05:41.091: INFO/DEBUG(31):     beb924a4  beb924d0  [stack]02-14 14:05:41.091: INFO/DEBUG(31):     beb924a8  40009408  /dev/ashmem/mspace/dalvik-heap/zygote/0 (deleted)02-14 14:05:41.091: INFO/DEBUG(31):     beb924ac  8081c020  /system/lib/libdvm.so02-14 14:05:41.102: INFO/DEBUG(31):     beb924b0  00008cdc  /system/bin/app_process02-14 14:05:41.112: INFO/DEBUG(31):     beb924b4  00002337  02-14 14:05:42.000: INFO/WindowManager(59): WIN DEATH: Window{44f9e8f0 com.keypoint_tech.adaptxt.inputmethod.core.testAdaptxt/com.keypoint_tech.adaptxt.inputmethod.core.testAdaptxt.TestAdaptxt paused=false}02-14 14:05:42.012: INFO/ActivityManager(59): Process com.keypoint_tech.adaptxt.inputmethod.core.testAdaptxt (pid 467) has died.02-14 14:05:42.121: INFO/BootReceiver(59): Copying /data/tombstones/tombstone_06 to DropBox (SYSTEM_TOMBSTONE)02-14 14:05:42.191: INFO/UsageStats(59): Unexpected resume of com.android.launcher while already resumed in com.keypoint_tech.adaptxt.inputmethod.core.testAdaptxt02-14 14:05:42.271: WARN/InputManagerService(59): Got RemoteException sending setActive(false) notification to pid 467 uid 10032</pre><p>I tried to use <code>arm-eabi-addr2line</code> with address <code>0001072a</code> than i got thefollowing result</p><pre><code>/usr/local/google/home/digit/android/main/cupcake/android/bionic/libc/unistd/brk.c:45</code></pre><p>I am getting this for all platforms: Android 1.6, 2.1, and 2.2.</p><p>My program getting crash when i am trying to retrieve the values from buffer which is populated in JNI side.</p><p>Here is following code I am using to get the value from JNI side populated buffer.</p><pre><code>for(int j = 0; j &lt; count; j++){    len = outBuf.getInt();    CharBuffer cbuf = outBuf.asCharBuffer();    CharSequence cS = cbuf.subSequence(0, len);    wordsPage[j] = cS.toString();    outBuf.position(outBuf.position()+ (len*2));}</code></pre><p>And could you please tell me any full proof mechanism to share the memory between Java and JNI. </p>","615980","","40342","","2011-02-14 10:12:09","2011-05-21 22:30:30","Getting the signal 11 (SIGSEGV), fault addr deadbaad in Android","<android><android-ndk><android-ndk-r4>","1","0","","",""
"4990918","1","9128452","","2011-02-14 10:11:58","1","484","<p>Is it possible to have an AIR application built in Flex run as process or receive intents?For example if I wanted to make a calendar and each time there was an event at a certain time, have the AIR up which isn't running in the foreground, pop-up and inform the user that ""it's time"".</p><p>Can it be done with the current stable versions of both AIR and Flex SDK?</p><p>Thank you.</p><p>I wonder about this still to this day...</p>","383148","","383148","","2012-02-03 13:22:22","2012-02-03 13:22:22","Can Flex AIR apps for Android run as processes?","<android><flex><process><air><android-intent>","1","0","","",""
"4990935","1","4991593","","2011-02-14 10:12:49","0","369","<p>I want to mock GPS data in my emaulator. the application target is Google APIs 2.3.1, API level 9.</p><p>I tried sending location manually from DDMS, loading gpx files and sending from the emulator console but nothing happens.</p><p>can anybody provide me with detailed and tested steps to achieve the mocking ?</p><p>thanks</p>","235123","","","","","2011-02-14 11:25:08","Android Google APIs GPS Data mocking not working in emulator?","<android><gps>","1","0","","",""
"4990943","1","4996059","","2011-02-14 10:13:22","0","354","<p>I have string like <code>""&amp;amp;auml;s&amp;amp;aring;""</code> that needs to be converted like ""äså""so how can we do that?.</p><p>Thanks in advance.</p>","500420","","203907","","2011-02-14 19:23:39","2011-02-14 19:23:39","How can I Decode string?","<java><android>","3","2","","",""
"4990963","1","6394171","","2011-02-14 10:15:50","0","1067","<p>I have used baseAdepter for display three View in list .first two are textView and last is checkBox View .But when i going to check the checkBox and scroll the list ,after  in the some specific number of item ,the other check box is automatic checked unaseptedlly ..</p><p>i don't have idea Why this kind of thing is occur .</p><p>Is anybody der who know the solution of it ..</p><p>here is my code for baseadepter ..</p><pre><code>private static class AdepterGetUnit extends BaseAdapter{private LayoutInflater mInflater;public AdepterGetUnit (Context context){   mInflater = LayoutInflater.from(context);}@Overridepublic int getCount() {    positionList  = sharedPreferences.getInt(UnitScreen.POSITION, 0);               if(positionList==0){currentListLenght=ArrayHolder.dbSpeed.size();}    else if(positionList==1){currentListLenght=ArrayHolder.dbAngle.size();}    else if(positionList==2){currentListLenght=listTemperature.length;}    else if(positionList==3){currentListLenght=ArrayHolder.dbLenght.size();}    else if(positionList==4){currentListLenght=ArrayHolder.dbWeightMass.size();}    else if(positionList==5){currentListLenght=ArrayHolder.dbPressure.size();}    else if(positionList==6){currentListLenght=ArrayHolder.dbPower.size();}    else if(positionList==7){currentListLenght=ArrayHolder.dbCurrency.size();}    else if(positionList==8){currentListLenght=ArrayHolder.dbDataSize.size();}    else if(positionList==9){currentListLenght=ArrayHolder.dbVolume.size();}    else if(positionList==10){currentListLenght=ArrayHolder.dbTime.size();}    else if(positionList==11){currentListLenght=ArrayHolder.dbArea.size();}    else if(positionList==12){currentListLenght=ArrayHolder.dbCoocking.size();}    return  currentListLenght; }@Overridepublic View getView(int position, View convertView, ViewGroup parent) {    ViewHolder holder;       if (convertView==null){           convertView = mInflater.inflate(R.layout.row_edit_unit, null);           holder = new ViewHolder();           holder.text = (TextView) convertView.findViewById(R.id.txt_show_units);           holder.textTotle = (TextView) convertView.findViewById(R.id.txt_unit);           holder.checkBox = (CheckBox) convertView.findViewById(R.id.check_box);           convertView.setTag(holder);       }       else       {           holder = (ViewHolder) convertView.getTag();       }//           positionList  = sharedPreferences.getInt(UnitScreen.POSITION, 0);                  switch (positionList) {    case 0:        holder.text.setText(ArrayHolder.dbSpeed.get(position));        holder.textTotle.setText(ArrayHolder.dbSpeedUnit.get(position));        txtUnitTitleName.setText(""Speed"");        break;    case 1:        holder.text.setText(ArrayHolder.dbAngle.get(position));        holder.textTotle.setText(ArrayHolder.dbAngleUnit.get(position));        txtUnitTitleName.setText(""Angle"");        break;    case 2:        holder.text.setText(ArrayHolder.dbTemperature.get(position));        holder.textTotle.setText(ArrayHolder.dbTemperatureUnit.get(position));        txtUnitTitleName.setText(""Temperature"");       break;    case 3:        holder.text.setText(ArrayHolder.dbLenght.get(position));        holder.textTotle.setText(ArrayHolder.dbLenghtUnit.get(position));        txtUnitTitleName.setText(""Lenght"");        break;    case 4:        holder.text.setText(ArrayHolder.dbWeightMass.get(position));        holder.textTotle.setText(ArrayHolder.dbWeightMassUnit.get(position));        txtUnitTitleName.setText(""Weight/Mass"");        break;    case 5:        holder.text.setText(ArrayHolder.dbPressure.get(position));        holder.textTotle.setText(ArrayHolder.dbPressureUnit.get(position));        txtUnitTitleName.setText(""Pressure"");        break;    case 6:        holder.text.setText(ArrayHolder.dbPower.get(position));        holder.textTotle.setText(ArrayHolder.dbPowerUnit.get(position));        txtUnitTitleName.setText(""Power"");        break;    case 7:         holder.text.setText(ArrayHolder.dbCurrency.get(position));        holder.textTotle.setText(ArrayHolder.dbCurrencyUnit.get(position));        if(!holder.checkBox.isChecked())        holder.checkBox.setChecked(false);        else        holder.checkBox.setChecked(true);           txtUnitTitleName.setText(""Currency"");        break;    case 8:        holder.text.setText(ArrayHolder.dbDataSize.get(position));        holder.textTotle.setText(ArrayHolder.dbDataSizeUnit.get(position));        txtUnitTitleName.setText(""DataSize"");        break;    case 9:        holder.text.setText(ArrayHolder.dbVolume.get(position));        holder.textTotle.setText(ArrayHolder.dbVolumeUnit.get(position));        txtUnitTitleName.setText(""Volume"");        break;    case 10:        holder.text.setText(ArrayHolder.dbTime.get(position));        holder.textTotle.setText(ArrayHolder.dbTimeUnit.get(position));        txtUnitTitleName.setText(""Time"");        break;    case 11:        holder.text.setText(ArrayHolder.dbArea.get(position));        holder.textTotle.setText(ArrayHolder.dbAreaUnit.get(position));        txtUnitTitleName.setText(""Area"");        break;    case 12:        holder.text.setText(ArrayHolder.dbCoocking.get(position));        txtUnitTitleName.setText(""Coocking"");        break;    default:        break;    }           return convertView;}static class ViewHolder {    TextView text ,textTotle;    ImageView icon;    CheckBox checkBox;         }@Overridepublic Object getItem(int position) {    // TODO Auto-generated method stub    return position-1;}@Overridepublic long getItemId(int position) {    // TODO Auto-generated method stub    return position-1;}@Overridepublic void notifyDataSetChanged() {    super.notifyDataSetChanged();}}</code></pre>","501483","","512958","","2011-02-14 10:44:08","2011-08-08 14:58:35","android Problem with checkBox with baseAdapter","<android>","1","0","","",""
"4991035","1","4991090","","2011-02-14 10:24:01","0","742","<p>i am trying to count the number characters in a text file which i have retrieved the SD card need some advice here am new to android programming</p><p>using this code to retrieve the text file from the sd card</p><pre><code>        //Find the directory for the SD Card using the API    //*Don't* hardcode ""/sdcard""    File sdcard = Environment.getExternalStorageDirectory();    //Get the text file    File file = new File(sdcard,""file.txt"");    //Read text from file    StringBuilder text = new StringBuilder();    try {        BufferedReader br = new BufferedReader(new FileReader(file));        String line;        while ((line = br.readLine()) != null) {            text.append(line);            text.append('\n');        }    }    catch (IOException e) {        //You'll need to add proper error handling here    }    //Find the view by its id    TextView tv = (TextView)findViewById(R.id.TextView01);    //Set the text    tv.setText(text);</code></pre>","578198","","","","","2011-02-14 10:30:46","Character count from a text file","<android>","1","0","","",""
"4991085","1","4991132","","2011-02-14 10:30:08","0","3143","<p>is it possible to achieve something like this?- when user touches on map, a circle will appear.- user drag to resize the circle to its desired size.</p><p>Is there a sample code on this implementation?</p><p>Thanks!</p>","211071","","","","","2011-02-14 10:36:17","Drawing circle on map dynamically","<android>","1","0","","",""
"4991095","1","","","2011-02-14 10:31:10","20","3278","<p>I'm writing an Information Visualization API for Android and ran into a problem trying to place two units of a custom <code>GLSurfaceView</code> into a Layout. The Custom <code>GLSurfaceView</code> at this point is simply an extension of the <code>GLSurfaceView</code> to eliminate possible faults caused by custom methods.</p><p>When I have both components added in layout and start the application it runs. But nothing is drawn, seems like it enters an infinite loop. because debug messages inside the Renderers are printed into the LogCat. However, It works perfectly fine if I only use one of the custom <code>GLSurfaceView</code> components.</p><p>I read that there is a problem using <code>GLSurfaceView</code> in multiple Activities and I suppose it also applies when using two of those components at the same time. I have tried the workaround posted <a href=""http://code.google.com/p/android/issues/detail?id=2828"">here</a> but cant seem to get it to work either.</p><p>I would appreciate any help. I choose to use openGL for the better performance, but if I cant use multiple components at once I guess I'll have to use Canvas instead.</p><p>The manifest looks as follows:</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:text=""@string/hello"" android:id=""@+id/TextView01""        android:layout_width=""wrap_content""            android:layout_height=""wrap_content"" /&gt;    &lt;com.syntronic.vtadlib.VisualizationView android:id=""@+id/glview""        android:layout_width=""fill_parent"" android:layout_height=""300px"" /&gt;    &lt;TextView android:text=""@string/hello"" android:id=""@+id/TextView02""        android:layout_width=""wrap_content""            android:layout_height=""wrap_content"" /&gt;    &lt;LinearLayout         android:orientation=""vertical"" android:layout_width=""fill_parent""        android:layout_height=""fill_parent""&gt;        &lt;com.syntronic.vtadlib.VisualizationView android:id=""@+id/glview2""            android:layout_width=""fill_parent"" android:layout_height=""fill_parent"" /&gt;    &lt;/LinearLayout&gt;&lt;/LinearLayout&gt;</code></pre><p>From the Activity the code is like this:</p><pre><code>@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    mSurfaceView = (VisualizationView) findViewById(R.id.glview);    mSurfaceView2 = (VisualizationView) findViewById(R.id.glview2);    //Enables debug flags for Errors    //mSurfaceView.setDebugFlags(GLSurfaceView.DEBUG_CHECK_GL_ERROR);       //mSurfaceView2.setDebugFlags(GLSurfaceView.DEBUG_CHECK_GL_ERROR);      mSurfaceView.setRenderer(new CoordinateSystemRenderer());    mSurfaceView2.setRenderer(new CoordinateSystemRenderer());}@Overrideprotected void onPause() {    // TODO Auto-generated method stub    super.onPause();    mSurfaceView.onPause();    mSurfaceView2.onPause();}@Overrideprotected void onResume() {    // TODO Auto-generated method stub    super.onResume();    mSurfaceView.onResume();    mSurfaceView2.onResume();}</code></pre><p>Am I missing something obvious? Or can someone explain why it doesn't work? </p>","606257","","44729","","2012-01-18 16:57:44","2014-03-04 17:24:56","How can I use Multiple GLSurfaceView components in the same Layout?","<android><android-layout><opengl-es><glsurfaceview>","4","1","4","",""
"4991133","1","5013201","","2011-02-14 10:36:18","2","1890","<p>I have a database that I extract data from to my Android project. There are some strings of text there with the swedish letters å, ä, ö written as : v•=å, v§=ä, vd=ö. What would be the best way of converting these symbols to the actual letters before I print them on the textview in the app? Is a substitution, like replace v• with å, the way to go? How would that be entered in the query that is now fetching the data:</p><pre><code>public Cursor getAlternative1(long categoryid, int questionid) {                final String MY_QUERY = ""SELECT question, image, alternative, questionid, correct FROM tbl_question a INNER JOIN tbl_alternative b ON a._id=b.questionid AND b.categoryid=a.categoryid WHERE a.categoryid=? AND a._id=?"";                Cursor cursor = mDb.rawQuery(MY_QUERY, new String[]{String.valueOf(categoryid), String.valueOf(questionid)});                if (cursor != null) {                      cursor.moveToFirst();                 }                return cursor;            }</code></pre><p>Thanks for any help!</p>","455479","","287586","","2011-02-21 20:19:05","2011-02-21 20:19:05","How can I display swedish characters in Android app?","<android><sqlite><character><mojibake>","1","4","","",""
"4991179","1","5025543","","2011-02-14 10:41:12","7","16369","<p>My code is :</p><pre><code>public class EventDataSQLHelper extends SQLiteOpenHelper {    private static final String DATABASE_NAME = ""my.db"";}public class Test extends Activity {    EventDataSQLHelper eventsData;    @Override    protected void onDestroy() {        System.out.println(""onDestroy"");        close();        if (db!=null){        db.close();    }    super.onDestroy();}public void close() {    eventsData.close();}</code></pre><p>I have closed the db here.. In all my activities except this its working(no exception is shown).. Here when i press back button from this Test activity the below exception is thrown</p><pre><code>02-14 15:59:34.642: ERROR/Database(535): close() was never explicitly called on database '/data/data/com.tesy.connect/databases/test.db' 02-14 15:59:34.642: ERROR/Database(535): android.database.sqlite.DatabaseObjectNotClosedException: Application did not close the cursor or database object that was opened here02-14 15:59:34.642: ERROR/Database(535):     at android.database.sqlite.SQLiteDatabase.&lt;init&gt;(SQLiteDatabase.java:1810)02-14 15:59:34.642: ERROR/Database(535):     at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:817)02-14 15:59:34.642: ERROR/Database(535):     at android.database.sqlite.SQLiteDatabase.openOrCreateDatabase(SQLiteDatabase.java:851)02-14 15:59:34.642: ERROR/Database(535):     at android.database.sqlite.SQLiteDatabase.openOrCreateDatabase(SQLiteDatabase.java:844)02-14 15:59:34.642: ERROR/Database(535):     at android.app.ContextImpl.openOrCreateDatabase(ContextImpl.java:540)02-14 15:59:34.642: ERROR/Database(535):     at android.content.ContextWrapper.openOrCreateDatabase(ContextWrapper.java:203)02-14 15:59:34.642: ERROR/Database(535):     at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:98)02-14 15:59:34.642: ERROR/Database(535):     at android.database.sqlite.SQLiteOpenHelper.getReadableDatabase(SQLiteOpenHelper.java:158)02-14 15:59:34.642: ERROR/Database(535):     at com.connect.Test.getEvents(Connect_EY.java:755)02-14 15:59:34.642: ERROR/Database(535):     at com.connect.Test.onCreate(Connect_EY.java:662)02-14 15:59:34.642: ERROR/Database(535):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)02-14 15:59:34.642: ERROR/Database(535):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)02-14 15:59:34.642: ERROR/Database(535):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)02-14 15:59:34.642: ERROR/Database(535):     at android.app.ActivityThread.access$2300(ActivityThread.java:125)02-14 15:59:34.642: ERROR/Database(535):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)02-14 15:59:34.642: ERROR/Database(535):     at android.os.Handler.dispatchMessage(Handler.java:99)02-14 15:59:34.642: ERROR/Database(535):     at android.os.Looper.loop(Looper.java:123)</code></pre><p>The exception is thrown on this getEvents line :</p><pre><code>public class Test extends Activity {    @Override    public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.pageview);    startRefreshActivity();    try { /* If No Record Exists Create a New One */    eventsData = new EventDataSQLHelper(this);    Cursor cursor = getEvents();    startManagingCursor(cursor);    } }private Cursor getEvents() {    try {    db = eventsData.getReadableDatabase();    Cursor cursor = db.query(EventDataSQLHelper.TABLE, null, null,        null, null, null, null);    startManagingCursor(cursor);    return cursor;} catch (Exception ex) {    System.out.println(""Exception Occured : "" + ex.toString());    return null;}}</code></pre><p>Exception : </p><pre><code>02-14 15:59:34.642: ERROR/Database(535):     at com.testconnect.Test.getEvents(Test.java:755)02-14 15:59:34.642: ERROR/Database(535):     at com.testconnect.Test.onCreate(Test.java:662)</code></pre>","563442","","883033","","2013-07-24 04:27:02","2013-07-24 04:27:02","Application did not close the cursor or database object that was opened here :","<android><sqlite><cursor>","3","4","1","",""
"4991200","1","4991270","","2011-02-14 10:43:41","0","1626","<p>I have map ( GeoActivity ) in my app. I need to mark some region with circle, circle need to move with finger touch . How to achieve that ?I need something similar like <a href=""http://www.apartmentfinder.com/Georgia/Atlanta-Apartments"" rel=""nofollow"">http://www.apartmentfinder.com/Georgia/Atlanta-Apartments</a>when you go on personalize your search .</p><p>Any idea, advice ?</p>","486578","","","","","2011-02-14 10:51:37","Put circle over google map","<android>","1","0","1","",""
"4991201","1","6974206","","2011-02-14 10:43:51","8","6315","<p>Is it possible to select text from a TextView(including highlight) ?</p><p>It is possible with EditText but i need that to be done using TextView ..</p><p>Any help regarding this please ?</p><p>Thanks,</p>","598331","","","","","2013-07-27 07:54:48","Select text from TextView?","<android>","3","7","1","",""
"4991225","1","4997139","","2011-02-14 10:47:01","1","759","<p>I am developing an application for Android using phonegap. When I include phonegap.js file in my html, it does not work on desktop browser like Firefox or chrome. I know that phonegap.js provides the bridge between Android's native functionalities and HTML/javascript.</p><p>I need to know is there any way so that my html files work fine on desktop browser also even if using phonegap.js because it is very difficult to debug js application on Android so I am searching some way so that it can work on Firefox, if phone related functionalities don't work then it is fine, I just need to debug the application.</p><p>NOTE: If I remove ""phonegap.js"" from html, it works fine on desktop browsers, but not able to communicate to server and so only screens appear but dada doesn't.</p><p>Thanks</p>","202461","","","","","2011-02-14 20:54:15","HTML files does not work on Desktop browser after including phonegap.js","<javascript><android><debugging><firefox><phonegap>","1","1","1","",""
"4991249","1","4991380","","2011-02-14 10:49:27","1","897","<p>I want to take data from database and compare with system time.my android code for taking system time is </p><pre><code>sTimeFirstPart= DateFormat.getTimeInstance(DateFormat.SHORT).format(new Date());</code></pre><p>this will hold the current system time and how can i compare this time to time in database table my db table is look like this </p><pre><code>public void onCreate(SQLiteDatabase db) {    db.execSQL(""CREATE TABLE IF NOT EXISTS names3 (_ID INTEGER PRIMARY KEY     AUTOINCREMENT, medicine VARCHAR, dose1 VARCHAR ,dose2 VARCHAR ,dose3 VARCHAR)"");</code></pre><p>dose1,dose2,dose3 are the time value stored in the database.</p><p>and i want to display  the next medicine at what time how can i  do this pls help me?</p>","555910","","243709","","2011-02-14 11:00:54","2011-02-14 13:14:53","I want to take data from database and compare with system time","<android><sqlite><time>","3","0","","",""
"4991279","1","4991832","","2011-02-14 10:52:19","3","5282","<p>I have a gridview, and I am trying to achieve a fly in effect on the images within it. This would be very similar to the effect seen when you load up gallery 3D and your image folders ""drop in"". I have googled around the subject, and think I need to use a ViewAnimator and generate the animation through that: <a href=""http://developer.android.com/reference/android/widget/ViewAnimator.html#setInAnimation(android.view.animation.Animation"" rel=""nofollow"">http://developer.android.com/reference/android/widget/ViewAnimator.html#setInAnimation(android.view.animation.Animation</a>)</p><p>However, I am not sure and any help on how to achieve this whatsoever would be very welcome!</p><p>Regards</p><p>Mark</p>","616064","","","","","2012-10-31 12:42:03","Fly In Animation for a GridView","<android>","1","0","6","",""
"4991281","1","","","2011-02-14 10:52:47","4","8115","<p>I am developing an application using phonegap in which a video section shows list of youtube videos retrieved using youtube jsonc api. I would like the video to be played inside the application when its link is clicked, so that when the video is closed, my application interface is shown again. Youtube apis give rstp:// and http:// links for the videos, but I haven't been able to play the videos inside the application. Once that works, I would like to port it over to blackberry and other devices too, so a phonegap specific solution is highly preferred.</p>","296542","","","","","2011-02-14 20:45:56","Playing youtube videos on phonegap","<android><video><blackberry><youtube><phonegap>","1","1","4","",""
"4991334","1","4991494","","2011-02-14 10:58:12","0","3762","<p>I am doing multimedia application. my issue is i want to connect oracle database into my application through JDBC. whenever i tried to connect jdbc driver it shows </p><blockquote>  <p>Dxwarning: Ignoring InnerClasses attribute for an anonymous inner class  (oracle.jdbc.pool.OracleRuntimeLoadBalancingEventHandlerThread$1) that doesn't come with an  associated EnclosingMethod attribute. This class was probably produced by a  compiler that did not target the modern .class file format. The recommended  solution is to recompile the class from source, using an up-to-date compiler  and without specifying any ""-target"" type options. The consequence of ignoring  this warning is that reflective operations on this class will incorrectly  indicate that it is <em>not</em> an inner class.</p></blockquote><p>can anyone link the exact jar file for oracle JDBC for android application. </p>","599841","","","","","2011-10-20 20:36:20","Connecting the oracle in android application","<android><oracle><jdbc>","2","8","","",""
"4991368","1","4991669","","2011-02-14 11:02:34","2","8618","<p>I am using my own SQLite3 database as opposed to creating a new one each time my app runs, as I have a few tables with static data that I am trying to display. I created my database and placed it in my assets folder. I then created my database helper and when I start my app I can open my database without problem but when I try to open my first table using the following code</p><pre><code>private Cursor getData() {    try    {        myDbHelper = new DatabaseHelper(this);        SQLiteDatabase db = myDbHelper.getReadableDatabase();        Cursor cursor = db.query(""exhibitor"", FROM, null, null, null,null, ORDER_BY);        startManagingCursor(cursor);        return cursor;    }    catch(SQLiteException e)    {        String err = e.toString();        return null;    }}</code></pre><p><br>It throws an error saying <code>android.database.sqlite.SQLiteException: no such table: exhibitor: , while compiling: SELECT _id, EXHIBITOR FROM exhibitor ORDER BY EXHIBITOR</code> but when I check the database exhibitor is there.<br><br>What am I missing?</p>","616076","","529196","","2011-02-14 11:12:55","2012-11-02 14:28:08","SQLiteException: no such table","<android><database><sqlite><sqlite3>","4","0","2","",""
"4991372","1","","","2011-02-14 11:02:56","0","2066","<p>i am writing a music player example using services.i am able to start and stop the service by using the activity which is in other application.but now i need to pause the player.how can i do this because their are no onpause method in services</p>","555653","","","","","2011-02-14 13:09:15","Pausing a service","<android><service>","1","0","","",""
"4991391","1","","","2011-02-14 11:04:45","0","8534","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/4721732/sqlite-example-program-in-android"">sqlite example program in android</a>  </p></blockquote><p>I need a code sample that shows how to connect an app to a local DB in Android. Can anyone help me please?</p>","555806","","301832","","2011-02-14 11:15:17","2011-10-03 11:19:10","Android SQLite Database -sample?","<android><sqlite>","0","0","","2011-12-17 23:10:41",""
"4991443","1","5010415","","2011-02-14 11:09:29","1","847","<p>I have a Jar library called BizLogic.jar and I am referring to it on my UI project. So when I obfuscate, I want to obfuscate BizLogic.jar first and then UI without breaking any references between them?</p><p>Is this possible with Proguard ? If not, Any other product that can support this ?</p><p>Thanks</p>","192901","","","","","2011-02-15 22:44:05","how to obfucate dependant .jar in Proguard?","<java><android><proguard>","1","1","1","",""
"4991452","1","4991639","","2011-02-14 11:10:28","0","2559","<p>I am developing a simple application,in which i am displaying a check Box and a text in each line of a list,but while i am selecting or checking one check box some other check boxes inside my list view are checked automatically.I have done a lot Google on it and unable to find a way to fix this...Please help me....</p><p>Thanx in advance....</p><pre><code> public void checkevent(View v) throws ParseException{    lv=(ListView)v.getParent().getParent();    int i=lv.getPositionForView(v);    Object o = lv.getItemAtPosition(i);    String item= o.toString();    int q=item.indexOf(""-"",0);    String alarm_date=new_date+"" ""+item.substring(0,q);    SimpleDateFormat formatter = new SimpleDateFormat(""yyyy-MM-dd HH:mm"");    Date rdate = (Date)formatter.parse(alarm_date);     set_prog=item.substring(q+1,item.length())+"" on ""+item.substring(0,q);    if(((CompoundButton) v).isChecked())    {    if(rdate.getTime()&gt;=new Date().getTime())    {        if(program_reminder_main.contains((alarm_date+""--""+item.substring(q+1,item.length()))))        {            Toast.makeText(this,""You have already selected this one"", Toast.LENGTH_LONG).show();            ((CompoundButton) v).setChecked(false);        }        else {            program_reminder_main+=(""~""+alarm_date+""--""+item.substring(q+1,item.length()));        }        //To call the Alarm service Class at respective time    Toast.makeText(this, ""Alarm Set For""+"" ""+item.substring(q+1,item.length())+"" on ""+item.substring(0,q), Toast.LENGTH_LONG).show();    Intent myIntent = new Intent(MainClass.this, MyAlarmService_Movie.class);    pendingIntent = PendingIntent.getService(MainClass.this, 0, myIntent, 0);    AlarmManager alarmManager = (AlarmManager)getSystemService(ALARM_SERVICE);         alarmManager.set(AlarmManager.RTC_WAKEUP,rdate.getTime()-30000,pendingIntent);}else { ((CompoundButton) v).setChecked(false);        Toast.makeText(MainClass.this, ""Alarm can't be set Before to crrent time"", Toast.LENGTH_LONG).show();    }}    else if(!((CompoundButton) v).isChecked()){        AlarmManager alarmManager = (AlarmManager)getSystemService(ALARM_SERVICE);        alarmManager.cancel(pendingIntent);        Toast.makeText(MainClass.this, ""Reset Alarm"", Toast.LENGTH_LONG).show();    }}</code></pre><p>ignore the extra things... just concentrate on the code for check box...and for your info. i have set the above method in the check Box's properties...</p>","595226","","595226","","2011-02-14 12:51:40","2011-02-14 12:51:40","Regarding the Checked state of a checkbox inside a list view","<android>","3","0","","",""
"4991464","1","5916292","","2011-02-14 11:11:07","3","1890","<p>I am allowing the user to select an image from the device using the following code:</p><p>(from  <a href=""http://stackoverflow.com/questions/2169649/open-an-image-in-androids-built-in-gallery-app-programmatically/2636538#2636538"">this post</a>)</p><p><pre><code></p><p>public class BrowsePicture extends Activity {</p><p>private static final int SELECT_PICTURE = 1;</p><p>private String selectedImagePath;</p><p>public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);</p><pre><code>((Button) findViewById(R.id.Button01))        .setOnClickListener(new OnClickListener() {            public void onClick(View arg0) {                // in onCreate or any event where your want the user to                // select a file                Intent intent = new Intent();                intent.setType(""image/*"");                intent.setAction(Intent.ACTION_GET_CONTENT);                startActivityForResult(Intent.createChooser(intent,                        ""Select Picture""), SELECT_PICTURE);            }        });</code></pre><p>}</p><p>public void onActivityResult(int requestCode, int resultCode, Intent data) {    if (resultCode == RESULT_OK) {        if (requestCode == SELECT_PICTURE) {            Uri selectedImageUri = data.getData();            selectedImagePath = getPath(selectedImageUri);        }    }}</p><p>public String getPath(Uri uri) {    String[] projection = { MediaStore.Images.Media.DATA };    Cursor cursor = managedQuery(uri, projection, null, null, null);    int column_index = cursor            .getColumnIndexOrThrow(MediaStore.Images.Media.DATA);    cursor.moveToFirst();    return cursor.getString(column_index);}</p><p></pre></code></p><p>The code works fine but it also displays application resources within the selection area. Is there any way I can remove application resources from the selection area?</p>","598186","","","","","2011-05-06 19:45:52","Retrieving only images from gallery when firing android image chooser intent","<android><image><activity><android-intent><gallery>","1","0","","",""
"4991487","1","","","2011-02-14 11:13:08","0","59","<p>I am using db for my android application,I am storing user's details andr device id in server's db,when user run my application at first time,I want to delete particular user's details in server db,whenever user uninstall my application in device.How can i implement this scenario in my application.</p><p>Thanks</p>","500595","","180674","","2011-02-14 12:15:19","2011-02-14 12:15:19","how to delete particular device's details in server's db?","<android>","1","2","","",""
"4991635","1","4994715","","2011-02-14 11:30:28","1","376","<p>This is my main file, which has image buttons, and it gives me an exception. When I click on courses image button, it just closes the application.</p><p>It works for rest of buttons (rest activities just consist a text view and button) whereas in courses view, I added 3 more buttons (before I added these 3 buttons, it used to work for switching between main and courses).</p><p>What i am trying to do is this:</p><p>Make 3 buttons in courses activity. They will navigate me to other views like ""higher education"" or ""further education"". In next views I will create a list which will display name of courses (like ""CCNA"" or ""Health diploma""!). When the user clicks on course, it will display a picture and some text information about the course.</p><pre><code>package com.NVT.android;import android.app.Activity;import android.content.Intent;import android.os.Bundle;import android.view.View;import android.widget.ImageButton;public class Main extends Activity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState)     {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        ImageButton CoursesButton = (ImageButton)findViewById(R.id.CoursesButton);        ImageButton ILoveNescotButton = (ImageButton)findViewById(R.id.ILoveNescotButton);        ImageButton CampusMapButton = (ImageButton)findViewById(R.id.CampusMapButton);        ImageButton GettingHereButton = (ImageButton)findViewById(R.id.GettingHereButton);        CoursesButton.setOnClickListener(new ImageButton.OnClickListener()        {            @Override            public void onClick(View view)             {                            Intent myIntent = new Intent(view.getContext(), Courses.class);                            startActivityForResult(myIntent, 0);            }        });        ILoveNescotButton.setOnClickListener(new ImageButton.OnClickListener()        {            @Override            public void onClick(View view)             {                            Intent myIntent = new Intent(view.getContext(), ILoveNescot.class);                            startActivityForResult(myIntent, 0);            }        });        CampusMapButton.setOnClickListener(new ImageButton.OnClickListener()        {            @Override            public void onClick(View view)             {                            Intent myIntent = new Intent(view.getContext(), CampusMap.class);                            startActivityForResult(myIntent, 0);            }        });        GettingHereButton.setOnClickListener(new ImageButton.OnClickListener()        {            @Override            public void onClick(View view)             {                            Intent myIntent = new Intent(view.getContext(), GettingHere.class);                            startActivityForResult(myIntent, 0);            }        });    }}</code></pre><p>Code for Courses View  ""Courses.java"" is given below,,,,</p><pre><code>package com.NVT.android;import android.app.Activity;import android.content.Intent;import android.os.Bundle;import android.view.View;import android.widget.Button;    public class Courses extends Activity     {        /** Called when the activity is first created. */        public void onCreate(Bundle savedInstanceState)         {            super.onCreate(savedInstanceState);            setContentView(R.layout.courses);            Button ButtonFurtherEducation = (Button)findViewById(R.id.Button_Courses_FurtherEducation);            Button ButtonHigherEducation = (Button)findViewById(R.id.Button_Courses_HigherEducation);            Button ButtonEmployernTraining = (Button)findViewById(R.id.Button_Courses_EmployersnTraining);            Button next = (Button) findViewById(R.id.Button01);            ButtonFurtherEducation.setOnClickListener(new Button.OnClickListener()            {                @Override                public void onClick(View view)                 {                                Intent myIntent = new Intent(view.getContext(), FurtherEducationCourses.class);                                startActivityForResult(myIntent, 0);                }            });            ButtonHigherEducation.setOnClickListener(new Button.OnClickListener()            {                @Override                public void onClick(View view)                 {                                Intent myIntent = new Intent(view.getContext(), HigherEducationCourses.class);                                startActivityForResult(myIntent, 0);                }            });            ButtonEmployernTraining.setOnClickListener(new Button.OnClickListener()            {                @Override                public void onClick(View view)                 {                                Intent myIntent = new Intent(view.getContext(), EmployersTrainingCourses.class);                                startActivityForResult(myIntent, 0);                }            });            next.setOnClickListener(new View.OnClickListener()             {                public void onClick(View view)                 {                    Intent intent = new Intent();                    setResult(RESULT_OK, intent);                    finish();                }            });        }       }</code></pre><p>and code for the   further Education Activity is given below,,,,</p><pre><code>package com.NVT.android;import android.app.Activity;import android.content.Intent;import android.os.Bundle;import android.view.View;import android.widget.Button;    public class FurtherEducationCourses extends Activity     {        /** Called when the activity is first created. */        public void onCreate(Bundle savedInstanceState)         {            super.onCreate(savedInstanceState);            setContentView(R.layout.further_education);            Button next = (Button) findViewById(R.id.Button01);            next.setOnClickListener(new View.OnClickListener()             {                public void onClick(View view)                 {                    Intent intent = new Intent();                    setResult(RESULT_OK, intent);                    finish();                }            });        }       }</code></pre><p>my Manifest coding as below</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.NVT.android""      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;activity android:name="".Courses""&gt;        &lt;/activity&gt;        &lt;activity android:name="".CampusMap""&gt;        &lt;/activity&gt;        &lt;activity android:name="".GettingHere""&gt;        &lt;/activity&gt;        &lt;activity android:name="".ILoveNescot""&gt;        &lt;/activity&gt;        &lt;activity android:name="".FurtherEducationCourses""&gt;        &lt;/activity&gt;        &lt;activity android:name="".HigherEducationCourses""&gt;        &lt;/activity&gt;        &lt;activity android:name="".EmployersTrainingCourses""&gt;        &lt;/activity&gt;    &lt;/application&gt;    &lt;uses-sdk android:minSdkVersion=""9"" /&gt;&lt;/manifest&gt; </code></pre>","1090104","","40342","","2011-02-14 12:18:30","2011-02-14 16:42:42","unknown Exception android","<android>","2","11","","",""
"4991637","1","9612501","","2011-02-14 11:30:32","0","1758","<p>I use an XML file to define a Dialog that is shown to the user.I'd like to be able to scroll TextViews and EditTexts but show OK and Cancel buttons at all the times. I'm not managing to do that.Here's 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""    android:orientation=""vertical""     android:layout_width=""fill_parent""    android:layout_height=""fill_parent""&gt;    &lt;ScrollView 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=""fill_parent""             android:layout_height=""wrap_content""            android:orientation=""vertical""             android:scrollbars=""vertical""            android:scrollbarAlwaysDrawVerticalTrack=""true""&gt;            &lt;!-- Group Name --&gt;            &lt;TextView android:id=""@+id/group_name_view""                android:layout_height=""wrap_content""                 android:layout_width=""wrap_content""                android:layout_marginLeft=""20dip""                 android:layout_marginRight=""20dip""                android:text=""@string/group_name_view_text""                 android:gravity=""left""                android:textAppearance=""?android:attr/textAppearanceMedium"" /&gt;            &lt;EditText android:id=""@+id/group_name_edit""                android:layout_height=""wrap_content""                 android:layout_width=""fill_parent""                android:layout_marginLeft=""20dip"" android:layout_marginRight=""20dip""                android:scrollHorizontally=""true""                 android:autoText=""false""                android:capitalize=""none""                 android:gravity=""fill_horizontal""                android:textAppearance=""?android:attr/textAppearanceMedium"" /&gt;            &lt;!-- Group Description --&gt;            &lt;TextView android:id=""@+id/group_description_view""                android:layout_height=""wrap_content""                 android:layout_width=""wrap_content""                android:layout_marginLeft=""20dip"" android:layout_marginRight=""20dip""                android:text=""@string/group_description_view_text""                 android:gravity=""left""                android:textAppearance=""?android:attr/textAppearanceMedium"" /&gt;            &lt;EditText android:id=""@+id/group_description_edit""                android:layout_height=""wrap_content""                 android:layout_width=""fill_parent""                android:layout_marginLeft=""20dip"" android:layout_marginRight=""20dip""                android:scrollHorizontally=""true""                 android:autoText=""false""                android:capitalize=""none""                 android:gravity=""fill_horizontal""                android:textAppearance=""?android:attr/textAppearanceMedium"" /&gt;            &lt;!-- Access security --&gt;            &lt;TextView android:id=""@+id/access_security_view""                android:layout_height=""wrap_content""                 android:layout_width=""wrap_content""                android:layout_marginLeft=""20dip"" android:layout_marginRight=""20dip""                android:text=""@string/access_security_view_text""                 android:gravity=""left""                android:textAppearance=""?android:attr/textAppearanceMedium"" /&gt;            &lt;Spinner android:id=""@+id/access_spinner""                android:layout_width=""fill_parent""                 android:layout_height=""wrap_content""                android:layout_marginLeft=""20dip"" android:layout_marginRight=""20dip""                android:gravity=""fill_horizontal""                 android:drawSelectorOnTop=""true""                android:textAppearance=""?android:attr/textAppearanceMedium"" /&gt;            &lt;!-- Communications security --&gt;            &lt;TextView android:id=""@+id/communcations_security_view""                android:layout_height=""wrap_content""                 android:layout_width=""wrap_content""                android:layout_marginLeft=""20dip"" android:layout_marginRight=""20dip""                android:text=""@string/communcations_security_view_text""                android:gravity=""left""                 android:textAppearance=""?android:attr/textAppearanceMedium"" /&gt;            &lt;Spinner android:id=""@+id/communications_spinner""                android:layout_width=""fill_parent""                 android:layout_height=""wrap_content""                android:layout_marginLeft=""20dip"" android:layout_marginRight=""20dip""                android:gravity=""fill_horizontal""                 android:drawSelectorOnTop=""true""                android:textAppearance=""?android:attr/textAppearanceMedium"" /&gt;            &lt;!-- User --&gt;            &lt;TextView android:id=""@+id/username_view""                android:layout_height=""wrap_content""                 android:layout_width=""wrap_content""                android:layout_marginLeft=""20dip"" android:layout_marginRight=""20dip""                android:text=""@string/username_view_text""                 android:gravity=""left""                android:textAppearance=""?android:attr/textAppearanceMedium"" /&gt;            &lt;EditText android:id=""@+id/username_edit""                android:enabled=""false""                android:layout_height=""wrap_content""                 android:layout_width=""fill_parent""                android:layout_marginLeft=""20dip"" android:layout_marginRight=""20dip""                android:scrollHorizontally=""true""                 android:autoText=""false""                android:capitalize=""none""                 android:gravity=""fill_horizontal""                android:textAppearance=""?android:attr/textAppearanceMedium"" /&gt;            &lt;!-- Password --&gt;            &lt;TextView android:id=""@+id/password_view""                android:layout_height=""wrap_content""                 android:layout_width=""wrap_content""                android:layout_marginLeft=""20dip"" android:layout_marginRight=""20dip""                android:text=""@string/password_view_text""                 android:gravity=""left""                android:textAppearance=""?android:attr/textAppearanceMedium"" /&gt;            &lt;EditText android:id=""@+id/password_edit""             android:enabled=""false""                android:layout_height=""wrap_content""                 android:layout_width=""fill_parent""                android:layout_marginLeft=""20dip"" android:layout_marginRight=""20dip""                android:scrollHorizontally=""true""                 android:autoText=""false""                android:capitalize=""none""                 android:gravity=""fill_horizontal""                android:password=""true"" android:textAppearance=""?android:attr/textAppearanceMedium"" /&gt;        &lt;/LinearLayout&gt;    &lt;/ScrollView&gt;    &lt;LinearLayout android:layout_height=""wrap_content""        android:layout_width=""fill_parent"" &gt;        &lt;Button android:layout_height=""wrap_content""                 android:layout_width=""wrap_content""                  android:text=""@string/ok_text""                 android:layout_weight=""1"" android:id=""@+id/group_creator_ok_button""&gt;       &lt;/Button&gt;        &lt;Button android:layout_height=""wrap_content""                 android:layout_width=""wrap_content""                  android:text=""@string/cancel_text""                 android:layout_weight=""1""                  android:id=""@+id/group_creator_cancel_button""&gt;       &lt;/Button&gt;    &lt;/LinearLayout&gt;&lt;/LinearLayout&gt;</code></pre><p>I've extended Dialog class so when onCreate is called I call</p><pre><code>setContentView(R.layout.my_layout_file);</code></pre><p>It is just showing me the ScrollView, but not the layout with the buttons... So I'm not even able to push the buttons.</p>","483362","","","","","2014-01-17 18:51:42","Dialog Layout doesn't show as it should","<android><dialog><android-layout><scrollview><android-linearlayout>","3","0","","",""
"4991839","1","","","2011-02-14 11:54:33","2","1473","<ul><li><p>I am trying to parse the xml data coming from webservice using SAX parser, when i try to parse the data(size:7.4MB) using URL, it works fine but when I copy the xml data from the URL and place the xml file(size:7.4MB) in the raw folder, the parsing fails. </p></li><li><p>When the size of file placed in raw folder is reduced to 1.95MB, it works fine. I have tried shuffling the tags to check if there are any issues with the data, I haven't found any.It works fine as long as the size doesn't exceed 1.95MB. Is there any size limit while parsing the data from raw folder in android? if yes what is the limit? or How to parse the large files using SAX parser?</p></li></ul><p>Any pointers will really help me. Thanks in advance for your time and any help offered.</p><p>Regards,Ramesh</p><pre><code>02-14 17:35:35.651: DEBUG/asset(11035): Data exceeds UNCOMPRESS_DATA_MAX (2138421 vs 2097152) 02-14 17:35:35.651: WARN/dalvikvm(11035): threadid=9: thread exiting with uncaught exception (group=0x4001d7d0) 02-14 17:35:35.659: ERROR/AndroidRuntime(11035): FATAL EXCEPTION: Thread-13 02-14 17:35:35.659: ERROR/AndroidRuntime(11035): java.lang.AssertionError: java.io.IOException 02-14 17:35:35.659: ERROR/AndroidRuntime(11035): at android.util.Xml.parse(Xml.java:89) </code></pre><p>code</p><pre><code>try {     System.out.println(""1"");     //Xml.parse((url.openConnection().getInputStream()), Encoding.UTF_8, datahandler);     Xml.parse(getResources().openRawResource(R.raw.sample), Encoding.UTF_8, datahandler);     System.out.println(""2"");     //xr.parse(new InputSource(getAssets().open(""sample.xml"")));}catch(Exception e){     System.out.println(""Ramesh""+""XML Parsing exception:""+e);}</code></pre><p>error</p><pre><code>Android DEBUG/asset(11035): Data exceeds UNCOMPRESS_DATA_MAX (2138421 vs 2097152) WARN/dalvikvm(11035): threadid=9: thread exiting with uncaught exception (group=0x4001d7d0) ERROR/AndroidRuntime(11035): FATAL EXCEPTION: Thread-13 ERROR/AndroidRuntime(11035): java.lang.AssertionError: java.io.IOException ERROR/AndroidRuntime(11035): at android.util.Xml.parse(Xml.java:89) ERROR/AndroidRuntime(11035): at com.infosys.gss.ui.Login$2$1.run(Login.java:431) ERROR/AndroidRuntime(11035): Caused by: java.io.IOException</code></pre>","616118","","512958","","2011-02-14 12:36:57","2011-02-15 04:59:37","Android - Parsing large files using SAX parser","<android>","2","10","1","",""
"4992009","1","4998455","","2011-02-14 12:12:44","2","938","<p>I have made an Android app that writes your current location to your wall.</p><p>When I look at other Facebook-apps I can see a small link just beneath the post that says ""Get [app name]"".</p><p>I mean something like this:</p><p><img src=""http://i.stack.imgur.com/IODvM.png"" alt=""enter image description here""></p><p>How can I add such a link to my posts?</p>","517460","","","","","2011-02-14 23:16:26","Add ""Get [app name]"" beneath Facebook wall-post with a link to a site","<java><android><facebook>","1","0","2","",""
"4992097","1","4992465","","2011-02-14 12:22:53","3","8676","<p>I am having below hashmap:</p><pre><code>HashMap&lt;String,String&gt; detail = new HashMap&lt;String, String&gt;();detail.add(""name"",""paresh"");detail.add(""surname"",""mayani"");detail.add(""phone"",""99999"");.............</code></pre><p>now, i want to pass this detail HashMap to the another activity, how do i ?</p>","379693","","457982","","2011-02-14 13:13:44","2012-06-22 11:16:03","Android - How to pass HashMap<String,String> between activities?","<android>","3","8","4","",""
"4992132","1","","","2011-02-14 12:27:13","1","286","<p>I am dealing with huge data (downloading from webserver to client/phone). Currently I am trying to parse and load complete data into sqlite database when the application launches.</p><p>This is taking a lot of time. I want to load the data based on the screen navigation.</p><p>How do I achieve that?</p>","616118","","418183","","2011-04-05 08:01:55","2011-04-20 09:03:46","How to achieve pagination?","<android>","3","1","1","",""
"4992158","1","4992352","","2011-02-14 12:29:57","0","813","<p>I want to save a download image into raw folder. I tried below code for downloading image</p><pre><code>public class Image extends FilterInputStream {    public Image(InputStream in) {      super(in);    }    public long skip(long n) throws IOException {      long m = 0L;      while (m &lt; n) {        long _m = in.skip(n-m);        if (_m == 0L) break;        m += _m;      }      return m;    }}</code></pre><p>The above code is working for downloading the image, so I want to save that download in raw folder. Please tell me the process.</p>","745367","","597607","","2012-02-14 21:29:48","2012-02-14 21:29:48","save download image in raw folder","<android><image>","1","2","1","",""
"4992241","1","5036899","","2011-02-14 12:41:27","3","4311","<p>I'm currently getting into the fragment API of the Android 3.0 Preview and have built the following minimal coding:</p><p>I have an Activty, which shall embed Fragment(s), which is currently implemented like this:</p><pre><code>public class Cockpit extends Activity {/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.cockpit);}public static class InfoFragment extends Fragment {    @Override    public View onCreateView(LayoutInflater inflater, ViewGroup container,            Bundle savedInstanceState) {        // Inflate the layout for this fragment        ViewGroup infoFragmentRoot = (ViewGroup) getActivity().findViewById(                R.id.infoFragmentRoot) ;        return inflater.inflate(R.id.infoFragment, container, false);    }}</code></pre><p>}</p><p>The corresponding layout of the activity:</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;fragment android:name=""test.android.ui.cockpit.Cockpit$InfoFragment""        android:id=""@+id/infoFragment""        android:layout_weight=""1""        android:layout_width=""10dp""        android:layout_height=""match_parent"" &gt;    &lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android"" android:layout_width=""match_parent""                  android:layout_height=""match_parent"" android:padding=""12dp"" android:id=""@+id/infoFragmentRoot"" &gt;        &lt;TextView              android:layout_width=""fill_parent""             android:layout_height=""wrap_content""             android:text=""@string/hello""        /&gt;    &lt;/LinearLayout&gt;&lt;/fragment&gt;</code></pre><p>Now, I do not understand why the ViewGroup container in the onCreateView() in the internal class InfoFragment is a nullpointer, nor do I understand,why</p><pre><code>ViewGroup infoFragmentRoot = (ViewGroup) getActivity().findViewById(                R.id.infoFragmentRoot) ;</code></pre><p>returns also null.</p><p>Thanks for feedback.</p>","616194","","750987","","2011-05-29 06:46:00","2011-05-29 06:46:00","Do not get the rootLayoutContainer in a Fragment (Android 3.0 Preview)","<android><android-fragments><android-3.0-honeycomb>","2","0","2","",""
"4992278","1","4992663","","2011-02-14 12:44:39","0","581","<p>I have this (attached)code which works perfectly on all the AVDs I create with eclipse. It calls a php file on a website. The php script files the xxx when the call <a href=""http://somebody.me.uk/testingphp/signup.php?user=xxx"" rel=""nofollow"">http://somebody.me.uk/testingphp/signup.php?user=xxx</a> is made. The php script does not give a response nor do I want one, the stuff in the loop of the code below is what I want to capture in the php file. In the real world, a nexus one phone with this code fails to contact the php script. In trying to resolve the problem I inserted lines of code creating toasts between the lines of code in the try block. Suddenly the app starts working and the php files the xxx. I presume this is due to introducing a delay on the nexus one while it shows the toasts, and gives chance for the communications to work. Any Ideas how to resolve the problem (without using toasts) Thank you.</p><pre><code>private boolean hasSolution(){        if (cells.solve()) {                            // send to web site for QA analysis.            String urlString = ""http://somebody.me.uk/testingphp/signup.php?user="" ;            for (int j=0; j&lt;9; j++) {                for (int i=0; i&lt;9; i++) {                    urlString += cells.getSolution(i, j);                }// end for i            }// end for j    try {                URL url = new URL(urlString);                URLConnection conn = url.openConnection();                                  BufferedReader rd = new BufferedReader(new InputStreamReader(conn.getInputStream()));                rd.close();            }catch (IOException e) {Toast.makeText(app.this, ""io error"", Toast.LENGTH_SHORT).show();}            return true;        }// end if        return false;    }</code></pre>","578689","","578689","","2011-02-14 12:53:33","2011-05-28 17:10:06","how to wait for URL call to complete","<android><url>","1","0","1","",""
"4992357","1","4992410","","2011-02-14 12:52:53","52","111283","<p>I'm quite new to Android and have been using an AVD to debug my app so far. However, I want to start checking the media options and therfore need to start using my Android phone. How do I get Eclipse to load my app to my phone instead of my AVD?</p>","616076","","533552","","2012-07-28 21:45:04","2014-04-16 18:54:33","How to load my app from Eclipse to my Android phone instead of AVD","<android><eclipse><usb><avd>","14","0","10","",""
"4992492","1","","","2011-02-14 13:08:48","0","881","<p>I am developing an app in android in which I need a  header and footer through out app <strong>while switching between different activities</strong>. The header and footer text will change while switching between activities. What would be the best way to achieve this approach? Actually the header will show navigation of app.</p>","616232","","244296","","2011-02-14 13:11:04","2011-04-21 20:43:12","How to use header and footer in android","<android><header><navigation><footer>","3","2","","",""
"4992532","1","","","2011-02-14 13:11:58","0","215","<p>i want to make an android application which can upload data simultaneously on the server.what should be my initial requirements(including the software,programming language used )??i may sound a bit novice ,but please help.its urgent.thanks.</p>","616235","","","","","2011-02-14 17:48:30","an android application for live data upload","<android>","1","0","","",""
"4992534","1","4994005","","2011-02-14 13:12:04","3","232","<p>I have developed an Android app which is currently in an open beta phase, which means that each interested user can download the apk from the project's website (<a href=""http://www.goodnews-mobile.com"" rel=""nofollow"">http://www.goodnews-mobile.com</a>). I have already provided some updates through the web site and the users had the possibility to gracefully update their current installation without loosing any of the app's data. Now I want to release a new version of this app in the Android Market. </p><p><strong>Here is the question:</strong> Will the users, who installed the app from the homepage be able to install the new version from the market without needing to uninstall the old version?</p><p>From a technical point of view I have ensured everything necessary to provide a graceful update (e.g. using a private key for signature that matches the market rules, maintaining version name and code in the manifest, etc.).</p>","280384","","","","","2011-02-14 15:34:00","Is it possible to let the user update from the non-market version of an app to the market version?","<android><google-play>","1","0","","",""
"4992555","1","4992582","","2011-02-14 13:14:49","11","8947","<p>I've a project in the IntelliJ IDEA IDE and I want to set up a parallel, production Ant build process that I can extend over time.</p><p>I have used IntelliJ's feature to create an Ant build file, and it is on the Build menu, so the Ant build process is running, and working within the IDE. All good.</p><p>But the Ant script IntelliJ has created is only compiling to class files, and is not doing a full Android build process through to an APK (as far as I can tell).</p><p>Can you point me towards a reference source (or an example) to help me understand how to get an ANT script doing a full build of an Android project?</p><p>If you know, would also be v useful to know how to then extend it to include Proguard, production signing, and inserting the production Maps key :)</p>","477415","","","","","2011-08-30 16:28:58","How do I build an Android project using Ant? (IntelliJ IDE)","<android><ant><intellij-idea><proguard>","2","0","4","",""
"4992564","1","","","2011-02-14 13:16:04","2","5001","<p>How can i open Android device contacts list at button click event.</p>","616244","","","","","2013-10-15 14:50:23","Open device contacts list at button click event","<android>","3","1","","",""
"4992567","1","4992634","","2011-02-14 13:16:12","6","1530","<p>I need to create a game in android for my final year project. I have created three games which are just a quiz game, punctuation game and jumble word game. </p><p>But I have been looking through many tutorials on the net and noticed it is not that difficult to create a more advanced 2D game. The game needs to support English in secondary education. </p><p>One of the tutorials I have been looking at is, along with playing with the LunarLander:</p><p><a href=""http://www.droidnova.com/playing-with-graphics-in-android-part-v,188.html"">http://www.droidnova.com/playing-with-graphics-in-android-part-v,188.html</a></p><p>If I was to make a platform game what is the best way just to get one character on the screen, that can walk forward and the screen moves along with it. Not sure how to implement this, I have looked around but most games and tutorials which I have looked at are objects moving around on one screen. Any help would be highly appreciated. Thanks</p>","608658","","168868","","2013-03-18 16:53:57","2014-02-20 10:26:16","Game in android","<android>","3","0","7","2014-02-21 18:36:01",""
"4992571","1","","","2011-02-14 13:16:41","-2","879","<p>i really want to know if there is a uri for calling via intent a generic barcode scanner, i don't want to limit the user to ZXing one.</p>","509375","","","","","2011-02-14 14:16:18","Android barcode reader","<android>","2","0","","2013-05-08 23:09:47",""
"4992646","1","","","2011-02-14 13:24:03","1","332","<p>I need to create some custom buttons as shown in the image below</p><p><img src=""http://i.stack.imgur.com/NzpJY.png"" alt=""enter image description here""></p><p>what is the best approach to follow?</p><p>thanksAbdul Khaliq</p>","100751","","","","","2011-02-16 16:09:57","android custom button","<android><view><uibutton>","2","0","","",""
"4992660","1","5712388","","2011-02-14 13:25:25","0","139","<p>Is it possible to enumerate all the displays supported by an Android device? The APIs currently support getting the default display, but don't appear to support getting any other displays.</p>","211292","","","","","2011-04-19 06:21:52","Android: How to get all the displays of a device","<android><device>","2","3","","",""
"4992701","1","4992920","","2011-02-14 13:30:35","1","1956","<p>I have an application which writes and reads from a specific file on the SD card. </p><p>What i would like is a way to encrypt the whole SD card or a minimum of That specific folder. So if the phone is stolen no one can read the content of that folder. </p><p>However, i also want the application to still be able to interact with the folder and the password isn't required until someone looks at the folder specifically (using astro etc) or inserts it into a PC to view. </p><p>Is this possible? thanks </p>","569654","","","","","2011-02-14 13:50:04","Android - Encrypting/Protecting SD Card Content","<android><encryption><password-protection><sd-card>","2","1","","",""
"4992716","1","","","2011-02-14 13:31:46","0","606","<p>This is a simple(?) question from someone with not so much routine.My app contains of a lot of ""submenu"" views, that is views with 3 or 4 alternatives that each opens up a new screen/activity. I'm not sure which component would be the best to use for these views?</p><p>I use a default drawable as background for each one of them.Each ""row"" is a text and a small icon.All rows are static, no dynamic data.</p><p>I created a tablelayout at first with a textview and an imageview but I never managed to get a nice transparent spacer between the rows.I then switched to a ListView but it seem kind of hard to get the drawable to look good as the background? Also, creating those adapters for a few static rows of data seem like an overkill.</p><p>Perhaps LinearLayout with a LinearLayout(horizontal) for each row containing TextView &amp; ImageView simply the best?</p><p>Regards from the Rookie</p>","498112","","","","","2011-02-14 13:31:46","android tablelayout or listview or ..?=","<android><listview><tablelayout>","0","2","","",""
"4992771","1","","","2011-02-14 13:36:22","1","960","<p>I am new to android.I want to play a video or audio file from my Pc(server) to the emulator(Client).To do this want should I have to do.I don't have any idea what should I have to do.I have to set Socket.I have to change any thing in Pc Side.What should I have to do.Please help me.Thanks in advance. </p>","366916","","","","","2011-02-14 13:49:34","Android-Audio Streaming From Pc","<android>","1","0","","",""
"4992794","1","5891755","","2011-02-14 13:38:23","20","15131","<p>I have googled my question but there is not working answer provided. How do add a bulleted list to my textview.</p>","590849","","3330969","","2014-03-01 16:37:49","2014-03-01 16:37:49","How to add bulleted list to android application ?","<android><android-textview><bullet>","10","0","7","",""
"4992797","1","4993979","","2011-02-14 13:38:32","0","6238","<p>I am new to Android development, so I hope someone can help me with this problem. </p><p>I am trying to create a expandable list, I have tried googling, and read through googles documentation. But somehow I can not wrap my head around it. My code gives no errors in eclipse. But when running it in the emulator, it crashes on startup. I think I am doing something wrong when I set the <strong><em>adapter</em></strong> to the <strong><em>view</em></strong>.</p><p>Here is my code:</p><pre><code>import android.os.Bundle;import android.view.View;import android.view.ViewGroup;import android.widget.TextView;import android.widget.ExpandableListView;import android.widget.ExpandableListAdapter;import android.widget.BaseExpandableListAdapter;import android.view.LayoutInflater;import android.content.Context;public class hmenyActivity extends MyActivity {    ExpandableListAdapter adapter;    private Context context;    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.hmeny);        adapter = new MyExpandableListAdapter();        ExpandableListView listView = (ExpandableListView) findViewById(R.id.listView);        listView.setOnChildClickListener(new OnChildClickListener()        {            @Override            public boolean onChildClick(ExpandableListView arg0, View arg1, int arg2, int arg3, long arg4)            {            Toast.makeText(getBaseContext(), ""Child clicked"", Toast.LENGTH_LONG).show();            return false;            }        });        listView.setAdapter(adapter);    }    public class MyExpandableListAdapter extends BaseExpandableListAdapter {        private String[] groups = {                ""Test1"",                ""Test2"",                ""Test3""            };        private String[][] children = {                {                    ""foo1"",                    ""foo2"",                    ""foo3""                },                {                    ""foo1"",                    ""foo2"",                    ""foo3""                },                {                    ""foo1"",                    ""foo2"",                    ""foo3""                }            };        public Object getChild(int groupPosition, int childPosition) {            return children[groupPosition][childPosition];        }        public long getChildId(int groupPosition, int childPosition) {            return childPosition;        }        public int getChildrenCount(int groupPosition) {            return children[groupPosition].length;        }        public View getChildView(int groupPosition, int childPosition, boolean isLastChild,                View convertView, ViewGroup parent) {            if (convertView == null) {                LayoutInflater infalInflater = (LayoutInflater) context                .getSystemService(Context.LAYOUT_INFLATER_SERVICE);                convertView = infalInflater.inflate(R.layout.underkat_layout, null);            }            TextView textView = (TextView) convertView.findViewById(R.id.tvChild);            textView.setText(getChild(groupPosition, childPosition).toString());            return convertView;        }        public Object getGroup(int groupPosition) {            return groups[groupPosition];        }        public int getGroupCount() {                return groups.length;        }        public long getGroupId(int groupPosition) {            return groupPosition;        }        public View getGroupView(int groupPosition, boolean isExpanded, View convertView,                ViewGroup parent) {            if (convertView == null) {                LayoutInflater infalInflater = (LayoutInflater) context                .getSystemService(Context.LAYOUT_INFLATER_SERVICE);                convertView = infalInflater.inflate(R.layout.kat_layout, null);            }            TextView textView = (TextView) convertView.findViewById(R.id.tvGroup);            textView.setText(getGroup(groupPosition).toString());            return convertView;        }        public boolean isChildSelectable(int groupPosition, int childPosition) {            return true;        }        public boolean hasStableIds() {            return true;        }    }} </code></pre><p>@ingo here is the logcat output:</p><pre><code>02-14 14:49:26.673: ERROR/AndroidRuntime(302): Uncaught handler: thread main exiting due to uncaught exception02-14 14:49:26.693: ERROR/AndroidRuntime(302): java.lang.NullPointerException02-14 14:49:26.693: ERROR/AndroidRuntime(302):     at com.android.quizapp.hmenyActivity$MyExpandableListAdapter.getGroupView(hmenyActivity.java:151)02-14 14:49:26.693: ERROR/AndroidRuntime(302):     at android.widget.ExpandableListConnector.getView(ExpandableListConnector.java:446)02-14 14:49:26.693: ERROR/AndroidRuntime(302):     at android.widget.AbsListView.obtainView(AbsListView.java:1273)02-14 14:49:26.693: ERROR/AndroidRuntime(302):     at android.widget.ListView.measureHeightOfChildren(ListView.java:1147)02-14 14:49:26.693: ERROR/AndroidRuntime(302):     at android.widget.ListView.onMeasure(ListView.java:1060)02-14 14:49:26.693: ERROR/AndroidRuntime(302):     at android.view.View.measure(View.java:7703)02-14 14:49:26.693: ERROR/AndroidRuntime(302):     at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:2989)02-14 14:49:26.693: ERROR/AndroidRuntime(302):     at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:888)02-14 14:49:26.693: ERROR/AndroidRuntime(302):     at android.widget.LinearLayout.measureVertical(LinearLayout.java:350)02-14 14:49:26.693: ERROR/AndroidRuntime(302):     at android.widget.LinearLayout.onMeasure(LinearLayout.java:278)02-14 14:49:26.693: ERROR/AndroidRuntime(302):     at android.view.View.measure(View.java:7703)02-14 14:49:26.693: ERROR/AndroidRuntime(302):     at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:2989)02-14 14:49:26.693: ERROR/AndroidRuntime(302):     at android.widget.FrameLayout.onMeasure(FrameLayout.java:245)02-14 14:49:26.693: ERROR/AndroidRuntime(302):     at android.view.View.measure(View.java:7703)02-14 14:49:26.693: ERROR/AndroidRuntime(302):     at android.widget.LinearLayout.measureVertical(LinearLayout.java:464)02-14 14:49:26.693: ERROR/AndroidRuntime(302):     at android.widget.LinearLayout.onMeasure(LinearLayout.java:278)02-14 14:49:26.693: ERROR/AndroidRuntime(302):     at android.view.View.measure(View.java:7703)02-14 14:49:26.693: ERROR/AndroidRuntime(302):     at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:2989)02-14 14:49:26.693: ERROR/AndroidRuntime(302):     at android.widget.FrameLayout.onMeasure(FrameLayout.java:245)02-14 14:49:26.693: ERROR/AndroidRuntime(302):     at android.view.View.measure(View.java:7703)02-14 14:49:26.693: ERROR/AndroidRuntime(302):     at android.view.ViewRoot.performTraversals(ViewRoot.java:747)02-14 14:49:26.693: ERROR/AndroidRuntime(302):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1613)02-14 14:49:26.693: ERROR/AndroidRuntime(302):     at android.os.Handler.dispatchMessage(Handler.java:99)02-14 14:49:26.693: ERROR/AndroidRuntime(302):     at android.os.Looper.loop(Looper.java:123)02-14 14:49:26.693: ERROR/AndroidRuntime(302):     at android.app.ActivityThread.main(ActivityThread.java:4203)02-14 14:49:26.693: ERROR/AndroidRuntime(302):     at java.lang.reflect.Method.invokeNative(Native Method)02-14 14:49:26.693: ERROR/AndroidRuntime(302):     at java.lang.reflect.Method.invoke(Method.java:521)02-14 14:49:26.693: ERROR/AndroidRuntime(302):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)02-14 14:49:26.693: ERROR/AndroidRuntime(302):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)02-14 14:49:26.693: ERROR/AndroidRuntime(302):     at dalvik.system.NativeStart.main(Native Method)02-14 14:49:26.713: INFO/Process(51): Sending signal. PID: 302 SIG: 302-14 14:49:26.713: INFO/dalvikvm(302): threadid=7: reacting to signal 302-14 14:49:26.713: ERROR/dalvikvm(302): Unable to open stack trace file '/data/anr/traces.txt': Permission denied02-14 14:49:36.493: WARN/ActivityManager(51): Launch timeout has expired, giving up wake lock!02-14 14:49:36.506: WARN/ActivityManager(51): Activity idle timeout for HistoryRecord{43919b58 com.android.skiquiz/.hmenyActivity}02-14 14:49:41.533: WARN/ActivityManager(51): Activity destroy </code></pre>","191077","","674530","","2011-07-07 10:25:29","2012-01-07 09:34:27","Problem with expandable list adapter","<android><list><expandable>","1","1","2","",""
"4992823","1","4992895","","2011-02-14 13:41:13","1","1590","<p>Can anyone tell me a way to store an XML file in the android apps so that I can update it in a regular basis just like we do it in SQlite database.I am developing an apps in which I use an xml file to store data and I need to update the data on regular basis, please tell me a way to store the xml file.Means where should I store that xml file so that I can update it.</p>","589503","","244296","","2011-02-14 13:48:24","2011-02-14 13:48:24","How to update an XML file while the Android app is running in a device or emulator?","<android><xml>","2","0","","",""
"4992832","1","4993024","","2011-02-14 13:41:58","0","1408","<pre><code>public EditText text;public TextView text1;@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);}        public void act(View v) {            text = (EditText) findViewById(R.id.widget30);            text1 = (TextView) findViewById(R.id.textView1);            text1.setText(text.getText());        }</code></pre><p>and this the code XML</p><pre><code>     &lt;EditTextandroid:id=""@+id/widget30""android:layout_width=""260px""android:layout_height=""50px""android:text=""Gouvernorat""android:textSize=""18sp""android:layout_x=""31px""android:layout_y=""90px""&gt;&lt;/EditText&gt;&lt;ImageButton android:layout_width=""wrap_content"" android:src=""@drawable/icon1"" android:id=""@+id/imageButton1"" android:layout_height=""wrap_content"" android:layout_x=""108dip"" android:layout_y=""360dip""&gt;android:onClick=""act""&lt;/ImageButton&gt;&lt;TextView android:layout_height=""wrap_content"" android:layout_width=""wrap_content"" android:id=""@+id/textView1"" android:text=""TextView"" android:layout_x=""196dip"" android:layout_y=""382dip""&gt;&lt;/TextView&gt;</code></pre><p>how can i field in the textview the content of EditText ?</p><p>Thank you</p>","616263","","457982","","2011-02-14 13:44:25","2011-02-14 15:34:50","action to an imageButton","<android>","2","0","","",""
"4992853","1","5002497","","2011-02-14 13:43:38","1","763","<p>I use the Progress Dialog ,first time when I load the web view and create the object in OnCreate</p><pre><code>            progressBar = new ProgressDialog(this);    progressBar.setCancelable(true);    progressBar.setMessage(""Loading..."");    progressBar.setOnCancelListener(new OnCancelListener() {        public void onCancel(DialogInterface arg0) {            if (progressBar.isShowing())                progressBar.dismiss();            finish();        }    });    progressBar.show();</code></pre><p>and dismiss it onPageFinished</p><pre><code>            public void onPageFinished(WebView view, String url) {                Log.i(""TEST"", ""Finished loading URL: "" + url);                if (progressBar.isShowing()) {                    progressBar.dismiss();                }            }</code></pre><p>then I load another url from menu then I write the code in onPageStarted</p><pre><code>                   @Override            public void onPageStarted(WebView view, String url, Bitmap favicon) {                 if(progressBar.isShowing()){}                 else                 //progressBar.                 progressBar.show();                super.onPageStarted(view, url, favicon);            }</code></pre><p>on second time the circle in Dialog is not running, all everything works fine.  you can view same problem in ApiDemos alos.  please install Apidemos application in device then go to view->progress bar->dialog->click on ""show Intermediat""  then dismiss using back button.Now add click on same button, the circle animation will working</p><p>Thanks in Advance. </p>","256612","","256612","","2011-02-15 09:33:47","2011-02-15 10:28:53","Android:dialog box issue","<android>","1","2","1","",""
"4992950","1","5046215","","2011-02-14 13:53:18","1","1138","<p>I have used FrameLayout within a Gallery as the Gallery Item. There are 2 RelativeLayouts inside the FrameLayout each holding some TextView and an ImageView. There is a button outside the Gallery called 'Flip'. Clicking the button 'Flip' hides one relative layout and shows the another with flip animation. And there is also a TextView outside the Gallery in which I update some text. When the user scrolls the Gallery to select another item, then I update the TextView from Gallery's setOnItemSelected method.</p><p>The problem is if I don't update the TextView from the setOnItemSelected method, the flipping animation works correctly. But, if I update the TextView then the animation doesn't work. Even it doesn't switch the RelativeLayout inside the FrameLayout.</p><p>If anybody has any idea where the problem please help me.</p><p>Here is the XML layout for the main screen:</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:gravity=""top|center"" android:background=""#0000""&gt;&lt;RelativeLayout android:id=""@+id/RelativeLayout04"" android:layout_height=""fill_parent"" android:layout_width=""fill_parent""&gt;&lt;RelativeLayout android:layout_width=""fill_parent"" android:layout_height=""wrap_content"" android:background=""@drawable/top_bar"" android:layout_alignParentTop=""true"" android:id=""@+id/headerRelativeLayout""&gt;&lt;Button android:id=""@+id/homeButton"" android:layout_height=""wrap_content"" android:layout_marginTop=""5dip"" android:background=""@drawable/home_button_open"" android:layout_marginLeft=""5dip"" android:layout_width=""wrap_content"" android:layout_alignParentLeft=""true""&gt;&lt;/Button&gt;&lt;Button android:id=""@+id/backButton"" android:layout_height=""wrap_content"" android:layout_marginTop=""5dip"" android:background=""@drawable/back_button"" android:layout_toRightOf=""@+id/homeButton"" android:layout_width=""wrap_content""&gt;&lt;/Button&gt;&lt;TextView android:layout_height=""wrap_content"" android:textSize=""22sp"" android:layout_toLeftOf=""@+id/LinearLayout02"" android:gravity=""center"" android:layout_toRightOf=""@+id/backButton"" android:id=""@+id/TextView02"" android:layout_width=""fill_parent"" android:textStyle=""bold"" android:layout_centerInParent=""true""&gt;&lt;/TextView&gt;&lt;LinearLayout android:layout_alignParentRight=""true"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:orientation=""horizontal"" android:layout_centerVertical=""true"" android:layout_marginRight=""10dip"" android:id=""@+id/LinearLayout02""&gt;&lt;com.vocabAhead.SATVocab.LoginButton android:layout_marginRight=""5dip"" android:id=""@+id/facebookButton"" android:layout_width=""wrap_content"" android:background=""@drawable/facebook_button"" android:layout_height=""wrap_content""&gt;&lt;/com.vocabAhead.SATVocab.LoginButton&gt;&lt;Button android:id=""@+id/settingsButton"" android:layout_width=""wrap_content"" android:background=""@drawable/settings_button"" android:layout_height=""wrap_content"" android:layout_gravity=""center_vertical""&gt;&lt;/Button&gt;&lt;/LinearLayout&gt;&lt;/RelativeLayout&gt;&lt;RelativeLayout android:layout_width=""fill_parent"" android:layout_height=""35dip"" android:background=""#FF212121"" android:layout_alignParentBottom=""true"" android:id=""@+id/footerRelativeLayout""&gt;&lt;Button android:id=""@+id/playButton"" android:layout_height=""wrap_content"" android:background=""@drawable/play_button"" android:layout_marginLeft=""10dip"" android:layout_width=""wrap_content"" android:layout_centerVertical=""true"" android:layout_alignParentLeft=""true""&gt;&lt;/Button&gt;&lt;Button android:layout_alignParentRight=""true"" android:id=""@+id/showScriptButton"" android:layout_height=""wrap_content"" android:background=""@drawable/infobutton"" android:layout_marginRight=""10dip"" android:layout_width=""wrap_content"" android:layout_centerVertical=""true""&gt;&lt;/Button&gt;&lt;TextView android:layout_height=""wrap_content"" android:textColor=""#FFFF"" android:id=""@+id/itemSerialTextView"" android:layout_width=""wrap_content"" android:layout_centerInParent=""true""&gt;&lt;/TextView&gt;&lt;TextView android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:layout_centerVertical=""true"" android:layout_marginLeft=""5dip"" android:layout_toRightOf=""@+id/playButton"" android:id=""@+id/durationTextView"" android:textColor=""#FFFF""&gt;&lt;/TextView&gt;&lt;/RelativeLayout&gt;&lt;Gallery android:id=""@+id/wordsGallery"" android:layout_above=""@+id/footerRelativeLayout"" android:layout_below=""@+id/headerRelativeLayout"" android:layout_height=""fill_parent"" android:layout_width=""fill_parent"" android:scrollbars=""none"" android:scrollbarSize=""0dip"" android:layout_margin=""0dip"" android:gravity=""fill"" android:padding=""0dip"" android:background=""#0000""&gt;&lt;/Gallery&gt;&lt;/RelativeLayout&gt;&lt;/LinearLayout&gt;</code></pre><p>And here is the XML layout for the Gallery items:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;FrameLayout xmlns:android=""http://schemas.android.com/apk/res/android"" android:id=""@+id/container""android:layout_width=""fill_parent""android:layout_height=""fill_parent"" android:layout_margin=""0dip""   android:padding=""0dip""&gt;&lt;RelativeLayout android:layout_height=""fill_parent"" android:layout_width=""fill_parent"" android:id=""@+id/wordDetailsRelativeLayout"" android:background=""#FFFF""&gt;&lt;TextView android:gravity=""center"" android:textSize=""18sp"" android:layout_alignParentTop=""true"" android:layout_width=""fill_parent"" android:text=""Apathy"" android:textStyle=""bold"" android:layout_height=""wrap_content"" android:layout_marginBottom=""5dip"" android:layout_marginTop=""5dip"" android:id=""@+id/wordTextView"" android:textColor=""#FF1a3f6e""&gt;&lt;/TextView&gt;&lt;TextView android:gravity=""center"" android:layout_width=""fill_parent"" android:text=""verb"" android:layout_height=""wrap_content"" android:id=""@+id/partsOfSpeechTextView"" android:layout_below=""@+id/wordTextView"" android:layout_marginBottom=""5dip""&gt;&lt;/TextView&gt;&lt;LinearLayout android:paddingBottom=""5dip"" android:layout_width=""fill_parent"" android:gravity=""center"" android:background=""#FFFF"" android:id=""@+id/LinearLayout01"" android:layout_height=""wrap_content"" android:layout_alignParentBottom=""true""&gt;&lt;ImageView android:src=""@drawable/iphone_vocabulary_logo_15"" android:id=""@+id/logoImageView"" android:layout_height=""wrap_content"" android:layout_width=""wrap_content""&gt;&lt;/ImageView&gt;&lt;/LinearLayout&gt;&lt;LinearLayout android:layout_height=""fill_parent"" android:layout_marginBottom=""5dip"" android:layout_width=""fill_parent"" android:layout_below=""@+id/partsOfSpeechTextView"" android:orientation=""vertical"" android:id=""@+id/imageAndMeaningLinearLayout"" android:gravity=""top|center_horizontal"" android:layout_above=""@+id/LinearLayout01""&gt;&lt;ImageView android:id=""@+id/wordImageView"" android:layout_height=""wrap_content"" android:layout_width=""wrap_content""&gt;&lt;/ImageView&gt;&lt;TextView android:layout_height=""wrap_content"" android:id=""@+id/wordMeaningTextView"" android:layout_width=""wrap_content"" android:textColor=""#F000"" android:textSize=""15sp"" android:layout_marginLeft=""10dip"" android:layout_marginTop=""10dip"" android:layout_marginRight=""10dip"" android:gravity=""center""&gt;&lt;/TextView&gt;&lt;/LinearLayout&gt;&lt;/RelativeLayout&gt;&lt;RelativeLayout android:layout_height=""fill_parent"" android:layout_width=""fill_parent"" android:background=""#FFFF"" android:id=""@+id/wordScriptRelativeLayout"" android:visibility=""gone""&gt;&lt;TextView android:gravity=""center"" android:textSize=""18sp"" android:layout_alignParentTop=""true"" android:layout_width=""fill_parent"" android:text=""Apathy"" android:textStyle=""bold"" android:layout_height=""wrap_content"" android:layout_marginBottom=""5dip"" android:layout_marginTop=""5dip"" android:textColor=""#FF1a3f6e"" android:id=""@+id/wordTextView2""&gt;&lt;/TextView&gt;&lt;TextView android:gravity=""center"" android:layout_width=""fill_parent"" android:text=""verb"" android:layout_height=""wrap_content"" android:id=""@+id/partsOfSpeechTextView2"" android:layout_below=""@+id/wordTextView2"" android:layout_marginBottom=""5dip""&gt;&lt;/TextView&gt;&lt;LinearLayout android:paddingBottom=""5dip"" android:layout_width=""fill_parent"" android:gravity=""center"" android:background=""#FFFF"" android:layout_height=""wrap_content"" android:layout_alignParentBottom=""true"" android:id=""@+id/LinearLayout02""&gt;&lt;ImageView android:src=""@drawable/iphone_vocabulary_logo_15"" android:id=""@+id/logoImageView"" android:layout_height=""wrap_content"" android:layout_width=""wrap_content""&gt;&lt;/ImageView&gt;&lt;/LinearLayout&gt;&lt;LinearLayout android:layout_height=""fill_parent"" android:layout_width=""fill_parent"" android:id=""@+id/wordScriptLinearLayout"" android:gravity=""top|center_horizontal"" android:layout_below=""@+id/partsOfSpeechTextView2"" android:layout_above=""@+id/LinearLayout02""&gt;&lt;TextView android:layout_height=""wrap_content"" android:layout_margin=""10dip"" android:id=""@+id/wordScriptTextView"" android:layout_width=""fill_parent"" android:textColor=""#F000"" android:textSize=""15sp""&gt;&lt;/TextView&gt;&lt;/LinearLayout&gt;&lt;/RelativeLayout&gt;&lt;/FrameLayout&gt;</code></pre><p>In the main screen when the user clicks the showScriptButton (right button of the footer), then framelayout's one relative layout switches with the another. The switching of the relative layout is shown with a flip animation. </p><p>Now, there is a text view in the middle of the footer. If we change the text of that text view from code then the flip animation doesn't work even though the frame layout doesn't change the relative layouts.</p><p>This is the setOnItemSelectedListener method for the Gallery:</p><pre><code>wordsGallery.setOnItemSelectedListener(new OnItemSelectedListener() {        @Override        public void onItemSelected(AdapterView&lt;?&gt; arg0, View arg1,                int position, long arg3) {            durationTextView.setText("""");        }        @Override        public void onNothingSelected(AdapterView&lt;?&gt; arg0) {        }    });</code></pre><p>Here is the method for playButton:</p><pre><code>private void playAudio() {    if(isPaused) {        myRefreshThread = new Thread(new secondCountDownRunner());        myRefreshThread.start();        audioPlayer.start();    } else {        audioPlayer = MediaPlayer.create(this, ApplicationCache.wordAudioList.get(word.wordText));        audioPlayer.setOnCompletionListener(this);        int totalDuration = audioPlayer.getDuration()/1000;        String durationText = """";          int min = totalDuration/60;          int seconds = totalDuration % 60;          if(min &lt; 10)              durationText = ""0"";          durationText += min+"":"";          if(seconds &lt; 10)              durationText += ""0"";          durationText += seconds;        System.out.println(""Duration of audio:""+durationText);        durationTextView.setText(durationText);        myRefreshThread = new Thread(new secondCountDownRunner());        myRefreshThread.start();        audioPlayer.start();    }    isPaused = false;    isPlaying = true;    playButton.setBackgroundResource(R.drawable.pause_button);}</code></pre><p>And here is the secondCountDownRunner thread:</p><pre><code>class secondCountDownRunner implements Runnable{    // @Override    public void run() {        while(!Thread.currentThread().isInterrupted()){            Message m = new Message();            m.what = 2;            audioPlayerHandler.sendMessage(m);            try {                Thread.sleep(1000);            } catch (InterruptedException e) {                Thread.currentThread().interrupt();            }        }    }}</code></pre><p>and here is the audioPlayerHandler:</p><pre><code>audioPlayerHandler = new Handler() {        @Override        public void handleMessage( Message msg )         {              if(msg.what == 1) {                  if(isPlaying) {                      if(wordsGallery.getSelectedItemPosition() &lt; (ApplicationCache.dontKnowWords.size() - 1)) {                        //currentPosition++;                        //currentGalleryPosition++;                        //isWordScriptShowing = false;                        //updateWordDetails();                        word = wordsList.get(wordsGallery.getSelectedItemPosition() + 1);                        wordsGallery.setSelection(wordsGallery.getSelectedItemPosition() + 1, true);                        playAudio();                      }                  }              } else if(msg.what == 2) {                  if(isPlaying) {                      int duration = audioPlayer.getDuration()/1000;                      int currentPosition = audioPlayer.getCurrentPosition()/1000;                      int timeLeft = duration - currentPosition;                      if(timeLeft &lt; 0)                          timeLeft = 0;                      String durationText = """";                      int min = timeLeft/60;                      int seconds = timeLeft % 60;                      if(min &lt; 10)                          durationText = ""0"";                      durationText += min+"":"";                      if(seconds &lt; 10)                          durationText += ""0"";                      durationText += seconds;                      durationTextView.setText(durationText);                  }              }                     }               };</code></pre><p>Here is the method which is called when showScriptButton is clicked:</p><pre><code>public void flipView(int position) {    applyRotation(0, 90, position);    isFrontShowing[position] = !isFrontShowing[position];       }private void applyRotation(float start, float end, int position) {    // Find the center of image    final float centerX, centerY;    if(isFrontShowing[position] == true) {        centerX = detailsLayout[position].getMeasuredWidth() / 2.0f;        centerY = detailsLayout[position].getMeasuredHeight() / 2.0f;    } else {        centerX = scriptLayout[position].getMeasuredWidth() / 2.0f;        centerY = scriptLayout[position].getMeasuredHeight() / 2.0f;    }    //System.out.println(""center X:""+centerX+"",Y:""+centerY);    // Create a new 3D rotation with the supplied parameter    // The animation listener is used to trigger the next animation    final Flip3dAnimation rotation =           new Flip3dAnimation(start, end, centerX, centerY);    rotation.setDuration(500);    rotation.setFillAfter(true);    rotation.setInterpolator(new AccelerateInterpolator());    rotation.setAnimationListener(new DisplayNextView(isFrontShowing[position], detailsLayout[position], scriptLayout[position]));    if (isFrontShowing[position] == true)    {        //detailsLayout[position].requestFocus();        //detailsLayout[position].bringToFront();        detailsLayout[position].startAnimation(rotation);    } else {        //System.out.println(""---Backward flipping started..."");        //scriptLayout[position].requestFocus();        //scriptLayout[position].bringToFront();        scriptLayout[position].startAnimation(rotation);    }}</code></pre><p>Here is the Flip3dAnimation class:</p><pre><code>import android.graphics.Camera;</code></pre><p>import android.graphics.Matrix;import android.view.animation.Animation;import android.view.animation.Transformation;</p><p>public class Flip3dAnimation extends Animation {    private final float mFromDegrees;    private final float mToDegrees;    private final float mCenterX;    private final float mCenterY;    private Camera mCamera;</p><pre><code>public Flip3dAnimation(float fromDegrees, float toDegrees, float centerX,        float centerY) {    mFromDegrees = fromDegrees;    mToDegrees = toDegrees;    mCenterX = centerX;    mCenterY = centerY;}@Overridepublic void initialize(int width, int height, int parentWidth,        int parentHeight) {    super.initialize(width, height, parentWidth, parentHeight);    mCamera = new Camera();}@Overrideprotected void applyTransformation(float interpolatedTime, Transformation t) {    final float fromDegrees = mFromDegrees;    float degrees = fromDegrees            + ((mToDegrees - fromDegrees) * interpolatedTime);    final float centerX = mCenterX;    final float centerY = mCenterY;    final Camera camera = mCamera;    final Matrix matrix = t.getMatrix();    camera.save();    camera.rotateY(degrees);    camera.getMatrix(matrix);    camera.restore();    matrix.preTranslate(-centerX, -centerY);    matrix.postTranslate(centerX, centerY);}</code></pre><p>}</p><p>DisplayNextView class:</p><pre><code>import android.view.animation.Animation;</code></pre><p>import android.widget.RelativeLayout;</p><p>public final class DisplayNextView implements Animation.AnimationListener {    private boolean mCurrentView;    RelativeLayout layout1;    RelativeLayout layout2;</p><pre><code>public DisplayNextView(boolean currentView, RelativeLayout layout1,        RelativeLayout layout2) {    mCurrentView = currentView;    this.layout1 = layout1;    this.layout2 = layout2;}public void onAnimationStart(Animation animation) {}public void onAnimationEnd(Animation animation) {    layout1.post(new SwapViews(mCurrentView, layout1, layout2));        }public void onAnimationRepeat(Animation animation) {}</code></pre><p>}</p><p>SwapViews class:</p><pre><code>import android.view.View;</code></pre><p>import android.view.animation.Animation;import android.view.animation.DecelerateInterpolator;import android.view.animation.Animation.AnimationListener;import android.widget.RelativeLayout;</p><p>public final class SwapViews implements Runnable {    private boolean mIsFirstView;    RelativeLayout layout1;    RelativeLayout layout2;</p><pre><code>public SwapViews(boolean isFirstView, RelativeLayout layout1, RelativeLayout layout2) {    mIsFirstView = isFirstView;    this.layout1 = layout1;    this.layout2 = layout2;}public void run() {    final float centerX, centerY;    if(mIsFirstView) {        centerX = layout1.getWidth() / 2.0f;        centerY = layout1.getHeight() / 2.0f;    } else {        centerX = layout2.getWidth() / 2.0f;        centerY = layout2.getHeight() / 2.0f;    }    Flip3dAnimation rotation;    if (mIsFirstView == true) {        layout1.setVisibility(View.GONE);        layout2.setVisibility(View.VISIBLE);        layout2.requestFocus();        layout2.bringToFront();        rotation = new Flip3dAnimation(-90, 0, centerX, centerY);    } else {        layout2.setVisibility(View.GONE);        layout1.setVisibility(View.VISIBLE);        layout1.requestFocus();        layout1.bringToFront();        rotation = new Flip3dAnimation(-90, 0, centerX, centerY);    }    rotation.setDuration(500);    rotation.setFillAfter(true);    rotation.setInterpolator(new DecelerateInterpolator());    rotation.setAnimationListener(new AnimationListener() {        @Override        public void onAnimationStart(Animation arg0) {        }        @Override        public void onAnimationRepeat(Animation arg0) {            // TODO Auto-generated method stub        }        @Override        public void onAnimationEnd(Animation arg0) {            WordDetailItemAdapter.notifyAdapter();        }    });    if (mIsFirstView == true) {        layout2.startAnimation(rotation);    } else {        layout1.startAnimation(rotation);    }}</code></pre><p>}</p><p>Does anyone have some idea about the problem. Please help.</p>","523118","","523118","","2011-02-21 10:32:23","2011-02-21 10:32:23","FrameLayout animation don't work while changing text in a textview outside of framelayout","<android><android-widget>","1","2","1","",""
"4993015","1","","","2011-02-14 13:59:58","0","1584","<p>I know this question has been asked before, but I couldn't get an answer for my issue. I have a large image, and I would like to display it with it's full sizes (in fact its a custom map image). I know that the image can be scrolled by swiping the finger, but my question is if there is a way to implement a vertical / horizontal scrollview for this. I would like to be able to use the scrollview features (swiping the finger an the image is scrolling by itself). Using a HorizontalScrollView inside a ScrollView didn't work either. The horizontal scroll bar appears only sometimes, and there is no way you can scroll in both directions. Any help is appreciated.</p><p>Thanls a lot,</p><p>Gratzi</p>","460611","","","","","2011-02-14 14:08:46","Scroll an Image horizontal and vertical","<android>","1","0","","",""
"4993026","1","4993311","","2011-02-14 14:00:53","3","15900","<p>Hi all got an app that saves audio on sd card. i've created a listview which retrieves the filesnames from the sdcard. i'm trying to set a listener so when the file name is clicked i can launch another intent that plays that file. when i try to set the listener and pass in a new OnItemClickListener() eclipse is red underlining it. i understand that i have to implement the onItemclick(), this is where i think the intent ought to go. any ideas?</p><p>thanks</p><p>Code:</p><pre><code>package com.tecmark;import java.io.File;import java.util.ArrayList;import android.app.Activity;import android.os.Bundle;import android.os.Environment;import android.util.Log;import android.widget.AdapterView;import android.widget.ArrayAdapter;import android.widget.ListView;import android.widget.AdapterView.OnItemClickListener;import android.widget.AdapterView.OnItemSelectedListener;public class SdGetList extends Activity {    private ListView lv1;    private String[] lv_arr;    private ArrayList&lt;String&gt; arr;    @Override    public void onCreate(Bundle icicle) {        super.onCreate(icicle);        setContentView(R.layout.listlayout);        arr = new ArrayList&lt;String&gt;();        File sdCardRoot = Environment.getExternalStorageDirectory();        Log.i(""root on sd ="", """"+ sdCardRoot.getPath());        for (File f : sdCardRoot.listFiles()) {            if (f.isFile()){                String name = f.getName();                arr.add(name);                Log.i(""arr is empty?******"", """"+arr.isEmpty());            }            else {                Log.i(""file"", "" no file"");            }            Log.i(""arr******"", """"+arr.size());        }        lv_arr = new String[arr.size()];        for(int i=0 ; i&lt;arr.size();i++) {            lv_arr[i] = arr.get(i);        }        lv1=(ListView)findViewById(R.id.ListView01);        // By using setAdpater method in listview we an add string array in list.        lv1.setAdapter(new ArrayAdapter&lt;String&gt;(this,android.R.layout.simple_list_item_1 , lv_arr));        lv1.setOnItemClickListener(new OnItemClickListener() {            public void onItemClick(AdapterView&lt;?&gt; parent, View view, int position, long id) {            }        } );    }}</code></pre>","532462","","318465","","2011-02-14 14:28:26","2011-02-14 14:42:15","using setOnItemClickListener for items in listview","<android><listview>","2","1","1","",""
"4993036","1","4993238","","2011-02-14 14:01:34","0","170","<p>My activity crashes whenever I hit back or home button, it happens when calling onPause method. I think it has to do something with the cursor but it shouldn't since application manages it.</p><pre><code>package mini.bookmarks.android.hr;import java.io.ByteArrayInputStream;import java.util.HashMap;import android.app.Activity;import android.content.Intent;import android.database.Cursor;import android.graphics.Color;import android.graphics.drawable.Drawable;import android.net.Uri;import android.os.Bundle;import android.provider.Browser;import android.provider.Browser.BookmarkColumns;import android.view.Menu;import android.view.MenuInflater;import android.view.MenuItem;import android.view.View;import android.widget.ImageView;import android.widget.RelativeLayout;import android.widget.ScrollView;public class Main extends Activity {private int FAVICON_SIZE = Constants.FAVICON_SIZE;private int topMargin = Constants.topMargin;private int leftMargin = Constants.leftMargin;ScrollView scrollView;BookmarkLayout bookmarkLayout;RelativeLayout.LayoutParams params;ImageView bookmark;private float scale;int bookmarkCounter;Cursor cursor;HashMap&lt;Integer, String&gt; urls = new HashMap&lt;Integer, String&gt;();String [] projection = new String[] {        BookmarkColumns.TITLE,        BookmarkColumns.URL,        BookmarkColumns.FAVICON,};String selection = BookmarkColumns.FAVICON + "" IS NOT NULL"";@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    scrollView = (ScrollView) findViewById(R.id.ScrollView_main);    bookmarkLayout = (BookmarkLayout) findViewById(R.id.BookmarkLayout_main);    scale = this.getResources().getDisplayMetrics().density;    loadResources();}private void loadResources() {    this.startManagingCursor(cursor);    cursor = managedQuery(Browser.BOOKMARKS_URI, projection, selection,    null, Browser.BookmarkColumns.VISITS + "" DESC"");    if(cursor.moveToFirst()) {        bookmarkCounter = 0;        ByteArrayInputStream blobImage;        do{           bookmark = new ImageView(this);           bookmark.setId(bookmarkCounter++);           bookmark.setBackgroundColor(Color.WHITE);           blobImage = new ByteArrayInputStream(                   cursor.getBlob(cursor.getColumnIndex(BookmarkColumns.FAVICON)));           bookmark.setImageDrawable(                   Drawable.createFromStream(blobImage, """" + bookmark.getId()));           urls.put(bookmark.getId(),                   cursor.getString(                            cursor.getColumnIndex(BookmarkColumns.URL)));           bookmark.setOnClickListener(new View.OnClickListener() {                @Override                public void onClick(View v) {                    Intent browserIntent = new Intent(                            Intent.ACTION_VIEW, Uri.parse(urls.get(v.getId())));                    startActivity(browserIntent);                }            });           params = new RelativeLayout.LayoutParams(                   (int) (scale * FAVICON_SIZE), (int) (scale * FAVICON_SIZE));           params.topMargin = (int) (scale * topMargin);           params.leftMargin = (int) (scale * leftMargin);           bookmarkLayout.addView(bookmark, params);        } while (cursor.moveToNext());     }    }@Overridepublic boolean onCreateOptionsMenu(Menu menu) {    MenuInflater inflater = getMenuInflater();    inflater.inflate(R.menu.main_menu, menu);    return true;}@Overridepublic boolean onOptionsItemSelected(MenuItem item) {    switch(item.getItemId()) {    case R.id.menu_item_settings:        return true;    case R.id.menu_item_about:        return true;    default:        return super.onOptionsItemSelected(item);    }}}</code></pre>","607767","","512958","","2011-02-14 14:10:57","2011-02-14 14:20:54","Android NPE when activity goes to background","<android><cursor><nullpointerexception>","1","3","","",""
"4993040","1","4993219","","2011-02-14 14:02:09","0","535","<p>HiI am trying to read an XML from the web and display them in a Listview. In the XML I have 3 records and my Listview only showing the last record. Would be great if anyone can help me identifying the mistakes!!I am using SAX to read from the web.</p><p>Handler:</p><pre><code>public class SearchItemHandler extends DefaultHandler{private boolean in_itemName=false;private boolean in_itemAddress=false;private boolean in_itemLatitude=false;private boolean in_itemLongitude=false;private boolean in_business=false;private boolean in_local=false;private SearchItem sItem=new SearchItem();public SearchItem getParsedData(){    return this.sItem;}    public static List&lt;SearchItem&gt; list=new ArrayList&lt;SearchItem&gt;();@Overridepublic void startDocument() throws SAXException {        this.sItem = new SearchItem();}@Overridepublic void endDocument() throws SAXException {        // Nothing to do}@Overridepublic void startElement(String namespaceURI,String localname,String qName,Attributes atts)throws SAXException{    if(localname.equalsIgnoreCase(""Business"")){        this.in_business=true;    }else if(localname.equalsIgnoreCase(""local"")){        this.in_local=true;    }else if(localname.equalsIgnoreCase(""ItemName"")){        String itemname=atts.getValue(""name"");        sItem.setItemName(itemname);        this.in_itemName=true;    }else if(localname.equalsIgnoreCase(""ItemAddress"")){        String itemaddress=atts.getValue(""address"");        sItem.setItemAddress(itemaddress);        this.in_itemAddress=true;    }else if(localname.equalsIgnoreCase(""Latitude"")){        double lat=Double.parseDouble(atts.getValue(""lat""));        sItem.setLatitude(lat);        this.in_itemLatitude=true;    }else if(localname.equalsIgnoreCase(""Longitude"")){        double lon=Double.parseDouble(atts.getValue(""lon""));        sItem.setLatitude(lon);        this.in_itemLongitude=true;} list.add(sItem);</code></pre><p>}    @Override    public void endElement(String namespaceURI, String localname, String qName)throws SAXException {        if(localname.equalsIgnoreCase(""Business"")){            this.in_business=false;        }else if(localname.equalsIgnoreCase(""local"")){            this.in_local=false;        }else if(localname.equalsIgnoreCase(""ItemName"")){            this.in_itemName=false;        }else if(localname.equalsIgnoreCase(""ItemAddress"")){            this.in_itemAddress=false;        }else if(localname.equalsIgnoreCase(""Latitude"")){            this.in_itemLatitude=false;        }else if(localname.equalsIgnoreCase(""Longitude"")){            this.in_itemLongitude=false;        }<br>}    @Override    public void characters(char ch[], int start, int length) {                if(this.in_local){                //currentCondition.(new String(ch, start, length));               // sItem.equals(new String(ch,start,length));        }    }</p><p>the Activity:</p><pre><code>public class SearchItemListActivity extends ListActivity{String param=""Bar"";@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.custom_list);try {    URL url = new URL(""http://www.webitour.dk/service/localbusiness.aspx?cat=""+param);    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*/    SearchItemHandler searchHandler=new SearchItemHandler();    xr.setContentHandler(searchHandler);    xr.parse(new InputSource(url.openStream()));    SearchItem sItem=searchHandler.getParsedData();    ArrayList&lt;HashMap&lt;String,String&gt;&gt; list = new ArrayList&lt;HashMap&lt;String,String&gt;&gt;();     HashMap&lt;String,String&gt; item = new HashMap&lt;String,String&gt;();    item.put(""Name"",sItem.getItemName());    item.put(""Address"", sItem.getItemAddress());    list.add(item);    SimpleAdapter adapter = new SimpleAdapter(            this,            list,            R.layout.custom_text_view,            new String[] {""Name"",""Address""},            new int[] {R.id.text1,R.id.text2}            );    setListAdapter(adapter);}catch(Exception e){}</code></pre><p>}</p><p>}</p><p>SearchItem class:</p><pre><code>public class SearchItem {private String itemName;private String itemAddress;public SearchItem(){}public String getItemName(){    return this.itemName;}public void setItemName(String itemName){    this.itemName=itemName;}public String getItemAddress(){    return this.itemAddress;}public void setItemAddress(String itemAddress){    this.itemAddress=itemAddress;}</code></pre><p>}</p>","574308","","574308","","2011-02-15 08:23:22","2011-02-15 08:23:22","Android listview not working properly","<android><xml><listview><sax>","1","0","","",""
"4993046","1","4993725","","2011-02-14 14:03:12","2","812","<p>I just want to set the maximum amount of characters per line, so that the words will wrap onto the next line. Is there any way to do this? I looked over the EditText documentation and I don't see a clear way of doing this.</p><p>Any help is appreciated</p>","348261","","310971","","2011-02-16 08:24:58","2011-02-16 08:24:58","Is there any way to fix the amount of characters per line in an EditText without doing it programatically?","<android><line><edittext><character>","1","0","0","",""
"4993059","1","4993210","","2011-02-14 14:04:58","6","9621","<p>I'm facing a dilemma: I have a solid ASP.NET development experience in C# and looking to start mobile development. I have done research and know that there are some hacks for getting a development environment for iOS on windows, and recently after Apple lifted ban on 3rd party dev apps, Adobe Flash CS5 can be used to package iOS apps. I do have some prior experience with Flash and AS2.So my question is: should i use Flash CS5 for iOS and MonoDroid for Android or should i just get Mac and learn Objective C for iOS and learn Java for Android? What would be the most practical solution?</p><p>Thank you in advance</p><p>EDIT: In the end, after trying out both Java Development in Eclipse against Android SDK and Mono for Android, I decided it's best to write Android apps in native environment. Eclipse FTW! As for iOS, I think it will also be best to use native Mac tools and Objective C.</p>","257442","","257442","","2011-07-05 20:58:38","2014-03-17 23:03:39","iOS and Android development on Windows","<android><ios><flash-cs5><monodroid>","6","0","3","",""
"4993063","1","","","2011-02-14 14:05:12","14","17420","<p>I have read the already posted solutions, but they dont tell how do I use system's contact details screen to select any ONE number to use?I am developing an sms sending android app which offers to choose contacts of the phone and the number a user wants to use to send to....</p><p>So far I have not been able to find anything about choosing any one number. Does it only has to be done programatically? retrieving all numbers from database and sending sms to it?</p><p>Regards</p><p>Sherry</p>","616322","","","","","2014-02-08 12:28:51","How to call Android contacts list AND Select one phone number from its details screen?","<android>","2","2","9","",""
"4993218","1","","","2011-02-14 14:19:32","0","731","<p>Hi can anyody tell how to increase the webview height dynamically in android .my webview content will come some time less and some time  .I have to show webview full layout .</p><p>Thanks</p>","426344","","","","","2011-02-14 14:41:59","How to increase webview height dynamically in android","<android>","1","0","","",""
"4993393","1","4993547","","2011-02-14 14:34:24","0","956","<p>In my app, when I click a button I was supposed to move to a new page, and it shows an image. The size of the image is width <em>480pixels</em> and height is <em>1257 pixels</em>. The image is very clear in landscape mode where as in portrait mode it seems to be stretched. but i need to be perfect in both the sides. </p><p>The follwing is the xml code</p><pre><code>&lt;?xml version=""1.0"" encoding=""UTF-8""?&gt;&lt;AbsoluteLayoutandroid:id=""@+id/finalPage""android:layout_width=""fill_parent""android:layout_height=""fill_parent""xmlns:android=""http://schemas.android.com/apk/res/android""&gt;&lt;ScrollView android:id=""@+id/ScrollView01""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    &gt;&lt;LinearLayout android:id=""@+id/LinearLayout02""        android:layout_width=""wrap_content""        android:layout_height=""30px""        android:orientation=""vertical""        &gt;&lt;ImageViewandroid:id=""@+id/widget41""android:layout_width=""wrap_content""android:layout_height=""wrap_content""android:layout_x=""0px""android:layout_y=""0px""&gt;&lt;/ImageView&gt;&lt;/LinearLayout&gt;&gt;&lt;/ScrollView&gt;&gt;&lt;/AbsoluteLayout&gt;</code></pre><p>this is to be part of my source code</p><pre><code>public class HelpPage extends Activity {    ImageView BackGroundImage;    int width,height,orientation;//  ImageView help;    public void onCreate(Bundle icicle)     {    super.onCreate(icicle);    DisplayMetrics displaymetrics = new DisplayMetrics();    getWindowManager().getDefaultDisplay().getMetrics(displaymetrics);    setContentView(R.layout.help);    height = displaymetrics.heightPixels;    width = displaymetrics.widthPixels;    WebView webview;    webview = (WebView) findViewById(R.id.webview);//  webview.loadUrl(""file:///android_asset/helptext.html"");    Log.e(""FirstImage"", ""Width = ""+width+""Height = ""+height+"" orientation= ""+orientation);    BackGroundImage = (ImageView) findViewById(R.id.widget41);    BackGroundImage.setBackgroundResource(R.drawable.help);     if(width == 320 &amp;&amp; height == 480)     {         BackGroundImage.setBackgroundResource(R.drawable.help);     }     //Landscape mode of 320x480     else if(width == 480 &amp;&amp; height == 320)     {         BackGroundImage.setBackgroundResource(R.drawable.help);     }     //portrait mode of 480x800     else if(width == 480 &amp;&amp; height == 800)     {            BackGroundImage.setBackgroundResource(R.drawable.help);     }   //Landscape mode of 480x800    else if(width == 800 &amp;&amp; height == 480)     {        BackGroundImage.setBackgroundResource(R.drawable.help1);     }   //portrait mode of 480x854     else if(width == 480 &amp;&amp; height == 854)     {             BackGroundImage.setBackgroundResource(R.drawable.help);     }   //Landscape mode of 480x854    else if(width == 854 &amp;&amp; height == 480)     {        BackGroundImage.setBackgroundResource(R.drawable.help1);     }//  help = new ImageView(this);//  help = (ImageView)findViewById(R.id.helps);    }}</code></pre><p>How can i solve this issue?</p>","596364","","559070","","2011-02-14 14:42:24","2011-02-14 15:48:51","how to get the image perfectly","<java><android><image><imageview>","3","0","","",""
"4993411","1","5010635","","2011-02-14 14:35:56","0","1815","<p><strong>The code</strong></p><pre><code>Bitmap bmp = (Bitmap)extras.get(""data"");ByteArrayOutputStream out = new ByteArrayOutputStream();bmp.compress(CompressFormat.JPEG, 100, out);byte[] raw = out.toByteArray();PassToWebservice(raw); //errorPassToWebservice(byte[] ba){   SoapObject envelope...   envelope.addProperty(""base64bytes"", ba);   ...   transport.call(ACTION, envelope);   envelope.getResponse() //error: IOException cannot serialize...}</code></pre><p><strong>The problem</strong><br>When I pass the compressed image to my webservice, I get a runtimeexception that says ""cannot serialize [B@47bcb6c8..."" Something is not apparent to me, can anyone see why the above (psuedo) code does not work? If it helps, on the webservice server side, the exception seems to be happening when the server writes the passed bytes to a file (using .Net IO.File.WriteAllBytes)</p><p><strong>Stack trace</strong><br><img src=""http://i.stack.imgur.com/GhLk6.png"" alt=""enter image description here""></p>","457577","","457577","","2011-02-14 15:14:53","2011-02-15 23:09:43","Android cannot serialize byte[] recieved from compressed BMP","<android><web-services><serialization><bitmap><android-ksoap2>","1","2","","",""
"4993451","1","4993597","","2011-02-14 14:39:39","2","1761","<p>I need to encode an image to be JPEG and maximum file zise to be 300 K and send it as byte array. I make encoding :</p><pre><code>ByteArrayOutputStream baos = new ByteArrayOutputStream();bitmap.compress(Bitmap.CompressFormat.JPEG, 100, baos);image = baos.toByteArray();</code></pre><p>do you know how to limit the file size to 300K? maybe the solution is to make image quality lower, but sometimes(when the image is smaller) I may not need this. Thanks</p>","517558","","","","","2011-02-14 14:56:02","android encode image with max size limit","<android><image><size><limit>","2","0","1","",""
"4993523","1","4993560","","2011-02-14 14:48:29","4","1820","<p>I would like to know how to remove an item (which a user can select) from a ListView on the User Interface.The ListView holds only TextViews which show an IP-Address. Now when I press a button (Remove) I want to remove the selected item from the ListView.</p><p>Now I keep track of the selected items through the use of an ArrayList, which hold the indexes of the items. I have set the choiceMode of the ListView to multipleChoice, so these indexes should be accurate.I don't know the best way to do it, but my way looks like this:</p><pre><code>mEndPointList.setOnItemClickListener(new OnItemClickListener(){    @Override    public void onItemClick(AdapterView&lt;?&gt; arg0, View arg1,            int arg2, long arg3){        boolean found = false;        int index = 0;        while(!found &amp;&amp; index &gt;= 0 &amp;&amp; index &lt; mSelectedItems.size()){            if(mSelectedItems.get(index).intValue() == arg2){                found = true;            }            index++;        }        if(!found){            mSelectedItems.add(new Integer(arg2));        }    }});</code></pre><p>Now when I am finished selecting the Items, I press the Remove button, which should remove the items at the stored Indexes. The code from the button looks like this:</p><pre><code>public class RemoveItemButtonHandler implements OnClickListener{    @Override    public void onClick(View v){        for(int index = 0; index &lt; mSelectedItems.size(); index++){            int selectedItemIndex = mSelectedItems.get(index);            mEndPointList.removeViews(selectedItemIndex, 1);        }        mSelectedItems.clear();        mEndPointList.postInvalidate();    }}</code></pre><p>This code is added as the onClickListener for the Remove button.The code will execute without any problems, but the Item doesn't get removed from the ListView.Does anybody have an idea on why it doesn't work?</p><hr><p>I guess it is only fair to show my solution in case anybody else wonders how I actually did it.Selection is done in the <code>OnItemClickListener</code> of the List:</p><pre><code>mEndPointList = ((ListView) findViewById(R.id.endpointList));mEndPointList.setOnItemClickListener(new OnItemClickListener(){    @Override    public void onItemClick(AdapterView&lt;?&gt; arg0, View arg1,            int arg2, long arg3){        boolean found = false;        int index = 0;        /* Loop through all current selected item indexes to see if         * there is a match. If not, add the index to the list of         * selected indexes. If the index is already present, remove         * the index from the list. */        while(!found &amp;&amp; index &gt;= 0 &amp;&amp; index &lt; mSelectedItems.size()){            if(mSelectedItems.get(index).intValue() == arg2){                found = true;                mSelectedItems.remove(index);            }            index++;        }        if(!found){            mSelectedItems.add(new Integer(arg2));        }        mSelectedItems.trimToSize();    }});</code></pre><p>Removal of the items is done like this:</p><pre><code>public class RemoveItemButtonHandler implements OnClickListener{    @Override    public void onClick(View v){        // Check to see if any items are selected.        if(mSelectedItems.size() == 0){            String message = ""No items selected.\nTo select, press once on item.\n"" +                             ""To unselect, press item again."";            Toast.makeText(getApplicationContext(), message, Toast.LENGTH_LONG).show();            return;        }        // Sort the selected item indexes from high to low to prevent List corruption.        Collections.sort(mSelectedItems, new DescendingComparator());        /* Iterate through the selected items and remove items from the EndPoint List         * using the selected item index. Corruption of the List is prevented by         * sorting the selected items list from high to low, thus the item with the         * highest index is removed first. */        if(mRawEndPoints.size() &gt; 1){            for(int index = 0; index &lt; mSelectedItems.size(); index++){                int selectedItemIndex = mSelectedItems.get(index);                              mRawEndPoints.remove(mListAdapter.getItem(selectedItemIndex));            }            // Update the Adapter to notify it's data has changed.            mListAdapter.notifyDataSetChanged();        } else {            String message = ""Cannot remove last item from the list."";            Toast.makeText(getApplicationContext(), message, Toast.LENGTH_LONG).show();        }        // Clear the List of selected items for a fresh selection.        mSelectedItems.clear();    }}</code></pre><p>Note that the <code>DescendingComparator</code> class is a custom class, which implements the <code>Comparator&lt;Integer&gt;</code> interface.</p>","603059","","603059","","2011-03-21 15:39:41","2011-03-21 15:39:41","How to remove a selected item from a listview?","<java><android>","1","0","1","",""
"4993533","1","","","2011-02-14 14:49:26","1","1937","<p>According to this topic <a href=""http://stackoverflow.com/questions/3263641/how-to-fetch-the-email-form-device/4992542"">How to fetch the Email form device ?</a> there is no possibility to fetch email from email account like gmail/yahoo/hotmail, etc.So if I wanna code an email app for android that will work with any email provider I have to setup standalone server that will be like proxy between adnroid device and email server.</p>","616229","","","","","2014-02-02 23:03:57","How to fetch email?","<android><email>","2","0","","",""
"4993581","1","4995167","","2011-02-14 14:52:59","3","767","<p>I want to create a simulation game and a main component of this simulation will be a 2D map (topographical/navigation map), which shall have different layers (objects are moving on the map, using of labels, you get it)</p><p>The question for me is now, shall I use OpenGL to accomplish this or is that not necessary? I have no special requirements apart of that the scrolling and zooming shall be smooth. The target platform are only Android tablets (so Android OS 3.0+).</p><p>Edit: To precise my question:</p><ul><li>platform independence is not important for me</li><li>I'd like to go with the easiest way concerning implementation efforts</li></ul>","616194","","750987","","2011-05-29 06:45:44","2011-05-29 06:45:44","Using OpenGL for displaying a 2D map or not? (Android 3.0 SDK)","<android><opengl-es><android-3.0-honeycomb>","3","1","2","",""
"4993584","1","4993738","","2011-02-14 14:53:28","2","2115","<p>THe only problem i am having is that when i add my image that is a jpeg, its type in my database is application / octet stream?</p><p>How do i make it stay as a jpeg in my database?</p>","601915","","","","","2011-02-14 15:30:58","upload an image to mysql from android","<php><android><mysql>","1","1","","",""
"4993651","1","4993801","","2011-02-14 15:00:34","3","6789","<p>we made a quit big iOS application with 2000+ objective c classes. I am wondering there is a best practice guide to port it to Android ? Currently I am looking at Visual Paradigm (UML) which reverse engineers objective c files to UML. Like Enterprise Architect it also allows me to generate code(headers + declaration) for another popular language like java or c++. Are there any other approaches yet ? Also, as our app is heavily using the UINavigation and UIView controllers, I am wondering there is similar model and implementation on Android.</p><p>Thanks so far, guenter</p>","497078","","","","","2013-11-29 07:20:02","Porting iOS app to Android","<android><ios><porting>","5","2","1","",""
"4993667","1","4993694","","2011-02-14 15:01:42","0","1407","<p>I have been working on a way to pass a reference between Activities, to my DataBaseHelper class. I don't want to recreate new instances of DataBaseHelper in each new activity.From what I have seen, the best way to do this is to implement android.os.parcelable, which is fine.However, when I try to override the DataBaseHelper constructor with:</p><pre><code>public DataBaseHelper(Parcel source)</code></pre><p>I get an error telling me that the constructor is undefined.I kind of understand what this means, but am not sure how to get around this issue and so implement Parcelable in this class.Below is the DatabaseHelper class, the parcelable code is towards the bottom.</p><pre><code>package com.drager;import java.io.FileOutputStream;import java.io.IOException;import java.io.InputStream;import java.io.OutputStream;import java.util.ArrayList;import android.content.Context;import android.database.Cursor;import android.database.SQLException;import android.database.sqlite.SQLiteDatabase;import android.database.sqlite.SQLiteOpenHelper;import android.os.Environment;import android.os.Parcel;import android.os.Parcelable;import android.util.Log;public class DataBaseHelper extends SQLiteOpenHelper implements Parcelable{    //private static String DB_PATH = ""/data/data/com.drager/databases/"";    private static String DB_PATH = Environment.getDataDirectory()+""/data/com.drager/databases/"";    final static String DB_NAME = ""myDBName"";    private SQLiteDatabase myDataBase=null;    private final Context myContext;    private DataBaseHelper myDbHelper;    private static String TAG =""MyActivity"";    public DataBaseHelper(Context context){        super(context, DB_NAME, null, 1);        this.myContext = context;    }    public DataBaseHelper(Parcel source) {        super(source);        // TODO Auto-generated constructor stub    }    public DataBaseHelper createDataBase() throws IOException{        boolean dbExist =checkDataBase();        //SQLiteDatabase db_read =null;        Log.i(TAG,""############value of dbExist""+dbExist+""##########"");        if (dbExist){            copyDataBase();            //db must exist        }        else{        myDbHelper = new DataBaseHelper(myContext);        myDataBase = myDbHelper.getReadableDatabase();        myDataBase.close();        //this.getReadableDatabase();            //db_read.close();            try {                copyDataBase();            } catch (IOException e) {                throw new Error(""error copying database"");            }        }        return this;    }    public Cursor executeStatement(){        Log.i(TAG,""in execute statement"");        Cursor cursor=null;        cursor=myDataBase.rawQuery(""SELECT _ID, title, value ""+                    ""FROM constants ORDER BY title"",                     null);        return cursor;    }    public String[] getTextViewItem(){        Cursor cursor=null;        String str="""";        String[] resultsString;        //store query results in cursor        cursor=myDataBase.rawQuery(""SELECT shrt_description FROM description"",                     null);        ArrayList strings = new ArrayList();        for(cursor.moveToFirst();!cursor.isAfterLast();cursor.moveToNext()){            str =cursor.getString(cursor.getColumnIndex(""shrt_description""));            strings.add(str);        }         resultsString =(String[])strings.toArray(new String[strings.size()]);         close();//close database after use        return resultsString;    }public String[] getDetailedDescription(){        Cursor cursor=null;        String str="""";        String[] resultsString;        //store query results in cursor        cursor=myDataBase.rawQuery(""SELECT detailed_description FROM description"",                     null);        ArrayList strings = new ArrayList();        for(cursor.moveToFirst();!cursor.isAfterLast();cursor.moveToNext()){            str =cursor.getString(cursor.getColumnIndex(""detailed_description""));            strings.add(str);        }         resultsString =(String[])strings.toArray(new String[strings.size()]);         close();//close database after use        return resultsString;    }    public void copyDataBase() throws IOException{        // open db as input stream        InputStream myInput;        //open empty db as output stream        OutputStream myOutPut;        try {            myInput = myContext.getAssets().open(DB_NAME);            //path to newly created db            String outFileName =DB_PATH + DB_NAME;            myOutPut = new FileOutputStream(outFileName);            //transfer bytes from the inputFile to the outPutFile            byte[] buffer = new byte[1024];            int length;            while((length = myInput.read(buffer))&gt;0){                myOutPut.write(buffer, 0, length);            }            myOutPut.flush();            myOutPut.close();            myInput.close();            }        catch (IOException e) {            // TODO Auto-generated catch block            e.printStackTrace();        }    }    private boolean checkDataBase() {        SQLiteDatabase checkDB = null;        String myPath = DB_PATH + DB_NAME;        try {            checkDB = SQLiteDatabase.openDatabase(myPath, null, SQLiteDatabase.OPEN_READWRITE);        } catch (SQLException e) {            e.printStackTrace();            return false;        }        if (checkDB != null){            checkDB.close();        }        return true;        //return checkDB !=null ? true : false;    }    public void openDataBase()throws SQLException{        //open the database        String myPath = DB_PATH + DB_NAME;        myDataBase = SQLiteDatabase.openDatabase(myPath, null, SQLiteDatabase.OPEN_READONLY);    }    @Override    public synchronized void close(){        if(myDataBase != null){            myDataBase.close();        }        super.close();    }    @Override    public void onCreate(SQLiteDatabase db) {        // TODO Auto-generated method stub    }    @Override    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {        // TODO Auto-generated method stub    }    @Override    public int describeContents() {        // TODO Auto-generated method stub        return 0;    }    @Override    public void writeToParcel(Parcel dest, int flags) {        // TODO Auto-generated method stub        dest.writeParcelable((Parcelable) myDataBase, 0);        dest.writeString(DB_PATH);        dest.writeString(DB_NAME);        dest.writeString(TAG);        dest.writeParcelable((Parcelable) myContext, 0);        dest.writeParcelable(myDbHelper, 0);    }    public static final Parcelable.Creator&lt;DataBaseHelper&gt; CREATOR = new Parcelable.Creator&lt;DataBaseHelper&gt;() {        @Override        public DataBaseHelper createFromParcel(Parcel source) {            // TODO Auto-generated method stub            return new DataBaseHelper(source);        }        @Override        public DataBaseHelper[] newArray(int size) {            // TODO Auto-generated method stub            return null;        }    };}</code></pre><p>Any help greatly appreciated.Thanks in advance.</p>","608750","","135152","","2011-07-05 17:47:14","2011-07-05 17:47:14","Implementing Parcelable in DataBaseHelper class","<java><android><sqlite>","2","0","","",""
"4993765","1","4994108","","2011-02-14 15:11:53","6","25238","<p>I am new to android development. I'm developing an application which sends a message to a specific number in a specific period of time. <strong>The problem is that it continues sending that message after that period of time.</strong> How would I stop the timer after that specific time in order to stop sending that message?</p><p>Can anyone help me?</p>","609050","","66158","","2011-02-15 17:59:43","2012-09-19 21:22:35","How to stop the Timer in android?","<android><timer>","5","1","3","",""
"4993928","1","4994542","","2011-02-14 15:27:15","0","2435","<p>I have the following code for my dialog box, I want to get some text from the alert box, but the below given code throws null pointer exception.</p><pre><code>public EditText summarytext;public Button done;Context mContext = getApplicationContext();    Dialog dialog = new Dialog(mContext);    dialog.setContentView(R.layout.summaryalert);    dialog.setTitle(""Other"");    done=(ButtonfindViewById(R.id.btn);    done.setOnClickListener(don);&lt;----Nullpointer Exception</code></pre><hr><hr><pre><code>     private View.OnClickListener don=new  View.OnClickListener() {                 @Override          public void onClick(View v) {                    // TODO Auto-generated method stub                    if(v==findViewById(R.id.btn)){                    summarytext=(EditText)findViewById(R.id.summarytext);                    sumry=summarytext.getText().toString();                    String display=""""+sumry;                    Toast toast = Toast.makeText(getBaseContext(),     display, Toast.LENGTH_LONG);                    toast.show();                    }</code></pre><hr><hr><h2>summary alert</h2><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayoutandroid:id=""@+id/widget31""android:layout_width=""wrap_content""android:layout_height=""wrap_content""android:background=""#000000""android:gravity=""center""xmlns:android=""http://schemas.android.com/apk/res/android""&gt;&lt;TableRowandroid:id=""@+id/widget60""android:layout_width=""fill_parent""android:layout_height=""wrap_content""android:gravity=""center""&gt;&lt;TextViewandroid:id=""@+id/text""android:text=""Other(provide summary)""android:textColor=""#ffffff""&gt;&lt;/TextView&gt;&lt;/TableRow&gt;&lt;TableRowandroid:id=""@+id/widget60""android:layout_width=""fill_parent""android:layout_height=""wrap_content""android:gravity=""center""&gt;&lt;EditTextandroid:id=""@+id/summarytext"" android:layout_height=""wrap_content"" android:layout_width=""wrap_content"" &gt;&lt;/EditText&gt;&lt;/TableRow&gt;&lt;TableRowandroid:id=""@+id/widget60""android:layout_width=""fill_parent""android:layout_height=""wrap_content""android:gravity=""center""&gt;&lt;Buttonandroid:id=""@+id/btn""android:text=""Done""&gt;&lt;/Button&gt;&lt;/TableRow&gt;</code></pre><h2>    </h2><h2>mainlayout</h2><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayoutandroid:id=""@+id/widget31""android:layout_width=""fill_parent""android:layout_height=""fill_parent""android:background=""#ffffffff""android:orientation=""vertical""xmlns:android=""http://schemas.android.com/apk/res/android""&gt;&lt;TableLayoutandroid:id=""@+id/widget58""android:layout_width=""320px""android:layout_height=""65px""android:orientation=""vertical""&gt;&lt;TableRowandroid:id=""@+id/widget60""android:layout_width=""fill_parent""android:layout_height=""wrap_content""android:gravity=""center""&gt;&lt;EditTextandroid:id=""@+id/other"" android:layout_height=""fill_parent"" android:layout_width=""fill_parent"" android:ems=""15""&gt;&lt;/EditText&gt;&lt;/TableRow&gt;&lt;TableRowandroid:id=""@+id/widget42""android:layout_height=""fill_parent""android:layout_width=""fill_parent""android:gravity=""center""&gt;&lt;Buttonandroid:id=""@+id/submit""android:layout_width=""155px""android:layout_height=""41px""android:text=""Done""android:layout_x=""77px""android:layout_y=""313px""&gt;&lt;/Button&gt;&lt;/TableRow&gt;&gt;&lt;/TableLayout&gt;</code></pre><h2>    </h2><p><strong>Edit</strong></p><p><strong>solved..!</strong></p><p>include 'dialog'</p><blockquote>  <p>done=(Button)dialog.findViewById(R.id.btn);</p></blockquote>","573700","","573700","","2012-06-07 15:05:18","2012-06-07 15:05:18","Null pointer exception in android","<android>","2","8","2","",""
"4993946","1","4994405","","2011-02-14 15:28:45","11","2413","<p>I'm about to publish a new version of an app to the Market. In order to avoid any potential problems once its been pushed to the Market and people get notified of an update, I'd like to simulate that process on my phone using the .apk for the new version of the app I'll be publishing.For instance, it has an update to the SQLite DB its using.The closest I can find is using the Android Debug Bridge (adb) using the command:adb install C:\myApplication.apkwith my phone attached to my PC via the usb cable.(the parameter represents wherever your apk file is on your PC).When I do this, if the app is already installed on my PC, I get an error messageFailure INSTALL FAILED ALREADY EXISTS.If I delete the existing app from my phone, the adb install command works fine.So, it looks like this can only be used to install an app that doesn't currently exist on your phone.Is there any way to simulate the update process?It'd be nice if there was an 'adb update' command, but I don't see that.</p>","523968","","21234","","2011-02-14 15:38:58","2011-02-14 16:12:44","How to test what will happen when you publish an update to your app to the Market","<android><publish><adb><simulate>","3","0","1","",""
"4993952","1","","","2011-02-14 15:29:13","0","1908","<p>I m working on an android app. I m storing some user info in shared preference. <strong>I want user should not be able to clear data of app from settings.</strong> can it be possible?</p><p>There is one permission in Manifest <strong>CLEAR_APP_USER_DATA</strong> can i use it?</p>","383597","","","","","2011-11-18 16:27:19","Android Clear data app","<android>","2","0","","",""
"4993993","1","","","2011-02-14 15:32:40","7","6489","<p>I'm writing an application and my aim is to detect when a user is walking.I'm using a Kalman filter like this:</p><pre><code>float kFilteringFactor=0.6f;        gravity[0] = (accelerometer_values[0] * kFilteringFactor) + (gravity[0] * (1.0f - kFilteringFactor));        gravity[1] = (accelerometer_values[1] * kFilteringFactor) + (gravity[1] * (1.0f - kFilteringFactor));        gravity[2] = (accelerometer_values[2] * kFilteringFactor) + (gravity[2] * (1.0f - kFilteringFactor));        linear_acceleration[0] = (accelerometer_values[0] - gravity[0]);        linear_acceleration[1] = (accelerometer_values[1] - gravity[1]);        linear_acceleration[2] = (accelerometer_values[2] - gravity[2]);        float magnitude = 0.0f;        magnitude = (float)Math.sqrt(linear_acceleration[0]*linear_acceleration[0]+linear_acceleration[1]*linear_acceleration[1]+linear_acceleration[2]*linear_acceleration[2]);        magnitude = Math.abs(magnitude);if(magnitude&gt;0.2)  //walking</code></pre><p>The array gravity[] is initialized with 0s.</p><p>I can detect when a user is walking or not (looking at the value of the magnitude of the acceleration vector), but my problem is that when a user is not walking and he moves the phones, it seems that he is walking.</p><p>Am I using the right filter?</p><p>Is it right to watch only the magnitude of the vector or have I to look at the single values ??</p>","525105","","744859","","2012-06-13 13:42:51","2013-01-03 17:48:36","How to detect walking with Android accelerometer","<android><filter><accelerometer><kalman>","3","5","2","",""
"4994112","1","4994175","","2011-02-14 15:45:45","2","7221","<p>Hi i want a screen which should appear for 2-3 screen with my logo and then should proceed to main program. how to implement this.</p>","569938","","","","","2011-06-23 07:12:27","How to display a welcome screen in android?","<android>","3","1","1","",""
"4994118","1","5000177","","2011-02-14 15:46:40","1","3301","<p>I'm currently developing an app using web view. I created some html files along with images and css (inside html file). When I put the files into assests folder the custom font is not loading. Without anychange i put it on server and accessed via mobile browser or accessed it via the app refering the online url (i.e. <a href=""http://hotwordpresstips.com/japs/Index.html"" rel=""nofollow"">http://hotwordpresstips.com/japs/Index.html</a>) and it shows properly. what am I missing here?? please find my HTML code below. If you want I'll put the java code too.</p><pre><code>&lt;html&gt;&lt;head&gt;&lt;style type=""text/css""&gt;@font-face { font-family: MyCustomFont; src: url(""Bamini.eot"") /* EOT file for IE */}@font-face { font-family: MyCustomFont; src: url(""Bamini.ttf"") /* TTF file for CSS3 browsers */}body { font-family: MyCustomFont, Verdana, Arial, sans-serif; font-size: medium; color: black}&lt;/style&gt;&lt;/head&gt;&lt;body&gt;&lt;div style=""border:2px solid black;""&gt;&lt;img src=""header.jpg"" width=100%&gt;&lt;h1&gt;,yq;ifiaj; jhf;fpa [g;ghdpau;fs;&lt;/h1&gt;&lt;UL&gt;&lt;LI&gt;&lt;a href=""intro.html""&gt;cyf Aj;jk; mwpKfk;&lt;/a&gt;&lt;/LI&gt;&lt;LI&gt;&lt;a href=""america.html""&gt;mnkupf;fhtpd; tUif&lt;/a&gt;&lt;/LI&gt;&lt;LI&gt;&lt;a href=""pilot.html""&gt;tPuk; epiwe;j tpkhd Xl;b&lt;/a&gt;&lt;/LI&gt;&lt;LI&gt;&lt;a href=""colombo.html""&gt;nfhOk;G&gt; jpUkiyj; jhf;Fjy;&lt;/a&gt;&lt;/LI&gt;&lt;LI&gt;&lt;a href=""end.html""&gt;KbTiu&lt;/a&gt;&lt;/LI&gt;&lt;LI&gt;&lt;a href=""image.html""&gt;gbkq;fs;&lt;/a&gt;&lt;/LI&gt;&lt;img src=""footer_main.jpg"" width=100%""&gt;&lt;/UL&gt;&lt;/div&gt;&lt;/body&gt;&lt;/html&gt;</code></pre>","348301","","","","","2011-02-15 05:23:43","Android: custom font in WebView using CSS issue","<java><android><css><webview><tamil>","1","4","0","",""
"4994126","1","4994400","","2011-02-14 15:47:29","2","817","<p>When you have the Messages Activity open and the phone receives a new message a notification is shown on the status bar. After a short amount of time the notification is removed.</p><p>Is it possible to do the same for my activity without using a timer to clear the notification after a few seconds?</p>","582843","","94363","","2013-02-21 16:27:06","2013-02-21 16:27:06","Clearing notification after a few seconds","<android><notifications>","1","0","","",""
"4994127","1","","","2011-02-14 15:47:37","0","681","<p>In Messaging Application, under Settings menu, if you select Restore default setting, the value's of Text message limit and Multimedia message limit changes to ""%1$s"". I tried setting android:defaultValue=""200"" in preferences.xml, but still, it's same behaviour.Can anybody please let me know what changes i have to do for updating the value to default.Thankyou</p><p>I understand, when exit the settings screen and come back to it, the default values (200 and 20) will be seen to have been restored correctly. but what i was looking for is, when selecting Restore default settings, how to updated the default value of Text message limit and Multimedia message limitI wanted to know what changes are required to be done in java file, when selecting Restore default setting.Thankyou for your help</p>","617500","","617500","","2011-02-15 09:49:26","2011-02-15 09:49:26","""%1$s"" is seen for message per conversation when pressing Restore default settings in Messaging Application","<android>","1","0","","",""
"4994263","1","","","2011-02-14 15:59:26","5","1464","<p>This question is about event handling on Android. It is not specific to c++.</p><p>I need to process UI/OS events, without blocking when all events have been processed. </p><p>The reason is that the application I am porting is very large and can't easily be rewritten to deal with its own stuff on a worker thread. Instead the application engine asks for UI/OS events to be processed during long-winded operations that would otherwise be blocking.</p><p>I have found that ALooper_pollAll(...) doesn't do this for me. If I, for example, create a dialog in my activity and start a long operation, ALooper_pollAll() won't make my dialog appear - it will show only when I return to the main loop (I tested this in onNativeWindowCreated).</p><p>The only solution that I have found to almost work is to do an inner loop on the UI thread, by calling the following code through JNI:</p><pre><code>public class MyActivity extends NativeActivity {  private Handler _uiEventsHandler = null;  private Runnable _uiEventsTask = new Runnable() {    public void run() {      Looper looper = Looper.myLooper();      looper.quit();      _uiEventsHandler.removeCallbacks(this);          _uiEventsHandler = null;    }  };  public void ProcessEvents(int timeout)  {    if (_uiEventsHandler==null) {      Looper looper = Looper.myLooper();      _uiEventsHandler = new Handler(looper);      _uiEventsHandler.removeCallbacks(_uiEventsTask);          //_uiEventsHandler.postDelayed(_uiEventsTask,timeout);          _uiEventsHandler.post(_uiEventsTask);          try {        looper.loop();      } catch (RuntimeException re) {         // We get an exception when we try to quit the loop, but the inner loop actually terminates      }    }  }}</code></pre><p>This is, however, not an optimal solution, because it will not loop until there would be no more events to process (because events may be created during the run of the loop).</p><p>During my research I have found that I can get the MessageQueue from the Looper and add an IdleHandler that can quit my inner loop. I haven't tried this yet, there has to be a better way.</p><p><em>Given the fact that this is the architecture I must stick with, what is a better solution?</em></p><p><strong>Update:</strong></p><p>Using the MessageQueue I'm able to achieve what I need:</p><pre><code>public class MyActivity extends NativeActivity {  private class IdleHandler implements MessageQueue.IdleHandler {    private Looper _looper;    protected IdleHandler(Looper looper) {      _looper = looper;    }    public boolean queueIdle() {      _uiEventsHandler = new Handler(_looper);      _uiEventsHandler.post(_uiEventsTask);          return(false);    }  };  private boolean _processingEventsf = false;  private Handler _uiEventsHandler = null;  private Runnable _uiEventsTask = new Runnable() {    public void run() {      Looper looper = Looper.myLooper();      looper.quit();      _uiEventsHandler.removeCallbacks(this);          _uiEventsHandler = null;    }  };  public void ProcessEvents()  {    if (!_processingEventsf) {      Looper looper = Looper.myLooper();      looper.myQueue().addIdleHandler(new IdleHandler(looper));      _processingEventsf = true;      try {        looper.loop();      } catch (RuntimeException re) {         // We get an exception when we try to quit the loop.      }      _processingEventsf = false;    }  }}</code></pre><p><em>However, I still would like to know if there is a better solution.</em></p>","16909","","16909","","2011-02-14 19:10:45","2012-04-02 00:08:32","How can I do non-blocking events processing on Android?","<android><events><jni><message-queue><looper>","1","1","1","",""
"4994345","1","5243319","","2011-02-14 16:06:40","2","485","<p>Tried on Dropbox forum but no luck:</p><p>I'm reaching Dropbox API from Android,</p><p>i do a HttpPost request to ""https://api.dropbox.com/0/fileops/create_folder"" and i pass as parameters:</p><pre><code>List &lt;NameValuePair&gt; parameters = new ArrayList &lt;NameValuePair&gt;();parameters.add(new BasicNameValuePair(""path"", ""xxx""));parameters.add(new BasicNameValuePair(""root"", ""xxx""));parameters.add(new BasicNameValuePair(""oauth_consumer_key"", ""xxx""));parameters.add(new BasicNameValuePair(""oauth_token"", ""xxx""));parameters.add(new BasicNameValuePair(""oauth_secret"", ""xxx""));parameters.add(new BasicNameValuePair(""oauth_timestamp"", ""xxx""));parameters.add(new BasicNameValuePair(""oauth_nonce"", ""xxx""));</code></pre><p>And well, the thing is i get an Internal Server Error although with the same code (different parameters, of course) i manage to authenticate. Any idea why?</p>","495904","","546999","","2011-02-14 16:08:17","2011-04-12 11:39:09","Internal Server Error in Dropbox from Android","<java><android><dropbox>","2","2","","",""
"4994496","1","4994599","","2011-02-14 16:20:45","2","3393","<p>I have an app which operates a large quantity (~100) of bitmaps - i.e. music cover art. Bitmaps are used in two ways - as a large background and a small (50dip) icon. Does it make sense to preload and cache two sizes as separate bitmaps?I've implemented both approaches (use large bitmap as the icon | cache both sizes), but I can't see actual performance difference.What is the best practice for such situation?</p>","223122","","","","","2011-02-14 16:28:57","Android bitmap caching","<android><caching><bitmap><drawable>","2","0","1","",""
"4994633","1","4994848","","2011-02-14 16:33:17","0","690","<p>I'm trying to load the contents of my SQLite table into a ListView using the following code.</p><pre><code>myDbHelper = new DatabaseHelper(this);  Cursor cursor = getData();  CursorAdapter dataSource = new SimpleCursorAdapter(this, R.layout.menu_item, cursor, fields, null);  menuList.setAdapter(datasource);  //My ListView  private Cursor getData() {      SQLiteDatabase db = myDbHelper.getReadableDatabase();      Cursor cursor = db.query(TABLE_NAME, FROM, null, null, null,null, ORDER_BY);      return cursor;  }  </code></pre><p>When I run the app it passes through this code and then throws an error. Am I using the correct technique for adding data to a ListView?</p>","616076","","616076","","2011-02-15 11:45:20","2011-02-15 11:45:20","Can't load my SQLite data into my ListView","<android><database><sqlite><sqlite3>","1","1","","",""
"4994681","1","4994961","","2011-02-14 16:38:49","4","3929","<p>I have written a simple Android application that draws a maze using a custom view derived from <code>SurfaceView</code>.  It follows the model of the <a href=""http://developer.android.com/resources/samples/LunarLander/index.html"" rel=""nofollow"">LunarLander sample application</a> and performs all calculation and drawing using a background thread directly into the <code>SurfaceHolder</code> object.</p><p>All well and good and it's running well for small/medium mazes, however if I set the maze cell size to be 8 pixels there are lots of cells in the maze the application crawls along.</p><p>The code is doing something I don't like in that is draws every cell even if it hasn't changed and this is required to avoid screen flickering from the <code>SurfaceView</code> double buffer (in previous iterations of the application I was drawing just what changed and that resulted in a jumpy mess).</p><p>What I want then is the ability to use <code>SurfaceView</code> but be more selective about what gets drawn.  Is this possible?  If not, what are the alternatives?  How about keeping an offscreen bitmap, and selectively drawing into that first?</p><p>EDIT: I implemented an offscreen <code>Bitmap</code> and <code>Canvas</code> combination, written to by my timer-driven state machine, drawing only those areas affected during carving/solution.  I then simply draw the whole offscreen bitmap onto the <code>SurfaceView</code> within the <code>run()</code> method and this has solved my problem; I am able to drop the cell size to 5 pixels and performance is fine.</p>","299924","","299924","","2011-02-14 22:43:34","2012-10-30 19:54:20","Improve performance of SurfaceView-dervied custom view?","<android><surfaceview><double-buffering>","1","1","2","",""
"4994701","1","5718586","","2011-02-14 16:40:46","1","877","<p>I have a gridview with custom views in it. The custom views are view that contain a few buttons. When I onItemClick the gridview to create the custom view, everything works fine, the GridView understands what I am trying to do; but as soon as I onItemLongClick a custom view (that has been created due to an onItemClick), it doesn't register at all. I don't get it, I'm always returning true at the end of the longClick. But if I fill the gridview with a simple image view, both types of click work... </p><p>As far as I've read from the android UI handling article all listeners will trickle top-down, so I figured that the event would fire at the gridview before hitting the custom view...</p><p>Any thoughts or Ideas?</p><pre><code>@Override public boolean onItemLongClick(AdapterView&lt;?&gt; arg0, View arg1, int pos, long arg3) {    Log.e(""Grid"", ""Log long click"");     mSelect = pos;    mHold = Bitmap.createScaledBitmap(mGridWidgets[pos].toBitmap(), getWidth()/2, getHeight()/2, true);    mIsHolding = true;    setOnTouchListener(mToucher);    Log.e(""Grid"", mSelect + """");    mBoundService.vibrator.vibrate(150);    return true;}</code></pre>","480691","","480691","","2011-02-16 23:01:35","2011-04-19 15:10:10","GridView onItemClick not being called?","<android><gridview><view><onclick><listener>","1","0","","",""
"4994800","1","4994922","","2011-02-14 16:51:18","3","6276","<p>Hai,  I want to display multiple markers on the google map in android. How can i achieve this? </p>","562743","","","","","2012-04-11 05:31:06","displaying multiple markers on google map","<android><google-maps>","1","1","2","",""
"4994845","1","4995345","","2011-02-14 16:56:05","0","1022","<p>I'm trying to overlay a small caption box over a photo whenever it is viewed in the gallery. </p><p>I couldn't find any intents for VIEWING A PHOTO that is broadcast by the gallery app, into which I could hook a broadcast receiver to draw the box. </p><p>So I'm using Intent.GET_CONTENT to get a photo from gallery and Intent.VIEW to display it. Is it possible to overlay a semi transparent caption box over the gallery app's activity that I opened via Intent.VIEW?</p>","338825","","338825","","2011-02-14 17:14:01","2011-02-14 17:41:28","Overlay activity over other activity opened via intent","<android><activity><android-intent><overlay><broadcast>","1","0","","",""
"4994872","1","4995387","","2011-02-14 16:57:48","1","406","<p>I would like to have my app's web service calls synchronized so only 1 is executing at any given moment.</p><p>I've created an object called WebService, which takes the data needing to be sent (request), sends it to the web service, gets the response and kicks it back out to whatever code invoked the WebService object.</p><p>I've added a Semaphore with a count of 1 (ie: mutex) member variable to the WebService object.  This member variable is a static.  It gets locked before the send and unlocked after the send.</p><p>Unfortunately, it's not working quite right.  Most of my code will boot up an IntentService and make the web service call.  Some other web services happen in AsyncTasks in the app's process.  I think, because these are two separate processes (?), the static mutex does not extend across the two (?).</p><p>Does anyone have any suggestions as to how I can sync my web service calls when some happen in the app's process and some happen in a service?</p>","406790","","","","","2011-02-14 17:44:00","Syncing web service calls across processes","<android><service><semaphore>","1","0","","",""
"4994926","1","4994957","","2011-02-14 17:02:40","0","502","<p>I have a 'home page' on my app with a button in.  I have implemented an onClickListener. I want to change to a different class when clicking the button. (Navigating to another page within the app with a different XML file)  What am I doing wrong??</p><pre><code>Intent myIntent = new Intent(this, menu_two.class);         startActivity(myIntent);</code></pre><p>That is in the code which goes in a switch statement which identifies which button has been pressed. I am not using an XML file, layout hard coded straight from java.</p><p>Home I have given you enough information to help</p><p>thanks</p>","616546","","321697","","2011-02-14 19:15:03","2011-03-31 20:51:11","Using Intents to switch between classes","<android>","1","1","","",""
"4994959","1","4995123","","2011-02-14 17:05:43","13","2002","<p>In many of Android methods, especially constructors and overridden methods, you should or even must call the parent class method using <strong>super()</strong>. When you use the Eclipse  <strong>Source > Override/Implement Methods...</strong> you get code from a template with TODO tags like this: </p><pre><code>public MyCanvas(Context context, AttributeSet attrs) {    super(context, attrs);    // TODO Auto-generated constructor stub}@Overrideprotected void onDraw(Canvas canvas) {    // TODO Auto-generated method stub          super.onDraw(canvas);} </code></pre><p>I do not understand exacly what the superclass does in each case so I always insert my code at the exact location of the <strong>//TODO</strong> tags.  In the example, I would call super() before my code in the constructor and after my code in onDraw(). </p><p>Can I always rely on these code insertions locations in the generated code? Is there a simple rule/explanation when to call super()?   </p>","550152","","","","","2012-07-27 15:01:48","Locations of super() calls in Android Eclipse Plugin generated code reliable?","<android><eclipse><adt><super>","3","2","2","",""
"4994997","1","4995439","","2011-02-14 17:09:34","5","4718","<p>Is it possible to call lua scripts from within java code for the android system? I discovered the Scripting Layer for Android and I have been playing with it on my device, but it would be really useful if I could call lua scripts from within my Eclipse projects. I know that this is possible if I developing on the NDK, but I have no desire to go that way (Java is just too nice).Thanks in advance. </p>","457899","","","","","2013-11-11 21:47:30","Is it possible to use lua scripts in a java android project?","<java><android><eclipse><lua>","6","0","3","",""
"4995006","1","5132482","","2011-02-14 17:11:00","0","347","<p>I have some main activity and clicking on a button it launches a custom dialog window. Within the dialog I have button ""Send email"" which calls an e-mail chooser (via simple method call) when user click on the button.</p><pre><code>sendEmail();</code></pre><p>And here is the sendEmail() method</p><pre><code>public void sendEmail() {    String email = ""some.email@gmail.com"";    Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);    emailIntent.setType(""text/plain"");    emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, new String[]{email});          emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, ""Subject"");    emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, ""Message"");    mContext.startActivity(Intent.createChooser(emailIntent, ""Choose an email""));}</code></pre><p>But on my HTC Desire (2.2) sometimes the dialog starts blinking. Simply I cannot click on anything, I must quit an application OR I just rotate it in landscape and back and then flashing/blinking stops.</p><p>Where is the problem? Why is it blinking?</p><p><b>UPDATE:</b> I tried to log ""multiple calls"" to sendEmail function or CreateDialog constructor but no, everything is called just one, after that I have this in my log... I could solve it to make another activity which will act like a dialog but I wanna know where is the problem here :/</p><p><b>Log</b></p><pre><code>02-15 19:06:45.605 D/SurfaceFlinger(   92): Layer::setBuffers(this=0x9a9478), pid=12757, w=1, h=102-15 19:06:45.605 D/SurfaceFlinger(   92): Layer::setBuffers(this=0x9a9478), pid=12757, w=1, h=102-15 19:06:45.675 D/SurfaceFlinger(   92): Layer::requestBuffer(this=0x92b350), index=1, pid=12757, w=443, h=337 success02-15 19:06:45.715 D/SurfaceFlinger(   92): Layer::requestBuffer(this=0x9a9478), index=0, pid=12757, w=480, h=762 success02-15 19:06:45.755 I/UsageStats(   92): Unexpected resume of android while already resumed in android02-15 19:06:45.815 D/SurfaceFlinger(   92): Layer::setBuffers(this=0x9a9478), pid=12757, w=1, h=102-15 19:06:45.815 D/SurfaceFlinger(   92): Layer::setBuffers(this=0x9a9478), pid=12757, w=1, h=102-15 19:06:45.895 D/SurfaceFlinger(   92): Layer::requestBuffer(this=0x9a9478), index=0, pid=12757, w=480, h=762 success</code></pre>","455268","","455268","","2011-02-15 18:11:22","2012-03-07 13:59:07","Blinking e-mail chooser","<android><email>","3","0","1","",""
"4995008","1","","","2011-02-14 17:11:11","1","1482","<p>I'm creating an email interface that populates a ListView from a database using a custom CursorAdapter. The items in this ListView then display an email thread, which in very similar fashion populates a ListView using a CursorAdapter. The problem that I am having is that the second ListView will not populate. </p><p>The code for initializing both of these adapters is nearly identical (we can say they are for all intents and purposes) and through the use of log statements, I have been able to verify that the cursor being passed to the second adapter is not empty and contains all of the data that it should. What seems to be the problem is that the newView method is never called. I've tried to investigate why this is happening and have come up with nothing. What I'm wondering is why the newView method would not be called. Where is this call supposed to be triggered from?</p><p>Here is the onCreate method for the ListActivity.</p><pre><code>public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.email_view);    cursor = EmailActivity.dbAdapter.fetchEmailThread(getIntent().getStringExtra(""senderUsername""));    Log.i(TAG, getIntent().getStringExtra(""senderUsername"") + "" "" + cursor.getCount() + "" "" + cursor.getColumnCount());    startManagingCursor(cursor);    adapter = new EmailViewCursorAdapter(this, cursor);    setListAdapter(adapter);}</code></pre><p>And here is the code from the adapter, just the constructor and newView method.</p><pre><code>public EmailViewCursorAdapter(Context context, Cursor c) {    super(context, c, true);    inflater = ((Activity) context).getLayoutInflater();    usernameInd = c.getColumnIndex(""sender_username"");    createdInd = c.getColumnIndex(""created_at"");    bodyInd = c.getColumnIndex(""body"");}@Overridepublic View newView(Context context, Cursor cursor, ViewGroup parent) {    Log.i(TAG, ""Made it here - new view"");    View view = inflater.inflate(R.layout.email_view_item, parent, false);    TextView senderName = (TextView) view.findViewById(R.id.sender_username);    TextView timeString = (TextView) view.findViewById(R.id.sent_time);    TextView emailBody = (TextView) view.findViewById(R.id.email_body);    senderName.setText(cursor.getString(usernameInd));    if(senderName.getText().equals(DataManager.getUser().getUsername()))        senderName.setTextColor(0x999999);    try {        SimpleDateFormat format = new SimpleDateFormat(""yyyy-MM-dd HH:mm:ss"");        Date sent = format.parse(cursor.getString(createdInd));        timeString.setText(EmailModel.createTimeText(sent));    } catch (ParseException e) {        timeString.setText("""");    }    emailBody.setText(cursor.getString(bodyInd));    return view;}</code></pre>","592259","","","","","2011-02-14 17:11:11","Android CursorAdapter not calling newView","<android><listactivity>","0","7","","",""
"4995070","1","","","2011-02-14 17:16:37","3","1058","<p>I'm using the maven-android-plugin to build my application, and I love it.</p><p>One thing that's confusing to me is the android sources.jar file that it comes with.  If I examine <code>InstrumentationTestRunner</code> in <code>android-1.5_r4-sources.jar</code>, to pick a random example, it looks like: </p><pre><code>package android.test;public class InstrumentationTestRunner  extends android.app.Instrumentation  implements android.test.TestSuiteProvider{public  InstrumentationTestRunner() { throw new RuntimeException(""Stub!""); }public  void onCreate(android.os.Bundle arguments) { throw new RuntimeException(""Stub!""); }protected  android.test.AndroidTestRunner getAndroidTestRunner() { throw new RuntimeException(""Stub!""); }public  void onStart() { throw new RuntimeException(""Stub!""); }public  junit.framework.TestSuite getTestSuite() { throw new RuntimeException(""Stub!""); }public  junit.framework.TestSuite getAllTests() { throw new RuntimeException(""Stub!""); }public  java.lang.ClassLoader getLoader() { throw new RuntimeException(""Stub!""); }public static final java.lang.String REPORT_VALUE_ID = ""InstrumentationTestRunner"";public static final java.lang.String REPORT_KEY_NUM_TOTAL = ""numtests"";public static final java.lang.String REPORT_KEY_NUM_CURRENT = ""current"";public static final java.lang.String REPORT_KEY_NAME_CLASS = ""class"";public static final java.lang.String REPORT_KEY_NAME_TEST = ""test"";public static final int REPORT_VALUE_RESULT_START = 1;public static final int REPORT_VALUE_RESULT_OK = 0;public static final int REPORT_VALUE_RESULT_ERROR = -1;public static final int REPORT_VALUE_RESULT_FAILURE = -2;public static final java.lang.String REPORT_KEY_STACK = ""stack"";}</code></pre><p>Which isn't very useful and clearly isn't the actual source code, which looks <a href=""http://www.google.com/codesearch/p?hl=en#uX1GffpyOZk/test-runner/src/android/test/InstrumentationTestRunner.java&amp;q=instrumentationtestrunner&amp;sa=N&amp;cd=1&amp;ct=rc"" rel=""nofollow"">like this</a>. </p><p>My pom looks like the following:</p><pre><code>&lt;dependencies&gt;    ...    &lt;dependency&gt;        &lt;groupId&gt;com.google.android&lt;/groupId&gt;        &lt;artifactId&gt;android&lt;/artifactId&gt;        &lt;version&gt;1.5_r4&lt;/version&gt;        &lt;scope&gt;provided&lt;/scope&gt;    &lt;/dependency&gt;&lt;/dependencies&gt;</code></pre><p>Is there a way to get the ACTUAL android sources from the maven-android-plugin to aid in debugging?</p>","82156","","569101","","2013-02-25 09:30:59","2013-02-25 09:30:59","Android source using maven-android-plugin","<android><maven><android-maven-plugin>","1","0","1","",""
"4995114","1","4995171","","2011-02-14 17:21:12","1","1365","<p>I need to develop an application on both iphone and android which have to support chart plots.(Or perhaps a similar chart library for ios/android platforms.)</p><p>Or what do you recommend?Thanks</p>","616571","","","","","2011-02-14 18:33:51","Is there any chart library working both on iphone and android applications?","<iphone><android><charts>","3","2","","",""
"4995199","1","4996123","","2011-02-14 17:29:20","0","190","<p>hi i just fixed the issue i had with my application, now i am stuck with another problem, please help :)</p><p>most of my code is here</p><p>""<a href=""http://stackoverflow.com/questions/4991635/unknown-exception-android"">unknown Exception android</a>""</p><p>now i want to make my main page look like this as shown in iphone application given below,</p><p>""<a href=""http://wwwm.coventry.ac.uk/app/Pages/iPhoneApp.aspx"" rel=""nofollow"">http://wwwm.coventry.ac.uk/app/Pages/iPhoneApp.aspx</a>""</p><p>i dont know if i need to use   tab activity or option menu or inflator,</p><p>as for call, email and web, i will have to call services as far as i know.</p><p>and last if i can see any tutorial or code which will help me to solve my problem, please give me a link.</p><p>thanks alot**</p><pre><code>Main.xml looks like this&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;AbsoluteLayout android:layout_width=""fill_parent"" android:layout_height=""fill_parent"" android:id=""@+id/AbsoluteLayout01""&gt;&lt;TextView android:layout_x=""61dip"" android:layout_y=""176dip"" android:id=""@+id/TextView02"" android:layout_height=""wrap_content"" android:layout_width=""wrap_content"" android:text=""@string/courses""&gt;&lt;/TextView&gt;&lt;ImageButton android:id=""@+id/CoursesButton"" android:layout_x=""62dip"" android:layout_y=""107dip"" android:background=""@drawable/a"" android:layout_height=""65dp"" android:layout_width=""65dp""&gt;&lt;/ImageButton&gt;&lt;TextView android:gravity=""center"" android:textSize=""25dp"" android:layout_height=""wrap_content"" android:layout_width=""fill_parent"" android:text=""@string/LabelNescot"" android:layout_x=""1dip"" android:layout_y=""39dip"" android:id=""@+id/TextView""&gt;&lt;/TextView&gt;&lt;ImageButton android:id=""@+id/ILoveNescotButton"" android:background=""@drawable/b"" android:layout_height=""65dp"" android:layout_width=""65dp"" android:layout_x=""179dip"" android:layout_y=""106dip""&gt;&lt;/ImageButton&gt;&lt;ImageButton android:id=""@+id/GettingHereButton"" android:background=""@drawable/d"" android:layout_height=""65dp"" android:layout_width=""65dp"" android:layout_x=""185dip"" android:layout_y=""208dip""&gt;&lt;/ImageButton&gt;&lt;TextView android:id=""@+id/TextView05"" android:layout_height=""wrap_content"" android:layout_width=""wrap_content"" android:text=""@string/Directions"" android:layout_x=""182dip"" android:layout_y=""283dip""&gt;&lt;/TextView&gt;&lt;TextView android:id=""@+id/TextView03"" android:layout_height=""wrap_content"" android:layout_width=""wrap_content"" android:text=""@string/facility"" android:layout_x=""180dip"" android:layout_y=""177dip""&gt;&lt;/TextView&gt;&lt;ImageButton android:background=""@drawable/c"" android:id=""@+id/CampusMapButton"" android:layout_height=""65dp"" android:layout_width=""65dp"" android:layout_x=""48dip"" android:layout_y=""208dip""&gt;&lt;/ImageButton&gt;&lt;TextView android:text=""@string/Map"" android:layout_height=""wrap_content"" android:id=""@+id/TextView04"" android:layout_width=""wrap_content"" android:layout_x=""37dip"" android:layout_y=""285dip""&gt;&lt;/TextView&gt;&lt;/AbsoluteLayout&gt;z&lt;/LinearLayout&gt;</code></pre>","1090104","","234039","","2011-02-14 18:54:10","2011-02-14 18:55:32","Tabactivity android Vs Iphone","<android>","1","0","","",""
"4995220","1","","","2011-02-14 17:31:06","1","394","<p>I have created a real simple transparent activity by using a custom theme and color:</p><pre><code>&lt;style name=""CustomTheme""&gt;&lt;item name=""android:windowBackground""&gt;@color/trans&lt;/item&gt;&lt;item name=""android:windowIsTranslucent""&gt;true&lt;/item&gt;&lt;/style&gt;</code></pre><p><code>&lt;color name=""trans""&gt;#00000000&lt;/color&gt;</code></p><p>The only problem with this is when the activity starts one black line scrolls up the screen to the top.  I assume this is the animation of the activity starting.  Is there any way to change this so no line scrolls upwards?</p>","242904","","","","","2011-02-14 17:31:06","Transparent activity without one black line going across the screen?","<android>","0","0","","",""
"4995245","1","5792357","","2011-02-14 17:33:41","3","1999","<p>I'm writing a fairly Android application which will need to cache a lot of different images around 48x48 to 500x500 pixels in size. These images are fetched over the network from a number of different sources (think: user selects a source, browses a bunch of images, changes source, browses a bunch of images, etc.). I'd like to implement caching for these images, as I don't want to hit HTTP if someone's flinging through some images they've already seen. Obviously, memory usage is pretty key, so that's where EhCache comes in, as it offers a lot of different options for bounding the cache, expanding it to disk, etc. </p><p>Is this the right/best way to go about caching these images? I have noticed a lot of applications cache right to disk on the SD card, but I'd like to avoid this if possible for the sake of speed/convenience. </p>","128967","","","","","2013-03-03 05:43:23","EhCache in Android for caching bitmap images?","<android><caching><ehcache>","1","2","","",""
"4995257","1","","","2011-02-14 17:34:42","5","1907","<p>I'm trying to write an app that send an MMS without user interaction (i.e. not using the ACTION_SEND intent), following what suggested <a href=""http://stackoverflow.com/questions/2972845/i-want-send-image-through-using-mms-in-android"">here</a>.</p><p>The statement </p><pre><code>     HttpUtils.httpConnection(context, 4444L, MMSCenterUrl,        bytesToSendFromPDU, HttpUtils.HTTP_POST_METHOD, !TextUtils                .isEmpty(MMSProxy), MMSProxy, port);</code></pre><p>return me an error that say that the statement cannot run in the same thread.So, I build a separate thread using the AsyncTask class and the doInBackground method.</p><p>Now, I'm receiving the following error</p><blockquote>  <p>02-14 17:49:27.519:  WARN/System.err(1884):  java.io.IOException: Connect to /213.230.130.89:80 timed out 02-14  17:49:27.649: WARN/System.err(1884):  Caused by: org.apache.http.conn.ConnectTimeoutException:  Connect to /213.230.130.89:80 timed  out</p></blockquote><p>where 213.230.130.89 is my MMSProxy (the MMSCenterUrl is ""http://mms.tim.it/servlets/mms"").</p><p>pls consider that I'm able to send an MMS from the user interface with the same settings.</p><p>does anyone have any idea on what I'm missing?</p><p>thanks in advance.</p><p>[edit]I found the mistake.according to <a href=""http://stackoverflow.com/questions/2972845/i-want-send-image-through-using-mms-in-android"">D. Kolakowski</a>: ""If you get result with Phone.APN_REQUEST_STARTED value, you have to wait for proper state. Register BroadCastReciver and wait until Phone.APN_ALREADY_ACTIVE appears"".So I did a receiver for checking the phone connectivity status and, only then, perform the http-post request. Now it's working. </p>","601866","","601866","","2011-02-28 16:17:06","2012-04-07 14:26:57","how to send an MMS programmatically?","<android><mms>","0","4","3","2012-04-07 15:31:13",""
"4995275","1","4995947","","2011-02-14 17:36:36","1","556","<p>I have the following requirement</p><p>i> Need to fetch data from server</p><p>ii> Re-size multiple images which is fetched from server &amp; render on screen.</p><p><strong>My Approach</strong></p><p>I am using the following code</p><pre><code>private void fetchResult() {        mProgressDialogue = ProgressDialog.show(this, """",                ""Fetching results ... Please wait"");        new Thread() {            public void run() {                Message msg = Message.obtain();                try {                    mResponseVec = new Vector();                    Object getItemsResponseObj = loadCategoryResponse();                    mResponseVec = Utilities.getInstance()                            .parseGetItemsResponse(getItemsResponseObj);                } catch (Exception e) {                }                messageHandler.sendMessage(msg);            }        }.start();    }    protected Handler messageHandler = new Handler() {        public void handleMessage(Message msg) {            super.handleMessage(msg);            showProduct(mProductName, mResponseVec, mProductId, 0, 0);            mProgressDialogue.dismiss();        }    };</code></pre><p>Within the <strong>showProduct()</strong> method , I am resizing around 6 images after calling the images imageUrl. This resizing of the images is taking some time. The problem I am facing with the above code is that , after fetching the data from the server , during the time for resizing ,  the progressdialog is visible but it becomes static(stop rotating) &amp; stays on that non rotating position for some time &amp; then the showProduct screen is displayed.</p><p>My requirement is I want the progressDialog to remain &amp; rotate till the showScreen is displayed.</p><p>Will be great if anyone can provide their inputs.</p><p>Warm Regards,</p><p>CB</p>","443141","","","","","2011-02-14 18:49:11","Problem with ProgressDialog","<android>","2","2","0","",""
"4995340","1","","","2011-02-14 17:40:53","0","2612","<p>I'm new at Java and Android and I was wondering if it is possible to use an <code>Intent</code> in the case to bring up a new background followed by text for what item the user clicked (for example; they click open contacts and I tell them what open contacts is) or is there  another way?</p><pre><code>public class ListActivityExample extends ListActivity{static final String[] ACTIVITY_CHOICES = new String[] {    ""Open Website Example"",    ""Open Contacts"",    ""Open Phone Dialer Example"",    ""Search Google Example"",    ""Start Voice Command""};final String searchTerms = ""superman"";protected void onCreate(Bundle savedInstanceState){    super.onCreate(savedInstanceState);    setListAdapter(new ArrayAdapter&lt;String&gt;(this,            android.R.layout.simple_list_item_1, ACTIVITY_CHOICES));    getListView().setChoiceMode(ListView.CHOICE_MODE_SINGLE);    getListView().setTextFilterEnabled(true);    getListView().setOnItemClickListener(new OnItemClickListener()    {        @Override        public void onItemClick(AdapterView&lt;?&gt; arg0, View arg1,                int arg2, long arg3){            switch(arg2) {            case 0: //opens web browser and navigates to given website                 startActivity(new Intent(Intent.ACTION_VIEW,                         Uri.parse(""http://ww.android.com"")));                break;            case 1: //opens phone dialer and fills in the given number                {                startActivity(new Intent(Intent.ACTION_VIEW,                        Uri.parse(""content://contacts/people/"")));                break;}            case 2:                            {                  startActivity(new Intent(Intent.ACTION_VIEW,                        Uri.parse(""tel:12125551212"")));                 break;}            case 3: //                {                Intent intent= new Intent(Intent.ACTION_WEB_SEARCH);                intent.putExtra(SearchManager.QUERY, searchTerms);                startActivity(intent);                break;}            case 4: //                 {startActivity(new                                Intent(Intent.ACTION_VOICE_COMMAND));                break;}                default: break;            }        }    });}}</code></pre>","616599","","418183","","2011-02-14 20:18:56","2011-11-05 10:36:46","Android switch statement trouble","<android><listview><switch-statement><listactivity>","3","2","","",""
"4995379","1","5303020","","2011-02-14 17:43:40","1","5537","<p>I'm creating an app that needs to display the phone contacts with its photo, name and number. I've created a ListView and can show contacts and numbers with a generic photo, but I can't show contat's picture. This is my code:<code></p><pre><code>Cursor cursor = getContacts();String[] fields = new String[] {Contacts.DISPLAY_NAME, Phone.NUMBER};SimpleCursorAdapter adapter = new SimpleCursorAdapter(this, R.layout.contact_entry, cursor,            fields, new int[] {R.id.contactEntryText, R.id.contactEntryNumber});mContactList.setAdapter(adapter);private Cursor getContacts()    // Run query    Uri uri = Phone.CONTENT_URI;    String[] projection = new String[] {            Contacts._ID,            Contacts.DISPLAY_NAME,            Phone.NUMBER,            Contacts.PHOTO_ID    };    //String selection = Contacts.HAS_PHONE_NUMBER + ""='1'"";    String selection = null;    String[] selectionArgs = null;    String sortOrder = Contacts.DISPLAY_NAME + "" COLLATE LOCALIZED ASC"";    return managedQuery(uri, projection, selection, selectionArgs, sortOrder);}</code></pre><p></code></p><p>How can I attach the contact's picture in the SimpleCursorAdapter? Is there another?</p><p>Thank you very much.</p>","616583","","","","","2011-09-22 21:06:16","Android: Set contact photo in a ListView with name and number","<android><listview><contacts><photo><image>","1","0","0","",""
"4995448","1","","","2011-02-14 17:48:38","0","190","<p>I'm trying to do a kind of table, as a TableModel in java, dynamically inserting several TextViews, everything works right, but when I go to the last row, or any in the midle, of the table the header disappears leaving only the body of the table. I wish that it stays fixed on the table's top, only moves horizontally, according to the table, body, moves horizontally...<br/>They are in separated tables and HorizontalViews....<br/>I've tried everything and so far nothing....<br/>Something like this, and in tableHeader and tableBody I insert rows with TextViews.<br/></p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?>  &lt;TableLayout...>    &lt;TableRow ...        &lt;HorizontalScrollView>        &lt;TableLayout android:id=""@+id/tableHeader>        &lt;/TableLayout>    &lt;/HorizontalScrollView>    &lt;HorizontalScrollVie>        &lt;TableLayou android:id=""@+id/tableBody>        &lt;/TableLayout>    &lt;/HorizontalScrollView>&lt;/TableLayout></code></pre><p>thank you in advance <br/></p>","616796","","616796","","2011-02-15 10:47:18","2011-02-15 10:47:18","Android - How to move together in two different tables HorizontalScrollViews?","<android>","1","0","","",""
"4995607","1","5133722","","2011-02-14 18:04:10","0","932","<p>I would like to change the default behaviour of my listview, so when im scrolling to the last item, the list will keep scrolling untill the last item is at the top of the list.</p><p>default behaviour stops scrolling when the last item is fully in view.</p><p>Any ideas on how i can go about this pre 2.3?</p><p>Thanks,   Totem.</p>","274180","","","","","2011-02-27 14:25:50","Android listview (array adapter) custom scrolling","<android><listview><scrolling>","1","2","","",""
"4995622","1","4995954","","2011-02-14 18:05:28","0","1355","<p>Is it possible to have an Android Alert box or Dialog off-center?  I have tried everything that comes to mind, including making a custom Dialog activity and theme (extending Android:Theme.Dialog), but I have not been able to move it from it's centered position.</p>","600746","","","","","2011-02-14 19:14:13","Android dialog or floating activity off-center","<android><layout><dialog>","2","0","","",""
"4995685","1","5081069","","2011-02-14 18:13:18","4","1015","<p>I'm currently having issues with my widget.  I'm using a Droid 2 phone and when I open the keyboard the screen rotates and my widget never calls the onUpdate() function call.</p><p>In efforts to debug the issue I overwrote the onReceive() and noticed that after the screen is rotated I get the intent action:</p><pre><code>com.motorola.blur.home.ACTION_WIDGET_ADDED</code></pre><p>After the rotation of the screen the TextViews loose their content so I need to be able to set text after the rotation.  I usually set the text at the onUpdate() call.</p><p>Anyone have any ideas why this issue? I'm sure I'm doing something wrong...</p><p>Thanks,</p><p>-Jona</p>","398248","","398248","","2011-02-15 03:51:31","2012-06-09 04:15:14","Widget onUpdate() is not called when Android home screen rotates","<android><widget>","1","3","2","",""
"4995822","1","4995847","","2011-02-14 18:26:37","2","753","<blockquote>  <p><strong>Possible Duplicates:</strong><br>  <a href=""http://stackoverflow.com/questions/4990943/how-can-i-decode-string"">How can I Decode string?</a><br>  <a href=""http://stackoverflow.com/questions/994331/java-how-to-decode-html-character-entities-in-java-like-httputility-htmldecode"">Java: How to decode HTML character entities in Java like HttpUtility.HtmlDecode?</a>  </p></blockquote><p>Hi,</p><p>I have string like as an eg <strong>""&ampauml;s&amparing;""</strong> that needs to be converted like this <strong>""äså""</strong> pls help me out here.</p><p>Thanks in advance</p>","500420","","","","","2011-02-14 18:41:58","is there any way to decode string?","<java><android><html>","1","2","1","2011-02-14 18:39:29",""
"4995857","1","4995883","","2011-02-14 18:30:08","0","1146","<p>I have looked around  the net and cannot find a project for this game. Is there a zip file which anyone knows of that I can download. Thanks</p>","608658","","","","","2011-02-14 18:32:15","Find Project for Replica Island","<android>","1","0","","",""
"4995906","1","4999839","","2011-02-14 18:34:11","0","639","<p>I am working on Android app and as part of that, I have to connect to a HTTPS host..This host users a security certificate that is not recognized by Android ! This is a valid certificate but it is not trusted by Android...</p><p>The system specefically raises an Security Exception: Certificate is not Trusted</p><p>My code is as shown:</p><pre><code>Url = new URL(""https://example.com"");url_connection = (HttpsURLConnection) Url.openConnection();url_connection.connect(); // This is where the exception is raised !</code></pre><p>Due to the exception, the connection is not open ! I want to skip the certificate verification ... OR somehow the exception should not be raised and the connection should open...</p><p>I am going to validate the certificates in next step after successful connection is made.. This is part of my app and hence during connection I want to skip this..</p><p>I have searched for similar questions, but none of the answers work for me... I have tried the approach of creating my own SSL Factory and local trust managers but it does not work at all ... I get the exception NoSuchAlgorithmException when I do the following:</p><pre><code>ssl_context = SSLContext.getInstance(""SSL""); // OR TSL for that matter..</code></pre><p>Due to this, I am not able to proceed ... Please help..</p><p>The main issue is the exception... If the connection is made with errors or warnings, then also it is fine... </p><p>Please note: I do not want to import the certificates onto device, becuase this is not feasible solution... Otherwise all users will have to go through this manual step..So, I want to validate the certificates programatically and make the connection...</p>","616663","","616663","","2011-02-14 18:45:30","2011-02-15 04:20:43","Android: Bypass security certificate check while doing a URL.Connect","<java><android><security>","2","0","","",""
"4995917","1","4995980","","2011-02-14 18:35:34","1","820","<p>I would like to have this android layout basically works like the dolphin browser, which I can make my sidebar in the left appears while scrolling the view horizontally to the right.</p><p>I figure it could be for example two sliding drawer working together, but after tying, it doesn't work out.</p><p>So, any thought or any reference and tutorial will be really nice!</p><p><a href=""http://bestmobileapp.org/wp-content/uploads/2010/07/Dolphin-Browser-HD-Android.jpg"" rel=""nofollow"">Here</a> is the screen shot which can illustrate how this layout works(I'm totally new here, so no picture upload allowed)</p>","616647","","616647","","2011-02-14 18:56:57","2011-02-14 18:56:57","To create a sidebar hidden in the left hand side of a view like dolphin browser do","<android><android-layout>","1","1","","",""
"4995965","1","5239007","","2011-02-14 18:40:53","3","3754","<p>Every once in a while a borked Eclipse build gets nailed down to the absence of this file, with the <a href=""http://stackoverflow.com/questions/4437023/resources-ap-does-not-exist-when-compile-my-android-project"">simple fix</a> of cleaning the build, or occasionally doing a <a href=""http://stackoverflow.com/questions/4714711/android-packaging-problem-resources-ap-does-not-exist"">deeper clean</a> on the project's metadata. I can live with this state of affairs, but the curious side of me has to ask <em>why</em>.</p><p>A search for it on developer.android.com turns up nothing :(, and a search on Google turns up various threads by folks wondering why their build is broken. </p><p><a href=""http://www.mail-archive.com/android-discuss@googlegroups.com/msg07691.html"" rel=""nofollow"">This guy</a> is the closest thing I've found to an explanation of the thing itself. Hopefully some nice, patient guru can shed some light on the fundamentals here without this noob digging too far into the source :)</p>","118220","","","","","2012-05-18 15:57:11","What is resources.ap_ and why does it have a penchant for not existing?","<android><adk>","2","0","","",""
"4996073","1","4996233","","2011-02-14 18:51:33","1","872","<p>Basiclly I have two screens at the moment. Question and Answer screens. When you click on the answer you think it is on the question screen it takes you to the answer screen to tell you if you were correct. The next part is from that screen you go back to the question screen and you are asked another question. At the moment this is creating loads of new activities and can easily get out of hand.What I need is to know when a question activity gets 3 down and stop it. Basicly from the reason screen you can go back to view the question, but when you are on a new question it should remove the old and the reason page.</p><p>How do I do this?</p>","614460","","","","","2011-02-14 19:20:11","Find Activity Position In Activity Stack","<android><activity><stack>","2","0","1","",""
"4996125","1","4996173","","2011-02-14 18:55:46","2","896","<p>This may be a stupid question, but here it goes. Is Google Maps a standard (and pre-installed) application on every android phone? I am writing a map application and using a mapview to plot several points near a given zip code. I got that working. If Google maps is pre-installed on every phone, then i can just theoretically send Google maps my two points and it will take care of the rest, correct? Or will i have to go old school and program all driving directions myself?</p>","250043","","","","","2011-02-14 19:12:03","Google maps standard on Android phone?","<android><google-maps><google-maps-api-3>","4","0","1","",""
"4996155","1","4996225","","2011-02-14 19:00:35","2","959","<p>I use TelephonyManager to get the network type as in getNetworkType(). Currently I see only CDMA and GSM networks only. How do I detect WiMAX as the networkType. Sprint's HTC EVO 4G phone supports WiMAX and when I use getNetworkType(), I get NETWORK_TYPE_EVDO_A even though the handset is on WiMAX network. </p><p>Thanks.Dillon</p>","616696","","","","","2011-03-08 19:54:07","How to tell if handset is on WiMAX","<android><sprint><telephonymanager>","2","0","1","",""
"4996190","1","","","2011-02-14 19:04:57","2","2079","<p>Anyone know of a good client for Powershell remote scripting on a local network?</p><p>I understand WinRM is required on the client to enable remote scripting. </p><p>WinRM is ""The Windows Remote Management (WinRM) is the Microsoft implementation of WS-Management Protocol, a standard Simple Object Access Protocol (SOAP)-based, firewall-friendly protocol that allows hardware and operating systems, from different vendors, to interoperate."" <a href=""http://msdn.microsoft.com/en-us/library/aa384426(v=vs.85).aspx"" rel=""nofollow"">http://msdn.microsoft.com/en-us/library/aa384426(v=vs.85).aspx</a></p><p>If a WinRM client is not available for Android but a WS-Management Protocol client is, can you use the latter for remote scripting?</p>","221669","","64046","","2011-05-12 16:03:22","2012-02-06 16:57:11","Android Client for Powershell remote scripting?","<android><scripting><powershell><client><powershell-remoting>","2","0","","",""
"4996245","1","4996315","","2011-02-14 19:11:39","1","2919","<p>At the moment I am having to write out each query to insert data into the database separately. </p><p>Is there a way I can import a spreadsheet or anything else and end up with this form.?</p><p>Is there an auto-increment feature like in normal MySQL? </p><pre><code> db.execSQL(""INSERT INTO "" +            SAMPLE_TABLE_NAME +            "" Values ('3','"" +            ""Question',"" +            ""'Answer1',"" +            ""'Answer2',"" +            ""'Answer3',"" +            ""'Answer4',"" +            ""'Correctanswer',"" +            ""'Reason');"");</code></pre>","614460","","23199","","2011-02-15 19:38:06","2011-02-15 19:38:06","Is there an easy way to import data into SQLite?","<android><sqlite>","3","1","","",""
"4996347","1","","","2011-02-14 19:24:42","4","3633","<p>In my Android application, I have bunch of meshes in a collection that are moving around in 3d space. I want something to happen to the mesh when any one of the moving mesh (object) is touched. How can I detect which object has been touched ( clicked) ?</p>","574122","","","","","2014-02-18 16:00:33","How to detect click on an object in OpenGL ES in Android application?","<android><opengl-es>","2","0","2","",""
"4996406","1","","","2011-02-14 19:31:26","1","2395","<p>I am using Samsung Galaxy 3. I have turned on the debug option and have connected the phone via usb to ubuntu/windows but the phone is simply not recognized. </p><p>It was working perfectly fine i.e. recognized on ubuntu for me to work with Eclipse, until I decided to reboot the phone with usb still connected to the computer. </p><p>I have tried rebooting the phone multiple times and everytime, when I plug in the usb, it simply charges and no notification of usb connection ever shows up. What am I doing wrong here? Please help. </p>","139123","","","","","2013-01-18 08:57:39","Android Phone is not recognized on Ubuntu/Windows via USB","<android><debugging><usb>","1","4","","",""
"4996466","1","","","2011-02-14 19:38:16","0","335","<p>The following is (what I think) a relatively simple view which works great in 'normal' rotation. However, when the device is rotated the first image disappears and the two bottom buttons anchor to the top. The ImageView and TextView that are centred in the parent display just as they should. </p><p>I'm a bit clueless as to what's going on here. Can someone explain to me how Android decides to render the following when rotated?</p><hr><pre><code>&lt;ScrollView xmlns:android=""http://schemas.android.com/apk/res/android"" android:layout_width=""fill_parent"" android:layout_height=""fill_parent"" android:fillViewport=""true""&gt;&lt;RelativeLayout android:layout_width=""fill_parent"" android:layout_height=""fill_parent"" android:background=""#fff"" android:gravity=""center_horizontal""&gt;&lt;ImageView android:id=""@+id/logo""     android:layout_width=""wrap_content""     android:layout_height=""wrap_content""    android:paddingLeft=""15dp""     android:layout_alignParentTop=""true""                android:layout_alignParentLeft=""true""    android:src=""@drawable/header""/&gt;    &lt;ImageView android:id=""@+id/map""         android:paddingTop=""5dp""         android:paddingRight=""1dp""         android:paddingLeft=""1dp""         android:layout_width=""fill_parent""         android:layout_height=""wrap_content""         android:layout_centerInParent=""true""        android:src=""@drawable/dotmap""/&gt;    &lt;TextView        android:layout_height=""wrap_content""         android:layout_width=""wrap_content""        android:gravity=""center_horizontal""              android:layout_centerInParent=""true""        android:background=""#fff""        android:textStyle=""bold""        android:textColor=""#000""        android:textSize=""18sp""        android:text=""Discover!"" /&gt;    &lt;TextView android:id=""@+id/NewSearch""          android:layout_width=""wrap_content""        android:layout_height=""wrap_content""         android:layout_alignParentBottom=""True""        android:layout_alignParentLeft=""True""        android:layout_marginLeft=""15dp""        android:clickable=""true""        android:padding=""10dp""        android:background=""#6900a9""        android:textSize=""16sp""        android:textStyle=""bold""        android:textColor=""#fff""        android:text=""Search"" /&gt;    &lt;TextView android:id=""@+id/Existing""         android:layout_width=""wrap_content""        android:layout_height=""wrap_content""         android:layout_alignParentBottom=""true""        android:layout_alignParentRight=""true""        android:visibility=""visible""         android:clickable=""true""        android:layout_marginRight=""15dp""        android:padding=""10dp""        android:background=""#6900a9""        android:textSize=""16sp""        android:textStyle=""bold""        android:textColor=""#fff""        android:text=""Tour"" /&gt;&lt;/RelativeLayout&gt;</code></pre><p></p>","278229","","","","","2011-02-14 19:38:16","Why are these TextViews aligned to bottom moving to the top on rotation? Android","<android><uiscrollview><textview><relativelayout>","0","5","","",""
"4996470","1","4996992","","2011-02-14 19:39:37","5","5467","<p>I am trying to display a jpg file from a server into an imageView. When I try to load a smaller image (300x400), there are no problems. But when I try to load a full size picture (2336x3504), the image will not load. The file size of the image is only 2mb. I do not get any errors in logcat and there are no exceptions thrown. It simply won't load the image. I also tried using this:</p><pre><code>BitmapFactory.Options options=new BitmapFactory.Options();options.inSampleSize = 8;Bitmap preview_bitmap=BitmapFactory.decodeStream(is,null,options);</code></pre><p>This doesn't do anything to help load the large files, but it does resize the smaller image (like it is suppose to). I did add the large picture to my resources and tested it as if it was embedded in the app and it worked fine, just won't work on the server. I have been working all day on this and can't seem to figure out how to load these large pictures. Can anyone help me out with this? Thanks for any info. </p><p><a href=""http://stackoverflow.com/questions/477572/android-strange-out-of-memory-issue/823966#823966"">Here</a> is the link where I found the above code and have been playing with the other examples but still not getting it to work. </p><p><strong>EDIT:</strong></p><p>Here is the code I'm using, to load the image:</p><pre><code>public static Bitmap getBitmapFromURL(String src) {    Bitmap bmImg;    URL myFileUrl = null;    try {        myFileUrl = new URL(src);        HttpURLConnection conn= (HttpURLConnection)myFileUrl.openConnection();        conn.setDoInput(true);        conn.connect();        InputStream is = conn.getInputStream();        BitmapFactory.Options options=new BitmapFactory.Options();        options.inSampleSize = 16;        bmImg = BitmapFactory.decodeStream(is, null, options);        return bmImg;    } catch (Exception e) {        // TODO Auto-generated catch block        Log.d(""Error"", e.toString());        return null;    }}</code></pre><p>Here is the logcat screenshot (couldn't figure out how to copy the text appropriately in eclipse) I cleared the log right before I hit the button to load the image. So all you see is what happens when I hit that button. I erased the company and app names (where you see ""com."", assume its ""com.mycompany.myapp"".<img src=""http://i.stack.imgur.com/Ntq6f.png"" alt=""Logcat Screenshot""></p>","469194","","469194","","2011-02-14 20:48:02","2013-01-17 15:15:45","Load Large Image from server on Android","<android><bitmap><imageview>","3","0","5","",""
"4996581","1","4996800","","2011-02-14 19:51:59","0","50","<p>I had a image but cant up load it yet AHH</p><p>I was able to get the menu to work. My question is how to I make a msgbox pop up on click so I can put details about app and my self?Thanks</p>","613481","","","","","2011-02-14 20:15:21","I added an about menu, and now I need help on how to bring info up on click","<android>","3","0","","",""
"4996729","1","","","2011-02-14 20:06:58","0","1939","<p>I would like to load a webview in the background and only display a bitmap of the page it loads.  I have a webview in my view hierarchy that has visibility set to ""invisible"" and an imageview that I wish to display a bitmap of the webview.</p><pre><code>imageView = (ImageView)findViewById(R.id.imageview);webView = (WebView)findViewById(R.id.webview);webView.setBackgroundColor(Color.parseColor(""#006330""));webView.setDrawingCacheEnabled(true);webView.loadDataWithBaseURL(SiteAPI.URL, html, ""text/html"", ""iso-8859-1"", null);webView.measure(MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED),                     MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED));webView.layout(0, 0, webView.getMeasuredWidth(), webView.getMeasuredHeight());Bitmap b = webView.getDrawingCache(); webView.setDrawingCacheEnabled(false);          if(b != null) {     Toast.makeText(getBaseContext(), ""Not null"", Toast.LENGTH_LONG).show();     imageView.setImageBitmap(Bitmap.createBitmap(b));}else {     Toast.makeText(getBaseContext(), ""Null."", Toast.LENGTH_LONG).show();}</code></pre><p>The call to getDrawingCache() returns null everytime.  I've tried setContentView(webView) and the page displays fine.  I've made sure that isDrawingCacheEnabled() returns true, yet the bitmap is still null.  Where am I going wrong?</p>","591042","","","","","2011-02-14 21:56:08","Android -- Displaying background WebView as a Bitmap","<android><webview><imageview>","1","0","2","",""
"4996918","1","4996948","","2011-02-14 20:31:06","1","97","<p>My being fairly new to SQL, I was wondering if I could use it to solve one of the complexities in my database automatically.</p><p>That is, I'm tracking entries by day.So, the columns we are concerned with are:YYYYMMDDXXX</p><p>where YYYY is year, MM is month, DD is day and XXX is a unique number given to each entry on a given day.  In such a way is uniqueness ensured.My question is if I can use SQL to automatically increment XXX (from 0) if I enter two records with the same YYYY, MM and DD.If not, I could do a query and manually check (but this would be easier).</p><p>I suppose the other option would be to use the _id column (that is _id INTEGER PRIMARY KEY AUTOINCREMENT) which is guaranteed to be unique for every row.  Would that just be a better solution?</p><p>I'm use the Android SQLite implementation (with Java)</p><p>Thanks!</p>","450153","","","","","2011-02-14 21:16:41","SQL check 3 columns + increment","<java><android><sqlite>","2","0","","",""
"4996999","1","","","2011-02-14 20:40:15","0","48","<p>I'm trying to draw a rotated layout in Android (because my app has to run in Landscape mode for reasons outside my control and I want to draw the widgets rotated 90 degrees so they'll look right when the device is in portrait mode). I've gotten it to work except for button highlights--they are not drawing correctly (one button's highlight will sometimes draw inside of two buttons). I tried to debug this by setting a breakpoint in Button.draw(), but to my surprise it is only called twice: once for the button in its normal state, and once for the first time the highlight is drawn. From then on, it must be cached. Where does the drawing actually occur? I tried calling setDrawingCacheEnabled(false) on the button but that didn't change its behavior.</p>","415533","","","","","2011-02-14 20:46:25","How are buttons drawn in android after the first tap?","<android><internals>","1","0","","",""
"4997072","1","5009926","","2011-02-14 20:48:49","0","599","<p>On Android, what's a way to be able to place a view, like a WebView, anywhere on screen? I'm providing an interface to users where they can create a WebView dynamically and place it anywhere they want with X-Y and Width-Height parameters. </p><p>FrameLayout doesn't work since it sticks everything at a corner. RelativeLayout I'm not sure of. AbsoluteLayout seems like the best bet, but it's been deprecated. </p>","93802","","","","","2011-02-15 21:54:27","How to place view anywhere on screen?","<java><android><layout><view><android-layout>","2","0","","",""
"4997152","1","","","2011-02-14 20:55:10","0","349","<p>I have tried to rotate the emulator while it is running by hitting and holding ctrl f11 but nothing happens. I also have read I need to switch off numlock which I dont have and hit 7 &amp; 9. I tried hitting 7 &amp; 9  but the emulator does not rotate. If any one has experienced this or knows another way I would highly appreciate a response. Thanks</p>","608658","","","","","2012-11-22 11:42:13","Rotating emulator ctrl f11 and 7 & 9 keys","<android>","3","0","","",""
"4997166","1","5004111","","2011-02-14 20:56:32","5","3715","<p>On my Android 2.2.2 device the gallery looks really nice. What I would love to do in my own app is to press a button and then show a menu that looks like this:<img src=""http://i.stack.imgur.com/Dr7l9.jpg"" alt=""enter image description here""></p><p>Is this using any standard Android themes / styles? Does anybody know of an example code to have a menu like this?</p><p>Edit:I figured out that one could mimic this menu with a Dialog. To simplify things I'm not using a ListView in this example, just a single TextView entry for the dialog:</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=""wrap_content""              android:layout_height=""wrap_content""              &gt;    &lt;TextView android:id=""@+id/text""              android:layout_width=""wrap_content""              android:layout_height=""fill_parent""              android:textColor=""#FFF""              android:padding=""10dp""              /&gt;&lt;/LinearLayout&gt;</code></pre><p>Showing the dialog when I press a button:</p><pre><code>                Dialog dialog = new Dialog(MyActivity.this);                dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);                dialog.setContentView(R.layout.custom_dialog);                TextView text = (TextView) dialog.findViewById(R.id.text);                text.setText(""Test option 1"");                WindowManager.LayoutParams WMLP = dialog.getWindow().getAttributes();                WMLP.gravity = (Gravity.BOTTOM | Gravity.LEFT);                WMLP.x = 0;                WMLP.y = 0;                dialog.getWindow().setAttributes(WMLP);                dialog.show();</code></pre><p>This creates a dialog that comes close to the menu in the picture. I still have two problems, however:</p><p>1) How can I draw this little triangle at the bottom of the dialog, like it is done in the picture above?</p><p>2) The button that is supposed to open the dialog is positioned horizontally in the middle of the bottom button bar. So when I press it, the dialog should be displayed right above that button.What I would like to do is this:</p><pre><code>WMLP.x = middleButton.getLeft() + (middleButton.getWidth() / 2) - dialog.getWindow().getDecorView().getPaddingLeft() - (WMLP.width / 2);</code></pre><p>The problem is, that WMLP.width is -2. I guess the reason is that the layout width is set to ""wrap_content"" (which is -2) and the actual width is not known at this moment.So, how can I determine the width of the dialog so that I can position it concentrical over another view?</p><p>Update: I finally found a great source for a dialog like this:<a href=""http://www.londatiga.net/it/how-to-create-quickaction-dialog-in-android/"" rel=""nofollow"">http://www.londatiga.net/it/how-to-create-quickaction-dialog-in-android/</a></p><p>It's exactly what I wanted and I'm using it in my app now.</p>","388826","","396458","","2011-12-19 18:42:09","2011-12-19 18:42:09","How to make a fancy transparent menu like the ""share menu"" in Android gallery?","<android><coding-style><menu><transparent>","3","2","3","",""
"4997264","1","","","2011-02-14 21:06:12","1","1456","<p>Hello i have succeeded to make an expandable list view in my app from an example and much struggle, but i don't really understand how i succeeded to get the right index the user clicked, i mean, i don't really know what's in childData and how groupData and childData are related to each other. I need some help understanding this guys, i had never seen generics in this way. So here are my questions: </p><p>1- How childData and groupData are related to each other, is groupData into childData Map?2- How can <code>String selectedWord = childData.get(groupPosition).get(childPosition).get(NAME);</code>   get the right word and header(or group) in the listView?</p><p>Here's the code:</p><pre><code>@Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.expandable_list_layout);        DBManager db = new DBManager(getApplicationContext());        List&lt;String&gt; header = db.selectAllCategories();        List&lt;Map&lt;String, String&gt;&gt; groupData = new ArrayList&lt;Map&lt;String, String&gt;&gt;();        final List&lt;List&lt;Map&lt;String, String&gt;&gt;&gt; childData = new ArrayList&lt;List&lt;Map&lt;String, String&gt;&gt;&gt;();        for (String category : header) {            Map&lt;String, String&gt; curGroupMap = new HashMap&lt;String, String&gt;();            groupData.add(curGroupMap);            curGroupMap.put(NAME, category);            List&lt;String&gt; categoryWords = db.selectWordsFromCategory(category);            List&lt;Map&lt;String, String&gt;&gt; children = new ArrayList&lt;Map&lt;String, String&gt;&gt;();            for (String word : categoryWords) {                Map&lt;String, String&gt; curChildMap = new HashMap&lt;String, String&gt;();                children.add(curChildMap);                curChildMap.put(NAME, word);            }            childData.add(children);        }        //create SimpleExpandableListAdapter object...        lv.setOnChildClickListener(new OnChildClickListener() {            public boolean onChildClick(ExpandableListView parent, View v, int groupPosition, int childPosition, long id) {//How does the below code works? //How can i get the group value from the childData map//i thought childData had only childs in it?                String selectedWord = childData.get(groupPosition).get(childPosition).get(NAME);                Log.i(""You clicked here:"", selectedWord)                return false;            }        });</code></pre><p>Thanks for your time.</p>","526924","","","","","2011-02-15 20:28:35","need help to understand onChildClick android","<android>","1","0","1","",""
"4997364","1","","","2011-02-14 21:16:40","0","152","<p>i have an application that will display an address in a TextView component. the address is 4 lines. I placed ""\r\n"" after each line so i can see the address in a formatted fashion. however, i noticed that when i see the textview on screen, i see the imprintable block after each line. any idea how to remove them or how to get all lines in a TextView without those pesky imprintable character blocks? </p>","250043","","","","","2011-04-25 03:32:06","TextView and imprintable characters","<android><listview><textview>","0","2","","",""
"4997377","1","","","2011-02-14 21:17:43","0","599","<p>Im building an app that sends an SMS. Its sending the SMS fine, but for some reason the intent restarts and when it does, its not getting the sent extras from the previous intent the second time around and it FC's. I have tried calling finish() after the textmessage is sent, but to no avail. It goes back to the previous activity, and then crashes. Anyone else ever had this problem? Here is my code</p><pre><code>package com.bv.crimestoppers;import android.app.Activity;import android.app.PendingIntent;import android.content.Intent;import android.os.Bundle;import android.telephony.SmsManager;import android.view.View;import android.view.View.OnClickListener;import android.widget.Button;import android.widget.EditText;import android.widget.ImageView;public class tip extends Activity implements OnClickListener{public static String title;@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.tip);    Bundle extras = getIntent().getExtras();    title = extras.getString(""com.bv.crimestoppers.title"");    Button submitButton = (Button)findViewById(R.id.tip_button);    submitButton.setOnClickListener(this);    EditText tipText = (EditText)findViewById(R.id.tip_text2);    //tipText.setText(title);}private void sendSMS(String phoneNumber, String message){            PendingIntent pi = PendingIntent.getActivity(this, 0,        new Intent(this, tip.class), 0);                    SmsManager sms = SmsManager.getDefault();    sms.sendTextMessage(phoneNumber, ""0000"", message, pi, null);     finish();}@Overridepublic void onClick(View v) {    switch (v.getId()) {    case (R.id.tip_button):        sendSMS(""6149402521"", ""CMH"");    }} }</code></pre>","587009","","","","","2011-02-14 21:17:43","Crash after sending sms android","<android><crash><sms><extra>","0","2","0","",""
"4997390","1","","","2011-02-14 21:19:24","0","357","<p>Here on my app   I've got a small surfaceView that displays the camera preview. This surfaceView is put in a FrameLayout that is put in a ScrollView, alltogether with other components (like buttons, textViews and such). The thing is, that when i scroll the screen, the surfaceView leaves a black hole where it was, and this black hole is only filled when the screen is redrawn, so, I'd like to redraw the screen on each scrolling step (yes, I am willing to pay the performance trade off, if there's no other way). Someone has any ideas?</p>","594145","","","","","2012-02-16 08:17:54","Detect when screen is scrolling?","<android>","1","0","","",""
"4997432","1","4997491","","2011-02-14 21:23:09","1","825","<p>I'm developing an application with lists and forms which most of them are loaded from the web (I have a JSON server I make requests). I'm using AsyncTasks to retrieve all the data. I was wondering if it's the best way to deal with networking, since the application can be sent to background (and in some cases, killed by the OS) by receiving a call, SMS or simply by having the home buttom pressed. What happens to AsyncTasks when the application goes background? Are they killed, suspended or something? I don't want to have my forms and lists half-loaded. Should I use services instead of AsyncTasks?</p><p>Thanks for any help.</p>","595881","","","","","2011-02-14 21:30:23","Android networking - best practices","<android><http><networking>","1","0","1","",""
"4997677","1","","","2011-02-14 21:49:14","9","18607","<p>Does anyone know if there is a way to intercept a ""page not found"" or ""page not loading error"" in WebView?</p><p>According to the android documentation, <code>onReceivedError()</code> should be able to intercept. but i tested it in an app which I deleberately gave the wrong URL, and it didn't do anything. </p><p>I want my app to be able to give my own custom error message if the URL is ever unavailable for any reason.</p><p>this is the code that did nothing: </p><pre><code>public void onReceivedError(WebView view, int errorCode,        String description, String failingUrl) {    // custom error handling ... show and alert or toast or something}</code></pre>","616323","","418183","","2011-09-26 09:55:15","2013-04-13 20:55:51","Android WebView onReceivedError()","<android><webview>","2","0","4","",""
"4997730","1","4998565","","2011-02-14 21:56:20","0","5736","<p><strong>Ans: Use viewFlipper.getCurrentView().getId()</strong></p><p>Hi,I'm stuck in a position where I have to execute a set of statements based on the screen that is being displayed (Have to use IF condition). The layout folder contains only one screen (i.e., main.xml). But inside the main.xml there are three absolute layouts (01,02 &amp; 03). I'm using flipper to swipe through these screens.</p><p>Earlier when I used to switch between two screens (main.xml and main2.xml), I had no problem. I was using two buttons to switch between the screens and I used a flag inside each button and used the same flag in my IF condition to execute the code. Now that I've implemented flipper, I'm unable to use flag. So I thought of using the LAYOUT ID in the IF condition. But I need to know <strong>how to check for the layout id in java coding</strong>. Can somebody help me out?</p><p>For Ex: </p><pre><code>if(findViewById(R.id.AbsoluteLayout01)==true){execute}else if(findViewById(R.id.AbsoluteLayout02)==true){execute #2}</code></pre><p><strong>(The above code throws the ""Incompatible operand types View and boolean"" error)</strong></p><p>So I tried</p><pre><code>if(findViewById()==v1) //v1 is the object for AbsoluteLayout01{execute}else if(findViewById()==v2) //v2 is the object for AbsoluteLayout02{execute #2}</code></pre><p><strong>(The above code throws the ""The method findViewById(int) in the type Activity is not applicable for the arguments ()"" error)</strong></p>","597622","","597622","","2011-02-15 00:17:09","2011-02-15 00:46:48","Android: How to get the id of a layout inside a flipper?","<java><android><layout><if-statement><android-layout>","4","1","1","",""
"4997731","1","7095704","","2011-02-14 21:56:21","15","4332","<p>I'm trying to upload a logo with a transparent background to the android market.  For some reason, my png is getting transformed by the market in a way that removes the transparency.</p><p>My designer is doing his best to follow the instructions in <a href=""https://market.android.com/support/bin/answer.py?answer=1078870"" rel=""nofollow"">https://market.android.com/support/bin/answer.py?answer=1078870</a>, but neither of us can figure out what's wrong.  As far as we can tell, he's doing alpha in the png, but it doesn't look right.</p><p>Here's the png:</p><p><img src=""http://i.stack.imgur.com/LcMua.png"" alt=""enter image description here""></p><p>And here's what it looks like in the market:</p><p><img src=""http://i.stack.imgur.com/dqJIK.png"" alt=""enter image description here""></p><p>This seems to be a widespread problem in the market, although some apps have managed to get it right. What are we doing wrong?</p>","82156","","","","","2011-08-17 15:47:30","Transparent png on android market for high resolution asset","<android><png><alpha><google-play>","3","14","6","",""
"4997812","1","","","2011-02-14 22:04:42","1","326","<p>I am working on <strong>android media players</strong>. I want to know how to get the <strong>number of bytes that have been loaded</strong> since the video streaming starts. </p><p>Is there any API or way to compute that?</p>","616727","","616727","","2011-02-14 23:51:08","2011-07-06 17:56:25","In Android media player, how do I get ""bytes loaded""?","<android><media-player>","1","0","","",""
"4997855","1","5496126","","2011-02-14 22:09:31","3","5088","<p>I can't seem to get the following trivial code to compile/link and the problem seems specific to std::wstring and the gnustl_static C++ library. Any help would be appreciated.</p><p>main.cpp file:</p><pre><code>#include &lt;string&gt;int main(void){    std::wstring wtest(L""Test"");    return 0;}</code></pre><p>Application.mk file:</p><pre><code>APP_CFLAGS += -fexceptionsAPP_STL := gnustl_static</code></pre><p>Android.mk file:</p><pre><code>LOCAL_PATH := $(call my-dir)include $(CLEAR_VARS)LOCAL_MODULE := TestWCharAppLOCAL_CFLAGS := -D_GLIBCXX_USE_WCHAR_TLOCAL_SRC_FILES := main.cppinclude $(BUILD_EXECUTABLE)</code></pre><p>When attempting to link the above application using gnustl_static I get the following error message:</p><pre><code>undefined reference to `std::basic_string&lt;wchar_t, std::char_traits&lt;wchar_t&gt;, std::allocator&lt;wchar_t&gt; &gt;::basic_string(wchar_t const*, std::allocator&lt;wchar_t&gt; const&amp;)'</code></pre><p>If I change APP_STL to stlport_static and define _STLP_HAS_WCHAR_T everything seems to compile/link/run fine. I verify it works by uploading the exe to the emulator and running it via the shell.</p><p>I'm going to need to use the gnustl implementation for c++ exception support otherwise I'd go with stlport_shared. Any clues as to why the above sample works for stlport_static but not gnustl_static?</p>","511698","","71034","","2011-02-14 22:30:38","2012-11-25 23:32:27","android-ndk gnustl_static exe not working","<android><android-ndk>","4","0","","",""
"4997907","1","4998542","","2011-02-14 22:15:19","15","18056","<p>I have a class that extends PreferenceActivity and shows the preference screen of my app. Is it possible to check if any changes were made to the preferences?</p><p>This helps...</p><p><a href=""http://developer.android.com/reference/android/content/SharedPreferences.OnSharedPreferenceChangeListener.html"" rel=""nofollow"">http://developer.android.com/reference/android/content/SharedPreferences.OnSharedPreferenceChangeListener.html</a></p><p>Other related post:<a href=""http://stackoverflow.com/questions/2542938/sharedpreferences-onsharedpreferencechangelistener-not-being-called-consistently"">SharedPreferences.onSharedPreferenceChangeListener not being called consistently</a></p><hr><pre><code>public class PreferenceClass extends PreferenceActivity {    OnSharedPreferenceChangeListener listener;    public void onCreate(Bundle savedInstanceState) {        SharedPreferences prefs = this.getSharedPreferences(""settings"", 0);        listener = new SharedPreferences.OnSharedPreferenceChangeListener() {            public void onSharedPreferenceChanged(SharedPreferences prefs, String key) {                int flag = 1;            }        };        prefs.registerOnSharedPreferenceChangeListener(listener);        super.onCreate(null);        addPreferencesFromResource(R.xml.settings);    }}</code></pre>","582665","","56285","","2014-04-02 16:21:12","2014-04-02 16:21:12","How to detect if changes were made in the preferences?","<android><sharedpreferences><android-preferences><preferenceactivity>","3","4","4","",""
"4997934","1","4998681","","2011-02-14 22:18:26","1","601","<p>So for my Android app I need a centralized server so multiple phones can use it. This server is only going to hold text. Just coordinates and a string per request.</p><p>I looked into Amazon S3 and Google Storage. These store ""buckets"" of info through a RESTful API. So basically, I can't put/get info into these things as I would into a database. I'm going to have to send/receive a text file correct?</p><p>Would it make more sense (both financially and technically), to buy my own web server so I can just create a MySQL DB or something and do it this way, or would the bucket thing still be the best way to go (cloud storage).</p><p>Thanks!</p>","534101","","","","","2011-02-14 23:51:17","Android web server","<android><mysql><amazon-s3><google-storage>","1","0","1","",""
"4998163","1","4999202","","2011-02-14 22:44:13","2","948","<p>I'm working on a piece of code where i have to write text and images on a bitmap. Unfortunately i don't know the number of text items to be added in bitmap. To begin i create a bitmap by this </p><pre><code>Bitmap bitMapBuffer = Bitmap.createBitmap(containerWidth,50, Bitmap.Config.ARGB_8888);</code></pre><p>the problem is .. the above bitmap is fixed size.. so after a while whatever i write does not show up on bitmap. How can i make it work, i mean a kind of stretched bitmap type. I looked in <code>BitmapDrawable</code>, but i cannot pass a drawable to a canvas like this </p><pre><code>Canvas c1 = new Canvas(bitMapBuffer);</code></pre><p>How can i handle this scenario?</p>","260298","","321697","","2011-02-14 23:26:59","2012-09-19 19:59:54","Stretched bitmap in android","<android>","2","2","","",""
"4998175","1","","","2011-02-14 22:45:27","0","630","<p>Can someone please help me figure out how to perform an action when sms is received, is there a special method for it? Will it automatically be ran in the background? The only thing I know is that I need to use permission RECEIVE_SMS.</p>","616977","","","","","2011-02-15 00:47:38","how to perform an action in android when receive sms?","<android><sms><action><receive>","1","1","","",""
"4998176","1","7649849","","2011-02-14 22:45:29","4","878","<p>I'm just starting with Robolectric.  It seems to be working fine to mock most Android classes but when my class under test tries to create a DefaultHttpClient() it gets the dreaded ""Stub!"" error.</p><p>The class under test fails at this line:</p><pre><code>HttpClient httpclient = new DefaultHttpClient();</code></pre><p>even though the article at <a href=""http://robolectric.blogspot.com/2011/01/how-to-test-http-requests.html?showComment=1297722651278#c3540420071421225744"" rel=""nofollow"">http://robolectric.blogspot.com/2011/01/how-to-test-http-requests.html?showComment=1297722651278#c3540420071421225744</a> seems to suggest this should just work.</p><p>My test looks like this:</p><pre><code>@Beforepublic void setUp() throws Exception{  Robolectric.addPendingHttpResponse(200, ""OK"");  service = new CheckinService();}@Testpublic void testIt() throws IOException{  // Fails at HttpClient httpclient = new DefaultHttpClient()  service.doStuff(Robolectric.application,                  REG_ID,                  TEST_DOMAIN);}</code></pre><p>Any idea what I'm doing wrong?</p>","385983","","","","","2011-10-04 14:55:36","Anyone had success mocking HttpRequests with Robolectric?","<android><http><testing><mocking>","2","0","1","",""
"4998205","1","5030788","","2011-02-14 22:49:45","2","1856","<p>I'm a student and I am developing on Android 2.2 for a project. For my tests and app executions, I am using an HTC Desire HD (with Android 2.2).</p><p>I just want to create a composant (class) to take a picture with the mobile device. I have an Android class, which I use for the getOptimalPreviewSize() method (this method is in the ApiDemos 2.2). This method is used to fix this type of error :</p><pre><code>02-14 21:38:05.818: ERROR/AndroidRuntime(2884): java.lang.RuntimeException: Fail to connect to camera service02-14 21:38:05.818: ERROR/AndroidRuntime(2884):     at android.hardware.Camera.native_setup(Native Method)02-14 21:38:05.818: ERROR/AndroidRuntime(2884):     at android.hardware.Camera.&lt;init&gt;(Camera.java:118)02-14 21:38:05.818: ERROR/AndroidRuntime(2884):     at android.hardware.Camera.open(Camera.java:91)02-14 21:38:05.818: ERROR/AndroidRuntime(2884):     at com.example.android.apis.graphics.Preview.surfaceCreated(CameraPreview.java:69)02-14 21:38:05.818: ERROR/AndroidRuntime(2884):     at android.view.SurfaceView.updateWindow(SurfaceView.java:540)02-14 21:38:05.818: ERROR/AndroidRuntime(2884):     at android.view.SurfaceView.dispatchDraw(SurfaceView.java:339)02-14 21:38:05.818: ERROR/AndroidRuntime(2884):     at android.view.ViewGroup.drawChild(ViewGroup.java:1660)02-14 21:38:05.818: ERROR/AndroidRuntime(2884):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1389)02-14 21:38:05.818: ERROR/AndroidRuntime(2884):     at android.view.View.draw(View.java:6764)02-14 21:38:05.818: ERROR/AndroidRuntime(2884):     at android.widget.FrameLayout.draw(FrameLayout.java:352)02-14 21:38:05.818: ERROR/AndroidRuntime(2884):     at android.view.ViewGroup.drawChild(ViewGroup.java:1662)02-14 21:38:05.818: ERROR/AndroidRuntime(2884):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1389)02-14 21:38:05.818: ERROR/AndroidRuntime(2884):     at android.view.View.draw(View.java:6764)02-14 21:38:05.818: ERROR/AndroidRuntime(2884):     at android.widget.FrameLayout.draw(FrameLayout.java:352)02-14 21:38:05.818: ERROR/AndroidRuntime(2884):     at com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:1887)02-14 21:38:05.818: ERROR/AndroidRuntime(2884):     at android.view.ViewRoot.draw(ViewRoot.java:1422)02-14 21:38:05.818: ERROR/AndroidRuntime(2884):     at android.view.ViewRoot.performTraversals(ViewRoot.java:1167)02-14 21:38:05.818: ERROR/AndroidRuntime(2884):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1744)02-14 21:38:05.818: ERROR/AndroidRuntime(2884):     at android.os.Handler.dispatchMessage(Handler.java:99)02-14 21:38:05.818: ERROR/AndroidRuntime(2884):     at android.os.Looper.loop(Looper.java:143)02-14 21:38:05.818: ERROR/AndroidRuntime(2884):     at android.app.ActivityThread.main(ActivityThread.java:5068)02-14 21:38:05.818: ERROR/AndroidRuntime(2884):     at java.lang.reflect.Method.invokeNative(Native Method)02-14 21:38:05.818: ERROR/AndroidRuntime(2884):     at java.lang.reflect.Method.invoke(Method.java:521)02-14 21:38:05.818: ERROR/AndroidRuntime(2884):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)02-14 21:38:05.818: ERROR/AndroidRuntime(2884):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)02-14 21:38:05.818: ERROR/AndroidRuntime(2884):     at dalvik.system.NativeStart.main(Native Method)</code></pre><p>So, I fixed this problem with this code :</p><pre><code>public class CameraView extends Activity implements SurfaceHolder.Callback {private SurfaceView mSurfaceView = null;private SurfaceHolder mSurfaceHolder = null;private Camera mCamera = null;private boolean mPreviewRunning = false;    public void onCreate(Bundle icicle) {    super.onCreate(icicle);    getWindow().setFormat(PixelFormat.TRANSLUCENT);    //requestWindowFeature(Window.FEATURE_NO_TITLE);    getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,            WindowManager.LayoutParams.FLAG_FULLSCREEN);    setContentView(R.layout.camera_surface);    mSurfaceView = (SurfaceView) findViewById(R.id.surface_camera);    mSurfaceHolder = mSurfaceView.getHolder();    mSurfaceHolder.addCallback(this);    mSurfaceHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);    if (!(android.os.Environment.getExternalStorageState().equals(            android.os.Environment.MEDIA_MOUNTED)))     {        Toast        .makeText(CameraView.this, R.string.msgNoSdCard, Toast.LENGTH_LONG)        .show();    }    else    {        Toast        .makeText(CameraView.this, R.string.msgPressBackBt, Toast.LENGTH_LONG)        .show();    }}@Overridepublic void surfaceCreated(SurfaceHolder holder) {    // TODO Auto-generated method stub    mCamera = Camera.open();     try {           mCamera.setPreviewDisplay(holder);        } catch (IOException exception) {            mCamera.release();            mCamera = null;            // TODO: add more exception handling logic here        }}@Overridepublic void surfaceDestroyed(SurfaceHolder holder) {    mCamera.stopPreview();    mPreviewRunning = false;    mCamera.release();}@Overridepublic boolean onKeyDown(int keyCode, KeyEvent event) {    //Handle the back button    if ((keyCode == KeyEvent.KEYCODE_DPAD_CENTER) || (keyCode == KeyEvent.KEYCODE_CAMERA)){        mCamera.takePicture(shutterCallback, rawCallback, jpegCallback);        return true;    }    else {        return super.onKeyDown(keyCode, event);    }}ShutterCallback shutterCallback = new ShutterCallback() {           public void onShutter() {                           }   };  /** Handles data for raw picture */ PictureCallback rawCallback = new PictureCallback() {           public void onPictureTaken(byte[] data, Camera camera) {                                }   };/** Handles data for jpeg picture */    PictureCallback jpegCallback = new PictureCallback() {          public void onPictureTaken(byte[] data, Camera camera) {                    FileOutputStream outStream = null;                  try {                           // write to local sandbox file system                           //outStream =                           //CameraView.this.openFileOutput(String.format(""%d.jpg"",                            //System.currentTimeMillis()), 0);                          // Or write to sdcard                           long fileName = System.currentTimeMillis();            outStream = new FileOutputStream(String.format(                                         ""/sdcard/%d.jpg"", fileName));                           outStream.write(data);                          outStream.close();                          Intent resultIntent = new Intent();                 String imageFileName = String.format(""/sdcard/%d.jpg"", fileName);            resultIntent.putExtra(""MyAvatar"", imageFileName);            setResult(Activity.RESULT_OK, resultIntent);        } catch (FileNotFoundException e) {                         e.printStackTrace();                    }         catch (IOException e) {                         e.printStackTrace();                    }         finally {                   }                   }   };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;    // Try to find an size match aspect ratio and size    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);        }    }    // Cannot find the one match the aspect ratio, ignore the requirement    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;}@Overridepublic 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();    List&lt;Size&gt; sizes = parameters.getSupportedPreviewSizes();    Size optimalSize = getOptimalPreviewSize(sizes, w, h);    parameters.setPreviewSize(optimalSize.width, optimalSize.height);    mCamera.setParameters(parameters);    mCamera.startPreview();}}</code></pre><p>The final problem is :  if the device is displaying the Camera View, the device is totally disoriented. If I point the camera to the top of a room (the scene which is filmed), the screen goes to the left, if I put the Camera to the ground, the screen goes the right. There is the same problem with landscape screen with wrong height and width and Camera Orientation.</p><p>Is there a solution to fix this problem of Camera API with the HTC Desire HD ?</p><p>Thanks,</p><p>Related links :</p><p><a href=""http://stackoverflow.com/questions/4557824/android-2-2-sdk-setparameters-failed-for-camera-api-on-nexus-one"">Android 2.2 SDK - setParameters failed for Camera API on Nexus One</a></p><p><a href=""http://code.google.com/p/android/issues/detail?id=7909"" rel=""nofollow"">http://code.google.com/p/android/issues/detail?id=7909</a></p>","616982","","219883","","2011-11-15 16:08:57","2011-11-15 16:08:57","HTC Desire HD not accepts setParameter() with hardware.Camera","<android><orientation><android-camera>","3","1","2","",""
"4998341","1","","","2011-02-14 23:04:35","8","2525","<p>I have an Android app that uses the license checking API. I've set up emulator AVDs with the Google APIs for API levels 8, 9, and 10. My app works fine with the level 8 AVD but fails miserably with the level 9 and 10 AVDs. Here is a typical logcat sequence:</p><pre><code>02-14 17:43:55.815: INFO/LicenseChecker(448): Binding to licensing service.02-14 17:43:55.935: WARN/ActivityManager(65): Unable to start service Intent { act=com.android.vending.licensing.ILicensingService }: not found02-14 17:43:55.935: ERROR/LicenseChecker(448): Could not bind to service.02-14 17:44:00.625: INFO/ActivityManager(65): Displayed com.zigzagworld.tehillim/.Tehillim: +2m1s448ms (total +5m43s546ms)02-14 17:44:01.085: INFO/ARMAssembler(65): generated scanline__00000177:03515104_00001002_00000000 [ 87 ipp] (110 ins) at [0x439de6f0:0x439de8a8] in 5603158 ns02-14 17:44:18.025: INFO/InputReader(65): Device reconfigured: id=0x0, name=qwerty, display size is now 320x48002-14 17:44:18.025: WARN/InputReader(65):   Touch device did not report support for X or Y axis!02-14 17:44:19.005: WARN/InputManagerService(65): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@4094558002-14 17:44:20.805: ERROR/ActivityThread(448): Activity com.zigzagworld.tehillim.Tehillim has leaked ServiceConnection com.android.vending.licensing.LicenseChecker@4051ba58 that was originally bound here02-14 17:44:20.805: ERROR/ActivityThread(448): android.app.ServiceConnectionLeaked: Activity com.zigzagworld.tehillim.Tehillim has leaked ServiceConnection com.android.vending.licensing.LicenseChecker@4051ba58 that was originally bound here02-14 17:44:20.805: ERROR/ActivityThread(448):     at android.app.LoadedApk$ServiceDispatcher.&lt;init&gt;(LoadedApk.java:938)02-14 17:44:20.805: ERROR/ActivityThread(448):     at android.app.LoadedApk.getServiceDispatcher(LoadedApk.java:833)02-14 17:44:20.805: ERROR/ActivityThread(448):     at android.app.ContextImpl.bindService(ContextImpl.java:864)02-14 17:44:20.805: ERROR/ActivityThread(448):     at android.content.ContextWrapper.bindService(ContextWrapper.java:347)02-14 17:44:20.805: ERROR/ActivityThread(448):     at com.android.vending.licensing.LicenseChecker.checkAccess(LicenseChecker.java:143)02-14 17:44:20.805: ERROR/ActivityThread(448):     at com.zigzagworld.tehillim.Tehillim.onCreate(Tehillim.java:76)02-14 17:44:20.805: ERROR/ActivityThread(448):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)02-14 17:44:20.805: ERROR/ActivityThread(448):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1586)02-14 17:44:20.805: ERROR/ActivityThread(448):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1638)02-14 17:44:20.805: ERROR/ActivityThread(448):     at android.app.ActivityThread.access$1500(ActivityThread.java:117)02-14 17:44:20.805: ERROR/ActivityThread(448):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:928)02-14 17:44:20.805: ERROR/ActivityThread(448):     at android.os.Handler.dispatchMessage(Handler.java:99)02-14 17:44:20.805: ERROR/ActivityThread(448):     at android.os.Looper.loop(Looper.java:123)02-14 17:44:20.805: ERROR/ActivityThread(448):     at android.app.ActivityThread.main(ActivityThread.java:3647)02-14 17:44:20.805: ERROR/ActivityThread(448):     at java.lang.reflect.Method.invokeNative(Native Method)02-14 17:44:20.805: ERROR/ActivityThread(448):     at java.lang.reflect.Method.invoke(Method.java:507)02-14 17:44:20.805: ERROR/ActivityThread(448):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)02-14 17:44:20.805: ERROR/ActivityThread(448):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)02-14 17:44:20.805: ERROR/ActivityThread(448):     at dalvik.system.NativeStart.main(Native Method)02-14 17:44:20.835: WARN/ActivityManager(65): Unbind failed: could not find connection for android.os.BinderProxy@40774fd0</code></pre><p>(I've verified that my test account is set up in all emulators and I've set up the developer console to return a response of LICENSED for the test account.) The error about leaking a connection occurs after I complete the <code>dontAllow()</code> processing in my <code>LicenseCheckerCallback</code>.</p><p>My code is pretty vanilla. I run the following in <code>onCreate()</code>:</p><pre><code>String deviceId = Secure.getString(getContentResolver(), Secure.ANDROID_ID);AESObfuscator ob = new AESObfuscator(SALT, getPackageName(), deviceId);LicenseChecker checker = new LicenseChecker(this,    new ServerManagedPolicy(this, ob), BASE64_PUBLIC_KEY);checker.checkAccess(this);</code></pre><p>Did something change in the licensing code after API 8? Has anyone else been able to test licensing in anything other than API 8?</p><p>Update: The same problem happens with the Market Licensing Sample app that Google supplies.</p>","535871","","199972","","2012-06-12 21:27:15","2012-07-04 10:27:05","Market licensing API on Android emulator issues","<android><android-emulator><licensing><google-api><google-play>","1","4","","",""
"4998389","1","4998496","","2011-02-14 23:09:46","3","3778","<p>I want to fill the area outside a rectangle on a canvas. I use </p><pre><code> canvas.drawRect(pTopLeft.x, pTopLeft.y, pBotRight.x, pBotRight.y, paint);</code></pre><p>to draw the rectangle, but can't figure out how to fill outside the rectangle/clip.</p><p>ThanksGeoff</p>","443445","","","","","2014-01-24 07:33:42","Fill canvas outside rectangle","<android><canvas>","4","0","","",""
"4998527","1","","","2011-02-14 23:28:04","8","4219","<p>I tried :</p><pre><code>process = Runtime.getRuntime().exec(""su -c cat /dev/graphics/fb0 &gt; /sdcard/frame.raw"");process.waitFor();</code></pre><p>but it doesn't work. My device is rooted.</p><p>I see many answers that it requires rooted access, but no actual code to get the framebuffer.</p><p>I also tried glReadPixels() but no luck.</p><pre><code>public void TakeScreen() {        DisplayMetrics dm = new DisplayMetrics();        getWindowManager().getDefaultDisplay().getMetrics(dm);        int width = dm.widthPixels;        int height = dm.heightPixels;        int screenshotSize = width * height;        ByteBuffer bb = ByteBuffer.allocateDirect(screenshotSize * 4);        bb.order(ByteOrder.nativeOrder());        gl.glReadPixels(0, 0, width, height, GL10.GL_RGBA,                GL10.GL_UNSIGNED_BYTE, bb);        int pixelsBuffer[] = new int[screenshotSize];        bb.asIntBuffer().get(pixelsBuffer);        bb = null;        Bitmap bitmap = Bitmap.createBitmap(width, height,                Bitmap.Config.RGB_565);        bitmap.setPixels(pixelsBuffer, screenshotSize - width, -width, 0, 0,                width, height);        pixelsBuffer = null;        short sBuffer[] = new short[screenshotSize];        ShortBuffer sb = ShortBuffer.wrap(sBuffer);        bitmap.copyPixelsToBuffer(sb);        for (int i = 0; i &lt; screenshotSize; ++i) {            short v = sBuffer[i];            sBuffer[i] = (short) (((v &amp; 0x1f) &lt;&lt; 11) | (v &amp; 0x7e0) | ((v &amp; 0xf800) &gt;&gt; 11));        }        sb.rewind();        bitmap.copyPixelsFromBuffer(sb);        saveBitmap(bitmap, ""/screenshots"", ""capturedImage"");    }</code></pre>","432056","","","","","2012-06-10 07:13:34","Android: How can you get framebuffer (screenshot) on rooted device?","<android><screenshot><framebuffer>","2","2","5","",""
"4998532","1","4998550","","2011-02-14 23:29:31","0","1500","<p>So I'm updating an app I created a while ago. In the AndroidManifest.xml I have the following (along with an <code>&lt;intent-filter&gt;</code> for <code>android.intent.action.MAIN</code>) inside an <code>&lt;activity&gt;</code>:</p><pre><code>&lt;intent-filter android:label=""@string/send_label"" android:icon=""@drawable/icon""&gt;    &lt;action android:name=""android.intent.action.SEND"" /&gt;    &lt;data android:mimeType=""text/plain"" /&gt;&lt;/intent-filter&gt;</code></pre><p>If I remember correctly, when I first created this app, the above (minus the <code>android:label</code> and <code>android:icon</code> bits) worked; my app would show up in the ""Share"" menu. A couple weeks ago I noticed a review of my app on the Market saying that it didn't show up when trying to Share stuff. I checked, and sure enough, it wasn't there.</p><p>Is the fact that I have two <code>&lt;intent-filter&gt;</code> blocks for one Activity confusing it? Did I break something between then and now, did something change in the Android API, or what's going on here?</p>","340743","","","","","2011-02-14 23:32:12","android.intent.action.SEND; doing it wrong?","<android><android-intent><android-manifest>","1","0","","",""
"4998533","1","7059840","","2011-02-14 23:29:35","10","5514","<p>Has anyone managed to get OpenGL ES 2.0 working in a live wallpaper?  I have a class that uses OpenGL ES 2.0 and runs fine as a Renderer for a GLSurfaceView.  However, I want it to function as a live wallpaper.  I found Robert Green's GLWallpaperService, but that is based on an older version of GLSurfaceView and does not support setEGLContextClientVersion, which is needed to run OpenGL ES 2.0.</p>","382157","","382157","","2011-02-14 23:41:12","2013-03-18 19:24:52","Android Live Wallpapers with OpenGL ES 2.0?","<java><android><opengl-es-2.0>","2","4","9","",""
"4998616","1","4999406","","2011-02-14 23:40:18","2","4083","<p>Can anyone explain to me why this error occures, or even better how do I handle it? I can not reproduce it. It is one of those errors that happends once out of a 1000.</p><p>Background: The user is trying to log in, a progress dialog is showing, a http request is sent in async task, the progress dialog is dissmissed. Error occures, app FC.</p><p>LoginActivity.java  </p><pre><code> 255:   private void dismissProgress() {   256:     if (mProgress != null) {   257:         mProgress.dismiss();   258:         mProgress = null;   259:     }   260:   }  java.lang.IllegalArgumentException: View not attached to window managerat android.view.WindowManagerImpl.findViewLocked(WindowManagerImpl.java:391)at android.view.WindowManagerImpl.removeView(WindowManagerImpl.java:236)at android.view.Window$LocalWindowManager.removeView(Window.java:432)at android.app.Dialog.dismissDialog(Dialog.java:278)at android.app.Dialog.access$000(Dialog.java:71)at android.app.Dialog$1.run(Dialog.java:111)at android.app.Dialog.dismiss(Dialog.java:268)at se.magpern.LoginActivity.dismissProgress(LoginActivity.java:257)at se.magpern.LoginActivity.access$5(LoginActivity.java:255)at se.magpern.LoginActivity$DoTheLogin.onPostExecute(LoginActivity.java:293)at se.magpern.LoginActivity$DoTheLogin.onPostExecute(LoginActivity.java:1)at android.os.AsyncTask.finish(AsyncTask.java:417)at android.os.AsyncTask.access$300(AsyncTask.java:127)at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:429)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>","513932","","345717","","2011-02-14 23:41:28","2011-02-15 02:34:55","IllegalArgumentException? Why?","<android>","2","2","0","",""
"4998648","1","","","2011-02-14 23:45:10","1","1468","<p><em>Hi,</em></p><p>I am patching the android platform. I have succaessfully included a prebuilt JAR in the build of the platform, and the classes load and work as expected.</p><p>My issue is that the JAR itself includes resource files and the clasess use them. This fails during runtime (ClassLoader.getResource() and ClassLoader.getResourceAsStream()). I've searched the web and found that Android allows resources only in package builds (.apk) and doesn't allow for JARs.</p><p>My question is: <strong>How can I bunlde the resources alongside the JAR? Can I create an APK build and use code inside of it like a JAR?</strong> I have all the source and resource files at hand.Currently I signify other platform projects to depend on my JAR with:</p><p>LOCAL_STATIC_JAVA_LIBRARIES := my-prebuilt-module-name</p><p>and this works. All left is bundling the resources too...</p><p><em>Thanks a lot</em></p>","287266","","","","","2011-02-15 00:56:29","Use resources from prebuilt JAR in android","<java><android><resources><build><jar>","1","0","1","",""
"4998737","1","4998886","","2011-02-15 00:02:07","2","2142","<p>Whenever I add something to the <code>SQLiteDatabase</code>, the <code>ListView</code> doesn't show it, but if I restart the app completely, it does. Here is my main .java:</p><pre><code>package com.gantt.shoppinglist;import android.app.Dialog;import android.app.ListActivity;import android.database.Cursor;import android.database.sqlite.SQLiteDatabase;import android.os.Bundle;import android.view.View;import android.view.View.OnClickListener;import android.widget.Button;import android.widget.EditText;import android.widget.ListView;import android.widget.SimpleCursorAdapter;public class ShoppingList extends ListActivity {    SimpleCursorAdapter adapter = null;    /** Called when the activity is first created. */    @Override    protected void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        final DataHelper dataHelper = new DataHelper(this);        ListView lv = (ListView) findViewById(android.R.id.list);        final SQLiteDatabase db = dataHelper.selectAll();        final Cursor c = db.rawQuery(""SELECT DISTINCT oid as _id,name FROM table1 ORDER BY name"", null);        if (c.moveToFirst()) {            String[] columnNames = new String[]{""name""};            int[] text1 = new int[]{android.R.id.text1};            adapter = new SimpleCursorAdapter(this, R.layout.rowlayout, c, columnNames, text1);        }        lv.setAdapter(adapter);        Button button1main = (Button) findViewById(R.id.add);        button1main.setOnClickListener(new OnClickListener()  {            @Override            public void onClick(View v)  {            final Dialog additem = new Dialog(ShoppingList.this);            additem.setContentView(R.layout.maindialog);            final EditText et = (EditText)additem.findViewById(R.id.edittext);            additem.setTitle(""Type your item"");            additem.setCancelable(true);            et.setHint(""Type the name of an item..."");            Button button = (Button) additem.findViewById(R.id.cancel);            button.setOnClickListener(new OnClickListener()  {                @Override                public void onClick(View v)  {                    additem.dismiss();                }            });            additem.show();            Button ok = (Button) additem.findViewById(R.id.ok);            ok.setOnClickListener(new OnClickListener() {                @Override                public void onClick(View v) {                    addItems();                }                private void addItems() {                    String item = et.getText().toString();                    dataHelper.insert(item);                    c.requery();                    db.close();                    additem.dismiss();                    et.setText("""");                }            });       }        });    }}</code></pre><p>My DataHelper class:</p><pre><code>package com.gantt.shoppinglist;import java.util.ArrayList;import java.util.List;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;public class DataHelper {       public static final String DATABASE_NAME = ""items.db"";       public static final int DATABASE_VERSION = 1;       public static final String TABLE_NAME = ""table1"";       public static final String KEY_ROWID = ""_id"";       private Context context;       private SQLiteDatabase db;       private SQLiteStatement insertStmt;       private static final String INSERT = ""insert into ""           + TABLE_NAME + ""(name) values (?)"";       public DataHelper(Context context) {          this.context = context;          OpenHelper openHelper = new OpenHelper(this.context);          this.db = openHelper.getWritableDatabase();          this.insertStmt = this.db.compileStatement(INSERT);       }       public long insert(String name) {          this.insertStmt.bindString(1, name);          return this.insertStmt.executeInsert();       }       public void deleteAll() {          this.db.delete(TABLE_NAME, null, null);       }       public SQLiteDatabase selectAll() {          List&lt;String&gt; list = new ArrayList&lt;String&gt;();          Cursor cursor = this.db.query(TABLE_NAME, new String[] { ""name"" },             null, null, null, null, ""name desc"");          if (cursor.moveToFirst()) {             do {                list.add(cursor.getString(0));              } while (cursor.moveToNext());          }          if (cursor != null &amp;&amp; !cursor.isClosed()) {             cursor.close();          }          return db;       }       public static String getDatabaseName() {        return DATABASE_NAME;    }    private static class OpenHelper extends SQLiteOpenHelper {          OpenHelper(Context context) {             super(context, getDatabaseName(), null, DATABASE_VERSION);          }          @Override          public void onCreate(SQLiteDatabase db) {              db.execSQL(""CREATE TABLE "" + TABLE_NAME + ""(id INTEGER PRIMARY KEY, name TEXT"");          }          @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 "" + TABLE_NAME);             onCreate(db);          }       }    }</code></pre>","560096","","560096","","2011-02-15 01:49:26","2011-04-28 03:21:21","ListView doesn't Refresh Upon Addition to SQLiteDatabase","<android><sqlite><listview><cursor><simplecursoradapter>","2","1","1","",""
"4998766","1","","","2011-02-15 00:07:26","1","1631","<p>I am doing md-5 hashing in both android and c# at the same time. But both the results should be the same for the same inputs. Is there any difference in the way its done in both the languages?</p><p>I get different outputs in both the cases. Here is the c# code for md-5 calculation:</p><pre><code>//this method hashes the values sent to it using MD5public static String hashwithmd5(String toHashMD5){    byte[] keyArray;    MD5CryptoServiceProvider hashmd5 = new MD5CryptoServiceProvider();    keyArray = hashmd5.ComputeHash(UTF8Encoding.UTF8.GetBytes(toHashMD5));    hashmd5.Clear();    return Convert.ToBase64String(keyArray, 0, keyArray.Length); }</code></pre><p>and here is the code for md5 in android using bouncycastle</p><pre><code>public byte[] Hashing(String toHash) throws Exception{    byte[] hashBytes = toHash.getBytes(""UTF-8"");    EditText et = (EditText) findViewById(R.id.entry);    org.bouncycastle.crypto.digests.MD5Digest digest = new org.bouncycastle.crypto.digests.MD5Digest();    digest.reset();    digest.update(hashBytes, 0, hashBytes.length);    int length = digest.getDigestSize();    byte[] md5 = new byte[length];    digest.doFinal(md5, 0);    et.setText(md5.toString());    return md5;}</code></pre><p>the result of md5 in c# is :XUFAKrxLKna5cZ2REBfFkg==</p><p>the result of md5 in android is :[B@4053cf40</p>","600910","","47589","","2011-02-15 00:14:13","2011-02-15 12:45:11","comparing md5 hashing in android(java) and c#","<c#><android><hash><md5>","4","3","1","",""
"4998782","1","5032852","","2011-02-15 00:08:46","2","768","<p>Hola!  This is my first post.  I'm having trouble with the codesnippet below.</p><p>Basically, you click an EditText and you're presented with a filebrowser.  If you choose a file all is right with the world.  If youchoose the back/return button on your phone without choosing a file aforce close is caused.  I think this is because I'm returning a nullfrom the intent, but I do not know how to fix nor what I should try/catch.</p><p>Your help is greatly appreciated.</p><p>Code:</p><pre><code>   filename = (EditText) findViewById(R.id.selectFile);   filename.setOnClickListener(new View.OnClickListener() {       public void onClick(View v) {           Intent intent = new Intent();           intent.addCategory(Intent.CATEGORY_OPENABLE);           intent.setType(""text/csv"");           intent.setAction(Intent.ACTION_GET_CONTENT);           startActivityForResult(Intent.createChooser(intent,""Select File""),1);       }   });</code></pre><p>The result from LogCat.</p><p>02-15 10:03:27.224: DEBUG/dalvikvm(133): GC_EXPLICIT freed 74K, 52% free 2860K/5895K, external 2101K/2456K, paused 69ms02-15 10:03:30.314: INFO/ActivityManager(61): Starting: Intent { cmp=com.aydabtu.BroadcastSMS/.DataManagerActivity } from pid 55702-15 10:03:30.483: DEBUG/dalvikvm(557): GC_EXTERNAL_ALLOC freed 228K, 52% free 2656K/5511K, external 1465K/1828K, paused 63ms02-15 10:03:30.633: WARN/AdMobSDK(557): Ignoring requestFreshAd() because we are requesting an ad right now already.02-15 10:03:30.643: INFO/AdMobSDK(557): Location information is not being used for ad requests. Enable location02-15 10:03:30.643: INFO/AdMobSDK(557): based ads with AdManager.setAllowUseOfLocation(true) or by setting 02-15 10:03:30.643: INFO/AdMobSDK(557): meta-data ADMOB_ALLOW_LOCATION_FOR_ADS to true in AndroidManifest.xml02-15 10:03:30.653: INFO/AdMobSDK(557): Making ad request in test mode02-15 10:03:31.104: INFO/AdMobSDK(557): Ad returned (493 ms):  AdMob Test Android Web Ad02-15 10:03:31.224: INFO/ActivityManager(61): Displayed com.aydabtu.BroadcastSMS/.DataManagerActivity: +855ms02-15 10:03:33.903: INFO/ActivityManager(61): Starting: Intent { act=android.intent.action.CHOOSER cmp=android/com.android.internal.app.ChooserActivity (has extras) } from pid 55702-15 10:03:34.254: DEBUG/dalvikvm(122): GC_EXTERNAL_ALLOC freed 20K, 44% free 3456K/6151K, external 2546K/2586K, paused 143ms02-15 10:03:35.124: INFO/ActivityManager(61): Displayed android/com.android.internal.app.ChooserActivity: +1s111ms02-15 10:03:36.064: DEBUG/dalvikvm(61): GC_CONCURRENT freed 959K, 47% free 4099K/7687K, external 2440K/3047K, paused 7ms+19ms02-15 10:03:40.623: WARN/KeyCharacterMap(557): No keyboard for id 002-15 10:03:40.633: WARN/KeyCharacterMap(557): Using default keymap: /system/usr/keychars/qwerty.kcm.bin02-15 10:03:40.864: DEBUG/AndroidRuntime(557): Shutting down VM02-15 10:03:40.864: WARN/dalvikvm(557): threadid=1: thread exiting with uncaught exception (group=0x40015560)02-15 10:03:40.953: ERROR/AndroidRuntime(557): FATAL EXCEPTION: main02-15 10:03:40.953: ERROR/AndroidRuntime(557): java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=1, result=0, data=null} to activity {com.aydabtu.BroadcastSMS/com.aydabtu.BroadcastSMS.DataManagerActivity}: java.lang.NullPointerException02-15 10:03:40.953: ERROR/AndroidRuntime(557):     at android.app.ActivityThread.deliverResults(ActivityThread.java:2496)02-15 10:03:40.953: ERROR/AndroidRuntime(557):     at android.app.ActivityThread.handleSendResult(ActivityThread.java:2538)02-15 10:03:40.953: ERROR/AndroidRuntime(557):     at android.app.ActivityThread.access$2000(ActivityThread.java:117)02-15 10:03:40.953: ERROR/AndroidRuntime(557):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:958)02-15 10:03:40.953: ERROR/AndroidRuntime(557):     at android.os.Handler.dispatchMessage(Handler.java:99)02-15 10:03:40.953: ERROR/AndroidRuntime(557):     at android.os.Looper.loop(Looper.java:123)02-15 10:03:40.953: ERROR/AndroidRuntime(557):     at android.app.ActivityThread.main(ActivityThread.java:3647)02-15 10:03:40.953: ERROR/AndroidRuntime(557):     at java.lang.reflect.Method.invokeNative(Native Method)02-15 10:03:40.953: ERROR/AndroidRuntime(557):     at java.lang.reflect.Method.invoke(Method.java:507)02-15 10:03:40.953: ERROR/AndroidRuntime(557):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)02-15 10:03:40.953: ERROR/AndroidRuntime(557):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)02-15 10:03:40.953: ERROR/AndroidRuntime(557):     at dalvik.system.NativeStart.main(Native Method)02-15 10:03:40.953: ERROR/AndroidRuntime(557): Caused by: java.lang.NullPointerException02-15 10:03:40.953: ERROR/AndroidRuntime(557):     at com.aydabtu.BroadcastSMS.DataManagerActivity.onActivityResult(DataManagerActivity.java:93)02-15 10:03:40.953: ERROR/AndroidRuntime(557):     at android.app.Activity.dispatchActivityResult(Activity.java:3907)02-15 10:03:40.953: ERROR/AndroidRuntime(557):     at android.app.ActivityThread.deliverResults(ActivityThread.java:2492)02-15 10:03:40.953: ERROR/AndroidRuntime(557):     ... 11 more02-15 10:03:41.733: WARN/ActivityManager(61):   Force finishing activity com.aydabtu.BroadcastSMS/.DataManagerActivity02-15 10:03:42.244: WARN/ActivityManager(61): Activity pause timeout for HistoryRecord{406cdfd8 com.aydabtu.BroadcastSMS/.DataManagerActivity}02-15 10:03:44.084: INFO/Process(557): Sending signal. PID: 557 SIG: 902-15 10:03:44.104: INFO/ActivityManager(61): Process com.aydabtu.BroadcastSMS (pid 557) has died.02-15 10:03:44.124: ERROR/InputDispatcher(61): channel '406c91a0 com.aydabtu.BroadcastSMS/com.aydabtu.BroadcastSMS.BroadcastSMS (server)' ~ Consumer closed input channel or an error occurred.  events=0x802-15 10:03:44.124: ERROR/InputDispatcher(61): channel '406c91a0 com.aydabtu.BroadcastSMS/com.aydabtu.BroadcastSMS.BroadcastSMS (server)' ~ Channel is unrecoverably broken and will be disposed!02-15 10:03:44.154: INFO/WindowManager(61): WIN DEATH: Window{406c91a0 com.aydabtu.BroadcastSMS/com.aydabtu.BroadcastSMS.BroadcastSMS paused=false}02-15 10:03:44.274: INFO/WindowManager(61): WIN DEATH: Window{406e5f80 com.aydabtu.BroadcastSMS/com.aydabtu.BroadcastSMS.DataManagerActivity paused=false}02-15 10:03:44.383: INFO/WindowManager(61): WIN DEATH: Window{406c4d58 android/com.android.internal.app.ChooserActivity paused=false}02-15 10:03:44.423: ERROR/InputDispatcher(61): Received spurious receive callback for unknown input channel.  fd=165, events=0x802-15 10:03:44.423: ERROR/InputDispatcher(61): Received spurious receive callback for unknown input channel.  fd=176, events=0x802-15 10:03:45.084: WARN/InputManagerService(61): Got RemoteException sending setActive(false) notification to pid 557 uid 10032</p><p>I think I have this fixed.  Thank you for the clues.</p>","617044","","617044","","2011-02-15 10:17:42","2011-02-17 18:13:21","Force close on Intent null return","<android>","1","3","","",""
"4999056","1","","","2011-02-15 01:13:40","0","1078","<p>For my Android app, I want to load a full web page in the background, then when it is ready show it in a full-screen view.  In other words, I want to show a fully-loaded web page without having the user sit through a ""loading"" screen.  Furthermore, I want to wait an arbitrary time, and not just show the page as soon as it's loaded.</p><p>It seems like the only way to show a full-screen web view is with a new Activity, but how do I pass the contents of the web page to the new Activity?  I tried calling <em>WebView.savePicture()</em> on a hidden webview then passing the results to a new Activity, but it seems like it won't save a picture unless it's actually visible.</p><p>Thoughts?</p>","482584","","","","","2011-02-15 01:44:19","Android: Pre-loading web page, then showing full screen","<android><html><webview>","2","0","","",""
"4999079","1","4999104","","2011-02-15 01:20:58","1","361","<p>I am currently developing an Android app where I need to do some action when the browser is launched. </p><p>What I want is that when the user launches the android browser on their phone my App creates a notification to allow them to launch my app.</p><p>How can I check to see if the browser has been opened. I assume I would need to have some sort of background service. </p><p>Thanks for the help</p>","499448","","","","","2012-01-30 18:23:41","Check when user has launched android browser","<android>","2","2","","",""
"4999131","1","4999372","","2011-02-15 01:33:01","11","8329","<p>I have a series of EditText entries and would like it so when the user hits the enter key it will go to the next Editext.  I know how do this one at a time but is there a way to tell all of the edittext controls to use the same function that checks the key entry and advances the cursor.  It seems kind of crazy to have one function for each of the EditTexts</p>","528130","","114066","","2012-02-22 08:20:46","2012-02-22 08:20:46","Android edittext key return goes to next text","<android><key><edittext>","2","1","6","",""
"4999196","1","4999250","","2011-02-15 01:47:46","0","251","<p>I want to see if it's possible to interfere with the ""pre-flash"" (the flickering the flash does prior to actually FLASHing with the photo), on the Tab.  The default camera app doesn't offer such a feature, and I wouldn't be surprised if there was no way to disable that functionality, but I'd like to see the API just in case it is possible. Does anyone know where/if Samsung (or Google) publishes its Tab specific API?</p>","59947","","","","","2011-02-15 01:58:41","Where do I find the Galaxy Tab specific Camera API documentation?","<android>","1","0","","",""
"4999204","1","","","2011-02-15 01:49:21","0","495","<p>I want to test some apps on Nexus S devices,can I access the devices remote or get some emulator image for it?</p><p>for the GALAXY Tab, I could get it at <a href=""http://innovator.samsungmobile.com/galaxyTab.do"" rel=""nofollow"">http://innovator.samsungmobile.com/galaxyTab.do</a> , but seems neither Samsung nor Google provides the actual info on Nexus S</p>","539982","","","","","2011-02-15 02:15:37","Where can I get a emulator image or binary info of NexusS?","<android><android-emulator><nexus-s>","2","0","","",""
"4999382","1","","","2011-02-15 02:29:48","3","2907","<p>I did search but I could not find an answer; When interpreting android accelerometer values, how can one translate these values into real world phone translation along X/Y/Z axes?</p><p>I hope it makes sense - I just can't get a grip on exactly how do we get rid of gravity? Do we need to?</p><p>I was thinking if we take the magnitude of the 3D vector that is returned by accelerometer - it would be 9.8 or greater, and then we subtract gravity to get the actual acceleration magnitude. But then would the vector returned by the accelerometer event be inaccurate due to motion of the phone + direction of gravity distributed across all 3 axes...</p><p>Please help!</p><p>Thanks</p>","355516","","355516","","2011-11-13 04:14:59","2011-11-13 04:14:59","Interpret android accelerometer values to get phone's translation along axes in real world","<java><android><accelerometer><direction><acceleration>","1","0","","",""
"4999566","1","","","2011-02-15 03:13:23","0","516","<p>This is the craziest issue.  I am loading custom icons from the assets directory for use with my application.  The application loads the custom icon and makes a shortcut on the desktop.  All of the icons are 48x48 png files.</p><p>On the Android 2.1 and 2.2 emulator this works perfect.  On the Droid X (Android 2.2) the icons show up smaller than 48x48.</p><p>Now for the kicker, if I move one of the icons to the drawable directory and load it from there it shows up correctly.</p><p>Any ideas what the problem could be with the droid x?</p><p>Is there any way to get a list of all drawables?  If there is I could just put all my icons in the drawables directory, albeit a little ugly to dump 100 icons in there.</p><p>My code for loading the icons is pretty standard:</p><pre><code>        AssetManager assets = context.getAssets();        InputStream inputStream = assets.open(""icons/""+ name);        if (inputStream != null)        {            Bitmap bitmap = BitmapFactory.decodeStream(inputStream);            if (bitmap != null)            {                return bitmap;            }        }</code></pre>","242904","","","","","2012-05-25 07:26:18","Shortcut icon too small from assets directory","<android>","2","0","","",""
"4999574","1","","","2011-02-15 03:15:22","1","348","<p>My Requirement is to manage the applications operations(install, update, remove) happens in any android device in the cloud. I could get the list all installed app in my deice through PackageManager Class. Also i am able to notified whenever any operations takes place in my device through intents filters like 'ACTION_PACKAGE_ADDED' through BroadCastRecievers. But i am unable get the app information (like name and others stuff) whenever any app installed and updates. I could get only notifications like installation.. update..removal.. not the details abut the app has been installed..updated..</p><p>Please help me out in regarding this...</p><p>Thanks in advance..</p><p>Regards Prakhs</p>","557012","","","","","2011-02-15 04:13:22","Name of the App installed","<android>","1","0","","",""
"4999647","1","4999726","","2011-02-15 03:32:33","0","748","<p>I am confused with the appropriate layout design to be used for grid of buttons. I want to display a ""textview and EditText"" at the top. Below that there should be a 3*4 grid/matrix of 12 buttons(like cell phone keys), following another three linear buttons at the bottom of the root layout. (upper layout should not overlap the bottom buttons).</p><p>It would be of great help if anybody guide me in this regard.</p>","564844","","","","","2011-02-15 03:50:54","Suitable layout for grid of buttons in android","<android>","1","0","","",""
"4999693","1","4999819","","2011-02-15 03:44:14","7","2103","<ol><li>Is it a good programming practice to call <code>invalidate()</code> inside <code>onDraw()</code>?</li></ol><p>As per my understanding, calling <code>invalidate()</code> inside <code>onDraw()</code> is expensive and is not required if there is no change to the canvas.</p><ol><li>Is <code>invalidate()</code> equivalent to an asynchronous version of <code>onDraw()</code>?</li></ol><p>As per my understanding, they are equivalent. Correct me if I am wrong. Thank you.</p>","605983","","421372","","2012-11-22 06:40:58","2012-11-22 06:43:02","Is it a good programming practice to call invalidate() inside onDraw()?","<android><ondraw>","1","0","1","",""
"4999708","1","4999987","","2011-02-15 03:47:42","12","4097","<p>I have an application that has a thread pool (ThreadPoolExecutor) that is handed tasks that each perform a HttpGet operation and read the InputStream into a byte[] to do something with.</p><p>After reading the HttpClient docs I came away with the impression that the best way to manage HttpClient connections across multiple threads is to create a single ThreadSafeClientConnManager and share it through out the application.</p><p>After implementing this, I am noticing that even after all of the tasks are completed there is still a significant amount of memory still being used by the ThreadSafeClientConnManager.</p><p>Looking at the heap dump, this memory is in the form of byte[] arrays.   These are not being held by any references that I created.  They are being held by pieces of the ThreadSafeClientConnManager and its pool.  I am not sure if they are related to the InputStreams or if they are something else.</p><p>All of the tasks themselves and their variables are successfully garbage collected.</p><p>If I call getConnectionManager().shutdown() on the ThreadSafeClientConnManager then all of the memory is freed just fine.  However, I do not want to have to shutdown the connection, because these HttpGet tasks could happen at anytime.  I would like to leave it open during the duration of the applications life.</p><p>As the HttpGet tasks run, the memory being held grows more and more and can eventually lead to out of memory errors.  When the tasks complete, the memory is not released.</p><p>How can I ensure the memory is released after the task that was using it is finished?</p><p>Here is the code I am using.  It is pieced together as best as I code from the HttpClient docs, other questions here on SO and online.</p><p>The creation of the HttpClient:</p><pre><code>// Create and initialize HTTP parametersHttpParams params = new BasicHttpParams();HttpConnectionParams.setConnectionTimeout(params, 40 * 1000);HttpConnectionParams.setSoTimeout(params, 40 * 1000);ConnManagerParams.setMaxTotalConnections(params, 100);HttpProtocolParams.setVersion(params, HttpVersion.HTTP_1_1);// Create and initialize scheme registry SchemeRegistry schemeRegistry = new SchemeRegistry();schemeRegistry.register( new Scheme(""http"", PlainSocketFactory.getSocketFactory(), 80));schemeRegistry.register(new Scheme(""https"", SSLSocketFactory.getSocketFactory(), 443));// Create an HttpClient with the ThreadSafeClientConnManager.// This connection manager must be used if more than one thread will// be using the HttpClient.ClientConnectionManager cm = new ThreadSafeClientConnManager(params, schemeRegistry);mHttpClient = new DefaultHttpClient(cm, params);</code></pre><p>Then, the Runnable that performs the HttpGet is pretty much based exactly on the example from the <a href=""http://hc.apache.org/httpcomponents-client-ga/examples.html"">HttpClient examples</a> for <a href=""http://hc.apache.org/httpcomponents-client-ga/httpclient/examples/org/apache/http/examples/client/ClientConnectionRelease.java"">Manual connection release</a>.  Here is an example of what it looks like:</p><pre><code>HttpClient httpclient = getTheSharedThreadSafeClientConnManager(); // Would return the mHttpClient from above    try {        HttpGet httpget = new HttpGet(""http://www.apache.org/"");        // Execute HTTP request        System.out.println(""executing request "" + httpget.getURI());        HttpResponse response = httpclient.execute(httpget);        System.out.println(""----------------------------------------"");        System.out.println(response.getStatusLine());        System.out.println(""----------------------------------------"");        // Get hold of the response entity        HttpEntity entity = response.getEntity();        // If the response does not enclose an entity, there is no need        // to bother about connection release        if (entity != null) {            InputStream instream = entity.getContent();            try {                instream.read();                // do something useful with the response            } catch (IOException ex) {                // In case of an IOException the connection will be released                // back to the connection manager automatically                throw ex;            } catch (RuntimeException ex) {                // In case of an unexpected exception you may want to abort                // the HTTP request in order to shut down the underlying                // connection immediately.                httpget.abort();                throw ex;            } finally {                // Closing the input stream will trigger connection release                try { instream.close(); } catch (Exception ignore) {}            }        }    }</code></pre><p>Is there more you have to do to release the resources per task?  I saw in their ThreadSafeClientConnManager example they used a HttpContext, but I can't find any documentation on how to use it.  Is that required?  If so how do you use it with a ThreadPoolExecutor?</p><p>Thanks so much.</p>","445348","","","","","2011-02-15 10:11:01","HttpClient memory management","<java><android><memory-leaks><httpclient><threadpool>","3","0","7","",""
"4999716","1","","","2011-02-15 03:48:57","0","857","<pre><code>I use the Mediastore in my application for capturing the video, But it will capture only 8 or 14 seconds ,based on encoder.Is there is any other way to increase the duration and size of video.</code></pre><p>Thanks</p>","555806","","","","","2011-09-10 06:12:38","Whether this property android.provider.MediaStore.EXTRA_SIZE_LIMIT is valid or not?","<android><video><video-capture>","1","0","","",""
"4999760","1","5054401","","2011-02-15 04:04:05","0","534","<p>I have a TV Guide activity which extends TabActivity. The tabs are labelled (example)...</p><pre><code>Today|Wed|Thu|Fri|Sat|Sun|Mon</code></pre><p>The TabHost.TabSpec content of each is set to another activity (GuideListActivity) which extends ListActivity like so...</p><pre><code>private void AddGuideTab(String tag, String indicator, String startDate, String endDate) {    Intent intent = new Intent().setClass(this, GuideListActivity.class);    // Set other Intent stuff    TabHost.TabSpec spec = tabHost.newTabSpec(tag).setIndicator(indicator).setContent(intent);    tabHost.addTab(spec);}</code></pre><p>This gives me a 7 day list of all the TV shows for one channel. All good so far.</p><p>The problem is how to cleanly recreate all of this when the user wants to view another channel's listings....</p><p>I have a button which the user can press which creates a popup 'channel selector' dialog. The dialog correctly returns the new channel name/number but I can't figure out how to either remove each TabSpec/GuideListActivity in order to start again nor tell the existing GuideListActivity that it needs to repopulate its ListView.</p><p>What am I missing? I seem to be going round in circles reading the docs.</p>","488241","","488241","","2011-02-15 04:31:54","2013-06-26 20:17:19","Force an activity in a TabSpec to update its view?","<android><android-tabhost>","2","1","","",""
"4999851","1","4999876","","2011-02-15 04:23:36","0","3006","<p>I'm trying to inflate an custom alertdialog and encountered something strange.</p><pre><code>layout = inflater.inflate(R.layout.call_or_sms_dialog,(ViewGroup)findViewById(R.id.contacts));</code></pre><p>The inflate() method takes 2 argument, the resource to be inflated and the optional view to be the parent of the generated dialog. My problem comes at the optional view part.</p><p>I can't find the id of the root view from findViewById(R.id.contacts). ""contacts"" is a xml file that contains the controls for this particular activity. I was able to reference some other xml file of other activities but just couldn't reference this contacts.xml.</p><p>I've tried doing the ""clean"" build on Eclipse and regenerating the R.java but still it does not help. Is there any way to manually generate the ID of ""contacts.xml"" instead?</p>","584187","","244296","","2011-02-15 04:32:13","2011-06-25 12:33:52","Can't find xml id while inflating view","<android><android-widget><android-layout><android-xml>","3","0","","",""
"4999874","1","4999938","","2011-02-15 04:29:36","1","438","<p>hai i want to rotate an image back and forth. But now it is happening only one side.After the image reach the destination suddenly it will come back to its original position.I am using animation for rotation. Somebody help me to do this. </p>","607853","","","","","2011-02-15 04:40:38","how to rotate an image back and forth in android","<android>","1","1","","",""
"4999913","1","","","2011-02-15 04:36:49","1","164","<pre><code>EditText userName = (EditText) findViewById(R.id.EditText01);EditText passWord = (EditText) findViewById(R.id.EditText02);String user=userName.getEditableText().toString();String pass=passWord.getEditableText().toString();</code></pre><p>what to do after this?</p>","617213","","348301","","2011-02-15 05:41:58","2011-11-22 09:43:35","I have created a login page. How to send these login parameters over to the server for validation and get the result back?","<android>","2","1","","",""
"4999936","1","5012576","","2011-02-15 04:40:15","0","938","<p>I have an activity group which contains 2 activities. From first activity I goto the 2nd. I have a close button inside my 2nd activity. When I do a close over there, I should close that 2nd activity and the first activity should come with the data which it had earlier. That means I cant call intent to the 1st activity while doing close. Because then the data in 1st activity will change. How can I do this?</p>","504162","","","","","2011-02-16 04:38:04","how to close an activity inside activity group?","<android>","1","0","","",""
"4999980","1","5000025","","2011-02-15 04:48:11","0","882","<p>hii begginer of android programming. i want a new about basic to create ListView. How many methos to use the create ListView. </p>","609209","","","","","2013-05-29 05:45:40","how to create listview in android? how many methods?","<android>","3","0","","",""
"4999991","1","5000058","","2011-02-15 04:49:56","41","36512","<p>What is a <a href=""http://developer.android.com/reference/android/os/Bundle.html"" rel=""nofollow""><code>bundle</code></a> in an Android application? When to use it?</p>","475349","","2668136","","2014-04-19 01:56:37","2014-04-19 01:56:37","What is a ""bundle"" in an Android application","<android><bundle><android-bundle>","8","0","21","",""
"5000008","1","","","2011-02-15 04:54:05","0","416","<p>I am trying to play a video via HTTP. It sometimes plays fine, others I get the ""Cannot play video"" error but can immediately start playing it again. It seems it will display this error on the slightest hiccup, is there anyway to increse the tolerance so it can continue through instead of just dropping the download and popping up the error?</p>","613795","","244296","","2011-02-15 04:58:07","2011-04-18 23:43:52","How to change behavior regarding ""Cannot play video"" error","<android><streaming><videoview>","1","0","","",""
"5000011","1","","","2011-02-15 04:54:59","2","1630","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/4317665/how-to-get-thumbnail-for-video-in-my-sdcard-android-data-mypackage-files-folder"">How to get thumbnail for video in my /sdcard/Android/data/mypackage/files folder ?</a>  </p></blockquote><p>Hello All</p><p>In my android application i am recording a video and saving this in sdcard.Now what i require is display this video as thumbnails in my application.</p><p>I tried all solutions from <a href=""http://stackoverflow.com/questions/1334694/android-is-it-possible-to-display-video-thumbnails"">Android: Is it possible to display video thumbnails?</a>The issue is i need the video from sdcard path and am not understanding as how to get it.</p><p>I tried below code</p><pre><code>int id = **""The Video's ID""** ImageView iv = (ImageView ) convertView.findViewById(R.id.imagePreview); ContentResolver crThumb = getContentResolver(); BitmapFactory.Options options=new BitmapFactory.Options(); options.inSampleSize = 1; Bitmap curThumb = MediaStore.Video.Thumbnails.getThumbnail(crThumb, id,MediaStore.Video.Thumbnails.MICRO_KIND, options); iv.setImageBitmap(curThumb);</code></pre><p>But could not understand as how to get the video from sdcard path.</p><p>Please share your valuable suggestions</p><p>Thanks in advance :)</p>","420261","","","","","2011-03-11 21:07:16","display video thumbnails from sdcard in android","<android>","1","0","1","2011-03-12 23:33:05",""
"5000135","1","5000158","","2011-02-15 05:16:45","1","1274","<p>How to parse and convert the contents of url into string?</p><p>whether this can be done for Android programming?</p>","1395320","","","","","2011-02-15 06:43:05","How to parse a url and convert the url contents into string for Android?","<java><android>","2","0","","",""
"5000175","1","5000247","","2011-02-15 05:23:27","0","4626","<p>i want to browse all Audio files, but i am getting error like No application can perform this action.. this is my code for browse activity...</p><p>-->    private static final int SELECT_MUSIC = 1;<br>      String selectedImagePath;</p><pre><code>@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    ((Button) findViewById(R.id.browse)).setOnClickListener(new OnClickListener() {        public void onClick(View arg0) {            // in onCreate or any event where your want the user to            // select a file            Intent intent = new Intent();            intent.setType(""music/*"");            intent.setAction(Intent.ACTION_GET_CONTENT);            startActivityForResult(Intent.createChooser(intent,""Select File""), SELECT_MUSIC);        }    });}@Overridepublic void onActivityResult(int requestCode, int resultCode, Intent data) {    if (resultCode == RESULT_OK) {        if (requestCode == SELECT_MUSIC) {            Uri selectedImageUri = data.getData();            selectedImagePath = getPath(selectedImageUri);        }    }}public String getPath(Uri uri) {    String[] projection = {MediaStore.Images.Media.DATA};    Cursor cursor = managedQuery(uri, projection, null, null, null);    int column_index = cursor.getColumnIndexOrThrow(MediaStore.Audio.Media.DATA);    cursor.moveToFirst();    return cursor.getString(column_index);}</code></pre><p>and i have also added permission to menifest file::    READ_PHONE_STATEwhat's problem?  any idea?</p><p>Thanks..</p>","472882","","","","","2011-12-27 18:41:23","Android: No Application perform this action, why?","<android><permissions>","3","0","","",""
"5000213","1","5000285","","2011-02-15 05:31:40","12","21502","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/3156781/how-to-show-android-checkbox-at-right-side"">How to show android checkbox at right side?</a>  </p></blockquote><p>In my android application, I have a checkbox and some text associate with it. By default the texts are in the right side and the checkbox in left side. But I want to put the checkbox on the right side. Help me please.</p>","595543","","","","","2014-04-01 14:04:51","How to Set the Checkbox on the right side of the text","<android><checkbox>","3","1","1","2012-12-19 16:13:58",""
"5000240","1","","","2011-02-15 05:35:40","1","3288","<p>I have the following code:</p><hr><p><strong><code>Filename: A.java</code></strong></p><pre><code>package test1public interface A {   int get();   int set();}</code></pre><hr><p><strong><code>Filename: B.java</code></strong></p><pre><code>package test1public class B implements A {    int get() {       ...    }    int set() {     ....    }}</code></pre><hr><p><strong><code>Filename: C.java</code></strong></p><pre><code>package test2import test1.A;import test1.B;publc class C {        public A getNum() {             B test = null;             return(test);        }}</code></pre><hr><p>When I compiled the above code in Eclipse--> Sample Java Project, It is working fine. But when I compiled the same code in Android, It is throwing the following error:: Method C.getNum returns unavailable type A;</p><p>Please let me know, where I am going wrong.</p><p>Thanks in advance,Kranti</p>","617256","","697630","","2012-06-14 15:51:11","2012-06-14 15:51:11","Issue in returning interface as return type in Java","<java><android><types><interface><return>","3","7","","",""
"5000375","1","","","2011-02-15 05:59:08","2","248","<p>Is it possible to add a layout to a surface view in Android?</p>","562237","","651104","","2012-06-09 03:40:58","2012-06-09 03:40:58","Is it possible to add a layout to a surface view in Android?","<android>","1","0","","",""
"5000385","1","","","2011-02-15 06:01:19","2","2748","<p>I have been trying to port FFMPEG (for playing audio) into Android using NDK. I have had some success</p><ul><li>I could build FFMPEG and link it via NDK.</li><li>I could call <code>avcodec_decode_audio3()</code> and decode a given audio file.</li></ul><p>So here I have a audio buffer output from the function. How do I play this now? Any ffmpeg guys can tell me the exact steps to decode and play audio. I am really clueless of what to do with the audio buffers created I got from <code>avcodec_decode_audio3()</code>.</p><p>thanks a lot.</p>","177890","","","","","2013-02-27 15:19:32","Playing audio with FFMPEG","<android><c><ffmpeg><audio-streaming><android-ndk>","1","2","","",""
"5000431","1","5000545","","2011-02-15 06:08:50","1","5110","<p>hi i have a custom listview that contain an image and textview ,am using  handler inside the getview of listview of adapter for loading images , when all the images are load , and then i change the orientation of my phone the image again start to download , i want to block this one,ie when all the images are load ,and when am orientation changes it take no effect.</p><pre><code>public View getView(final int position, View convertView, ViewGroup parent) {        final String imageurl = imageUrls.get(position);        LayoutInflater inflate = LayoutInflater.from(context);        View v = inflate.inflate(rowResId, parent, false);        final ImageView image = (ImageView) v.findViewById(R.id.image);        final ProgressBar progress = (ProgressBar) v                .findViewById(R.id.progress);        image.setVisibility(View.GONE);        progress.setVisibility(View.VISIBLE);        final Handler handler = new Handler() {            @Override            public void handleMessage(Message message) {                System.out.println(""Set image at"" + position                        + "" Image Name :: "" + imageurl);                progress.setVisibility(View.GONE);                image.setImageBitmap((Bitmap) message.obj);                image.setVisibility(View.VISIBLE);            }        };        Thread thread = new Thread() {            @Override            public void run() {                Bitmap drawable = LoadImageFromWebOperations(imageurl);                Message message = handler.obtainMessage(1, drawable);                handler.sendMessage(message);            }        };        thread.start();        return v;    }</code></pre>","487219","","","","","2011-02-15 07:21:05","android Listview Image Loading","<android><listview>","3","0","2","",""
"5000500","1","5000548","","2011-02-15 06:22:44","0","1525","<p>In my application I want to use 4 tabs and each tab will have more than one screen. So I tried to get this and found there are two ways to do this:</p><ol><li>Use <code>ViewFlipper</code> inside every tab.</li><li>Use <code>ActivityGroup</code> in tabs.</li></ol><p>However, I'm not sure which will be efficient and easy way to do this since I'm a newbie in Android. So please help me.</p><p>Please post me some link where I can get sample code related to <code>ActivityGroup</code>.</p>","463586","","1128737","","2012-01-11 19:40:51","2012-01-11 19:40:51","How to use ActivityGroup/ViewFlipper?","<android><android-widget>","3","1","1","",""
"5000524","1","5000541","","2011-02-15 06:26:30","1","5457","<p>In Landscape mode video view is covering 3/4 part of screen . how to make it full screen?</p><p>Thanks</p>","609289","","991737","","2012-01-12 18:57:20","2012-01-12 18:57:20","Play Video view in full screen mode","<android><video>","1","0","","",""
"5000551","1","5116673","","2011-02-15 06:31:15","0","591","<p>hi if i try to download a book from the ebook store, my android emulator browser shows an error ""Content type is not supported by the phone'. any solution?</p>","617302","","617302","","2011-09-20 09:12:29","2011-09-20 09:12:29","unable to download .zip Android emulator browser","<android><download>","1","0","","",""
"5000645","1","5000675","","2011-02-15 06:44:42","2","2658","<p>I want to add one icon to the notification bar for mediaplayer.  Now on dragging the notification bar I want to add view like four buttons.<br>How can I do that?</p><p>This functionality is in default player of android.  When a user exits the screen, the player keeps playing in the background and when we drag the notification there is functionality to play, pause, next and previous.</p>","411359","","1288","","2011-03-21 13:07:21","2011-03-21 13:07:21","how to add view to notification?","<android>","1","0","1","",""
"5000682","1","","","2011-02-15 06:51:56","0","329","<p>Please any one tell me that how can I show character like ï¿½cija in android textview.i.e some spanish word I have to show in textview</p>","583267","","493193","","2011-02-15 07:05:53","2011-02-17 11:36:49","How to show dynamic character coming from server to textView in android","<android>","1","0","","",""
"5000722","1","5000782","","2011-02-15 06:59:37","2","14535","<p>I am developing an Android application. Yesterday I have changed my system. Now I am using Mac OS for development. </p><p>Just I copied the project from my previous System to current System. I have imported the Project in Eclipse.</p><p>The problem is; Now I am getting following issue.<br><code>""org.apache.http.entity.mime cannot be resolved""</code> </p><p>How to resolve this issue ?</p>","221846","","","","","2011-02-15 07:11:02","How to fix the issue in eclipse ""cannot be resolved""?","<android><eclipse>","1","4","","",""
"5000776","1","5001343","","2011-02-15 07:10:29","5","3830","<p>Will you please anyone let me know how to change the Message (Body) of an alert dialog in onPrepareDialog().  </p><p>I am not able to find any function like setText() even after typecasting the Dialog parament in the onPrepareDialog() function.</p><p>I dont want to use<br>removeDialog()<br>showDialog()<br>as it will be overhead to GC to clean the objects and if i go for custom dialog then code becomes huge for handling in case of themes.</p><p>Please let me know if anyone have idea of changing the text of an AlertDialog in the onPrepareDialog() function.</p><p>Thanks &amp; Regards,<br>SSuman185</p>","607625","","","","","2011-02-15 08:34:39","How to change the message(body) of AlertDialog in onPrepareDialog()?","<android>","1","0","0","",""
"5000787","1","5000843","","2011-02-15 07:11:54","21","66275","<p>I have an Android application.  I am making a loading screen with a progress bar.</p><p>I entered a delay in the onCreate method.  When the timer finishes, I want to finish the current activity and start a new one.  </p><p>It just gives me an exception when it calls the <code>finish()</code> method.</p><pre><code>public class LoadingScreen extends Activity{    private LoadingScreen loadingScreen;    Intent i = new Intent(this, HomeScreen.class);    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.loading);        CountDownTimer timer = new CountDownTimer(10000, 1000) //10 second Timer        {            public void onTick(long l)             {            }            @Override            public void onFinish()             {                loadingScreen.finishActivity(0);                startActivity(i);            };        }.start();    }}</code></pre><p>How can I change the code so that it ends when the progress bar is done?</p>","521015","","445131","","2013-09-14 23:43:22","2013-09-14 23:51:12","How to finish current activity in Android","<android><activity-finish>","3","2","10","",""
"5000820","1","","","2011-02-15 07:16:35","1","114","<p>I am New to Android.. My requirement is to find the location and pointing to that, based on given address. can any one help me.....</p>","554827","","1069068","","2013-03-19 14:40:34","2013-03-19 14:40:34","How to find location programetically based on given address in Android?","<android>","0","1","1","",""
"5000823","1","5044611","","2011-02-15 07:16:42","1","3880","<p>The new Android in-app billing (http://developer.android.com/guide/market/billing/billing_testing.html) page says: ""To test in-app billing in an application you must install the application on an Android-powered device. You cannot use the Android emulator to test in-app billing. The device you use for testing must run a standard version of the Android 1.6 or later platform (API level 4 or higher), and have the most current version of the Android Market application installed. If a device is not running the most current Android Market application, your application won't be able to send in-app billing requests to Android Market.""</p><p>and ""A device must be running version 2.3.0 (or higher) of the Android Market application to support in-app billing.""</p><p>I have a Galaxy Tablet running 2.2.11 version of the Market app that I'm trying to use for developing my application. Can some body please let me know or give me any pointers on how can I upgrade it to 2.3.0 or higher ? Does it also require a latest version (gingerbread) of Android too on my device?</p><p>thanks in advance for your help!</p>","442071","","","","","2012-04-15 02:06:17","How to upgrade Google Android Market Application","<android><in-app-purchase>","2","0","","",""
"5000874","1","5002173","","2011-02-15 07:23:49","0","82","<p>hi i have posted one of my app in market.android.com when i am trying to post second app it shows ""You have another application on Market with the same package name. Go to that other application, and click upgrade"" I dont want to upgrade it but i want my second app to be posted. When i tried to change the package name it showed lots of errors, so i decided to create the app once again in a new package and project name, it seems to be a very lengthy process.... pls help me to solve the issue bcoz i have created all my app in same package name unknowingly....... </p>","596364","","12030","","2011-02-15 11:56:04","2011-02-15 11:56:04","uploading app problem in developers site","<java><android>","1","0","","",""
"5000976","1","5002097","","2011-02-15 07:38:32","0","986","<p>am bit confused with tab activity, i have 3 tabs on my main view, and i can switch views using tabs, like main to courses or courses to main ,</p><p>but i want to call different services for each tab, like</p><ol><li>Tab 1 (Call) :  When a user clicks it, it will make a Call to a number ""88888888888""</li><li>Tab 2 (Email) :  When a user clicks it, it will take user straight to ""Compose new email"" and passing     values like ""aaaaaaa@aaa.com""</li><li>Tab 3 (Web) : when a user clicks it, it will open a browser with ""www.helpme.co.uk""</li></ol><p>my current java and xml file coding is given below,</p><p>Java Code :</p><pre><code>package com.NVT.android;import android.app.TabActivity;import android.content.Intent;import android.content.res.Resources;import android.os.Bundle;import android.widget.TabHost;public class MainTabActivity extends TabActivity{        public void onCreate(Bundle savedInstanceState) {            super.onCreate(savedInstanceState);            setContentView(R.layout.tab_activity_layout);            Resources res = getResources(); // Resource object to get Drawables            TabHost tabHost = getTabHost();  // The activity TabHost            TabHost.TabSpec spec;  // Resusable TabSpec for each tab            Intent intent;  // Reusable Intent for each tab            // Create an Intent to launch an Activity for the tab (to be reused)            intent = new Intent().setClass(this, Main.class);            // Initialize a TabSpec for each tab and add it to the TabHost            spec = tabHost.newTabSpec(""main"").setIndicator(""Main"",                              res.getDrawable(R.drawable.ic_tab_artists_grey))                          .setContent(intent);            tabHost.addTab(spec);            // Do the same for the other tabs            intent = new Intent().setClass(this, Courses.class);            spec = tabHost.newTabSpec(""courses"").setIndicator(""Courses"",                              res.getDrawable(R.drawable.ic_tab_artists_white))//m using same buttons for each tab u can change it by adding new drawable xml.. got that                          .setContent(intent);            tabHost.addTab(spec);            intent = new Intent().setClass(this, Courses.class);            spec = tabHost.newTabSpec(""courses"").setIndicator(""Courses"",                              res.getDrawable(R.drawable.ic_tab_artists_white))//m using same buttons for each tab u can change it by adding new drawable xml.. got that                          .setContent(intent);            tabHost.addTab(spec);        }    }</code></pre><p>XML Coding</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;RelativeLayout    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""            android:layout_alignParentBottom=""true""             /&gt;                  &lt;FrameLayout            android:id=""@android:id/tabcontent""            android:layout_width=""fill_parent""            android:layout_height=""fill_parent""            android:padding=""5dp""&gt;&lt;/FrameLayout&gt;    &lt;/RelativeLayout&gt;    &lt;/LinearLayout&gt;&lt;/TabHost&gt;</code></pre>","1090104","","1090104","","2011-02-15 07:56:54","2011-02-15 09:55:05","calling service using Tab activity Android","<android>","1","4","","",""
"5000983","1","","","2011-02-15 07:39:09","0","3744","<p>If an Activity has the following 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>Under what circumstances will an Intent matching the above filter be issued by Android?</p><p>1)  During launch of the application.</p><p>2) ?  Are there any other circumstances?</p>","602260","","115145","","2011-02-15 12:49:09","2011-02-15 12:51:33","When beside launch will android.intent.action.MAIN be fired by Android","<android><activity><android-intent><launch>","1","0","1","",""
"5001035","1","","","2011-02-15 07:47:38","2","1026","<p>I would like to create pages of gridview in android.<br>The page 1 will have a 3x3 set of elements.<br>On clicking the next button it should jump to page-2 with the next 3x3 set of elements.  </p><p>Right now i have a grid of 3x3 elements and when i give a set of 12 elements, a scrollbar will appear in the right side of the gridview and the next three elements will be shown in the same page by scrolling down.  </p><p>So please help on how i can implement a page of gridviews.  </p><p>Thanks,<br>Sen</p>","449378","","449378","","2011-02-15 09:24:37","2013-03-24 14:58:51","How to page a gridviews in android?","<android><gridview><paging>","1","1","0","",""
"5001038","1","","","2011-02-15 07:48:13","3","1613","<p>I'm researching creating a view for displaying EPG data. That is the view should:</p><ul><li>have a fixed header column that shows the services,</li><li>have a fixed header row that shows the time and</li><li>a content area that has equal-height TextViews of flexible width for showing the actual EPG entries</li><li>Most importantly, scolling vertically must scroll header column as well, scrolling horizontally must scroll header row.</li></ul><p>Apart from drawing the whole view myself (inside a scrollable?) I'm totally stumped if there is any good approach I could use involving linear layouts or such.</p><p>Any hints are greatly appreciated- please note that I'm and android beginner.</p>","608395","","608395","","2011-02-17 13:52:57","2011-02-17 14:00:21","Two-way scolling list view?","<android><android-layout>","2","0","2","",""
"5001066","1","5001380","","2011-02-15 07:51:55","5","6390","<p>I have to connect to a PostgreSQL server in LAN without web service.At the moment I think JDBC is the only way I can consider of.</p><p>How can I fulfill this? Is there any ready-to-use 3rd party library I can import to my Android project?</p><p>Any reply would be appreciated.</p>","617389","","","","","2012-12-04 18:44:16","How to connect to a PostgreSQL server via JDBC in Android?","<android><database><postgresql><jdbc>","2","0","1","",""
"5001097","1","5001144","","2011-02-15 07:55:42","0","995","<p>So, is there any easy way to identify the tablerow clicked?I have a tablelayout with static data, like a menu. When the user click any tablerow I want to start the specified activity. I've googled a couple of hours but everyone seem to use the view inside the tablerows text property to identify it, which sucks if you translate the app. I tried to find some getIndex property of the TableLayouit but no luck, and the views .getId property is useless.</p><p>I guess the solution is to have specific onclicklisteners on each tablerow but that will generate a lot of (unnecessary) code and there must be a better solution?</p><p>Regards</p>","498112","","","","","2011-07-06 13:38:09","android identify tablerow","<android><tablelayout><tablerow>","1","0","","",""
"5001113","1","5001183","","2011-02-15 07:58:31","1","854","<p>I use the MediaStore to capture the video, but it will record the video upto 8 seconds only ,can anyone help me to increase the duration of video. I am using android 2.2.</p>","555806","","","","","2011-02-15 08:08:19","How to increase the duration of Video recoding in android?","<android><video>","1","0","1","",""
"5001123","1","","","2011-02-15 08:00:01","1","1092","<p>I have a database in my sqlite Manager in that i have one table.Now i want to access that table through my android code.Is there any possible way to do that...Please reply me....</p>","617402","","135152","","2011-05-25 02:56:29","2011-12-13 19:06:14","Accessing the external SQLite database with Android?","<android><sqlite>","1","0","","",""
"5001124","1","5002205","","2011-02-15 08:00:21","1","5905","<p>i am working on an android application, where some of the functions that users should input:  register, locate hospital location, search for messages (sent via sms to registered users) and can schedule and make appointments. So far, all the activities are done, however i need to know how to connect to the database in order to read and store this data. I am using Android 2.1, MacOsX, and SQLite firefox extension.</p><p>this is the code i have to connect to the sqllite db, what am i doing wrong?</p><pre><code>package com.bitnuts.imom;import java.io.FileOutputStream;import java.io.IOException;import java.io.InputStream;import java.io.OutputStream;import android.content.Context;import android.database.sqlite.SQLiteDatabase;import android.database.sqlite.SQLiteOpenHelper;public class DbManager extends SQLiteOpenHelper {    private static final String DB_NAME = ""iMom.sqlite"";    private static final String DB_PATH = ""/data/data/com.bitnuts.imom/databases/"";    private static final Integer DB_VERSION = 1;    private static final String TAG = ""DbManager"";    private final Context context;    private SQLiteDatabase db;    private DbManager dbManager;    public DbManager(Context context) {        super(context, DB_NAME, null, DB_VERSION);        this.context = context;    }    public DbManager open() {        dbManager = new DbManager(context);        db = dbManager.getWritableDatabase();        return this;    }    @Override    public void onCreate(SQLiteDatabase arg0) {             createNewDatabase();    }    @Override    public void onUpgrade(SQLiteDatabase arg0, int arg1, int arg2) {        // TODO Auto-generated method stub    }    public void createNewDatabase() {        InputStream assetsDB = null;        try {            assetsDB = context.getAssets().open(DB_NAME);            OutputStream dbOut = new FileOutputStream(DB_PATH + DB_NAME);            byte[] buffer = new byte[1024];            int length;            while ((length = assetsDB.read(buffer)) &gt; 0) {                dbOut.write(buffer, 0, length);            }            dbOut.flush();            dbOut.close();            assetsDB.close();        } catch (IOException e) {        }    }}</code></pre>","574150","","574150","","2011-02-15 08:06:45","2013-08-19 05:34:38","how to connect an sqlite database (sqlite firefox extension ) to android application, for android 2.1 to query and insert to the database","<android><sqlite>","3","0","","",""
"5001148","1","","","2011-02-15 08:04:18","0","74","<p>I just started Android programming. I have a <code>ListView</code> with an image and some text and I want to change the image when clicked, but the problem is I cannot identify which image is clicked because I am using the same image id and only changing the source.</p><p>How can I solve this problem?</p><p>My <code>ListView</code> is based on <code>LazyAdapter</code> class model.</p>","617405","","299924","","2011-02-15 08:14:54","2011-02-15 14:49:13","Android Listing Problem","<android><listview>","1","1","","",""
"5001194","1","6439415","","2011-02-15 08:09:48","1","2355","<p>I am attempting to load a set of JAR files that go together to make up an API. For some reason I can only load classes not dependent on definitions in other JARs. I am beginning to suspect that the Android classloaders simply do not handle implementing an interface from one JAR file in another. For this reason I've also unpacked the classes into a common dir however this doesn't work either.</p><p>Please see the following code. Apologies for any anomalies, but I've tried to ensure it will compile straight up if pasted into an ADT project called MyProj.</p><pre><code>import java.io.File;import java.io.FileOutputStream;import java.io.InputStream;import java.io.OutputStream;import java.lang.reflect.Field;import java.util.ArrayList;import java.util.Enumeration;import java.util.jar.JarEntry;import java.util.jar.JarFile;import java.util.logging.Level;import dalvik.system.PathClassLoader;import android.content.Context;    // IPluginSource simply defines the method here at the top.public class AndroidPluginSource implements IPluginSource {    @Override    public void doSearching(ArrayList&lt;ClassLoader&gt; classLoaders, ArrayList&lt;String&gt; classNames)     {        String jarPaths = """";            // For each of the raw resources, JARs compiled into the 'res/raw' dir...        for (Field str : R.raw.class.getFields())        {            String resName = str.getName();            Logger.log(Level.FINE, ""Resource: "" + str);            try             {                                    // Copy the JAR file to the local FS.                InputStream is = MyProj.self.getResources().openRawResource(str.getInt(this));                OutputStream os = MyProj.self.openFileOutput(resName + "".jar"", Context.MODE_PRIVATE);                copyData(is, os);                is.close();                os.close();                                    // Get JAR location.                String jarLoc = MyProj.self.getFilesDir() + File.separator + resName + "".jar"";                                // First attempt is just single classloaders, so we aren't suprised this won't work.                classLoaders.add(new PathClassLoader(jarLoc, MyProj.self.getClassLoader()));                //Logger.log(Level.FINE, ""  LOC: "" + jarLoc);                                    // Keep running list of JAR paths, will that work?                if (jarPaths.length() &gt; 0) jarPaths += File.pathSeparator;                jarPaths += jarLoc;                                    // We have to go through the JARs to get class names...                JarFile jar = new JarFile(jarLoc);                Enumeration&lt;JarEntry&gt; entries = jar.entries();                while (entries.hasMoreElements())                {                    JarEntry entry = entries.nextElement();                    String entryName = entry.getName();                    if (entryName.endsWith("".class""))                    {                        classNames.add(toClassName(entryName));                        Logger.log(Level.FINE, ""    ENT: "" + entryName);                                    // ...while we're here lets get the class out as a file.                        String classLoc = MyProj.self.getFilesDir() + File.separator + entryName;                        Logger.log(Level.FINER, ""    CLS: "" + classLoc);                        File classFile = new File(classLoc);                        classFile.delete();                        classFile.getParentFile().mkdirs();                        InputStream jis = jar.getInputStream(entry);                        //OutputStream jos = MyProj.self.openFileOutput(classLoc, Context.MODE_PRIVATE);                        OutputStream jos = new FileOutputStream(classFile);                        copyData(jis, jos);                        jos.close();                        jis.close();                    }                }            }             catch (Exception ex)            {                Logger.log(Level.SEVERE, ""Failed plugin search"", ex);            }        }        File f = MyProj.self.getFilesDir();        recursiveList(f, 0);        // So we have a class loader loading classes...        PathClassLoader cl = new PathClassLoader(VermilionAndroid.self.getFilesDir().getAbsolutePath(), ClassLoader.getSystemClassLoader());        classLoaders.add(cl);        // A JAR loader loading all the JARs...        PathClassLoader jl = new PathClassLoader(jarPaths, ClassLoader.getSystemClassLoader());        classLoaders.add(jl);        // And if edited as below we also have a DexLoader and URLClassLoader.    }            // This is just so we can check the classes were all unpacked together.    private void recursiveList(File f, int indent)    {        StringBuilder sb = new StringBuilder();        for (int x = 0; x &lt; indent; x++) sb.append("" "");        sb.append(f.toString());        Logger.log(Level.INFO, sb.toString());        File[] subs = f.listFiles();        if (subs != null)        {            for (File g : subs) recursiveList(g, indent+4);        }    }            // Android helper copy file function.    private void copyData(InputStream is, OutputStream os)    {        try        {            int bytesRead = 1;            byte[] buffer = new byte[4096];            while (bytesRead &gt; 0)            {                bytesRead = is.read(buffer);                if (bytesRead &gt; 0) os.write(buffer, 0, bytesRead);            }        }        catch (Exception ex) {}    }        // Goes from a file name or JAR entry name to a full classname.    private static String toClassName(String fileName)    {        // The JAR entry always has the directories as ""/"".        String className = fileName.replace("".class"", """").replace(File.separatorChar, '.').replace('/', '.');        return className;    }   }</code></pre><p>The following code is where this is called from.</p><pre><code>public void enumeratePlugins(IPluginSource source){    ArrayList&lt;ClassLoader&gt; classLoaders = new ArrayList&lt;ClassLoader&gt;();    ArrayList&lt;String&gt; classNames = new ArrayList&lt;String&gt;();    source.doSearching(classLoaders, classNames);    logger.log(Level.FINE, ""Trying discovered classes"");    logger.log(Level.INFO, ""Listing plugins..."");    StringBuilder sb = new StringBuilder();    // Try to load the classes we found.    for (String className : classNames)    {        //boolean loadedOK = false;        Throwable lastEx = null;        for (int x = 0; x &lt; classLoaders.size(); x++)        {            ClassLoader classLoader = classLoaders.get(x);            try            {                Class dynamic = classLoader.loadClass(className);                if(PluginClassBase.class.isAssignableFrom(dynamic) &amp;&amp;                        !dynamic.isInterface() &amp;&amp; !Modifier.isAbstract(dynamic.getModifiers()))                {                    PluginClassBase obj = (PluginClassBase) dynamic.newInstance();                    String classType = obj.getType();                    String typeName = obj.getName();                    classes.put(typeName, new PluginClassDef(typeName, classType, dynamic));                    logger.log(Level.FINE, ""Loaded plugin: {0}, classType: {1}"", new Object[] {typeName, classType});                    sb.append(typeName).append("" ["").append(classType).append(""], "");                    if (sb.length() &gt; 70)                    {                        logger.log(Level.INFO, sb.toString());                        sb.setLength(0);                    }                }                lastEx = null;                break;            }            catch (Throwable ex)            {                lastEx = ex;            }        }        if (lastEx != null)        {            logger.log(Level.INFO, ""Plugin instantiation exception"", lastEx);        }    }    if (sb.length() &gt; 0)    {        logger.log(Level.INFO, sb.substring(0, sb.length()-2));        sb.setLength(0);    }    logger.log(Level.FINE, ""Finished examining classes"");}</code></pre><p>Thanks for your help.</p><p>EDIT: I have also tried adding</p><pre><code>    URLClassLoader ul = null;    try     {        URL[] contents = new URL[jarURLs.size()];        ul = new URLClassLoader(jarURLs.toArray(contents), ClassLoader.getSystemClassLoader());    }     catch (Exception e) {}     classLoaders.add(ul);        </code></pre><p>...which gives rise to a new exception - UnsupportedOperationException: Can't load this type of class file.</p><p>AND:</p><pre><code>    DexClassLoader dl = new DexClassLoader(jarPaths, ""/tmp"", null, getClass().getClassLoader());    classLoaders.add(dl);</code></pre><p>Also didn't work correctly, but thanks for the suggestion <strong>Peter Knego</strong></p><p>I should clarify that in the JAR files I have:</p><pre><code>JAR1:    public interface IThing    public class ThingA implements IThingJAR2:    public class ThingB implements IThing</code></pre>","","user595447","","user595447","2011-02-15 12:13:21","2011-06-22 11:58:06","dalvik.system.PathClassLoader not loading multiple JARs","<android><jar><classloader>","2","1","1","",""
"5001294","1","5001322","","2011-02-15 08:27:30","0","389","<p>Is there a way to have a TextView that adds a new line after each space character in the text? For example, the text ""one two three"" should be displayed on 3 lines. </p><p>Thanks a lot,</p><p>Gratzi</p>","460611","","","","","2011-02-15 08:31:12","New line after space","<android>","1","0","","",""
"5001298","1","","","2011-02-15 08:28:16","0","650","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/5001113/how-to-increase-the-duration-of-video-recoding-in-android"">How to increase the duration of Video recoding in android?</a>  </p></blockquote><p>Hi,</p><p>While capturing the video from device for my application, after 9 sec the toast will appear size limit reached and then stop the recording, can any help one me please,to increase the size.</p>","555806","","","","","2011-02-15 08:30:23","Size Limit Reached while capturing video from android?","<android><video>","0","4","","2011-02-15 13:17:47",""
"5001406","1","5005601","","2011-02-15 08:42:30","0","1510","<p>i downloaded Monodroid: http://monodroid.net/Installation   but i write 2 simple project 2 days ago. But i press f5 to run . i face to face </p><p><h3> This beta version has expired. Please upgrade to a newer beta to help us test the latest code</h3> How can i run it?</p>","52420","","217288","","2011-02-16 15:38:13","2011-04-20 15:00:02","how can i run monodroid in vs 2010?","<c#><android><visual-studio><mono><android-ndk>","1","2","1","",""
"5001460","1","","","2011-02-15 08:50:16","0","1061","<p>I am working through the Android Google Maps tutorial here <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> using Eclipse 3.6 and Google API's 10 revision 1. </p><p>However, whenever I try to edit the 'Main.xml' file, the following error is thrown by the editor:</p><pre><code>java.lang.NullPointerException    at com.android.ide.eclipse.adt.internal.editors.layout.gle2.GraphicalEditorPart.renderWithBridge(Unknown Source)    at com.android.ide.eclipse.adt.internal.editors.layout.gle2.GraphicalEditorPart.recomputeLayout(Unknown Source)    at com.android.ide.eclipse.adt.internal.editors.layout.gle2.GraphicalEditorPart.activated(Unknown Source)    at com.android.ide.eclipse.adt.internal.editors.layout.LayoutEditor.pageChange(Unknown Source)    at org.eclipse.ui.part.MultiPageEditorPart.setActivePage(MultiPageEditorPart.java:1067)    at org.eclipse.ui.forms.editor.FormEditor.setActivePage(FormEditor.java:607)    at org.eclipse.ui.part.MultiPageEditorPart.createPartControl(MultiPageEditorPart.java:352)    at org.eclipse.ui.internal.EditorReference.createPartHelper(EditorReference.java:670)    at org.eclipse.ui.internal.EditorReference.createPart(EditorReference.java:465)    at org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:595)    at org.eclipse.ui.internal.EditorReference.getEditor(EditorReference.java:289)    at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched(WorkbenchPage.java:2863)    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:2674)    at org.eclipse.ui.ide.IDE.openEditor(IDE.java:683)    at com.android.ide.eclipse.adt.internal.wizards.newxmlfile.NewXmlFileWizard.performFinish(Unknown Source)    at org.eclipse.jface.wizard.WizardDialog.finishPressed(WizardDialog.java:811)    at org.eclipse.jface.wizard.WizardDialog.buttonPressed(WizardDialog.java:430)    at org.eclipse.jface.dialogs.Dialog$2.widgetSelected(Dialog.java:624)    at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:234)    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.jface.window.Window.runEventLoop(Window.java:825)    at org.eclipse.jface.window.Window.open(Window.java:801)    at org.eclipse.ui.internal.handlers.WizardHandler$New.executeHandler(WizardHandler.java:254)    at org.eclipse.ui.internal.handlers.WizardHandler.execute(WizardHandler.java:274)    at org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:293)    at org.eclipse.core.commands.Command.executeWithChecks(Command.java:476)    at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:508)    at org.eclipse.ui.internal.handlers.HandlerService.executeCommand(HandlerService.java:169)    at org.eclipse.ui.internal.handlers.SlaveHandlerService.executeCommand(SlaveHandlerService.java:241)    at org.eclipse.ui.internal.actions.CommandAction.runWithEvent(CommandAction.java:157)    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: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:2640)    at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2604)    at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2438)    at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:671)    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:664)    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)</code></pre><p>Any clues on what I am doing wrong/possible fixes would be much appreciated.</p><p>Thanks</p><p>NigelT</p>","617445","","27905","","2013-02-07 18:04:52","2013-02-07 18:04:52","Android Layout Editor cannot open file","<android><eclipse>","2","1","1","",""
"5001549","1","","","2011-02-15 08:59:48","0","478","<p>I happened to chance upon the file""org_apache_harmony_xnet_provider_jsse_NativeCrypto.cpp"" in thelibcore of android.</p><p>I learn that this file seems to be the JNI wrapper that Apache Harmonyprovider uses to call the under the hood openssl engine for some ofits functionality like ssl, signature verification and digestcalculation.</p><p>Can somebody clarify the following for me:</p><p>1) I want to add a few printf statements and see it on the ""adblogcat"" command. I tried adding printf here and there... Where/how arethese files getting compiled? There is a sub.mk(make file) providedalong, but who calls this?</p><p>After I added the printf statements, I just did an android ""make"" butin the end I never get to see these. How do I go about now?</p><p>2)Is JNI wrapper for openssl used by Apache only for the threefunctionality I said or are there more?</p><p>If I have to allow my Apps to use ssl, do I also have to extend thisJNI wrapper to allow it to call other algorithms/functions etc(for eg.RSA)</p><p>Thanks in advance</p>","489152","","","","","2011-05-14 02:01:01","OpenSSL for Apache Harmony on Android","<android><cryptography><jni><openssl><android-ndk>","1","0","","",""
"5001572","1","","","2011-02-15 09:03:00","1","326","<p>As you should know, Google annonced that Apple Http Live Streaming is now supported in the SDK V3.0 via the mediaPlayer Framework.</p><p>So I wrote some lines to test this. I started with a ""3gp"" movie that is correclty displayed on the emulator (a tablet). When I feed the source with a working m3u8 URL nothing is displayed and the debugger reports an error</p><p>Can someone lead me from darkness to light ???</p><p>I guess it has something to do with codec but...</p><p>Many thanks for any clue.Zbb</p><pre><code>02-15 09:49:31.284: INFO/avc_utils(33): found AVC codec config (320 x 180, Main-profile level 1.3)02-15 09:49:31.444: INFO/ESQueue(33): found AAC codec config (24000 Hz, 2 channels)02-15 09:49:31.444: INFO/ESQueue(33): [ 02-15 09:49:31.454    33:0x1b9 F/ACodec   ]02-15 09:49:31.444: INFO/ESQueue(33): frameworks/base/media/libstagefright/ACodec.cpp:1594 CHECK_EQ( omx-&gt;allocateNode(componentName.c_str(), observer, &amp;node),(status_t)OK) failed: -2147483648 vs. 002-15 09:49:31.605: INFO/DEBUG(31): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***02-15 09:49:31.605: INFO/DEBUG(31): Build fingerprint: 'generic/sdk/generic:Honeycomb/HPI20B/eng.xav.20110125.162619:eng/test-keys'02-15 09:49:31.605: INFO/DEBUG(31): pid: 33, tid: 441  &gt;&gt;&gt; /system/bin/mediaserver &lt;&lt;&lt;02-15 09:49:31.615: INFO/DEBUG(31): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr deadbaad</code></pre>","617410","","524566","","2011-02-15 09:19:33","2011-02-15 09:19:33","Did someone give a try the Http Live Streaming in Android V3.0?","<android>","0","0","","",""
"5001594","1","","","2011-02-15 09:05:22","2","155","<p>here I want to display list row with text and button . I want to give listener to button only . </p>","617468","","","","","2012-04-05 12:36:47","android listview","<android><listview>","1","4","","",""
"5001644","1","","","2011-02-15 09:11:11","4","1369","<p>I'm trying to make a helper class to start an <code>Activity</code> and get the return result (<code>startActivityForResult</code>) to avoid developers writing their own <code>onActivityResult</code> code and encapsulate the complex internal details.</p><p>ie: the caller's code:</p><pre><code>MyIntent i = new MyIntent();i.getMyData(new OnData() { public void onData(Bundle data) {....} );</code></pre><p>I tried creating a ""dummy"" <code>Activity</code> inside MyIntent just to be able to override <code>onActivityResult</code>, but the activity needs to be declared in the manifest, which is what the helper class tries to avoid. There is no ""setOnActivityResult"" which would be a good alternative.</p><p>So, how to create an <code>Activity</code> programmatically and ""attach"" it so it has valid state?</p><p>After creating <code>new Activity()</code> I'd like to call the Activity ""attach"" which is internal.</p>","1382501","","512958","","2011-02-15 10:24:33","2013-12-12 06:57:57","Handling onActivityResult from outside the Activity","<android><activity><android-intent>","2","0","1","",""
"5001676","1","5082058","","2011-02-15 09:14:34","1","482","<p>i have written code for draw a triangle and rectangle.</p><pre><code>// Reset the Modelview Matrixgl.glLoadIdentity();gl.glTranslatef(0.0f, -1.2f, -6.0f);    tt.draw(gl);    //rectangle class draw method           gl.glTranslatef(0.0f, 2.5f, 0.0f);      tr.draw(gl);    //triangle class draw method</code></pre><p>i have load a texture on rectangle </p><pre><code>// Load the texture for the rectangle in onSurfaceCreated()tt.loadGLTexture(gl, this.context);</code></pre><p>my problem is the texture mapping on triangle shape alsothe screen shot is available in following link.<a href=""http://www.freeimagehosting.net/uploads/82fe919770.png"" rel=""nofollow"">http://www.freeimagehosting.net/uploads/82fe919770.png</a></p><p>how can i resolve this problem?</p>","769225","","44729","","2011-05-26 15:44:04","2011-05-26 15:44:04","Texture issue with drawing triangles with OpenGL for Android","<android><opengl-es>","1","1","2","",""
"5001682","1","5050400","","2011-02-15 09:15:24","18","11958","<p>My question is a little bit complicated.</p><p>I want to understand how the app treats resources (especially images for backgrounds, buttons, etc.) when Activity is started, then suspended.</p><p>For example, I start Activity A, it shows all the images on the screen, eats its memory, then another Activity B is started and A is suspended. What happens to all the images, resources, etc.? When they are freed? How can I take control over them? Should I not keep the Activity A in the memory and remove it from the Activity stack?</p><p>If you need any clarification for my questions, pls write me!</p><p>Thanks in advance!Danail</p>","232798","","","","","2011-09-24 17:34:26","android memory management in activity lifecycle","<android><memory><activity>","5","0","7","",""
"5001739","1","","","2011-02-15 09:20:27","2","3637","<p>All,</p><p>I am trying to run a shell script (which copies a file to a specific location) on phone power up and below is the sample code for the same which is added in the inti.rc file</p><p>service test_copy /system/bin/sh /system/bin/test_copy.sh<br>    class pre-zygote_services<br>    oneshot<br>    user system<br>    group system  </p><p>when the service name(test_copy) is same as the script name ( in this e.g., it is test_copy) it doesn't execute the script but if change the service name to a different one e.g., start_test_copy it works. I am just eager to know the reason on why when service name is same as script name it doesn't work or I may be wrong.</p><p>Appreciate your inputs!</p>","424296","","424296","","2011-02-15 09:29:42","2012-01-19 19:48:05","Problem running a script from init.rc on phone boot up","<android><service><boot>","1","1","","",""
"5001762","1","5006577","","2011-02-15 09:21:51","0","510","<p>I have recently started testing for my android application using Instrumentation framework.I have an Activity A which calls out an AsyncTask in its onCreate() method. </p><p>So the problem is, all of my test-cases executes one after the other and does not wait for AsyncTask to get completed. So how can I implement the thing that waits until the thread has been finish and then continue with other test cases?</p><p>Thanks</p>","435025","","","","","2011-02-15 16:42:25","Android - Unit testing using Instrumentation Framework","<android><testing><instrumentation>","1","0","","",""
"5001790","1","5004552","","2011-02-15 09:24:14","1","1919","<p>I have a DatePicker in my activity. I want to store the selected date when the user clicks a button like this.</p><pre><code>Date selectedDate=new Date(dp.getYear(), dp.getMonth(), dp.getDayOfMonth());</code></pre><p>the problem is when the selected date is like today's: Feb 15 2010</p><p>the date returned from the </p><blockquote>  <p>selectedDate</p></blockquote><p>is 3910-02-15, so the year is 3910 instead of 2011</p><p>what is wrong with this ?</p><p>Thanks</p>","235123","","","","","2011-02-15 13:58:24","Android DatePicker year problem","<android>","3","0","","",""
"5001882","1","5002392","","2011-02-15 09:33:29","6","8715","<p>Suppose I have an application containing activities named A,B,C,D. Now, consider A has been launched as the root activity and B has been launched from A and C has been launched from B and D has been launched from C. Now I have a button named ""Remove"" in the activity D. If suppose, I press the button ""Remove"" in the activity D, then the activity B and activity C should be removed from the history stack. On Pressing back key from the activity D should display activiy A instead of C. I don't know how to implement this. Can anyone help me to resolve this problem?</p>","617510","","1304064","","2012-08-15 19:17:42","2013-04-17 11:10:59","How to clear specific activity from the stack history?","<android>","6","0","","",""
"5001986","1","5005004","","2011-02-15 09:44:00","1","515","<p>i am trying to detect a screen touch on my current application such that when the user touches a part of the screen</p><p>my app basically retrieves a text file from the SD card and display's the text in the file onto a textview</p><p>is it possible for me to append a customize vibration pattern to the text upon touch</p><p>For example, ""HELLO"" is retrieved from the text file and display via textview</p><p><a href=""http://i54.tinypic.com/2hqfadf.png"" rel=""nofollow"">http://i54.tinypic.com/2hqfadf.png</a></p><p>when i touch on the individual characters, a preset vibration is used</p><p>i am using this to achieve the vibrations with all the various patterns set.</p><pre><code>vibrator.vibrate(pattern101, -1);</code></pre>","578198","","","","","2011-02-15 14:41:20","setting custom vibration profile on screen touch","<android>","1","0","0","",""
"5002019","1","5031374","","2011-02-15 09:46:51","4","921","<p>I follow the <a href=""http://www.sonatype.com/books/mvnref-book/reference/android-dev-sect-using.html#android-dev-sect-multimodule"" rel=""nofollow"">advice</a> to implement Android device (not application!) independent library code for my Android Apps in a seperate ""Java Library Code"" project. This makes testing easier for me as I can use the standard maven project layout, Spring test support and Continuous Build systems the way I am used to. I do not want to mix this inside my Android App project although this might be possible.</p><p>I now wonder how to implement logging in this library. As this library will be used on the Android device I would like to go with <code>android.util.Log</code>. I added the followind dependency to my project to get the missing Android packages/classes and dependencies:</p><pre><code>&lt;dependency&gt;    &lt;groupId&gt;com.google.android&lt;/groupId&gt;    &lt;artifactId&gt;android&lt;/artifactId&gt;    &lt;version&gt;2.2.1&lt;/version&gt;    &lt;scope&gt;provided&lt;/scope&gt;&lt;/dependency&gt;</code></pre><p>But this library just contains stub method (similar to the android.jar inside the android-sdk), thus using <code>android.util.Log</code> results in</p><pre><code>java.lang.RuntimeException: Stub!</code></pre><p>when running my unit tests. How do I implement logging which works on the Android device but does not fail outside (I do not expect it to work, but it must not fail)?</p><p>Thanks for any advice<br/>  Klaus</p><hr><p>For now I am going with the workaround to catch the exception outside android but hope there is a better solution.</p><pre><code>try {    Log.d(""me"", ""hello"");} catch (RuntimeException re) {    // ignore failure outside android}</code></pre>","367285","","367285","","2011-02-17 15:21:11","2011-02-17 16:00:29","Logging in ""Java Library Code"" libs for Android applications","<java><android><logging>","1","0","0","",""
"5002032","1","5004976","","2011-02-15 09:47:47","0","627","<p>In My application I want to connect usb keyboard with my android based phone.so Is it possible to connect keyboard with mobile?I have tried to connect keyboard with mobile but there is no response form mobile.should I need to install any kernel base driver or any other driver?or there is another way?</p>","533863","","180538","","2011-02-15 14:45:53","2011-02-15 14:45:53","Kernel USB Driver for android","<android><android-ndk>","1","0","","",""
"5002049","1","5002073","","2011-02-15 09:49:09","23","16495","<p>After many experiments with onTouchEvent and onTouch, I found that onTouch works everywhere you want (whether it is in activity or view) as long as you have declared the interface and put the Listener right! On the other hand, onTouchEvent only works inside a View!Is my assumption correct? Is this the real difference? </p>","587377","","2561980","","2013-08-07 21:31:58","2014-04-13 13:27:58","onTouchevent() vs onTouch()","<android><ontouchlistener><ontouchevent>","4","1","5","",""
"5002202","1","5002398","","2011-02-15 10:04:56","0","2121","<p>I just want to animate a ImageView like TranslateAnimation which should move form center(As the ImageView is in center of LinearLayout in Layout.xml) to top of the screen. I use this...</p><pre><code>TranslateAnimation moveLefttoRight = new TranslateAnimation(0, 0, 0, -200);</code></pre><p>I work, But I want to Scale out while image is moving to the top... How I can combine both animations?</p>","486139","","","","","2011-02-15 10:20:44","How to animate ImageView form center to the top in android?","<android><android-animation>","1","0","","",""
"5002350","1","5006497","","2011-02-15 10:16:45","3","2950","<p>I have gone through the article <a href=""http://developer.android.com/resources/articles/avoiding-memory-leaks.html"" rel=""nofollow"">http://developer.android.com/resources/articles/avoiding-memory-leaks.html</a> . In this article it is suggested to use static inner class with Weak Reference . </p><pre><code>public class GalleryVideo extends Activity {    private int AUDIO_NO = 1;     ...........................    ................      @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        gallery = (Gallery) findViewById(R.id.examplegallery);    gallery.setAdapter(new AddImgAdp(this));    }    static  public class AddImgAdp extends BaseAdapter {    private int GalItemBg;        private Context cont;        private WeakReference&lt;GalleryVideo&gt; mGalleryVideo;        public AddImgAdp(Context c) {            mGalleryVideo = new WeakReference&lt;GalleryVideo&gt;(c);            TypedArray typArray = obtainStyledAttributes(R.styleable.GalleryTheme);            GalItemBg = typArray.getResourceId(R.styleable.GalleryTheme_android_galleryItemBackground, 0);            typArray.recycle();        }        public long getItemId(int position) {            final GalleryVideo galleryVideo = mGalleryVideo.get();            if(galleryVideo == null){              if(galleryVideo.AUDIO_NO==4){               ..................               ...............              }            }       }   }}</code></pre><p>Is it the correct way to inner class with weak ref.? Is the above code memory leak-safe?</p>","525004","","","","","2011-02-15 16:35:13","Android Weak Reference of Inner Class","<android><memory-leaks><static><weak-references><inner-classes>","1","0","1","",""
"5002361","1","5006289","","2011-02-15 10:17:13","1","1752","<p>I know that the problem have been treated in other post but after reading  several articles and tutorial i don't understand...</p><p>I have the follogin rox.xml for each listview item</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""android:background=""#FFFFFF"" xmlns:android=""http://schemas.android.com/apk/res/android""&gt;&lt;ImageView android:layout_height=""50sp"" android:layout_width=""50sp"" android:layout_alignParentLeft=""true"" android:id=""@+id/ImageIcon""/&gt;&lt;TextView android:text=""@+id/TextView01"" android:id=""@+id/TitleText""android:textStyle=""bold""android:textSize=""20sp"" android:layout_toRightOf=""@id/ImageIcon""android:layout_alignParentTop=""true""android:layout_width=""fill_parent"" android:layout_height=""wrap_content""android:background=""#FFFFFF""android:textColor=""#333333""/&gt;&lt;TextView android:text=""@+id/TextView02"" android:id=""@+id/DescriptionText"" android:layout_width=""fill_parent"" android:layout_height=""wrap_content""android:textSize=""12sp""android:background=""#FFFFFF""android:textColor=""#333333""android:layout_toRightOf=""@id/ImageIcon""android:layout_below=""@id/TitleText""android:layout_alignWithParentIfMissing=""true""/&gt;&lt;/RelativeLayout&gt;</code></pre><p>My ListViewAdapter has the following getView (with a ViewWrapper)</p><pre><code>public View getView(int position, View convertView, ViewGroup parent)    {        View row=convertView;        ViewWrapper wrapper=null;        Activity activity=(Activity)getContext();        RssItem item=getItem(position);        if (row == null) {            LayoutInflater inflater=activity.getLayoutInflater();        row=inflater.inflate(R.layout.row,null);        wrapper=new ViewWrapper(row);        row.setTag(wrapper);    }        else        {            wrapper=(ViewWrapper)row.getTag();        }        wrapper.getTitle().setText(item.getTitle());        String cleaned=item.getDescription().replaceAll(""\\&lt;.*?\\&gt;"", """");        int Long=cleaned.length();        if (Long&lt;=100)        {            wrapper.getDescription().setText(cleaned);        }        else wrapper.getDescription().setText(cleaned.substring(0, 50)+""..."");        String laurl=item.getImageUrl();        if (laurl!="""")         {             Drawable cachedImage = imageloader.loadDrawable(laurl);            wrapper.getImage().setImageDrawable(cachedImage);        }        else         {            wrapper.getImage().setImageResource(R.drawable.icon);        }        return row;    }    class ViewWrapper {        private View base;        private TextView title=null;        private TextView description=null;        private ImageView icono=null;        ViewWrapper (View base) {            this.base=base;        }        public TextView getTitle() {            if (title==null) {                title=(TextView)base.findViewById(R.id.TitleText);            }            return title;        }        public TextView getDescription() {            if (description==null) {                description=(TextView)base.findViewById(R.id.DescriptionText);            }            return description;        }        public ImageView getImage() {            if (icono==null) {                icono=(ImageView)base.findViewById(R.id.ImageIcon);            }            return icono;        }           }</code></pre><p>And I'm getting images throgh the following class.</p><pre><code>public class ImageThreadLoader  {    //GlobalCache    private HashMap&lt;String, SoftReference&lt;Drawable&gt;&gt; imagecache;    public ImageThreadLoader()    {        imagecache= new HashMap&lt;String, SoftReference&lt;Drawable&gt;&gt;();    }    public Drawable loadDrawable(final String imageurl) //,final ImageCallback imageCallback)    {        if (imagecache.containsKey(imageurl))        {            SoftReference&lt;Drawable&gt; softReference=imagecache.get(imageurl);            Drawable drawable=softReference.get();            if (drawable != null) {                return drawable;            }        }        new Thread() {            @Override            public void run() {                Drawable drawable = loadImageFromUrl(imageurl);                imagecache.put(imageurl, new SoftReference&lt;Drawable&gt;(drawable));            }        }.start();        return null;    }    public static Drawable loadImageFromUrl(String url) {        InputStream inputStream;        try {            inputStream = new URL(url).openStream();        } catch (IOException e) {            throw new RuntimeException(e);        }        return Drawable.createFromStream(inputStream, ""src"");    }}</code></pre><p>Now the listview scrolls smoothly but at the beginning no image are loaded. Then if I scroll up and down repeatedly images appear and sometime disappear.</p><p>I think the problem is that i really dont understand how things works..</p><p>Thanks in adavance</p>","557518","","","","","2011-07-13 16:50:08","ListView Images are only showed when I scroll (and disappear). Explanation of how it works","<android><image><listview><scroll>","3","0","","",""
"5002372","1","","","2011-02-15 10:17:48","0","300","<p>An Android application is usually composed of :- an main activity which is the entry point- other activites- broadcasts- services</p><p>when I start my application :- the main activity is loaded in memory- my main activity starts other activities using startActivity()- a broadcast is loaded in memory- a service is loaded in memory</p><p>The question is : When I press the back button of my cell phone what happens exactly for all the components of my application :- I guess the main activity is destroyed- what about other activites started in my application- is the broadcast still alive ?</p><p>Regards</p>","617578","","","","","2011-02-15 16:49:51","Life cycle of an application / activity and broadcast","<android>","3","0","","",""
"5002381","1","5002459","","2011-02-15 10:19:20","0","101","<p>I have another question!</p><p>I have a configure <code>Activity</code> in my app. On it, I have a <code>ListView</code>. Now adding &amp; removing items to &amp; from it works, but when I rotate the screen to landscape or back, all added &amp; non-saved items in the <code>ListView</code> get removed... I wonder why this is... Why is this?</p>","603059","","","","","2011-02-15 11:28:45","Why is it that when I swap to landscape, my changes to the User Interface are undone?","<java><android>","3","1","","",""
"5002385","1","","","2011-02-15 10:19:36","0","1411","<p>i want to get android emulator port number in program how do i get it????</p>","568796","","","","","2012-10-29 10:51:45","how to get emulator port number in program?","<android><emulator>","2","1","1","",""
"5002417","1","5013699","","2011-02-15 10:22:19","2","1552","<p>I have written a HTML page which has following code.</p><pre><code>&lt;div id=""adsListContainer"" style=""margin: 5px;""&gt;    &lt;textarea id=""txtDesc"" rows=""20"" cols=""50""&gt;&lt;/textarea&gt;    &lt;br /&gt;    &lt;input id=""txtCounts"" value=""0"" size=""8"" /&gt;    &lt;input type=""button"" value=""Count"" onclick=""countChars()"" /&gt;&lt;/div&gt;</code></pre><p>The above html is enclosed in a file named <strong>test.html</strong> and it's being shown in android's WebView control. Now using Java and WebView's <strong>loadURL()</strong> function I am executing javascript as to write something in that textarea as following code goes.</p><pre><code>javascript:document.getElementsByTagName(""textarea"")[0].value += 'anything goes here of not more than 50 chars';void(0);</code></pre><p>Even thought the above code works and I am calling it many times so I may insert 7000+ characters in this textarea element.</p><p>The Java code responsible for executing Javascript to insert text (HTML) into textarea is as follows.</p><pre><code>int bStart = 0;int bEnd = 49;String description = ""some huge description including html tags""int totalChars = description.length() - 1;while (bStart &lt;= totalChars) {    if (bEnd &gt; totalChars)        bEnd = totalChars;    rv = ""javascript:"";    rv += ""var tas=document.getElementsByTagName('textarea');""; // description    rv += ""if (tas.length&gt;0) {"";    rv += ""var ta=tas[0];"";    rv += ""ta.value += '""           + description.substring(bStart, bEnd)            .replace(""'"", ""\\'"").replace('""', '\""') + ""';""; // description    rv += ""}"";    webView.loadUrl(rv + ""void(0);"");    bStart += 50;    bEnd += 50;}</code></pre><p>Although the above code works but not perfectly. The description has <strong>7245</strong> characters but it only insert <strong>6267</strong> characters into textarea of the web page.</p><p>Is there something I am missing?</p>","355507","","","","","2011-02-16 07:34:27","HTML TextArea Characters Limit Inside Android WebView","<java><javascript><android><html><webview>","1","2","1","",""
"5002519","1","5002759","","2011-02-15 10:30:56","1","1749","<p>My layout contain one header in which i inculded in  each Activity, in this header there is a image button. Is it possible to write a common onClick event for this imageButton??</p>","593523","","593523","","2011-02-15 10:46:50","2011-02-15 13:29:55","Common buttons onClick for every activity in android","<android>","3","0","3","",""
"5002567","1","5009372","","2011-02-15 10:36:01","3","607","<p>I have used maps many times before, but this is the first time I have ever tried to use it within an ActivityGroup. I have spent hours pulling my hair out trying to figure out why the maps won't show (just showing the grid) and it turns out that it is simply because the Activity is in an ActivityGroup.</p><p>I googled the problem but all found was people asking how and not getting any answers.</p><p>Does anyone know if there is a way to get maps working inside an ActivityGroup?</p>","348261","","","","","2011-02-15 20:53:38","Does anyone know how to get maps working inside an activity group?","<android><activity><grid><maps><activitygroup>","1","3","","",""
"5002572","1","","","2011-02-15 10:36:24","0","515","<p>I want to put into a listview all contact number. Some contacts have more than one phone number and I want to display a list this :</p><pre><code>PippoNumber : +393934578987PippoNumber : +394578952364TopolinoNumber : +45124578972MinnieNumber : +39454545445bMinnieNumber : +39457879758etc</code></pre><p>I used a SimpleAdapter with List and Maps but the performance was poor...than I decided to use the SimpleCursorAdapter and for to access the table ContactsContract and ContactsContract.CommonDataKinds.Phone a CursorJoiner with this code</p><pre><code>Cursor cursor = getContentResolver().query(ContactsContract.Contacts.CONTENT_URI, null, ContactsContract.Contacts.HAS_PHONE_NUMBER + ""=1"", null, null);Cursor phones = getContentResolver().query(ContactsContract.CommonDataKinds.Phone.CONTENT_URI,null,ContactsContract.CommonDataKinds.Phone.CONTACT_ID + "" = "" + Contacts._ID, null, null);        String[] cursor_join = new String[]{                Contacts._ID,                ContactsContract.Contacts.DISPLAY_NAME,                ContactsContract.CommonDataKinds.Phone.NUMBER        };        MatrixCursor matrix_cursor = new MatrixCursor(cursor_join);        CursorJoiner cursor_j = new CursorJoiner(cursor, new String[]{Contacts._ID}, phones, new String[]{ContactsContract.CommonDataKinds.Phone.CONTACT_ID});        for (CursorJoiner.Result joinerResult : cursor_j) {            String[] values;            switch (joinerResult) {                         case LEFT:             // handle case where a row in cursorA is unique                                 values = new String[]{                            cursor.getString(cursor.getColumnIndex(Contacts._ID)),                            cursor.getString(cursor.getColumnIndex(ContactsContract.Contacts.DISPLAY_NAME)),                            phones.getString(phones.getColumnIndex(ContactsContract.CommonDataKinds.Phone.NUMBER))                        };                        matrix_cursor.addRow(values);                    break;                         case RIGHT:             // handle case where a row in cursorB is unique                                 break;                         case BOTH:             // handle case where a row with the same key is in both cursors                                 values = new String[]{                            cursor.getString(cursor.getColumnIndex(Contacts._ID)),                            cursor.getString(cursor.getColumnIndex(ContactsContract.Contacts.DISPLAY_NAME)),                            phones.getString(phones.getColumnIndex(ContactsContract.CommonDataKinds.Phone.NUMBER))                        };                        matrix_cursor.addRow(values);                    break;                 }        }        while(matrix_cursor.moveToNext()){            contactId = matrix_cursor.getInt(matrix_cursor.getColumnIndex(Contacts._ID));            String name = matrix_cursor.getString(matrix_cursor.getColumnIndex(ContactsContract.Contacts.DISPLAY_NAME));            String num = matrix_cursor.getString(matrix_cursor.getColumnIndex(ContactsContract.CommonDataKinds.Phone.NUMBER));        }</code></pre><p>but it does not work  </p><p>someone tell me why?</p><p>Thanks</p>","617602","","762442","","2011-10-26 13:06:47","2011-11-13 15:02:10","ContactsContract and performance","<android><listview><android-listview><contacts>","2","0","","",""
"5002586","1","5086468","","2011-02-15 10:37:45","3","829","<p>I am creating a Live Wallpaper and I'm painting to the canvas on everyRunnable.run() call with a changing colour and i'm hoping to put agradient over the top but the gradient i'm creating is bandinghorribly. After Googling around for a few days I came up with 2 solutions:set the dither to trueset the canvas bitmap to ARGB_8888</p><p>i've tried doing the first one (set dither to true) on thegetWallpaper() accessor and the Paint object but it's not helped (I can't seeany dithering at all) so I've tried changing the canvas bitmap but i'mnot sure how to actually display it</p><pre><code>// _canvasBmp = Bitmap.createBitmap(metrics.widthPixels, metrics.heightPixels, Bitmap.Config.ARGB_8888);_shadowPaint.setStyle(Paint.Style.FILL);_shadowPaint.setShader(new RadialGradient(metrics.widthPixels / 2,metrics.heightPixels / 2, metrics.heightPixels / 2, 0x00000000,0x33000000, Shader.TileMode.CLAMP));_shadowPaint.setDither(true); // this hasn't seemed to have done anything to fix the banding// my main rendering method is this (based on the Google live wallpaper example)void drawFrame(){   final SurfaceHolder holder = getSurfaceHolder();   Canvas c = null;   try   {           c = holder.lockCanvas();           // c.setBitmap(_canvasBmp);// this was my attempt to update the bitmap to one that was ARGB_8888 but it didn't render at all           if (c != null)           {                   // draw something                   drawBackground(c);                   drawTouchPoint(c);                   drawShading(c);                   drawBorder(c);                   getWallpaper().setDither(true); // yet another attempt to get some kind of dithering going to no avail           }   }   finally   {           if (c != null)                   holder.unlockCanvasAndPost(c);   }   _handler.removeCallbacks(_drawClock); // _drawClock is the Runnable object   if (_isVisible)   {           _handler.postDelayed(_drawClock, 1000 / 25);   }}private void drawShading(Canvas c){    c.drawRect(_screenBounds, _shadowPaint); // _screenBounds is a Rect set to the _metrics width and height}</code></pre><p>Thanks in advance for your time</p>","617603","","19750","","2012-01-05 18:36:45","2012-02-17 00:19:26","Live Wallpaper gradient banding: is it possible to use ARGB_8888 or dithering to fix?","<android><gradient><live-wallpaper>","1","0","3","",""
"5002589","1","5010949","","2011-02-15 10:38:08","10","1599","<p>I have gone through the article <a href=""http://developer.android.com/resources/articles/avoiding-memory-leaks.html"">http://developer.android.com/resources/articles/avoiding-memory-leaks.html</a> . In this article it is suggested to use static inner class with Weak Reference . Many inner class are used in the event listeners. Can those inner class also cause memory leakage? Should those inner class be Staic one? Can any one give me any example code how the event listener can use leak-proofly.</p>","525004","","","","","2011-02-15 23:57:52","Memory leakage in event listener","<android><memory-leaks><static><inner-classes><eventlistener>","1","0","6","",""
"5002713","1","5005030","","2011-02-15 10:51:01","2","1430","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/3579693/android-tutorials"">android tutorials</a>  </p></blockquote><p>Can somebody point to some links where I can find some good tutorials and examples for developing android applications which is more than Hello World?</p><p>I want something combining web and android together. Like some app which is consuming data from my server or anything like that.</p>","443694","","385273","","2014-02-05 18:45:24","2014-02-05 18:45:24","Where can i find best android tutorials which is more than beginners","<android>","2","4","1","2011-12-18 07:09:27",""
"5002722","1","5002751","","2011-02-15 10:51:31","6","5621","<p>I want to display a point and a text on top of an image. I have tried several tutorial on overlaying bitmap, but it doesn't seem to work. Here is the code which displays the background image.</p><pre><code>mBitmap = BitmapFactory.decodeResource(getResources(), R.drawable.roomplan);mIV = (ImageView)findViewById(R.id.ImageView01);mIV.setImageBitmap(mBitmap); mIV.invalidate();btnDraw = (Button)findViewById(R.id.Button01);btnDraw.setOnClickListener(this);</code></pre><p>Then on the OnClickListener, I define another bitmap and draw the point and the text.</p><pre><code>Bitmap bmOverlay = Bitmap.createBitmap(mBitmap.getWidth(), mBitmap.getHeight(),     Bitmap.Config.ARGB_4444);Canvas canvas = new Canvas(bmOverlay);Paint paint = new Paint();paint.setColor(Color.CYAN);paint.setTextSize(20);paint.setFlags(Paint.ANTI_ALIAS_FLAG);canvas.drawText(""You are here"", 100, 100, paint);canvas.drawPoint(30.0f, 50.0f, paint);canvas.drawBitmap(bmOverlay, 0, 0, null);</code></pre><p>Nothing is displayed on top of the background image, even when I remove the image. Any hint please?</p><p><strong>Update:</strong> The working code</p><pre><code>// get a reference to the background imagemBitmap = BitmapFactory.decodeResource(getResources(), R.drawable.raumplan_isst);mIV = (ImageView)findViewById(R.id.ImageView01);// create a mutable bitmap with the same size as the background imageBitmap bmOverlay = Bitmap.createBitmap(mBitmap.getWidth(), mBitmap.getHeight(),     Bitmap.Config.ARGB_4444);// create a canvas on which to drawcanvas = new Canvas(bmOverlay);Paint paint = new Paint();paint.setColor(Color.CYAN);paint.setTextSize(20);paint.setFlags(Paint.ANTI_ALIAS_FLAG);// if the background image is defined in main.xml, omit this linecanvas.drawBitmap(mBitmap, 0, 0, null);// draw the text and the pointcanvas.drawPoint(fKoordX, fKoordY, paint);canvas.drawText(""You are here"", fKoordX+3, fKoordY+3, paint);// set the bitmap into the ImageViewmIV.setImageBitmap(bmOverlay);</code></pre>","404437","","404437","","2011-02-15 14:52:53","2011-02-15 14:52:53","draw text on top of bitmap failed","<android><graphics><bitmap><overlay>","1","2","1","",""
"5002734","1","","","2011-02-15 10:52:29","1","266","<p>I have a list view, it loads the personal details of some broadcasters. </p><p>If I click on this. it directs to another list view with some details.  When I try to scroll the view a force to close message appears.</p><p>List view is displayed by using LazyAdapter class and write some extra condition for second and third list view.</p><p>In first view scrolling has no problem. but all other view (second and third) scroll time error force to close how to solve this problem?</p><p>Date 23-03-2011this problem is solved thanx for all comments</p>","617405","","617405","","2011-03-23 10:44:06","2011-03-23 10:44:06","List view Android","<android><listview>","1","3","","",""
"5002845","1","6199060","","2011-02-15 11:04:23","4","6206","<p>I'm building the Android scanning app using zxing library. I have built the zxing core and included the core.jar into my application build path. I don't want to use the intent solution provided in this url ""http://code.google.com/p/zxing/wiki/ScanningViaIntent"".</p><p>My question is: How can I open the camera, capture the contentious images and pass to zxing core library to decode it, when the decode method return the success stop the camera and print the result?</p><p>I found the following link useful for me: <a href=""http://www.arp123.com/post/Identified-in-the-Android-use-ZXing-barcode-QR-Code.html"" rel=""nofollow"">http://www.arp123.com/post/Identified-in-the-Android-use-ZXing-barcode-QR-Code.html</a> But I'm having problems in continuous scanning. When compared to zxing 1.6 Android barcode scanner app my solution is not good. If someone can help me or guide me to sort this out I would really appreciate it.</p>","322111","","488657","","2012-04-18 12:09:59","2012-04-30 13:40:05","How to use zxing core as library on my Android project?","<android>","1","2","2","",""
"5002900","1","","","2011-02-15 11:13:12","0","1251","<p>i want to create a car dashboard on android.Actually i am created already this application.But that is based on animation and it is working nicely.Now here i want to add two button(up and down).when i am clicking up the hand have to move 10 degree up.Again click up button means the hand have to move 10 degree up from the current position, and when i am clicking down means it have to come down by 10 degree. i cant do this by a single button in animation.in animation i want to create more button and each button i want to create different animation. This is very complex. please somebody help me to do this.Here i am adding my code</p><pre><code>     import android.app.Activity;     import android.graphics.Bitmap;     import android.graphics.BitmapFactory;     import android.graphics.Matrix;     import android.graphics.drawable.BitmapDrawable;     import android.os.Bundle;     import android.view.MotionEvent;     import android.view.View;     import android.view.animation.AccelerateInterpolator;     import android.view.animation.Animation;     import android.view.animation.AnimationUtils;     import android.widget.Button;     import android.widget.ImageView;     public class dash1 extends Activity {      ImageView img,img1;  Animation an,an1,an2,an3;Button bt,bt2,bt3,bt4;         /** Called when the activity is first created. */public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    img = (ImageView)findViewById(R.id.ImageView01);    final Bitmap bmp = BitmapFactory.decodeResource(getResources(), R.drawable.minute);    final int w= bmp.getWidth();    final int h= bmp.getHeight();    final Matrix mat = new Matrix();    mat.postRotate(180);    Bitmap rtd = Bitmap.createBitmap(bmp, 0, 0, w, h, mat, true);    BitmapDrawable bmd = new BitmapDrawable(rtd);    img.setImageDrawable(bmd);    an = AnimationUtils.loadAnimation(this, R.anim.anim);    an1 = AnimationUtils.loadAnimation(this, R.anim.anim1);    an2 = AnimationUtils.loadAnimation(this, R.anim.anim2);    an3 = AnimationUtils.loadAnimation(this, R.anim.anim3);    bt = (Button)findViewById(R.id.Button01);    bt2 = (Button)findViewById(R.id.Button02);    bt3 = (Button)findViewById(R.id.Button03);    bt4 = (Button)findViewById(R.id.Button04);                bt.setOnTouchListener(new View.OnTouchListener() {                @Override                public boolean onTouch(View v, MotionEvent event) {                    // TODO Auto-generated method stub                    an.setFillAfter(true);                    img.startAnimation(an);                    return false;                }            });            bt2.setOnClickListener(new View.OnClickListener() {                @Override                public void onClick(View v) {                    // TODO Auto-generated method stub                    img.startAnimation(an1);                }            });            bt3.setOnClickListener(new View.OnClickListener() {                @Override                public void onClick(View v) {                    // TODO Auto-generated method stub                    an2.setFillAfter(true);                    img.startAnimation(an2);                }            });            bt4.setOnClickListener(new View.OnClickListener() {                @Override                public void onClick(View v) {                    // TODO Auto-generated method stub                    an3.setFillAfter(true);                    img.startAnimation(an3);                }            });}}</code></pre>","607853","","607853","","2011-02-15 12:16:20","2011-02-15 12:21:49","how to rotate an image back and forth in android without using animation","<android>","1","1","","",""
"5002907","1","","","2011-02-15 11:13:44","1","773","<p>I'm working on android c2dm for a while.</p><p>Last week, I got registration id in the emulator's logcat, but I still can not get auth token.</p><p>And there are some error &amp; warning messages in my logcat:</p><p></p><pre><code>**02-15 10:41:39.092: WARN/DefaultRequestDirector(176): Authentication error: Unable to respond to any of these challenges: {}****02-15 10:41:39.102: ERROR/C2DMRegistrar(176): [C2DMReg] handleRequest caught org.apache.http.auth.AuthenticationException**02-15 10:41:42.601: INFO/System.out(487): APA91bF_B-VagQ9pO1toPGGMUYMBAURfgyL1AAa6Y8fn5WKf2DSj0qJINnlJIQ_MRoJBVdo9hMvJu1hLjHid-rk37zOFuOaY5A02-15 10:41:42.601: INFO/System.out(487): [ 02-15 10:41:42.601   487:0x1f3 I/1registrationid=APA91bF_B-VagQ9pO1toPGGMUYMBAURfgyL1AAa6Y8fn5WKf2DSj0qJINnlJIQ_MRoJBVdo9hMvJAPA91bF_B-VagQ9pO1toPGGMUYMBAURfgyL1AAa6Y8fn5WKf2DSj0qJINnlJIQ_MRoJBVdo9hMvJu1hLjHid-rk37zOFuOaY5A02-15 10:41:42.642: INFO/C2DMReceiver-onRegistered(487): APA91bF_B-VagQ9pO1toPGGMUYMBAURfgyL1AAa6Y8fn5WKf2DSj0qJINnlJIQ_MRoJBVdo9hMvJu1hLjHid-rk37zOFuOaY5A**02-15 10:41:42.713: WARN/DeviceRegistrar(487): 2Registration error the name must not be empty: null**</code></pre><p>Now I'm trying to use the chrometophone's source code, but still don't get auth token...</p><p>Am I miss something and how can I get the auth token?</p>","517011","","469983","","2011-10-27 09:33:48","2012-01-23 16:01:39","How to get C2DM auth token?","<android><android-c2dm><auth-token>","1","0","1","",""
"5002931","1","","","2011-02-15 11:17:31","1","974","<p>Can I change the Android phone mode (day, night, automatic) programmatically?  This is not working for me:</p><pre><code>UiModeManager manager = (UiModeManager)getSystemService(Context.UI_MODE_SERVICE);manager.setNightMode(UiModeManager.MODE_NIGHT_YES);</code></pre><p>Do I need to set any permissions in AndroidMaifest.xml for this?</p>","609602","","515205","","2014-02-27 23:27:25","2014-02-27 23:27:25","change mode of android phone as day, night, automatic","<android>","0","3","","",""
"5002938","1","","","2011-02-15 11:18:03","0","774","<p>Could any plz tell how to find how many activites are currently in the history stack of the application ?</p>","617510","","","","","2011-02-15 11:57:25","How to find total activities in the stack history?","<android>","1","1","","",""
"5003025","1","5003750","","2011-02-15 11:26:19","0","1143","<p>code is given below, problem is i am not able to remove ""Main""  tab from the code, as it just closes the application, and that happens because once main tab is removed it selects ""call"" tab default activity...buh i want to have  main view as main activity and call or email or web    tab only work when a user click on them </p><p>Java code</p><pre><code>package com.NVT.android;import android.app.TabActivity;import android.content.Intent;import android.content.res.Resources;import android.os.Bundle;import android.widget.TabHost;public class MainTabActivity extends TabActivity{        public void onCreate(Bundle savedInstanceState) {            super.onCreate(savedInstanceState);            setContentView(R.layout.tab_activity_layout);            Resources res = getResources(); // Resource object to get Drawables            TabHost tabHost = getTabHost();  // The activity TabHost            TabHost.TabSpec spec;  // Resusable TabSpec for each tab            Intent intent;  // Reusable Intent for each tab            // Create an Intent to launch an Activity for the tab (to be reused)            intent = new Intent().setClass(this, Main.class);            // Initialize a TabSpec for each tab and add it to the TabHost            spec = tabHost.newTabSpec(""main"").setIndicator(""Main"",                              res.getDrawable(R.drawable.ic_tab_artists_grey))                          .setContent(intent);            tabHost.addTab(spec);            TabHost host=getTabHost();            host.addTab(host.newTabSpec(""one"")                    .setIndicator(""Call"")                    .setContent(new Intent(this, CallService.class)));            host.addTab(host.newTabSpec(""two"")                    .setIndicator(""Email"")                    .setContent(new Intent(this, EmailService.class)));            host.addTab(host.newTabSpec(""three"")                    .setIndicator(""Web"")                    .setContent(new Intent(this, WebService.class)));        }    }</code></pre><p>XML coding</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;RelativeLayout    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""            android:layout_alignParentBottom=""true""             /&gt;                  &lt;FrameLayout            android:id=""@android:id/tabcontent""            android:layout_width=""fill_parent""            android:layout_height=""fill_parent""            android:padding=""5dp""&gt;&lt;/FrameLayout&gt;    &lt;/RelativeLayout&gt;    &lt;/LinearLayout&gt;&lt;/TabHost&gt;</code></pre><p>Manifest file</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.NVT.android""      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;!--            &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; --&gt;        &lt;/activity&gt;        &lt;activity android:name="".MainTabActivity""                  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="".Courses""&gt;        &lt;/activity&gt;        &lt;activity android:name="".CampusMap""&gt;        &lt;/activity&gt;        &lt;activity android:name="".GettingHere""&gt;        &lt;/activity&gt;        &lt;activity android:name="".ILoveNescot""&gt;        &lt;/activity&gt;        &lt;activity android:name="".FurtherEducationCourses""&gt;        &lt;/activity&gt;        &lt;activity android:name="".HigherEducationCourses""&gt;        &lt;/activity&gt;        &lt;activity android:name="".EmployersTrainingCourses""&gt;        &lt;/activity&gt;        &lt;activity android:name="".WebService""&gt;        &lt;/activity&gt;        &lt;activity android:name="".CallService""&gt;        &lt;/activity&gt;        &lt;activity android:name="".EmailService""&gt;        &lt;/activity&gt;    &lt;/application&gt;    &lt;uses-sdk android:minSdkVersion=""9"" /&gt;&lt;uses-permission android:name=""android.permission.CALL_PHONE""&gt;&lt;/uses-permission&gt;&lt;/manifest&gt; </code></pre>","1090104","","180538","","2011-02-15 12:31:36","2011-02-15 12:39:32","no tab selected by default","<android><android-tabhost>","1","5","","",""
"5003065","1","5003110","","2011-02-15 11:30:00","2","589","<p>I have a bar with several ImageViews, each of them is used as a button (by using the OnClickListener). Now what I want to achieve is when a user pressed the image, some kind of a glow effect will appear around the image (much like when you press barButton on the iphone).</p><p>Is this possible?</p>","171911","","114066","","2011-02-15 11:36:40","2011-02-15 16:13:27","Android: Animating Images?","<android><animation><imageview>","3","0","1","",""
"5003069","1","5003186","","2011-02-15 11:30:35","2","4247","<p>I implemented basic scrolling via touch dragging and multitouch zooming for a custom view. This works well, but now I'd like to add some advanced features.</p><p>For example, in the Google Maps application, when you drag around the screen, after you stop dragging it will still continue to move a bit (inertia). And some browsers (e.g. IPad Safari) allow you to drag the screen further than the visible area of the website, but then the screen will quickly snap back to the edge of the website.</p><p>I'd now like to implement something similar, but to do that I need to change the active screen region <em>after</em> the touch events happened in regular intervals to perform the animation. How can I do that?</p>","347857","","347857","","2011-02-18 13:42:42","2011-02-18 13:42:42","Smooth scrolling with inertia and edge resistance/snapback","<java><android><touch>","2","0","10","",""
"5003124","1","","","2011-02-15 11:36:28","0","203","<p>I've an app using the LVL. It consists (for simplicity) of two activities: The first one called LVLActivity checks the licence. If it fails, it simply finnishes, otherwise it launches the second activity called MainActivity with an explicit intent.</p><p>In the manifest, there is</p><pre><code>&lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;    &lt;activity android:name="".LVLActivity""&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="".MainActivity""&gt;    &lt;/activity&gt;&lt;/application&gt;</code></pre><p>My question is then : Is it possible for someone else to write a small app that launches the MainActivity with an explicit intent ? Is this kind of setup is enough for a reasonable protection ?</p><p>Thanks!</p>","377088","","","","","2011-02-15 13:09:20","App protection with LVL and explicit intents?","<android><android-intent><android-lvl>","2","0","","",""
"5003156","1","5152019","","2011-02-15 11:39:21","66","49391","<p>I'm struggling to create a WebView with transparent background.</p><pre><code>webView.setBackgroundColor(0x00FFFFFF);webView.setBackgroundDrawable(myDrawable);</code></pre><p>Then I load a html page with </p><pre><code>&lt;body style=""background-color:transparent;"" ...</code></pre><p>The background color of the WebView is transparent but as soon as the page is loaded, it's overwritten by a black background from the html page. This only happens on android 2.2, it works on android 2.1.</p><p>So is there something to add in the html page code to make it really transparent ?      </p>","612912","","612912","","2011-02-15 11:50:56","2014-02-21 14:36:59","Android WebView style background-color:transparent ignored on android 2.2","<android><background><webview><transparency><transparent>","16","1","23","",""
"5003196","1","","","2011-02-15 11:43:42","0","214","<p>Android:Hello,i am creating Sms aplication.I have ListView of all sms and i am trying if i click on any sms in listview it's open SmsManager where will be number of that sms.But there is unexpected end of aplication if i click on any message in listview.Thank you for help.</p><p>There is source code:</p><pre><code> list.setOnItemClickListener(new OnItemClickListener() {            @Override            public void onItemClick(AdapterView&lt;?&gt; arg0, View view, int position,                    long id) {                SmsManager m = SmsManager.getDefault();                Uri uriSMSURIs = Uri.parse(""content://sms/inbox"");                Cursor cc = getContentResolver().query(uriSMSURIs, null, null, null, null);                String destinationAddress  = cc.getString(cc.getColumnIndex(""address""));                m.sendTextMessage(destinationAddress , null, destinationAddress , null, null);            }        });    }</code></pre>","617683","","","","","2011-02-15 12:35:19","Open SmsManager","<android>","2","2","","",""
"5003208","1","","","2011-02-15 11:44:29","0","2735","<p>This code is usingthe Google APIs (level 8).</p><p>When I update the OverlayItem to use a custom drawable the Canvasobject seems to draw the pixels in the wrong location.  In thisexample I'm trying to draw a circle in Louisiana.  When viewing theentire map the circle is drawn off the map.  As you zoom into NewOrleans you'll see the circle approach the appropriate latitude andlongitude.  The hot spot seems to be in the correct location, nomatter where the circle is being drawn.</p><p>If, in the draw method, the canvas restore method is called the circledraws in the correct location.</p><p>Also If the custom drawable is not used, the icon is drawn in thecorrect location (without using Canvas ""restore"").</p><p>Below is the code showing this behavior.  I tried adding ""setBounds""and ""boundCenterBottom"", since other people seemed to indicate thatresolved their ""wrong location"" problems. Thoughto be honest I'm not sure why those calls are needed.</p><pre><code>=======================================================================public class MapsActivity extends MapActivity{    /** Called when the activity is first created. */    public void onCreate(Bundle savedInstanceState)    {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        MapView mapView = (MapView) findViewById(R.id.mapView);        mapView.setBuiltInZoomControls(true);        // Itemized Overlay        List&lt;Overlay&gt; mapOverlays = mapView.getOverlays();        Drawable defaultIcon =this.getResources().getDrawable(R.drawable.icon);        MyItemizedOverlay itemizedoverlay = newMyItemizedOverlay(defaultIcon, this);        // Overlay Item        GeoPoint pt = new GeoPoint(30000000, -90000000);        OverlayItem item = new OverlayItem(pt,""New Orleans"",""Louisiana"");        // Custom Drawable        CustomDrawable customDrawable = new CustomDrawable(pt,mapView);        boolean showProblem = true;        if (showProblem)        {            item.setMarker(customDrawable);        }        else        {            item.setMarker(defaultIcon);        }        // Add item we want to overlay        itemizedoverlay.addOverlay(item);        // Add overlay        mapOverlays.add(itemizedoverlay);    }    protected boolean isRouteDisplayed()    {        return false;    }}=======================================================================public class MyItemizedOverlay extends ItemizedOverlay&lt;OverlayItem&gt;{    private ArrayList&lt;OverlayItem&gt; mOverlays = newArrayList&lt;OverlayItem&gt;();    private Context mContext;    public MyItemizedOverlay(Drawable defaultMarker, Context context)    {        super(boundCenterBottom(defaultMarker));        mContext = context;    }    public void addOverlay(OverlayItem item)    {        mOverlays.add(item);        populate();    }    public void removeOverlay(OverlayItem item)    {        mOverlays.remove(item);    }    public void removeOverlay(int item)    {        mOverlays.remove(item);    }    protected OverlayItem createItem(int i)    {        OverlayItem item = mOverlays.get(i);        Drawable drawable = item.getMarker(0);        if (drawable != null)        {            int w = drawable.getIntrinsicWidth();            int h = drawable.getIntrinsicHeight();            drawable.setBounds(0, 0, w, h);            item.setMarker(boundCenterBottom(drawable));        }        return item;    }    public void draw(android.graphics.Canvas canvas, MapView mapView,            boolean shadow)    {        if (shadow)            return;        super.draw(canvas, mapView, shadow);    }    public int size()    {        return mOverlays.size();    }    protected boolean onTap(int index)    {        OverlayItem item = mOverlays.get(index);        AlertDialog.Builder dialog = newAlertDialog.Builder(mContext);        dialog.setTitle(item.getTitle());        dialog.setMessage(item.getSnippet());        dialog.show();        return true;    }}=======================================================================public class CustomDrawable extends ShapeDrawable{    private int radius = 10;    private GeoPoint point = null;    private MapView mapView = null;    public CustomDrawable(GeoPoint point, MapView mapView)    {        this.point  = point;        this.mapView  = mapView;    }    public void draw(Canvas canvas)    {        // TODO This (somewhat) fixes projection problem?        //canvas.restore();        Projection projection = mapView.getProjection();        Point pt = projection.toPixels(point, null);        canvas.drawCircle(pt.x, pt.y, radius,getPaint());    }    public int getIntrinsicHeight()    {        return 2 * radius;    }    public int getIntrinsicWidth()    {        return 2 * radius;    }}=======================================================================</code></pre>","617686","","","","","2013-01-14 14:14:48","Problem with drawing location using a custom Drawable in an Android OverlayItem","<android><location><marker><overlayitem>","2","2","1","",""
"5003266","1","5003355","","2011-02-15 11:50:11","1","1124","<p>I am having two page, in one page am having chronometer, after I left and come back the page the chronometer has stopped, any one can tell me how to redirect the page</p><p>My code:</p><pre><code>            Chronometer chrono=(Chronometer)findViewById(R.id.chronometer);            chrono.setBase(SystemClock.elapsedRealtime());            chrono.start(); </code></pre><p>thank you</p>","565106","","457982","","2011-02-15 12:05:52","2011-02-15 12:09:58","Redirect the page in Android","<android><redirect>","2","0","","",""
"5003328","1","5003434","","2011-02-15 11:56:59","0","1611","<p>I am not sure if this is possible...i have code within my application which encrypts images...</p><pre><code>Cipher cipher;SecretKey key;byte[] buf = new byte[1024];DesEncrypter() {   byte[] iv = new byte[] { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09,      0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17 };   key = new SecretKeySpec(iv, ""AES"");   try {     cipher = Cipher.getInstance(""AES/ECB/PKCS7Padding"", ""BC"");     cipher.init(Cipher.ENCRYPT_MODE, key);             }    catch (NoSuchProviderException e) {} }        public void encrypt(InputStream in, OutputStream out) {    try {      out = new CipherOutputStream(out, cipher);      int numRead = 0;      while ((numRead = in.read(buf)) &gt;= 0) {          out.write(buf, 0, numRead);      }      out.close();    } </code></pre><p>Every time i encrypt or decrypt an image (which my application does alot) it takes a very long time, any tips on how to increase the process so users have a better experience? </p>","569654","","","","","2011-02-15 12:52:00","Android - Increase speed of encryption","<android><image><encryption><image-processing>","5","0","1","",""
"5003329","1","5003569","","2011-02-15 11:57:01","3","672","<p>I suspect there are applications on my Android system that use the AlarmManager way too agressively (eg. exact repeating, instead of inexact repeating, etc.).  Is there a way to inspect all alarms set in the AlarmManager on the system?</p>","616165","","","","","2011-02-15 12:22:04","How to inspect all alarms defined in the AlarmManager on the system?","<android><alarmmanager>","1","0","4","",""
"5003494","1","5003624","","2011-02-15 12:13:16","0","581","<p>I have two images, one text view and one gallery in my app and want my layout as shown below.</p><pre><code>............................................-.&lt;ImageView&gt;|     &lt;TextView&gt;      |&lt;ImageView&gt;|..............................................||                  Gallery||.............................................</code></pre><p>I have a table layout and almost got the deign as shown above except that when the text length is small the ImageView at the right end of the screen keeps moving. I want the the ImageView's at left and right end of the screen to be fixed irrespective of the size of text.</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""android:orientation=""vertical""xmlns:android=""http://schemas.android.com/apk/res/android"" &gt;&lt;TableLayout xmlns:android=""http://schemas.android.com/apk/res/android""android:layout_height=""wrap_content"" android:layout_width=""wrap_content""&gt;&lt;TableRow&gt; &lt;ImageView xmlns:android=""http://schemas.android.com/apk/res/android""    android:id=""@+id/imageL""android:layout_width=""fill_parent""    android:layout_height=""fill_parent""      android:layout_weight=""1""    android:minHeight=""30px""android:minWidth=""30px""  /&gt;  &lt;TextView xmlns:android=""http://schemas.android.com/apk/res/android""android:id=""@+id/title""android:paddingLeft=""10px""android:layout_width=""wrap_content""    android:layout_height=""wrap_content""     android:layout_weight=""3""    android:layout_gravity=""center""    android:minHeight=""30px""android:minWidth=""30px""   /&gt;  &lt;ImageView xmlns:android=""http://schemas.android.com/apk/res/android""android:id=""@+id/imageR""android:paddingLeft=""10px""android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:layout_weight=""1""    android:minHeight=""30px""android:minWidth=""30px""    /&gt; &lt;/TableRow&gt; </code></pre><p></p><p></p>","608209","","512958","","2011-02-15 12:18:24","2011-02-15 14:19:06","Android Layout Problem","<android><layout>","3","0","","",""
"5003545","1","5003773","","2011-02-15 12:18:29","1","110","<p>I am connecting oracle database through OJDBC.RAR. when i try to list out all the data from the database it show only the data which contains in the first column. the remaining data are not visible.  pls give me a solution </p><p>My Code:</p><pre><code>DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver()); Connection conn; ResultSet rs; Statement stmt; conn = DriverManager.getConnection(jdbcURL, user, passwd); stmt = conn.createStatement(); //getting values from DBS rs = stmt.executeQuery(""SELECT * FROM isroot""); rs.next(); id = rs.getString(1); name=rs.getString(2); genre=rs.getString(5);</code></pre>","599841","","267269","","2011-02-15 12:39:17","2011-10-20 20:54:32","accessing data from Database","<android>","1","3","","",""
"5003558","1","","","2011-02-15 12:20:24","1","778","<p>I'm facing a problem using Wake lock through PowerManager API.Currently, i have a service and a broadcast receiver.</p><p>My service has 2 main roles :</p><ul><li>First one, it creates an alarm at a specific time (my receiver receives the boot completed intent from system and start the service to create the next alarm)</li><li>Second one, the receiver reacts to the alarm (in RTC_WAKEUP mode) and start the service to play a notification by turning on the screen.</li></ul><p>I'm using Mark murphy's cwac-wakeful module to achieve that and it works just fine.</p><p>The problem is : the screen turns on and off too fast for the user to see it.</p><p>Here is what's happening when the alarm intent is launched (for the second role/case) : </p><ul><li>OnReceive method of Broadcast receiver is called</li><li>It calls WakefulIntentService.sendWakefulWork</li><li>My wakeLock is acquired (with SCREEN_DIM_WAKE_LOCK  | ACQUIRE_CAUSES_WAKEUP | ON_AFTER_RELEASE flags)</li><li>Screen is turned on</li><li>The service is launched : The notifications is created and displayed</li><li>Service finishes</li><li>Wake lock is released</li><li>Screen is turned off immediatly (not on after release for a few seconds)</li></ul><p>As you have probably understood. The problem is, the lock is released too fast after the service finishes so i can just see the screen turning on and off in less that one second.I thought that using the  ON_AFTER_RELEASE (the doc says : ""If this flag is set, the user activity timer will be reset when the WakeLock is released, causing the illumination to remain on a bit longer. This can be used to reduce flicker if you are cycling between wake lock conditions. "") would have solved my problem, but no.</p><p>When googling, i found a solution that consists in :</p><ul><li>Not releasing the wake lock justafter the service finishes butlaunching another alarm in the next15/20sec (from when service finishes)that would release the wakelock (viareceiver/service) and turn off thescreen. I don't know if it'a goodsolution and it seems complicated tome for this use case</li></ul><p><em><strong>Then my question is how can i maintain the screen on for a few seconds (say 10/15 sec) like when i receive an sms, what is the best solution to achieve that ?</em></strong></p><p>Any help would be greatly appreciated, and thanks in advance !</p>","617736","","","","","2012-10-07 05:15:23","Screen on and then off too fast when using WakeLock (not remaining on for a few second)","<android>","2","0","1","",""
"5003609","1","5003661","","2011-02-15 12:25:02","2","993","<p>In France and other countries, the currency symbol is after a monetary amount while in others it is before, plus, the decimal separator is a comma rather than a point (<code>£0.00</code> vs <code>0,00 €</code>).</p><p>If I use the following Java code (from memory, may not compile) on my Android device, I can get a <code>NumberFormat</code> which formats things correctly:</p><pre><code>NumberFormat format = NumberFormat.getCurrencyInstance(Currency.get(Locale.FRANCE));</code></pre><p>This <code>NumberFormat</code> formats to the correct number of decimal places (two in the above examples).</p><p>I would like to format to 10 decimal places for a financial app, while keeping the decimal separator and 'symbol side' correct.</p><p>I can quite happily build my own format expression - the problem is finding out the information for a particular <code>Locale</code> or <code>Country</code>. Is there a way of finding this out at runtime from the Java/Dalvik VMs or am I just going to have to hard code it?</p><p>Hard coding it isn't really a problem as I only have about 20 currencies to worry about, but obviously if it can be derived then that is even easier :)</p>","68283","","","","","2011-02-15 12:31:09","Correctly formatting currencies to more decimal places than the Locale specifies","<java><android><localization><locale>","1","0","2","",""
"5003656","1","5004028","","2011-02-15 12:30:42","-2","413","<p>I am making an application and I have added an EditText in my layout.</p><p>What I'm trying to achieve is that when EditText is selected should open a dialog box, with some general text and an <code>OK</code> button. Which method can I use to accomplish this?</p>","521015","","16487","","2011-02-15 13:14:36","2011-02-15 13:14:36","editText in android","<android>","3","5","","",""
"5003876","1","","","2011-02-15 12:52:50","0","1190","<p>I have a problem in updating the SDK with Android SDK Tools, revision 9</p><p>I am getting the following error. I have tried reinstalling the SDK but i did not work.</p><p>Downloading Android SDK Tools, revision 9Server returned HTTP response code: 403 for URL: <a href=""http://dl-ssl.google.com/android/repository/tools_r09-windows.zip"" rel=""nofollow"">http://dl-ssl.google.com/android/repository/tools_r09-windows.zip</a></p>","2443826","","","","","2011-02-15 14:16:24","Downloading Android SDK Tools, revision 9","<android>","1","1","","",""
"5003931","1","5005162","","2011-02-15 12:59:45","2","3666","<p>I am making a simple apps for Android, This apps have some function:- Upload- Download- ShowAllFile</p><p>When i use Gdata, it's easy to make this function in Java</p><p>But Gdata didn't support Android. </p><p>Can anyone give sample code for GoogleDoc in Android which use google-api-java-clien ? </p><p>Best Regards</p><p>P/s: UPDATE: i can upload file</p>","617801","","617801","","2011-02-17 07:43:23","2012-05-24 07:44:51","Google Document Sample with google-api-java-client in Android","<android><google-docs-api><google-api-java-client>","3","0","3","",""
"5003939","1","5003967","","2011-02-15 13:00:44","10","19395","<p>Why am I getting a dead code warning on the i++ in this function ?</p><pre><code>InputFilter hexInputFilter()    {    return new InputFilter()        {            @Override            public CharSequence filter(CharSequence source, int start,                    int end, Spanned dest, int dstart, int dend)                {                for (int i = start; i &lt; end; i++)                    {                    if ((source.charAt(i) &gt;= '0')                            &amp;&amp; (source.charAt(i) &lt;= '9'))                        {                        return null;                        }                    if ((Character.toUpperCase(source.charAt(i)) &gt;= 'A')                            &amp;&amp; (Character.toUpperCase(source.charAt(i)) &lt;= 'F'))                        {                        return null;                        }                    return """";                    }                return null;                }        };    }</code></pre>","583683","","244296","","2011-03-03 02:31:18","2012-10-26 12:24:10","Dead code warning?","<java><android><eclipse>","4","2","1","",""
"5003940","1","5154825","","2011-02-15 13:00:51","1","1811","<p>Does anybody know how to implement an expandable view which behaves like the status bar?I've seen it in many apps, so I assume it's not too difficult :)</p>","490395","","330204","","2011-11-21 21:35:53","2011-11-21 21:35:53","How to implement expandable view (window shade) in Android?","<android>","2","4","","",""
"5004013","1","5004133","","2011-02-15 13:07:45","2","3965","<p>I'm creating a table in which each row contains text as well as a button. Now when that button is pressed I want to call an event that uses the value of the text next to the button. How can I access the content of that TextView? I can get the <code>ViewParent</code> of my button, which should be the row, but there's no method to access that views children.</p><pre><code>private OnClickListener updateButtonListener = new OnClickListener(){     public void onClick(View v) {         ViewParent parent = v.getParent();         //Here I would like to get the first child of that ViewParent      }};</code></pre>","596827","","","","","2013-09-26 05:56:54","Get other child that shares parent with the current view","<android><parent>","2","0","2","",""
"5004049","1","","","2011-02-15 13:11:12","1","6765","<p>Am trying to write generic code for all the resolutions. Being a new developer am getting stopped by this font issue. Consider am having various resolutions ( 100 * 100, 200 * 200, 300 * 300 etc ).Am having a textview if suppose i set the font size as 20 for 100*100, when i am porting this code to 200*200, the size of the font seems to be very small for the resolution 200*200. Could any plz tell how to calculate font size for various regions. Is there any formual available to calculate it.. plz advise.. thanks in advance...</p>","617510","","","","","2011-02-15 13:14:18","how to calculate font size for various resolution?","<android>","1","2","2","",""
"5004091","1","","","2011-02-15 13:15:42","3","356","<p>I have a TextView, with a MaxLine property set to X. When the user pushes a button, I'd like to increase this X value to a greater Y. This works, but the extra lines appear suddenly, without animation. Also, this TextView is in a ListView-row (in case that matters, tho I doubt it).</p><p>In the new Android Market app., when you open the detailed view of an application, the details of the app. is presented exactly the way I'd like to achive. Initially, only 3 lines of text is shown, then when the user taps on the 'more' buttons, the rest of the lines animate in.</p><p>Could somebody explain to me how to achieve this effect?</p><p>Thanks</p>","446529","","","","","2011-06-05 08:22:26","Modifying TextView's MaxLines property with animation?","<android><animation><textview>","1","0","","",""
"5004138","1","5006102","","2011-02-15 13:19:49","1","970","<p>I'm creating a custom component, where can I know the dimensions this can assume on it's parent? In Layout it's defined with fill_parent x fill_parent.</p><p>I tried getWidth() x getHeight() on the constructor, on the onMeasure method and onFinishInflate, in all cases this return 0, I wish to know the size it's have to draw some components in independent screen size.</p>","558433","","","","","2011-02-15 16:05:42","How know the size a component can assume in it's parent?","<android><view><android-layout>","2","0","","",""
"5004154","1","","","2011-02-15 13:21:45","0","1245","<p>I want to implement searchbox in my app. I am creating table in each row there is imageview and textview. Textview having name of image. When I enter name in search box that table row should get searched. Please , help me for implemnenting that.</p>","613002","","244296","","2011-02-15 13:28:27","2012-02-10 09:20:41","how to implement search box in android?","<android><android-widget>","1","0","","",""
"5004224","1","5004257","","2011-02-15 13:28:05","2","696","<p>I want to have different language values folders (Ex: values-en, values-de, values-fr). Every folder will have a version of the strings.xml file. My question is: do I have to keep the default strings.xml file in the values folder, or one of the specific strings.xml files will be used if I deleted the default file?</p>","460611","","244296","","2011-02-15 13:32:37","2011-02-15 13:32:37","Is the strings.xml in the values folder necessary?","<android>","1","0","","",""
"5004234","1","5004544","","2011-02-15 13:28:59","0","137","<p>In my app I am getting the data from the server, and I am successfully showing the data but I want to show the images after the loading of data from the server,the images are also coming from server.So my doubt is i want to show first data and show the view and then in background i want to load the images.So how can i do this please help me, and i am not showing this data in listview this is my code.lyt is object of ScrollView.After this below code i want to show the view after that in background i want load image in imvPict (object of ImageView).Please help me.Thank you. </p><pre><code>while(parser.blnMoveNextRow())        {                           v = inflater.inflate(R.layout.list_item,null);            v.setTag(parser.getResults(""EventCode""));                                           v.setBackgroundResource(R.drawable.btn_backgrnd);            txtTitle=(TextView)v.findViewById(R.id.txtTtile);            txtGenre=(TextView)v.findViewById(R.id.txtGenre);            txtLan=(TextView)v.findViewById(R.id.txtLang);            txtLen=(TextView)v.findViewById(R.id.txtLen);            txtAct = (TextView)v.findViewById(R.id.txtActr);            imvPict = (ImageView)v.findViewById(R.id.imgPicture);            txtTitle.setText(parser.getResults(""EventTitle"").toString());            txtGenre.setText(parser.getResults(""Genre"").toString());            txtLan.setText(parser.getResults(""Language"").toString());            txtLen.setText(parser.getResults(""Length"").toString());            txtAct.setText(parser.getResults(""Actors"").toString());            lyt.addView(v);                     }</code></pre>","537819","","222159","","2011-02-15 14:00:51","2011-02-15 14:00:51","android threads","<android><android-layout>","1","0","","",""
"5004247","1","","","2011-02-15 13:30:10","1","2222","<p>I'm beginner in Java Android developing. I'm using Eclipse SDK 3.6.1 version. I'm trying to create a txt file and write a date/time and string. But I can't update txt file, I see only one row. There is my code:</p><pre><code>@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.logfile);    working();    viewing ();}public void working() {    // try to write the content    try {        // open myfilename.txt for writing        FileOutputStream out =            openFileOutput(""file.txt"",Context.MODE_APPEND);        // write the contents on mySettings to the file        String time = DateFormat.getDateTimeInstance().format(new Date());        String abs = ""action"";        String mySettings = time+"" -- ""+abs+""\n"";        out.write(mySettings.getBytes());        // close the file        out.close();    } catch (java.io.IOException e) {        //do something if an IOException occurs.        e.printStackTrace();    }}public void viewing (){    TextView rodyk = (TextView)findViewById(R.id.textas);    try {        // open the file for reading        InputStream instream = openFileInput(""file.txt"");        // if file the available for reading        if (instream != null) {            // prepare the file for reading            InputStreamReader inputreader = new InputStreamReader(instream);            BufferedReader buffreader = new BufferedReader(inputreader);            String line;            // read every line of the file into the line-variable, on            // line at the time            while (( line = buffreader.readLine()) != null) {                // do something with the settings from the file                     rodyk.setText(line);            }        }        // close the file again        instream.close();    } catch (IOException e) {        // TODO Auto-generated catch block        e.printStackTrace();       }}</code></pre><p>I use Context.MODE_APPEND, but still can't update txt file. I see only one row. </p>","572853","","3414","","2011-02-15 13:53:14","2011-12-18 14:12:02","How to update txt file in android app?","<android><input><view><text-files>","3","2","","",""
"5004353","1","","","2011-02-15 13:39:56","-1","230","<p>I have written a small script to pull of all shared object files from an android device for dynamically linked native code development. The script works fine and I could probably stop there, but I don't like the use of the temporary file. I spent some time trying to re-write this so I don't need it but failed with all sorts of attempts. Here is the script:</p><pre><code>declare -rx OUT_FILE=tmp.shadb shell 'cd /system/lib &amp;&amp; for f in *.so; do echo -e ""adb pull /system/lib/$f ./lib""; done' &gt; $OUT_FILEdos2unix $OUT_FILEchmod +x $OUT_FILE./$OUT_FILErm $OUT_FILE</code></pre><p>I tried using a subshell for the adb command and assigning the result to a variable that could then be fed into sed to strip the carriage returns. I couln't get that to work. Here is an example how I tried using command substitution:</p><pre><code>res=$(adb shell 'cd /system/lib &amp;&amp; for f in *.so; do echo -e ""adb pull /system/lib/$f ./lib""; done')echo $res &gt; tmp.txt</code></pre><p>Now from my limited knowledge I would suspect that the tmp.txt file from the second solution would contain the same conent as the tmp file in my working solution. This is not the case.</p><p>Best Regards,</p><p>Andre</p>","154567","","154567","","2011-02-15 14:41:59","2011-02-16 08:10:39","Rewriting script so it works without using a temp file","<android><bash><scripting>","2","3","","",""
"5004402","1","5004508","","2011-02-15 13:44:34","0","357","<p>I have a custom html(suppose a.html) file which i am using from the resources and thus building a string with the entire document which is then passed to the WebView.</p><p>There's some text in a.html on click of which i want load another file b.html in the webview itself.</p><p>Please let me know what is the apporach to be followed here.</p>","617872","","","","","2011-02-15 13:56:39","Call a webview inside another webview in android?","<android><html><load><webview>","2","0","1","",""
"5004498","1","5011075","","2011-02-15 13:53:07","1","2240","<p>Trying to create expandable list view in android.  I would like each group to expand to a pre-set XML layout file.  For example.</p><p>Group A{ when expanded displays XML file A: buttons, seekbar, spinner and etc }</p><p>Group B{ when expanded displays XML file B: buttons, seekbar, spinner and etc }</p><p>Group C{ when expanded displays XML file C: buttons, seekbar, spinner and etc }</p><p>Group D{ when expanded displays XML file D: buttons, seekbar, spinner and etc }</p><p>Group E{ when expanded displays XML file E: buttons, seekbar, spinner and etc }</p><p>Creating the XML file is simple.  How can I display the XML file inside desired group?</p>","590690","","918414","","2012-01-19 22:49:26","2012-01-19 22:49:26","Android expandable list view","<android><expandablelistview>","2","0","","",""
"5004567","1","5004613","","2011-02-15 13:59:35","0","3390","<p>i'm dooing  <a href=""http://www.vogella.de/articles/Android/article.html#first"" rel=""nofollow"" title=""http://www.vogella.de/articles/Android/article.html#first"">this</a> tutorial and at one point he uses the R.id.xxxx where x is the name/id of a control I'm using, if I understood it correctly. </p><p>Now I have two of those R thing's -.-' and one is android.R and the other is dk.ilizane.android.temperatur.R which doesn't contain any id at all so I kinda figured I will be using android.R.id but i'm looking for editText1, radio0, radio1 and it doesn't contain any of those. </p><p>Is there anyone kind enough to try explain this to me? I'm trying to learn this so I would appreciate if the answer wasn't just the correct code but an answer which I can </p><p>My code:</p><pre><code>package dk.ilizane.android.temperatur;import android.app.Activity;import android.os.Bundle;import android.view.View;import android.widget.EditText;import android.widget.RadioButton;import android.widget.Toast;public class Omregn extends Activity {    private EditText text;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        text = (EditText) findViewById(android.R.id.editText1);    }    public void myClickHandler(View view) {    switch (view.getId())     {    case android.R.id.button1:        RadioButton celsiusButton = (RadioButton) findViewById(dk.ilizane.android.temperatur.R);        RadioButton fahrenheitButton = (RadioButton) findViewById(android.R.id.radio1);        if (text.getText().length() == 0)         {            Toast.makeText(this, ""Please enter a valid number"", Toast.LENGTH_LONG).show();            return;        }        float inputValue = Float.parseFloat(text.getText().toString());        if(celsiusButton.isChecked()){            text.setText(String.valueOf(convertFahrenheitToCelsius(inputValue)));        }else {            text.setText(String.valueOf(convertCelsiusToFahrenheit(inputValue)));        }        if(fahrenheitButton.isChecked()){            fahrenheitButton.setChecked(false);            celsiusButton.setChecked(true);        }        else        {            fahrenheitButton.setChecked(true);            celsiusButton.setChecked(false);        }        break;    }    }    private float convertFahrenheitToCelsius(float fahrenheit){        return ((fahrenheit - 32) * 5 / 9);    }    private float convertCelsiusToFahrenheit(float celsius){        return ((celsius *9) / 5) + 32;    }}</code></pre>","479256","","","","","2012-09-22 00:15:56","I can't seem to find android.R.id.radio0?(among others)","<java><android><eclipse>","3","0","","",""
"5004659","1","","","2011-02-15 14:09:17","0","422","<p>I am on WIFI and my Android device is connected. </p><p>In the android device I open a browser and go to <a href=""http://192.168.1.12"" rel=""nofollow"">http://192.168.1.12</a> - This is the IP address of the machine/server on the local network. I get the home page from this machine into my browser on the android device (because there is web server installed and it is a server machine).</p><p>Through my Java program - HttpPost is working very well for external sites like <a href=""http://www.yahoo.com"" rel=""nofollow"">http://www.yahoo.com</a> through WIFI - but it is NOT working for a server on the LAN</p><pre><code>HttpClient hc = new DefaultHttpClient();HttpPost post = new HttpPost(""http://192.168.0.12/"");HttpResponse rp = hc.execute(post); </code></pre><p>The above code DOES NOT work and http response status 404. But if I change the above url to say ""http://www.yahoo.com"" it works and response status is 200</p><p>Can anyone help please</p>","617938","","54200","","2011-02-15 14:12:12","2011-02-15 14:12:12","Why am I Not able to send http request over WIFI to a machine on the local network from my android device","<android>","1","0","","",""
"5004707","1","5022444","","2011-02-15 14:14:02","0","3236","<p>After numerous questions about this topic I still haven't fully solved the problem.In the end the first imageview always gets ""overwritten"" or better said overlapped by another view which should go right of that view.</p><p>After extending RelativeLayout is it enough to only override onLayout() method for children view placement? Does onLayout method place all children in one pass or is it called for every specific child? How should that onLayout method implement child placement if I want to use RelativeLayouts specific placemnts (RIGHT_OF, BELOW, etc ...)</p><p>In view creation, how can I create a view without layoutparams, is it even possible?</p><p>EDIT: Ok I avoided using getWidth in any form and still get bad layout. Icons get first row mixed but full (5 icons), next row has 1 icon only and 2 are missing. At this point I'm quite frustrated because it's a stupid issue and I can't seem to find what's wrong, why doesn't official developer tutorial have more help on dynamic layouts and views?</p><p>Log.e from down says:2: RIGHT OF 13: RIGHT OF 24: RIGHT OF 35: RIGHT OF 46: BELOW 17: RIGHT OF 68: RIGHT OF 79: RIGHT OF 8</p><p>That's the way it's supposed to be yet it doesn't work, I can't set relative position to layouts that should have been layed out?</p><pre><code>private void loadResources() {cursor = managedQuery(Browser.BOOKMARKS_URI, projection, selection,null, SORT_BY_COLUMN + "" "" + SORT_ORDER);this.startManagingCursor(cursor);ImageView previousBookmark;int idOfViewToTheLeft = 1;if(cursor.moveToFirst()) {    bookmarkCounter = 1;    ByteArrayInputStream blobImage;    int size = (int) scale * FAVICON_SIZE;    int screenWidth = getWindowManager().getDefaultDisplay().getWidth();    int rowBookmarkCount = (int) (screenWidth/(size + scale*leftMargin));    do{       bookmark = new ImageView(this);       bookmark.setId(bookmarkCounter++);       bookmark.setBackgroundColor(Color.WHITE);       blobImage = new ByteArrayInputStream(               cursor.getBlob(cursor.getColumnIndex(BookmarkColumns.FAVICON)));       bookmark.setImageDrawable(               Drawable.createFromStream(blobImage, """" + bookmark.getId()));       urls.put(bookmark.getId(),               cursor.getString(                        cursor.getColumnIndex(BookmarkColumns.URL)));       bookmark.setOnClickListener(new View.OnClickListener() {            @Override            public void onClick(View v) {                Intent browserIntent = new Intent(                        Intent.ACTION_VIEW, Uri.parse(urls.get(v.getId())));                startActivity(browserIntent);            }        });       lp = new RelativeLayout.LayoutParams(size, size);       lp.topMargin = (int) (scale * topMargin);       lp.leftMargin = (int) (scale * leftMargin);       if(bookmark.getId() &gt; 1) {           previousBookmark = (ImageView) findViewById(bookmark.getId() - 1);           if((bookmark.getId() % (rowBookmarkCount + 1)) != 0)           {               Log.e("""" + bookmark.getId(), ""RIGHT OF "" + previousBookmark.getId());               lp.addRule(RelativeLayout.RIGHT_OF, previousBookmark.getId());           } else {               Log.e("""" + bookmark.getId(), ""BELOW "" + idOfViewToTheLeft);               lp.addRule(RelativeLayout.BELOW, idOfViewToTheLeft);               idOfViewToTheLeft = bookmark.getId();           }       }       bookmarkLayout.addView(bookmark, lp);    } while (cursor.moveToNext()); }}</code></pre>","607767","","607767","","2011-02-15 19:02:03","2011-02-16 21:39:11","Android dynamic RelativeLayout and children Views creation","<android><dynamic><relativelayout>","3","0","","",""
"5004718","1","5316489","","2011-02-15 14:14:53","7","3435","<p>Here's an interesting question that I'm shocked hasn't been asked more often on the internet.  Android's CursorAdapters are extremely useful once you get a ContentProvider up and running and learn how to use it, but they are limited due to their requirement on having the _id field as part of their query (an error is thrown without it).  Here's why:</p><p>My specific problem is that I have two spinners:  One spinner should contain unique ""category"" names from the database, and the other should populate with all the database entries from the selected ""category"" (category being the column name, here).  This seems like a pretty simple setup that many programs might use, no?  Trying to implement that first spinner is where I've run into problems.</p><p>Here's the query that I would like for that first spinner:</p><pre><code>SELECT DISTINCT category FROM table;</code></pre><p>Making this query throws an error on CursorAdapter because the _id column is required as part of the query.  Adding the _id column to the projection naturally returns every row of the table, since you're now asking for distinct id's as well, and every id is distinct (by definition).  Obviously I would rather see only one entry per category name.  </p><p>I've already implemented a work around, which is to simply make the query above and then copy the results into an ArrayAdapter.  My reason for this post is to see if there was a more elegant solution to this odd little problem and start a discussion on what I could be doing better.  Alternate implementation suggestions, such as using different kinds of controls or adapters, are very welcome.  </p>","387781","","","","","2014-02-06 23:29:15","Android's SimpleCursorAdapter with queries using DISTINCT","<android><sqlite><distinct><simplecursoradapter>","5","0","1","",""
"5004751","1","5062930","","2011-02-15 14:17:51","0","2060","<p>Little complicated title, but i don't know how to tell in different way =D.</p><p>I have 1 activity and 2 layout xml files.<br>in 1st .xml i have listview and in 2nd .xml i have items, which representing row in listview. it looks like in this tutorial: <a href=""http://ykyuen.wordpress.com/2010/01/03/android-simple-listview-using-simpleadapter/"" rel=""nofollow"">http://ykyuen.wordpress.com/2010/01/03/android-simple-listview-using-simpleadapter/</a>  </p><p>my question is: how can i programmatically change textviews settings in 2nd .xml (in tutorial grid_item.xml)<br> if i call <code>text1.setTextColor(Color.RED);</code> , it throws me exception java.lang.NullPointerException</p>","555762","","","","","2011-02-21 06:16:54","Android: change textview settings (setTextColor) in listview-row layout","<android>","1","3","1","",""
"5004787","1","5013141","","2011-02-15 14:20:33","0","1367","<p>I'm currently developing an augmented reality application in android. Textured openGL object is drawn over the camera view. I had tried so many methods to take the screen shot of android openGL view (GLSurfaceview). But no success. I want the screenshot with transparent background so that I could draw it over camera image to produce an ARImage. Can any one help me? I know that I have to read the pixels of opengl using glReadPixels() function. I tried it using GL_RGBA mode and created bitmap (used ARGB_8888 and RGB_565). Using ARGB_8888 format I'll get a transparent image with no object and in RGB_565 mode I'll get a image filled with black color. Can any one guide me? Thanks in advance.</p><p>Thanks,Midhun </p>","292127","","","","","2012-01-30 19:37:29","Android opengl screenshot with alpha channel support","<android><image-processing><opengl-es><bitmap><screenshot>","2","0","","",""
"5004875","1","5004989","","2011-02-15 14:28:55","1","2629","<p>I followed <a href=""http://www.stealthcopter.com/blog/2010/08/making-prettier-buttons-in-android-xml-rolloverselection-focus-effects-9patch-images-and-transparency/"" rel=""nofollow"">this tutorial</a> to make some nicer buttons for Android, I also took the example 9-patch button from that site. It is this one: <img src=""http://i.stack.imgur.com/wtiVz.png"" alt=""enter image description here""></p><p>But as you can see in the following image, my buttons are not displayed correctly. </p><p><img src=""http://i.stack.imgur.com/qDU0K.png"" alt=""enter image description here""></p><p>Here is the code of the ""4 x 4"" button:</p><pre><code>&lt;Button android:id=""@+id/btn4""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:onClick=""starteSpiel""        android:text=""   4 x 4   ""        android:background=""@drawable/button"" /&gt;</code></pre><p>And here is my button.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/button_normal"" /&gt;&lt;item android:state_focused=""true""      android:state_pressed=""true""      android:drawable=""@drawable/button_normal"" /&gt;&lt;item android:state_focused=""false""      android:state_pressed=""true""  android:drawable=""@drawable/button_normal"" /&gt;&lt;item android:drawable=""@drawable/button_normal"" /&gt;</code></pre><p></p><p>Where is the error? The buttons should look like the ones in the <a href=""http://www.stealthcopter.com/blog/2010/08/making-prettier-buttons-in-android-xml-rolloverselection-focus-effects-9patch-images-and-transparency/"" rel=""nofollow"">tutorial</a>.</p>","453895","","","","","2012-01-20 17:22:35","9-patch buttons not displayed correctly","<android><button>","1","4","","",""
"5004889","1","5005848","","2011-02-15 14:29:57","0","1779","<p>I'm really really stuck the following problem.<br>I used FrameLayout inside LinearLayout  and then through code i added linearlayout to this FrameLayout but it produce an extra space. I have given the screen shot below. <img src=""http://i.stack.imgur.com/VOs0y.png"" alt=""enter image description here""></p><p>I part marked as white is the problem. i need to remove this.<br>My FrameLayout</p><pre><code>&lt;TabHost        android:cacheColorHint=""#00000000""        android:id=""@android:id/tabhost""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""&gt;        &lt;TabWidget            android:id=""@android:id/tabs""            android:cacheColorHint=""#00000000""            android:visibility=""gone""            android:layout_width=""100dp""            android:layout_height=""10dp""&gt;        &lt;/TabWidget&gt;        &lt;FrameLayout            tyle=""@style/tabhost""            android:cacheColorHint=""#00000000""            android:id=""@android:id/tabcontent""            android:layout_width=""wrap_content""                                 android:layout_height=""fill_parent"" /&gt;    &lt;/TabHost&gt;</code></pre><p>This is the linearLayout i added this FrameLayout  </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=""#FFFFFF""/&gt;</code></pre><p>Thank you</p>","609646","","609646","","2011-02-19 05:39:07","2011-02-19 05:39:07","extra line in tab host","<android>","2","2","","",""
"5004910","1","5005742","","2011-02-15 14:32:53","0","877","<p>I've got a ListActivity that displays a list of items from a database using a CursorAdapter, which initially contains all items in the table. I also provide an EditText view where the user can enter search text, and as characters are entered, I requery the database using a ""LIKE"" or ""MATCH"" where clause to filter the results (IOW, what lots of apps do when searching).</p><p>Currently, I do this in an AsyncTask by creating a new Cursor from the query, creating a new instance of my CursorAdapter class, and then calling list.setAdapter from the UI thread when the task completes. This is all working, but is there a more elegant way of effectively requerying the database with a new WHERE clause from withing the existing adapter/cursor and avoiding having to create new object instances each time? Any examples of this technique? </p><p>Doug GordonGHCS Software</p>","446874","","","","","2011-02-15 15:37:58","Android Cursor Management w/ListView","<android>","1","0","","",""
"5005039","1","","","2011-02-15 14:44:30","-1","264","<p>I am trying to figure out how feasible Blackberry's rumored intent to have the Playbook tablet access the Android App store will be.  </p><p>There have been several news/blog reports on this matter, but i haven't seen any feedback from the app developer community on this forum regarding what the experience will be like for Playbook users, whether apps would need to be altered by developers going forward to accommodate for the Playbook, what Google and Blackberry would have to do to ensure that the user experience is seamless.</p><p>From an app developer's perspective, I imagine this is a huge homerun, as it opens up sales opportunities to Blackberry customers.  However, there are likely risks of alienating some users if the experience isn't the same as one would get on, say, a Galaxy Tab or the Motorola Xoom.</p><p>Here is an article on the topic: <a href=""http://www.slashgear.com/blackberry-playbook-android-app-support-coming-in-2h-2011-tip-insiders-11132674/"" rel=""nofollow"">http://www.slashgear.com/blackberry-playbook-android-app-support-coming-in-2h-2011-tip-insiders-11132674/</a></p><p>What do app developers at large think about QNX facilitating this?</p>","617990","","","","","2012-03-05 17:31:00","RIM Blackberry Playbook to Access Android Apps in QNX? Will it work? What will experience be like?","<android><tablet><qnx><blackberry-playbook>","2","1","","",""
"5005089","1","5007535","","2011-02-15 14:49:05","0","556","<p>I have a form application, in this application the user clicks on a Menu option(M1) to go to a form (Frm1). This is done using Intent. The form (Frm1) have two buttons, a back button and a submit button. When the user clicks the submit button the form is submitted, when the back button is clicked the user reaches the menu option(done using Intent).  Now, When the user clicks the back button(he goes to M1) with a half filled form, he must be able to continue with the task when he returns back( to Frm1). My logic was to collect all the values in the form to a bundle and carry it along the way from Frm1 to M1 and vice versa.Is this a good approach, got any better idea?</p><p>Thanks in advance..!</p>","573700","","","","","2011-12-16 08:57:10","Form application in android","<android>","4","0","","",""
"5005093","1","5005367","","2011-02-15 14:49:18","0","237","<p>Hy!</p><p>I have two pictures on the view and a button at the buttom.</p><p>But the Problem is that the last picture is drawn at the button and not under the first on. So the button at the buttom is unvisible.</p><p><img src=""http://i.stack.imgur.com/XMzF7.png"" alt=""Screenshot""></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:layout_height=""wrap_content"" android:layout_width=""fill_parent"" android:orientation=""vertical""&gt;    &lt;TextView android:layout_height=""wrap_content"" android:id=""@+id/mainscreen"" android:layout_width=""fill_parent"" android:text=""Selected Channel"" android:gravity=""center""&gt;&lt;/TextView&gt;    &lt;ImageView android:id=""@+id/ImageView01"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;&lt;/ImageView&gt;    &lt;TextView android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:id=""@+id/mainscreen_state""&gt;&lt;/TextView&gt;    &lt;ImageView android:layout_width=""wrap_content"" android:layout_centerHorizontal=""true"" android:layout_height=""wrap_content"" android:id=""@+id/ImageAd"" android:layout_gravity=""center""&gt;&lt;/ImageView&gt; &lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""        android:layout_height=""fill_parent""        android:layout_width=""fill_parent""&gt;    &lt;Button android:layout_width=""wrap_content""         android:layout_height=""wrap_content""         android:layout_alignParentBottom=""true""        android:layout_centerHorizontal=""true""        android:id=""@+id/mainscreen_btchange""         android:text=""Change State""&gt;&lt;/Button&gt;    &lt;/RelativeLayout&gt;    &lt;/LinearLayout&gt;</code></pre>","547995","","547995","","2011-02-15 14:58:28","2011-02-15 15:09:45","How to choose the right picture size","<android>","2","0","","",""
"5005107","1","5005702","","2011-02-15 14:50:26","0","338","<p>i want to create same copy of a bitmap image on draw method. i am using surface veiw and extending </p><pre><code>public  class Panel extends SurfaceView implements SurfaceHolder.Callback{    @Override    public void onDraw(Canvas canvas) {        Bitmap redCoin1 = BitmapFactory.decodeResource(getResources(),R.drawable.red);</code></pre><p>how do i copy the same redcoin1 . i need 18 copies on screan. how do i go ahead with it.</p><p>RegardsZaheer </p>","617987","","491044","","2011-03-11 07:56:20","2011-03-11 07:56:20","Android Help on Creating multiple copies of same bitmap using canvas on a surface view","<android><android-widget>","1","0","","",""
"5005168","1","","","2011-02-15 14:55:27","2","2863","<p>I need to read from an EPUB file using a Java only solution.</p><p>Could anyone point me towards a tutorial for this, or give me the solution? Thanks</p>","451575","","","","","2012-04-05 10:01:07","Read EPUB using Java only","<java><android><file-io><epub>","1","2","","",""
"5005192","1","","","2011-02-15 14:56:53","1","375","<p>I am creating an alert dialog with Android with this code:</p><pre><code>            AlertDialog ad = new AlertDialog.Builder(self)                .setTitle(""Invalid Input"")                .setMessage(""The number you entered is not a real number."")                .setNeutralButton(""OK"",                    new DialogInterface.OnClickListener() {                    public void onClick(DialogInterface dialog, int which){}                }                ).show();</code></pre><p>I also have an application theme that looks like this:</p><pre><code>&lt;style name=""CustomTheme"" parent=""@android:style/Theme.NoTitleBar""&gt;    &lt;item name=""android:layout_width""&gt;fill_parent&lt;/item&gt;    &lt;item name=""android:layout_height""&gt;wrap_content&lt;/item&gt;    &lt;item name=""android:textColor""&gt;#222222&lt;/item&gt;    &lt;item name=""android:background""&gt;#DDDDDD&lt;/item&gt;&lt;/style&gt;</code></pre><p>As you can see, I'm not theming the dialog or changing it's colors, but it shows up very strangely.</p><p>It looks like this:<img src=""http://i.stack.imgur.com/dX5PR.png"" alt=""Android Alert Dialog""></p><p>Does anyone know how to make it appear more normal?</p>","12243","","","","","2011-02-15 15:06:29","Android Alert Dialog coloring is off","<java><android><alertdialog>","1","5","","",""
"5005253","1","5029378","","2011-02-15 15:01:26","1","3312","<p>I am working on establishing a Bluetooth Piconet among multiple devices in a testbed. The topology of this network is known to all devices.</p><p>The devices in the testbed are Ubuntu Desktop PCs and Android (Eclair) devices. Now, I'm looking at a way of establishing a master slave relationship among these devices in a deterministic way. Specifically, I'm looking for a way to establish an android device as master and open multiple connections with 7 other devices. </p><p>I have looked at native implementations using the bluez stack and the NDK, but the bluez stack implementation on my device (Samsung GT 15503) does not conform to the standards I guess and even normal apps like hcitool, hciconfig don't work.</p><p>Therefore, I tried using the official SDK and even succeeded in establishing an RFCOMM socket with my laptop (Using the bluetooth chat sample app as a reference). But I'm stuck at the point where I try connecting two or more devices using the same BluetoothServerSocket. Unless I close the original socket, I can't seem to open new connections.</p><p>Any suggestions in this regard are greatly appreciated.</p>","618016","","","","","2011-02-17 13:12:13","Establishing a Bluetooth Piconet in Android","<android><bluetooth>","2","0","2","",""
"5005442","1","","","2011-02-15 15:15:29","0","905","<p>I am creating a library search engine based on android. I want to have an EditText field in my application, where user will put the search text. And upon clicking the search button it should search using the library web page. I want to use the text being put in the EditText field to be used by the web page in the background and want to show the result to the user. Could find a clue. I will be really grateful if you could answer asap.</p><p>Thanks./ Hasibur Rahman </p>","618047","","","","","2011-02-15 15:30:51","How can I use text from an EditText Field into a web page?","<android>","2","0","","",""
"5005587","1","5006012","","2011-02-15 15:25:32","1","205","<p>What is the best way to make more room (increase width of the bitmap) in the bitmap without distorting or scaling the existing data in Android. I'm tried various method and still can't figure out how to do it </p>","260298","","","","","2011-02-15 15:58:45","Make more room in the bitmap in android","<android>","2","1","0","",""
"5005590","1","","","2011-02-15 15:25:48","1","624","<p>I am unit testing an application that includes a custom dialog. This dialog inherits from <code>android.app.Dialog</code> but requires a speciall subclass of <code>Activity</code>, let's call it <code>CustomActivity</code>, that provides some functions it needs.</p><p>I want to avoid instantiating one of the Activities from the tested application since I already have tests for them. I'm unit testing, not black-box-testing, so I want to run all the public functions in the dialog. This is not possible, however, without instantiating the dialog first and that requires a <code>CustomActivity</code> instance.</p><p>I've tried to create a mock subclass of <code>CustomActivity</code> and use that to launch the dialog, but I keep running into the same problem: The test application is not looking for activities in the test-application, only in the tested application. So I get ""Unable to resolve activity"".</p><p>I've also tried to create the activity myself, without using <code>Instrumentation.launchActivity</code> but that requires a context, which I don't have under <code>InstrumentationTestCase</code>. If I use <code>AndroidTestCase</code> instead, the provided context (via <code>getContext</code>) is just a <code>ContextWrapper</code> which doesn't seem to wrap any context, so I'm back to square one. I need to instantiate the activity first.</p><p>I've googled quite a bit and I can't believe I am the first person ever to need to unit test a <code>Dialog</code>. It seems to me that I would need something similar to the <code>ActivitiTestCase2</code> but for dialogs that provide the necessary context.</p><p>What is the best way to create my dialog? Is there another way I haven't tried? Does anyone have an example of a custom dialog unit-test?</p>","617988","","","","","2011-02-15 15:47:52","I am trying to unit test a custom Dialog in Android and I can't seem to instantiate it","<android><unit-testing><dialog>","1","0","","",""
"5005714","1","","","2011-02-15 15:36:02","0","213","<p>I am still looking for a solution for this <a href=""http://stackoverflow.com/questions/5002417/html-textarea-characters-limit-inside-android-webview"">HTML TextArea Characters Limit Inside Android WebView</a></p><p>Now I experimented more and found out that this is HTML string inside string which is causing the error.</p><p>Lets say I have a very long string (approx 11K+ characters in it) and I run the following code on android WebView.</p><pre><code>int bStart = 0;int bEnd = 99;String description = ""some huge description including html tags""int totalChars = description.length() - 1;while (bStart &lt; bEnd &amp;&amp; bEnd &lt;= totalChars) {    rv = ""javascript:"";    rv += ""var tas=document.getElementsByTagName('textarea');""; // description    rv += ""if (tas.length&gt;0) {"";    rv += ""var ta=tas[0];"";    rv += ""ta.value += '""           + description.substring(bStart, bEnd)            .replace(""'"", ""\\'"").replace('""', '\""') + ""';""; // description    rv += ""}"";    webView.loadUrl(rv + ""void(0);"");    bStart = bEnd;    if ((totalChars - bStart) &gt;= 100)       bEnd += 100;    else       bEnd += (totalChars - bStart);}</code></pre><p>It works perfect! A textarea on the web page gets all (11K+) characters in it. But when I store some huge HTML data in <strong>description</strong> variable, although the code works with no error at all but it ignores chunks of HTML from inserting it into textarea. I am not sure what's wrong. I can show you text as well as HTML I am trying if you wish.</p>","355507","","355507","","2011-02-15 17:08:08","2011-02-15 17:08:08","HTML String Problem","<java><javascript><android><html>","0","8","","",""
"5005773","1","5005933","","2011-02-15 15:39:42","0","302","<p>Hy!</p><p>I have two pictures on the view and a button at the buttom.</p><p><img src=""http://i.stack.imgur.com/XMzF7.png"" alt=""Screenshot""></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:layout_height=""wrap_content"" android:layout_width=""fill_parent"" android:orientation=""vertical""&gt;    &lt;TextView android:layout_height=""wrap_content"" android:id=""@+id/mainscreen"" android:layout_width=""fill_parent"" android:text=""Selected Channel"" android:gravity=""center"" android:layout_alignParentTop=""true""&gt;&lt;/TextView&gt;    &lt;ImageView android:id=""@+id/ImageView01"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;&lt;/ImageView&gt;    &lt;TextView android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:id=""@+id/mainscreen_state"" android:layout_above=""@+id/mainscreen_btchange""&gt;&lt;/TextView&gt;    &lt;ImageView android:layout_width=""wrap_content"" android:layout_centerHorizontal=""true"" android:layout_height=""wrap_content"" android:id=""@+id/ImageAd"" android:layout_gravity=""center"" android:layout_below=""@+id/mainscreen""&gt;&lt;/ImageView&gt; &lt;RelativeLayout xmlns:android=""http://schemas.android.com/apk/res/android""        android:layout_height=""fill_parent""        android:layout_width=""fill_parent""&gt;    &lt;Button android:layout_width=""wrap_content""         android:layout_height=""wrap_content""         android:layout_alignParentBottom=""true""        android:layout_centerHorizontal=""true""        android:id=""@+id/mainscreen_btchange""         android:text=""Change State""&gt;&lt;/Button&gt;    &lt;/RelativeLayout&gt;    &lt;/LinearLayout&gt;</code></pre><p>My Question: How to shrink the pictures that all elements of the layout are shown?</p>","547995","","547995","","2011-02-15 17:56:19","2011-02-15 17:56:19","How to resize the pictures right?","<android>","1","0","","",""
"5005810","1","5005857","","2011-02-15 15:42:30","2","5660","<p>I've an Ant build using the Proguard config below, which is that generated by the ""android"" command line tool, it seems pretty straightfoward. But when I build the app using this script, the app blows up when it's executed on the device, with a series of null pointer exceptions (the obfuscation process is somehow adding bugs to the code). To fix the app, I just rebuild it without running it through Proguard.</p><p>What advice would you offer to someone using Proguard with Android apps so that a) the app is optimised and obfuscated to a reasonable degree, but b) without the functional integrity being damaged?</p><pre><code>-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 * extends android.app.backup.BackupAgentHelper-keep public class * extends android.preference.Preference-keep public class com.android.vending.licensing.ILicensingService-keepclasseswithmembernames class * {    native &lt;methods&gt;;}-keepclasseswithmembernames class * {    public &lt;init&gt;(android.content.Context, android.util.AttributeSet);}-keepclasseswithmembernames class * {    public &lt;init&gt;(android.content.Context, android.util.AttributeSet, int);}-keepclassmembers enum * {    public static **[] values();    public static ** valueOf(java.lang.String);}-keep class * implements android.os.Parcelable {  public static final android.os.Parcelable$Creator *;}</code></pre>","477415","","","","","2011-02-15 16:04:00","How to use Proguard with Android and protect the app's functional integrity?","<java><android><obfuscation><proguard>","2","1","4","",""
"5006076","1","5006163","","2011-02-15 16:04:05","2","826","<p>I'm working on an Android application and I'd like to maintain a top-bar of sorts in most of my Activities, as per the Twitter and Facebook applications. How is this done? I'd like to keep it there at all times, as it'll provide functionality core to the whole application.</p>","128967","","","","","2011-03-16 22:41:25","How to persist a View across Activities in Android","<android>","5","1","6","",""
"5006135","1","5006455","","2011-02-15 16:07:58","1","1064","<p>I have a viewFlipper with different ListViews in each ""flip"". I have made all the lists <code>registerForContextMenu(chosenList);</code> and the longPress menu appears in each of the lists as I want. </p><p>Now I want to have DIFFERENT contextMenues in the different list views. eg. one list with network info will have network related choices in the contextMenu and the list with friends will have another set of choices in it's contextMenu. </p><p>How do I do this efficiently? is this even possible?    </p><pre><code>public void onCreateContextMenu(ContextMenu menu2, menu3, menu4, View v, ContextMenuInfo menuInfo) {  super.onCreateContextMenu(menu2, menu3, menu4, v, menuInfo);  menu2.setHeaderTitle(""Quick Menu"");  menu3.setHeaderTitle(""Menu3"");  menu4.setHeaderTitle(""Menu4"");  MenuInflater inflater = getMenuInflater();  inflater.inflate(R.menu.context_menu, menu2);  inflater.inflate(R.menu.context_menu3, menu3);  inflater.inflate(R.menu.context_menu4, menu4);}</code></pre><p>...or ...? how else? this is starting to drive me insane in the midbrain... :D</p>","591995","","591995","","2011-02-15 16:23:48","2011-02-15 16:32:21","multiple lists with different contextMenus","<android><listview><contextmenu>","1","0","","",""
"5006151","1","5007168","","2011-02-15 16:09:13","0","304","<p>I am creating a XML layout for my activity - let's call it <code>layout_a.xml</code> - which looks like:</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;include layout=""@layout/layout_b""/&gt;    &lt;include layout=""@layout/layout_b""/&gt;&lt;/LinearLayout&gt;</code></pre><p>Here is <code>layout_b.xml</code>:</p><pre><code>&lt;FrameLayout    xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""&gt;    &lt;ImageView        android:id=""@+id/place_details_list_entry_checkins_history_user_avatar""        android:layout_width=""34dip""        android:layout_height=""34dip""        android:src=""@drawable/icn_profilepic_medium""        android:scaleType=""centerCrop""/&gt;    &lt;ImageView        android:id=""@+id/place_details_list_entry_checkins_history_user_avatar_provider_icon""        android:layout_gravity=""bottom|left""        android:src=""@drawable/icn_fb_small""        android:layout_width=""11dip""        android:layout_height=""11dip""/&gt;&lt;/FrameLayout&gt;`</code></pre><p>I get this error in Eclipse:</p><p>Found cyclical &lt;include&gt; chain: layout_a=>layout_b</p><p>Does anybody have a hint on what is causing it?</p>","389262","","512958","","2011-02-15 16:44:45","2011-02-15 17:32:17","""Found cyclical <include> chain"" error in XML layout file","<android><android-layout>","3","1","","",""
"5006166","1","5006276","","2011-02-15 16:10:19","2","6715","<p>I need to be able to mask an image in my layout to have rounded corners. Is there a simple way to specify an alpha mask in the layout? I would like to avoid having to manually mask each bitmap I'm using.</p><hr><h1>EDIT</h1><p>Here is my code, as referenced to the other answer:</p><pre><code>HttpURLConnection connection = (HttpURLConnection) this.items.get(position).getIcon().toURL().openConnection();connection.setDoInput(true);connection.connect();Bitmap bitmap = BitmapFactory.decodeStream(connection.getInputStream());Integer dimension = bitmap.getWidth() &gt; bitmap.getHeight() ? bitmap.getWidth() :        bitmap.getHeight();Bitmap rounder = Bitmap.createBitmap(dimension, dimension, Bitmap.Config.ARGB_8888);Canvas canvas = new Canvas(rounder);Paint painter = new Paint(Paint.ANTI_ALIAS_FLAG);painter.setColor(Color.RED);canvas.drawRoundRect(new RectF(0, 0, dimension, dimension),         20.0F, 20.0F, painter);painter.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.DST_IN));canvas.drawBitmap(bitmap, 0, 0, null);canvas.drawBitmap(rounder, 0, 0, painter);holder.image.setImageBitmap(bitmap);</code></pre><p>However, this doesn't work. I don't see see rounded corners, I see the regular image as-is. Is there a step at the end I'm missing that involves the canvas?</p>","128967","","128967","","2011-02-15 19:54:39","2011-02-15 19:54:39","Mask an image in layout in Android","<android><android-layout><mask>","2","1","1","",""
"5006228","1","5147760","","2011-02-15 16:14:50","2","4872","<p>Is there a sane way to programatically scroll to show a specific component in a Gallery - the equivalent of setSelection(int) but with smooth scrolling rather than a direct jump?</p>","39368","","","","","2011-02-28 21:26:13","Smoothly scroll to specified position in Android gallery","<android>","1","5","3","",""
"5006252","1","","","2011-02-15 16:17:15","0","592","<p>Im developing an application and got stuck. i have a normal simple Button. What i want to do is that if i click this button it will behave just like you press the SPACE on the soft keyboard.</p><p>How do i do this. there must be a way because you can develop a softkeyboard.</p><p>So repeat xP How do i ""inject"" a keypress or simulate a keypress if i press a button.</p><p>Thank you!//Me</p>","564612","","","","","2011-02-15 16:22:16","Android Development: Keypress/keyEvent","<android>","1","2","","",""
"5006514","1","5006806","","2011-02-15 16:36:40","2","983","<p>I asked a similar question to this awhile back and got zero responses, so I'm going to try rephrasing it . . . </p><p>What is ""best practice"" for ensuring that the 2D drawing primitives in the Canvas class scale properly for different devices (phones with different screen resolutions)?    Are they supposed to scale automatically?    Is there a way to scale the whole canvas?   Am I supposed to detect the size and do my own scaling as I draw each line, circle and point individually?  Am I supposed to do it by manipulating the View?  Or what?</p><p>The goal is to make sure the graphics fill up the screen to take full advantage of the available resolution,  but don't overflow it.</p><p>Thanks in advance!  </p>","424690","","","","","2011-02-15 16:59:32","Scaling Android Canvas 2D graphics for different devices","<android>","1","0","","",""
"5006624","1","5006853","","2011-02-15 16:46:21","4","4314","<p>I try to run this query on my custom contentprovider. </p><pre><code>cursor = activity.getContentResolver().query(                GoalDescriptor.CONTENT_URI,                ""max(priority)"", null,                null, null);</code></pre><p>to obtain the max value of priority int column. </p><p>i tried also :</p><pre><code>cursor = activity.getContentResolver().query(                GoalDescriptor.CONTENT_URI,                null, ""max(priority)"",                null, null);</code></pre><p>whit no success.</p><p>This code return this exception: </p><pre><code>    java.lang.IllegalArgumentException: Invalid column MAX(priority)E/DatabaseUtils(  688):     at android.database.sqlite.SQLiteQueryBuilder.computeProjection(SQLiteQueryBuilder.java:523)E/DatabaseUtils(  688):     at android.database.sqlite.SQLiteQueryBuilder.buildQuery(SQLiteQueryBuilder.java:370)E/DatabaseUtils(  688):     at android.database.sqlite.SQLiteQueryBuilder.query(SQLiteQueryBuilder.java:323)E/DatabaseUtils(  688):     at android.database.sqlite.SQLiteQueryBuilder.query(SQLiteQueryBuilder.java:280)E/DatabaseUtils(  688):     at nan.salsa.contentprovider.goal.GoalContentProvider.query(GoalContentProvider.java:118)E/DatabaseUtils(  688):     at android.content.ContentProvider$Transport.bulkQuery(ContentProvider.java:150)E/DatabaseUtils(  688):     at android.content.ContentProviderNative.onTransact(ContentProviderNative.java:111)E/DatabaseUtils(  688):     at android.os.Binder.execTransact(Binder.java:288)E/DatabaseUtils(  688):     at dalvik.system.NativeStart.run(Native Method)D/AndroidRuntime(  727): Shutting down VM</code></pre><p>My Content Provider Implementation (Standard - see notePad sample)</p><pre><code>public Cursor query(Uri uri, String[] projection, String selection,        String[] selectionArgs, String sortOrder) {    SQLiteQueryBuilder qb = new SQLiteQueryBuilder();    qb.setTables(GoalDescriptor.TABLE_NAME);    switch (sUriMatcher.match(uri)) {    case GOAL:        qb.setProjectionMap(sGoalProjectionMap);        qb.appendWhere(GoalDescriptor._ID + ""=""                + uri.getPathSegments().get(1));        break;    case GOALS:        qb.setProjectionMap(sGoalProjectionMap);        break;    default:        throw new IllegalArgumentException(""Unknown URI "" + uri);    }    // If no sort order is specified use the default    String orderBy;    if (TextUtils.isEmpty(sortOrder)) {        orderBy = GoalInfo.GoalDescriptor.DEFAULT_SORT_ORDER;    } else {        orderBy = sortOrder;    }    // Get the database and run the query    SQLiteDatabase db = mOpenHelper.getReadableDatabase();    Cursor c = qb.query(db, projection, selection, selectionArgs, null,            null, orderBy);    // Tell the cursor what uri to watch, so it knows when its source data    // changes    c.setNotificationUri(getContext().getContentResolver(), uri);    return c;}</code></pre><p>can you help me ? </p><p>regards </p>","618195","","618195","","2011-02-15 17:21:19","2012-03-15 02:32:31","Android - Select max in contentProvider","<android><sqlite><select><max><android-contentprovider>","2","1","1","",""
"5006712","1","5014894","","2011-02-15 16:52:21","0","517","<p>I have a pretty long expandable list with lots of children under each group. When a group is expanded and I perform scroll action, I see background behind children becomes dark untill scroll stopps.</p><p>Does anybody know how to disable this effect?</p>","611206","","","","","2011-02-16 09:50:08","How to disable background child highlight in expandable list","<android><expandablelistadapter>","1","0","1","",""
"5006791","1","5006847","","2011-02-15 16:58:42","1","421","<p>hey,i'm new to android and i have a problem. here is my code:</p><pre><code>Log.v(""Test"", """" + lv_arr_id[0]); //displays 0    if (lv_arr_id[0] == ""0"") {      Toast.makeText(longOperationContext, ""A"", Toast.LENGTH_SHORT).show();    }    else {      Toast.makeText(longOperationContext, ""B"", Toast.LENGTH_SHORT).show();    }</code></pre><p>lv_arr_id[0] has the value ""0"" and is a string, its external data pulled via json from web. however each time the B toast gets triggered instead of the A toast. the value really is 0, i tested this in the logcat.any ideas why?thanks in advance</p>","563020","","","","","2011-02-15 17:02:28","""if"" not working properly","<android><arrays><if-statement>","2","1","","",""
"5006798","1","","","2011-02-15 16:59:07","0","1563","<p>I've tried yesterday to create a selector for a view, which should change its background color and its background image with transparency (both at the same time) in different states. But it didn't really work.</p><p>Is it possible at all? Can anybody give an example?</p><p>thank you</p><p><strong>Upd:</strong></p><p>Using this code everything works fine:</p><pre><code>&lt;selector    xmlns:android=""http://schemas.android.com/apk/res/android""&gt;    &lt;item        android:state_pressed=""false""        android:drawable=""@drawable/details_test""&gt;    &lt;/item&gt;    &lt;item        android:state_pressed=""true""        android:drawable=""@drawable/details_sel""&gt;           &lt;/item&gt;&lt;/selector&gt;</code></pre><p>If I try to use modificated code, no image will be displayed</p><pre><code>&lt;selector    xmlns:android=""http://schemas.android.com/apk/res/android""&gt;    &lt;item        android:state_pressed=""false""        android:drawable=""@drawable/details_test""        android:color=""#aaaaaa""&gt;    &lt;/item&gt;    &lt;item        android:state_pressed=""true""        android:drawable=""@drawable/details_sel""        android:color=""#999999""&gt;            &lt;/item&gt;&lt;/selector&gt;</code></pre><p>This one works as well, but background color won't be changed:</p><pre><code>&lt;selector    xmlns:android=""http://schemas.android.com/apk/res/android""&gt;    &lt;item        android:state_pressed=""false""        android:drawable=""@drawable/details_test""&gt;        &lt;shape&gt;            &lt;solid android:color=""#aaaaaa""/&gt;        &lt;/shape&gt;            &lt;/item&gt;    &lt;item        android:state_pressed=""true""        android:drawable=""@drawable/details_sel""&gt;        &lt;shape&gt;            &lt;solid android:color=""#999999""/&gt;        &lt;/shape&gt;                    &lt;/item&gt;&lt;/selector&gt;</code></pre>","408780","","759866","","2014-01-06 14:45:13","2014-01-06 14:45:13","android drawable selectors","<android><draw>","0","2","","",""
"5006827","1","5006957","","2011-02-15 17:01:14","0","565","<p>I have a simple, one Activity application.The problem is that, if i press the BACK button, the application is minimized, but if i try to launch it again, another instance is started.I know this because my app has plays a sound stream even if is minimized.</p><p>How can i maximize the already running instance when trying to launch it ?</p><p>I've tried with the code below, but is not working.</p><pre><code>android:launchMode=""singleInstance""</code></pre>","58945","","58945","","2011-02-15 17:56:12","2011-02-15 17:56:12","Open the same app instance","<android><activity>","2","2","","",""
"5007042","1","","","2011-02-15 17:20:28","1","1157","<p>I've been able to successfully write URL and text data to RFID tags, these are recognized by the Android Tags app, but I have been unable to get the Tags app to recognize vcard data. Where I would assume it would give me the option to add contact after scanning I only see the MIME type text/x-vcard.</p><p>Can anyone confirm whether or not the Tags app will recognize vcard data?</p><p>Thanks,Chris</p>","618267","","","","","2012-12-18 08:57:03","Does Android Tags app recognize vcard data from an NFC tag?","<android><vcard><nfc>","2","0","","",""
"5007059","1","5007098","","2011-02-15 17:22:35","0","201","<p>I have two variables and was wondering how I would define both at once.</p><pre><code>    Button answer1;Button answer2;</code></pre>","614460","","115145","","2011-02-15 17:38:57","2011-02-15 17:38:57","Android, How to define multiple variables at once","<java><android>","2","4","","",""
"5007064","1","5085206","","2011-02-15 17:23:19","2","427","<p>When I push my app to a Honeycomb AVD I get this:</p><pre><code>Package com.myapp requires unavailable shared library com.google.android.maps; failing!</code></pre><p>Am I right in thinking this is because the Preview SDK only provides the AOSP SDK, and not the Google components?</p><p>Is there currently any way to test apps in the Honeycomb AVD that rely on MapView?</p>","477415","","750987","","2011-05-29 06:45:34","2011-05-29 06:45:34","MapView in the Android 3.0 Honeycomb Preview AVD emulator?","<android><android-mapview><android-3.0-honeycomb>","1","0","","",""
"5007198","1","5007323","","2011-02-15 17:35:07","0","181","<p>So i wrote a scrolling image component which uses relative layout's , linear layouts , AsyncTasks and canvas drawing. While developing I tested the application by writing everything inside a dummy activity. Since my component uses threads to communicate with the server, the thread creation and destruction are related to the activity life cycle. </p><p>Now, i want to embed this component inside the real main activity of application. So my question is there a way to make my component aware of activity life cycle events. The approach I have used now is to create a matching life cycle method such as (onMyComponentCreate()) and call it inside onCreate. Is there another way to do that?</p>","260298","","","","","2011-02-15 17:44:58","Hooking up a new android component to main activity","<android>","1","0","","",""
"5007208","1","","","2011-02-15 17:35:40","0","1114","<p>I created a simple application which will stream video from an URL, it works fine when i point to some local URL like,</p><pre><code>http://192.168.X.XX:XXX/Tutorial/TestVideo.mp4</code></pre><p>But when try to point some external URL like,</p><pre><code>http://122.183.X.XX/Tutorial/TestVideo.mp4</code></pre><p>the app is not working. In both the URLs i am having the same video file. When i work with the external URL i am getting the following logcat info</p><pre><code>08-17 17:34:28.772: INFO/Prefetcher(34): max duration reached, size = 960201 bytes</code></pre><p>Please find my code below:</p><pre><code>public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    preview=(VideoView)findViewById(R.id.surface);    preview.setEnabled(true);    preview.bringToFront();    MediaController mc=new MediaController(playerActivity.this);    mc.setMediaPlayer(player_interface);    mc.show(50);    preview.setMediaController(mc );    holder=preview.getHolder();    holder.setFixedSize(400, 400);    b=(Button)findViewById(R.id.cmd_play);    pb=(ProgressBar)findViewById(R.id.progress);    b.setOnClickListener(new View.OnClickListener()    {    public void onClick(View v)    {        try        {                   mp.setDisplay(holder);            mp.setAudioStreamType(AudioManager.STREAM_MUSIC);                           mp.setOnBufferingUpdateListener(playerActivity.this);            mp.setOnPreparedListener(playerActivity.this);            mp.prepare();                       mp.start();            mp.seekTo(20000);        }        catch(Exception e)        {        }}</code></pre><p>I don't know what is the problem, please some body help me if you know the solution for this.</p><p>Thanks and Regards,</p><p>Rajapandian</p>","131062","","131062","","2011-02-16 10:10:54","2011-02-16 10:10:54","Facing problem in Android Video streaming","<android><video><streaming>","1","0","1","",""
"5007233","1","","","2011-02-15 17:37:52","0","64","<p>Hopefully this is easy to do, I've tried searching for it with no luck, my apologies if it was previously answered.</p><p>I want to be able to build 'blah' in setcontentview(R.layout.blah) as shown below in my code:</p><pre><code>@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.options_sounds);</code></pre><p>Where options_sounds will be defined by a user selected spinner.  I'd like to save it as a string and then read it into the setcontentview line somehow.   All the blah.xml files will have been previously built and ready to go, I just want the user to tell me which one he/she wants.</p><p>Thank you for your time.-c</p>","618287","","","","","2011-02-15 17:49:03","setcontview(R.layout.blah) - can i define 'blah' on the fly?","<java><android><android-layout>","1","0","","",""
"5007318","1","5007404","","2011-02-15 17:44:47","-1","72","<p>I was wondering, how would I make a switch statement, that when that certain case was triggered, it would open a new screen with text. Would I use an intent? And if so, which one? </p><p>Thank you for your help in advance.</p>","616599","","66158","","2011-02-15 18:05:01","2011-02-15 19:07:50","android switchstatement question","<android><android-intent><switch-statement><listactivity>","2","0","","",""
"5007332","1","5007728","","2011-02-15 17:45:44","4","7215","<p>Can anyone help me with this?</p><p><strong>I want to read the message body of a new incoming SMS in android, programmatically.</strong></p><p>I tried something but that doesn't return any contents:</p><pre><code>Uri uri = Uri.parse(""content://sms/inbox"");        ContextWrapper context = null;              Cursor c = context.getContentResolver().query(uri, null, null ,null,null);              String body = null;         String number=null;        if(c.moveToFirst()) {                   body = c.getString(c.getColumnIndexOrThrow(""body"")).toString();           number = c.getString(c.getColumnIndexOrThrow(""address"")).toString();        }        c.close(); </code></pre><p>Is their any error in my codePlease any one give me the answer please because totally i wasted one month for this </p>","609050","","66158","","2011-02-15 17:52:41","2013-12-17 12:00:15","How to read the message content of a new in coming message in android?","<android><sms>","5","1","2","",""
"5007385","1","","","2011-02-15 17:50:39","0","942","<p>while writing tests for my content provider i stumbled upon a weird problem. The following code simply tries to verify a call on the my ContentObserver when the underlying data changes. But the onChange callback ContentObserverMock never gets invoked. It also makes no difference if i try it diretcly on the ContentResolver or the Cursor. Here is my test:</p><pre><code>public class TestCursor extends AndroidTestCase {    private class ContentObserverMock extends ContentObserver {        public boolean  cursorObserverIsTriggered   = false;        /**         * @param handler         */        public ContentObserverMock(Handler handler) {            super(handler);        }        @Override        public boolean deliverSelfNotifications() {            return true;        }        /**         * {@inheritDoc}         */        @Override        public void onChange(boolean selfChange) {            Log.d(TestCursor.TAG, ""ONCHANGE is called"");            cursorObserverIsTriggered = true;            super.onChange(selfChange);        }    }    private final static String TAG = TestCursor.class.getSimpleName();    /**     * {@inheritDoc}     */    @Override    protected void setUp() throws Exception {        super.setUp();        Globals.setApplicationContext(getContext());        DummyDataDB.insertDummyDataIntoDB();    }    /**     * {@inheritDoc}     */    @Override    protected void tearDown() throws Exception {        super.tearDown();        DummyDataDB.clearDB();    }    @SmallTest    public void testContentResolver() {        ContentResolver resolver = getContext().getContentResolver();        Uri uri = MyContentProvider.CONTENT_URI;        Handler handler = new Handler();        ContentObserverMock contentObserver = new ContentObserverMock(handler);        resolver.registerContentObserver(uri, true, contentObserver);        Cursor cursor = resolver.query(uri, null, null, null, null);        Assert.assertNotNull(cursor);        int count = cursor.getCount();        DomainObject contentStub = StubFactory.createContentStub();        ContentValues cv = HelperDomainObjectToContentValues.contentValuesFor(contentStub );        resolver.insert(uri, cv);        cursor = resolver.query(uri, null, null, null, null);        Assert.assertEquals(count, (cursor.getCount() - 1));        Assert.assertEquals(true, contentObserver.cursorObserverIsTriggered);    }    @SmallTest    public void testCursor() {        Log.d(TestCursor.TAG, ""testCursor()"");        DbHelper dbHelper = new DbHelper(getContext());        Cursor cursor = dbHelper.selectAllDomainObjects();        Handler handler = new Handler();        ContentObserverMock contentObserver = new ContentObserverMock(handler);        Log.d(TestCursor.TAG, ""registerContentObserver()"");        cursor.registerContentObserver(contentObserver);        DomainObject contentStub = StubFactory.createContentStub();        ContentValues cv = HelperDomainObjectToContentValues.contentValuesFor(contentStub );        dbHelper.writeDOmainObject(contentValues);        Log.d(TestCursor.TAG, ""cursor Requery()"");        cursor.requery();        Assert.assertEquals(true, contentObserver.cursorObserverIsTriggered);    }</code></pre><p>Thanks in advance!</p>","20278","","247921","","2011-02-25 10:24:45","2011-02-26 07:12:50","ContentObserver never receives a onChange callback during instrumentation testing?","<android><database><android-contentprovider><instrumentation>","2","0","","",""
"5007579","1","5008045","","2011-02-15 18:05:28","1","288","<p>Hi everyone I am looking to add a Notification when the app is started. That will ask the user if they have a wifi or unlimited connection. If they pick yes then they can go into the app, if no then the app closes with a message 'Try again later...'</p>","613481","","118587","","2011-02-15 18:17:59","2011-02-15 18:44:30","Want to add a startup notification Droid app","<android><eclipse>","1","2","1","",""
"5007609","1","","","2011-02-15 18:08:37","0","726","<p>I have created 3 tabs each tab performing different task on click of them.Each tab calls new intent that in turn make HTTP connection and display the results in their activity. Till here everything works fine as expected.</p><pre><code>public class PhotoVideoTab  extends TabActivity {     @Override     protected void onCreate(Bundle savedInstanceState) {         super.onCreate(savedInstanceState);         TabHost tabHost = getTabHost();         tabHost.addTab(tabHost.newTabSpec(""tab1"")                .setContent(new Intent(this, FetchImages.class)));        tabHost.addTab(tabHost.newTabSpec(""tab2"")                .setContent(new Intent(this, FetchList.class)));        tabHost.addTab(tabHost.newTabSpec(""tab3"")                .setContent(new Intent(this, FetchData.class)));    }}</code></pre><p>There is delay in displaying different activity as each activity makes other operations like making HTTP request,fetching data etc.In this mean time i want to display ProgressDailog.please let me know how do i bring ProgressDailog between the two Tab Activity</p><pre><code>public class FetchImages extends Activity {//Make Connection//Display GridView}public class FetchList extends Activity {//Make Connection//Display ListView}public class FetchData extends Activity {//Make Connection//Display ScrollView}</code></pre>","618335","","759866","","2014-01-06 14:45:05","2014-01-06 14:45:05","Progress Dialog with TabActivity","<android><http><android-intent><progressdialog><tabactivity>","1","1","","",""
"5007670","1","5008041","","2011-02-15 18:13:36","0","450","<p>Is it advice able to have top banner/Logo as a webview instead of Image embedded into App? The idea is to control what user see on top using an Adserver</p>","601484","","319618","","2011-02-15 18:27:44","2011-05-18 07:51:04","Android layout top banner as webview","<android><android-webview><banner-ads>","1","1","","",""
"5007721","1","5007755","","2011-02-15 18:18:53","7","4501","<p>Is there a notion of sleep stages/levels on Android? </p><p>From browsing the mailing lists, I'm aware that there exist a stage called ""Deep Sleep"". Do execution for all apps halt when device reaches this state? If so, besides user hitting the power button, what else could wake the device back up?</p>","440093","","1267021","","2012-09-12 00:04:51","2012-09-12 00:04:59","Android: Sleep stages/levels on an Android device?","<android><sleep>","3","0","7","",""
"5007737","1","5007822","","2011-02-15 18:21:28","0","1677","<p>hi i am a new developer, i created an app of my own. I created the .apk file and get it signed and aligned it. When i was running it on my device i thought of doing some changes in it, but i missed the original source code. Can i get back my source code using the aligned.apk file... I am using eclipse</p>","596364","","","","","2011-02-15 18:27:02","how to open an .apk file","<java><android>","1","2","1","",""
"5007772","1","5007819","","2011-02-15 18:23:53","2","189","<p>which 'on' event is invoked when the user selects a ListView item by pressing the trackball button?i trapped onKeyDown, onTouchEvent, onTrackballEventbut it's none of those...thanks</p>","604237","","","","","2011-02-15 18:26:51","which 'on' method is called when the trackball's 'Select' button is pressed?","<android><event-handling><trackball>","1","0","2","",""
"5007792","1","","","2011-02-15 17:27:04","0","498","<p>Does anyone know whether Android API libraries supports to create a custom Caller UI? For instance to add a new button on the Caller UI. </p>","618485","Developerx","21960","","2011-02-15 18:25:21","2011-02-15 18:25:21","How to create a custom Caller UI using Android API","<android>","1","0","","",""
"5007839","1","5007988","","2011-02-15 18:28:36","2","2410","<p>I have an asp.net MVC 2.0 application.  I also have a WFC service, if I want to go that route. but I am not particularly fond of parsing xml in Java. (I haven't worked in Java in about 7 years).  This is my first time using eclipse, so please explain things to me like the android/java noob that I am.</p><p>After some research I think I would like to use my MVC site as a restful service to pass json back and forth between the android and the server. I know how to pass Json out of the controller:</p><pre><code>public ActionResult SomeActionMethod() {    return Json(new {foo=""bar"", hello=""World""});}</code></pre><p>How do I go about connecting to the service and then translating the json into objects within my android application?</p>","107455","","","","","2011-02-15 18:58:28","Connecting Android to ASP.NET MVC with json","<java><android><json><asp.net-mvc-2>","3","0","","",""
"5007902","1","","","2011-02-15 18:33:06","3","567","<p>Someone can give some information about how related apps are calculated in android market?Why for example X is related to Y but Y isn't related to X?</p>","269454","","","","","2011-02-26 01:55:20","How are related apps calculated in android market","<android><google-play>","2","0","1","",""
"5007928","1","5029476","","2011-02-15 18:35:11","0","651","<p>I have a small app wich runs in background doing some tasks wich basically detects the user behavior inside the Android Music application.</p><p>I wanna check in background if the user pressed the back, play/stop or skip button. It seems like I can access information about the current playing song but I have no idea how to put an ""observer"" to watch those buttons.</p><p>Does anyone have an idea to help with? </p>","609787","","","","","2011-02-17 13:21:17","Android ""observer""","<android><button><background><task><observer-pattern>","2","1","","",""
"5007956","1","5008261","","2011-02-15 18:37:03","1","345","<p>I'm attempting to programmatically add several Tiles which extend from <code>TextViews</code> into a <code>RelativeLayout</code>.</p><p>My code is as follows.</p><pre><code>RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);for (int i = 0; i &lt; characters.length; i++) {    Tile tile = new Tile(this);    tile.setText(Character.toString(characters[i]));    tile.setId(i);    if (i != 0) {        params.addRule(RelativeLayout.RIGHT_OF, i - 1);    }    _display.addView(tile, params);}</code></pre><p>So I'm creating a new instance class of <code>LayoutParams</code> called <code>params</code> and adding a rule to align each tile to the right of the previous tile. When I run the app it appears that the tiles are overlapping over each other. Any suggestions?</p>","305211","","515205","","2013-06-21 18:12:22","2013-06-21 18:12:22","Programmatic RelativeLayout","<java><android>","1","0","","",""
"5008001","1","5008125","","2011-02-15 18:40:08","3","728","<p>We service multiple clients.  One feature we want to offer is an android application which allows the client to custom brand the application (icons, logos, names, etc).  </p><p>Here are a few stipulations.</p><ol><li>Customers of clients will use this app.  </li><li>You could be a customer of more than one client, but we cannot show the user any kind of list of clients.</li><li>Clients cannot share a single app.</li><li>The app must be able to look different per client, even though the functionality is the same </li></ol><p>Yes, I know it's a PITA to build it this way, but our clients don't want customers of other clients to know they are also our client.</p><p>So, what is the best  way to build an easily brandable application with as little strain on the developer's sanity as possible?</p>","107455","","107455","","2011-02-15 18:46:17","2011-02-15 19:02:21","Brandable Android Application","<android><branding>","3","0","3","",""
"5008019","1","5008075","","2011-02-15 18:42:19","3","538","<p>I am working on an Android app that deals with sensitive user information.  One of the requirements is that the user is required to log back into the application whenever they leave it and come back.  This is easily dealt with for the case when the user presses the Home button and then relaunches the app (<code>android:clearTaskOnLaunch</code> attribute on the <code>Activity</code> in <code>AndroidManifest.xml</code>).  However, we need to do the same thing when the user long presses the Home button, switches to another application, then comes back.</p><p>I have researched this every way that I can think of and have not found a workable solution.  Is this even possible with Android?</p><p>When answering, please keep in mind that this is a business requirement which I have no control over.</p>","618378","","244296","","2011-02-15 20:15:07","2013-02-20 15:39:40","Require login every time user returns to Android application","<android><security>","5","0","1","",""
"5008056","1","5010586","","2011-02-15 18:45:28","1","783","<p>When working in .NET, I can use the web.config or app.config to set up multiple environments (Dev, Test, Production).    </p><p>For example, I wish to specify the location of my web (restful) service for developing against one, testing against another, and then using the production url in the release version of the app.</p><p>How would I do something similar in Android?</p><p><strong>EDIT</strong>: Without changing the url every time I release a version</p>","107455","","107455","","2011-02-15 18:58:51","2011-02-15 23:03:37","Android Equivalent to web/app.config for multiple environments","<android><configuration><configuration-files><configuration-management>","1","0","","",""
"5008059","1","5008203","","2011-02-15 18:45:49","3","8982","<p>I am building up a UI from code and can successfully add ProgressBar widgets, however I cannot alter the dimensions of the widget to values I need, it always stays at the default size (around 50dp).  I've tried the following code;</p><pre><code>    ProgressBar progressBar = new ProgressBar(activity, null, android.R.attr.progressBarStyleHorizontal);    progressBar.setMinimumHeight(20);    progressBar.setMinimumWidth(100);</code></pre><p>I've also tried setting the progressBar LayoutParams but again nothing and I've tried wrapping the widget in another layout, but still not luck.</p><p>Can anyone help, as I can't see how to do it?  If there is a solution using XML it could work, but I have to set the dimension and location at runtime.</p><hr><p>For Progress XML I used the following.</p><pre><code>&lt;ProgressBar      xmlns:android=""http://schemas.android.com/apk/res/android""       android:layout_width=""fill_parent""      android:layout_height=""10dp""      android:indeterminateOnly=""false""      android:progressDrawable=""@android:drawable/progress_horizontal""      android:indeterminateDrawable=""@android:drawable/progress_indeterminate_horizontal""      android:maxWidth=""1000dp""   /&gt;</code></pre><p>Then the code to inflate it is as follows.  This is a mix of what we have been discussing.</p><pre><code>    LayoutInflater layoutInflater = (LayoutInflater)activity.getSystemService(Context.LAYOUT_INFLATER_SERVICE);    ProgressBar progressBar = (ProgressBar)layoutInflater.inflate(R.layout.progress_bar, null);    progressBar.setMinimumHeight(10);    progressBar.setMinimumWidth(200);    progressBar.setLayoutParams(new RelativeLayout.LayoutParams(200, 10);    progressBar.setMax(100);    progressBar.setProgress(getScrollBarValue());    progressBar.setIndeterminate(isIndeterminate());    progressBar.getLayoutParams().width = 200;    progressBar.invalidate();</code></pre>","264808","","264808","","2011-02-16 20:51:48","2011-02-16 20:51:48","Change the width of a ProgressBar added at runtime","<android><layout><progress-bar><width>","2","2","2","",""
"5008122","1","5008198","","2011-02-15 18:51:57","2","2622","<p>How do I enable multitouch support for an app, I wish two users touching the screen and both sending drag events for the aplication.</p><p>I have this code on my component</p><pre><code>public boolean onTouchEvent(MotionEvent evt) {        if (evt.getY() &gt; 612) {            east.notifyMotionEvent(evt);            south.notifyMotionEvent(evt);        } else {            weast.notifyMotionEvent(evt);            north.notifyMotionEvent(evt);        }        return true;}</code></pre><p>But only one drag event is being send to it.</p><p>My code to support now is</p><pre><code>        for (int i = 0; i &lt; evt.getPointerCount(); i++) {            float y = evt.getY(i);            if (y &gt; 612) {                eastPad.notifyMotionEvent(evt.getX(i), evt.getY(i));                southPad.notifyMotionEvent(evt.getX(i), evt.getY(i));            } else {                weastPad.notifyMotionEvent(evt.getX(i), evt.getY(i));                northPad.notifyMotionEvent(evt.getX(i), evt.getY(i));            }        }</code></pre>","558433","","558433","","2011-02-15 19:26:58","2011-02-15 19:30:10","How enable multi touch for dragging events","<android><multi-touch>","1","0","0","",""
"5008176","1","5008271","","2011-02-15 18:56:48","1","4317","<p>Hy!</p><p>My Thread.interrupt doesn't work.</p><p>Code (us is  global):</p><pre><code>//Callus = new UpdateState(params, hup);            us.start();//Interupt@Override    public boolean onOptionsItemSelected(MenuItem item) {        if (item.getItemId()== R.id.stopthread)        {            Log.e(""Kill"", ""Kill"");            us.interrupt();        }        return super.onOptionsItemSelected(item);    }</code></pre><p>Class:</p><pre><code>package android.skiptvad;import java.util.List;import org.apache.http.NameValuePair;import android.os.Handler;import android.os.Message;import android.text.NoCopySpan.Concrete;import android.util.Log;import android.widget.TextView;import android.widget.Toast;import android.util.Log;public class UpdateState extends Thread {    public List&lt;NameValuePair&gt; params;    public Handler handler;    public Handler ins;    public UpdateState(List&lt;NameValuePair&gt; params, final Handler handler) {        this.handler = handler;        this.params = params;        this.ins = new Handler (){            @Override            public void handleMessage(Message msg) {                if (msg.obj.toString()!= null)                {                    JSONParse json = null;                    try                     {                                   Message msg2 =new Message();                            Log.e(""Channel_State_Update"",msg.obj.toString());                            json = new JSONParse(msg.obj.toString());                            String state = json.getChannelState();                            Log.e(""Channel_State_Send"",state);                            msg2.obj = state;                            handler.sendMessage(msg2);                    }                     catch (final Exception e)                     {                            e.printStackTrace();                    }            }        }        };    }    @Override    public void run() {            while (true)            {                if (!this.isInterrupted())                {                    HttpConnection con = new HttpConnection(params, ""http://surfkid.redio.de/getChannelState"", this.ins);                    con.start();                    try {                        Log.e(""Sleep"", ""Begin"");                        UpdateState.this.sleep(5000);                        Log.e(""Sleep"", ""End"");                    } catch (InterruptedException e) {                        // TODO Auto-generated catch block                        Log.e(""Sleep"", ""Error"");                        e.printStackTrace();                    }                }            //super.run();        }    }}</code></pre><p>Please help</p><p>Log:</p><pre><code>02-15 18:50:30.317: ERROR/Sleep(10696): End02-15 18:50:30.347: ERROR/Sleep(10696): Begin02-15 18:50:30.677: ERROR/Channel_State_Update(10696): {""responseData"":{""channelState"":""0""},""responseDetails"":null,""responseStatus"":200}02-15 18:50:30.677: ERROR/Channel_State_Send(10696): 002-15 18:50:30.677: ERROR/UPDATE(10696): 002-15 18:50:35.347: ERROR/Sleep(10696): End02-15 18:50:35.357: ERROR/Sleep(10696): Begin02-15 18:50:35.897: ERROR/Channel_State_Update(10696): {""responseData"":{""channelState"":""0""},""responseDetails"":null,""responseStatus"":200}02-15 18:50:35.897: ERROR/Channel_State_Send(10696): 002-15 18:50:35.897: ERROR/UPDATE(10696): 002-15 18:50:36.868: ERROR/Kill(10696): Kill02-15 18:50:36.878: ERROR/Sleep(10696): Error02-15 18:50:36.908: ERROR/Sleep(10696): Begin02-15 18:50:37.427: ERROR/Channel_State_Update(10696): {""responseData"":{""channelState"":""0""},""responseDetails"":null,""responseStatus"":200}02-15 18:50:37.427: ERROR/Channel_State_Send(10696): 002-15 18:50:37.427: ERROR/UPDATE(10696): 002-15 18:50:41.909: ERROR/Sleep(10696): End02-15 18:50:41.927: ERROR/Sleep(10696): Begin</code></pre>","547995","","","","","2011-02-15 19:03:13","Thread.interrupt () doesn't work","<java><android>","2","0","","",""
"5008184","1","5010490","","2011-02-15 18:57:12","0","916","<p>I would like to put the phone contacts on my phone to an Array. I've created 4 contacts in the Emulator.</p><p>I have found this code on the web, but the last row (263) makes the app crash:</p><pre><code>String contactName = null;ArrayList&lt;String&gt; myArr = new ArrayList&lt;String&gt;();Context context = getApplicationContext();Cursor cursor = context.getContentResolver().query(ContactsContract.Contacts.CONTENT_URI, null, null, null, null);while (cursor.moveToNext()) {    contactName  = cursor.getString(cursor.getColumnIndex(ContactsContract.Contacts.DISPLAY_NAME));     myArr.add(contactName);         }wtxt1.setText(myArr.get(3));</code></pre><p>wtxt1 is declared as TextView wtxt1;</p><p>What is wrong with the code?</p><p>Logcat:</p><pre><code>02-15 19:47:47.602: WARN/dalvikvm(586): threadid=1: thread exiting with uncaught exception (group=0x4001d800)02-15 19:47:47.602: ERROR/AndroidRuntime(586): FATAL EXCEPTION: main02-15 19:47:47.602: ERROR/AndroidRuntime(586): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.bfarago.nevnap/com.bfarago.nevnap.MainActivity}: java.lang.NullPointerException02-15 19:47:47.602: ERROR/AndroidRuntime(586):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)02-15 19:47:47.602: ERROR/AndroidRuntime(586):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)02-15 19:47:47.602: ERROR/AndroidRuntime(586):     at android.app.ActivityThread.access$2300(ActivityThread.java:125)02-15 19:47:47.602: ERROR/AndroidRuntime(586):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)02-15 19:47:47.602: ERROR/AndroidRuntime(586):     at android.os.Handler.dispatchMessage(Handler.java:99)02-15 19:47:47.602: ERROR/AndroidRuntime(586):     at android.os.Looper.loop(Looper.java:123)02-15 19:47:47.602: ERROR/AndroidRuntime(586):     at android.app.ActivityThread.main(ActivityThread.java:4627)02-15 19:47:47.602: ERROR/AndroidRuntime(586):     at java.lang.reflect.Method.invokeNative(Native Method)02-15 19:47:47.602: ERROR/AndroidRuntime(586):     at java.lang.reflect.Method.invoke(Method.java:521)02-15 19:47:47.602: ERROR/AndroidRuntime(586):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)02-15 19:47:47.602: ERROR/AndroidRuntime(586):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)02-15 19:47:47.602: ERROR/AndroidRuntime(586):     at dalvik.system.NativeStart.main(Native Method)02-15 19:47:47.602: ERROR/AndroidRuntime(586): Caused by: java.lang.NullPointerException02-15 19:47:47.602: ERROR/AndroidRuntime(586):     at com.bfarago.nevnap.MainActivity.onCreate(MainActivity.java:263)02-15 19:47:47.602: ERROR/AndroidRuntime(586):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)02-15 19:47:47.602: ERROR/AndroidRuntime(586):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)02-15 19:47:47.602: ERROR/AndroidRuntime(586):     ... 11 more02-15 19:47:48.852: WARN/ActivityManager(65):   Force finishing activity com.bfarago.nevnap/.MainActivity02-15 19:47:49.361: WARN/ActivityManager(65): Activity pause timeout for HistoryRecord{43f939d0 com.bfarago.nevnap/.MainActivity}</code></pre><p>Debug:</p><pre><code>Log.d(""Checking size"", String.valueOf(myArr.size()));</code></pre><p>in the while cycle results in:</p><pre><code>02-15 22:18:17.986: DEBUG/Checking size(452): 102-15 22:18:18.036: DEBUG/Checking size(452): 202-15 22:18:18.056: DEBUG/Checking size(452): 302-15 22:18:18.076: DEBUG/Checking size(452): 4</code></pre><p>And</p><pre><code>wtxt1.setText(String.valueOf(myArr.size()));</code></pre><p>also results in crash.</p>","571648","","571648","","2011-02-15 21:23:33","2011-02-15 22:53:11","Android contacts array","<android><contacts>","1","2","","",""
"5008224","1","5234964","","2011-02-15 18:59:48","11","4399","<p>Is correct to use ContentProvider with dao Pattern ... ? or it should bring to performance issue ? </p><p>i try to explain ... </p><p>i've a contentProvider ... an activity, a dao and a bean ..</p><p>this is the code : </p><pre><code>class Bean(){ String name;}class Dao{ Activity activity; public Dao(Activity activity){ this.activity = activity;public List&lt;Bean&gt; getAllBean() {    Cursor c = activity.managedQuery(Bean.CONTENT_URI, PROJECTION,                null, null, Bean.DEFAULT_SORT_ORDER);    return BeanMapper.GetAllFromCursor(c);    }}}Class Activity{..... onCreate(....){  Dao dao = new Dao(this);  List&lt;Bean&gt; aList = dao.getAllBean();}....}</code></pre><p>what do you think ? </p><p>regards </p>","618195","","","","","2011-03-08 16:01:24","Android - Using Dao Pattern with contentProvider","<android><dao><android-contentprovider>","1","0","3","",""
"5008225","1","5008403","","2011-02-15 18:59:49","0","2133","<p>I have a web view on a picture and I want when I click on a button to change the background of the webview to transparent...</p><p>To do so I use webView.setBackgroundColor(Color.TRANSPARENT);</p><p>When I press the button my webview doesn't change it's color.. I have to write something in it to change it's color after I press the button..</p><p>Does somebody knows how to fix this?</p><p>Thank you! </p>","449310","","","","","2013-06-13 09:05:28","android webview setbackground() doesn't work","<android><webview><background-color>","3","0","","",""
"5008252","1","5008510","","2011-02-15 19:02:02","4","1303","<p>I am trying to write a simple physics simulation where balls with varying radii and masses bounce around in a perfectly elastic and frictionless environment. I wrote my own code following this resource: <a href=""http://www.vobarian.com/collisions/2dcollisions2.pdf"" rel=""nofollow"">http://www.vobarian.com/collisions/2dcollisions2.pdf</a> and I also tested the code from here: <a href=""http://stackoverflow.com/questions/345838/ball-to-ball-collision-detection-and-handling"">Ball to Ball Collision - Detection and Handling</a></p><p>QUESTION EDITED </p><p>With the help of Rick Goldstein and Ralph, I have gotten my code to work (there was a typo..). Thanks so much for you help. However I am still confused as to why the other algorithm isn't working for me. The balls bounce off in the correct directions, but the total energy of the system is never conserved. The velocities get faster and faster until the balls just start blinking in static positions on the screen. I actually want to use this code in my program, because it is a lot more concise than the one I wrote. </p><p>Here is the functional algorithm that I wrote (although I did take the first bit from that other source). Its in a Bubble class: </p><pre><code>public void resolveCollision(Bubble b){    // get the minimum translation distance    Vector2 delta = (position.subtract(b.position));    float d = delta.getMagnitude();    // minimum translation distance to push balls apart after intersecting    Vector2 mtd = delta.multiply(((getRadius() + b.getRadius())-d)/d);     // resolve intersection --    // inverse mass quantities    float im1 = 1 / getMass();     float im2 = 1 / b.getMass();    // push-pull them apart based off their mass    position = position.add(mtd.multiply(im1 / (im1 + im2)));    b.position = b.position.subtract(mtd.multiply(im2 / (im1 + im2)));    //get the unit normal and unit tanget vectors    Vector2 uN = b.position.subtract(this.position).normalize();    Vector2 uT = new Vector2(-uN.Y, uN.X);    //project ball 1 &amp; 2 's velocities onto the collision axis    float v1n = uN.dot(this.velocity);    float v1t = uT.dot(this.velocity);    float v2n = uN.dot(b.velocity);    float v2t = uT.dot(b.velocity);    //calculate the post collision normal velocities (tangent velocities don't change)    float v1nPost = (v1n*(this.mass-b.mass) + 2*b.mass*v2n)/(this.mass+b.mass);    float v2nPost = (v2n*(b.mass-this.mass) + 2*this.mass*v1n)/(this.mass+b.mass);    //convert scalar velocities to vectors    Vector2 postV1N = uN.multiply(v1nPost);    Vector2 postV1T = uT.multiply(v1t);    Vector2 postV2N = uN.multiply(v2nPost);    Vector2 postV2T = uT.multiply(v2t);    //change the balls velocities    this.velocity = postV1N.add(postV1T);    b.velocity = postV2N.add(postV2T);}</code></pre><p>And here is the one that doesn't work</p><pre><code>public void resolveCollision(Bubble b){    // get the minimum translation distance    Vector2 delta = (position.subtract(b.position));    float d = delta.getMagnitude();    // minimum translation distance to push balls apart after intersecting    Vector2 mtd = delta.multiply(((getRadius() + b.getRadius())-d)/d);     // resolve intersection --    // inverse mass quantities    float im1 = 1 / getMass();     float im2 = 1 / b.getMass();    // push-pull them apart based off their mass    position = position.add(mtd.multiply(im1 / (im1 + im2)));    b.position = b.position.subtract(mtd.multiply(im2 / (im1 + im2)));    // impact speed    Vector2 v = (this.velocity.subtract(b.velocity));    float vn = v.dot(mtd.normalize());    // sphere intersecting but moving away from each other already    if (vn &gt; 0.0f) return;    // collision impulse (1f is the coefficient of restitution)    float i = (-(1.0f + 1f) * vn) / (im1 + im2);    Vector2 impulse = mtd.multiply(i);    // change in momentum    this.velocity = this.velocity.add(impulse.multiply(im1));    b.velocity = b.velocity.subtract(impulse.multiply(im2));}</code></pre><p>Let me know if you find anything. Thanks</p>","577826","","577826","","2011-02-16 02:49:30","2011-02-16 02:49:30","2d Ball Collision Problem: no conservation of energy","<java><android><physics><collision><game-physics>","3","0","1","",""
"5008388","1","","","2011-02-15 19:13:29","1","1342","<p>I want to determine if a paired device is currently active. I don't really need to connect to it, just determine if it has a heartbeat. </p><p>I'm fighting a series of IO errors while trying to connect a bluetooth socket, but I'm not sure I really need to. </p>","618420","","","","","2012-08-06 16:59:15","Android Bluetooth - Determine if a paired device is 'on'","<android><bluetooth>","2","1","","",""
"5008426","1","5009077","","2011-02-15 19:16:49","3","868","<p>I am working on a custom view with a hope of reusability. It should have a generic type, like this:</p><pre><code>public class CustomViewFlipper&lt;someType&gt; extends ViewFlipper { }</code></pre><p>I know how to bind a normal custom view to the XML file. But I couldn't find any example for this situation. Is there any way to define a generic type for a class in XML?</p>","553993","","","","","2012-07-03 16:53:42","Adding a custom view to XML... but with a GENERIC-type","<android><xml>","2","0","","",""
"5008445","1","5100679","","2011-02-15 19:18:46","1","1837","<p>I'm entirely new to Android development, and I'm interested in making a live wallpaper. I was thinking about looping a set of pictures instead of drawing the animation. Is this a possible approach? If possible is this a suitable or ideal way of doing it, does it eat up memory and would i need images with different resolutions because of the fragmentation?(hundreds of different devices) </p><p>Thanks in advance :)</p>","618406","","19750","","2011-03-31 15:39:54","2011-03-31 15:39:54","Android LIVE Wallpaper approach?","<android><image><live-wallpaper>","3","0","","",""
"5008476","1","5008716","","2011-02-15 19:21:45","0","971","<p>Hey. I have an android spinner item, in which the lines are made up of a TextView and an ImageView (a star, to mark that the user has marked that particular item as a favourite). Now, when a user favourites an item, I want to make the star appear next to that item in the spinner list, so I want to redraw the spinner to show the updated images. How do I do this?</p><p>What I'm doing now is that I'm creating a whole new spinner, with the appropriate images. This makes my spinner set the selected item to the first item in the list, which is annoying - I want it to stay the same. I have tried</p><pre><code>spinner.setSelection(selectedItem);</code></pre><p>This works for ANY number other than the number I actually want (the position of the currently selected item), then it sets the selected spinner item to the first in the list again.</p><p>So: how can I redraw the list with the updated information without having to recreate the whole list, or alternatively, how can I recreate the list and still preserve the spinner item selection?</p><p>To clarify: here's what I'm doing</p><pre><code>// Callback for ""favourite""-buttonstar.setOnClickListener(new ImageButton.OnClickListener() {        @Override        public void onClick(View arg0) {            // Toggle favourite            getActiveSelection().setStarred(getActiveSelection().isStarred() ? false : true);            reloadText();            createSpinner();        }    }); private void createSpinner() {    spinner = ((Spinner)findViewById(R.id.spinner));    ArrayList&lt;HashMap&lt;String, Object&gt;&gt; list = new ArrayList&lt;HashMap&lt;String, Object&gt;&gt;();    HashMap&lt;String, Object&gt; map = new HashMap&lt;String, Object&gt;();    // Populate spinner item list    for(int i=0; i&lt;N; i++) {        SpinnerItem item = getSpinnerItem(i);        map = new HashMap&lt;String, Object&gt;();        map.put(""Name"", item.getName());        map.put(""Icon"", (item.isStarred() ? ""On"" : ""Off""));        list.add(map);    }            MySpinnerAdapter aspn = new MySpinnerAdapter(this, list,            R.layout.spinner, new String[] { ""Name"", ""Icon"" },            new int[] { R.id.spinnerrow, R.id.spinnerrowicon });    spinner.setAdapter(aspn);    spinner.setSelection(getActiveSelection().getSpinnerPosition());}</code></pre>","573536","","","","","2011-09-05 21:30:53","Redraw android spinner","<android><selection><spinner>","3","0","","",""
"5008525","1","","","2011-02-15 19:26:17","1","617","<p>I've seen the use of media scanners to dynamically add items from the sd card to a gallery but I'm in need of adding content from the web.</p><p>I have a large quantity of images to display and I want to load 5 to start with and have a ""load more"" button at the end.  This button will add 5 more images to the end of the gallery and keep the original 5 as well as keep the ""load more"" button at the end.</p>","591042","","","","","2011-02-15 19:26:17","Android -- Dynamically Adding Items to Gallery Adapter","<android><gallery><adapter>","0","0","","",""
"5008567","1","5048779","","2011-02-15 19:30:12","1","393","<p>I have checked everything and the creating of the database is fine its when I try to add data to it that it forces the app to close. I cant see why.</p><pre><code>    db.execSQL(""CREATE TABLE IF NOT EXISTS "" +            SAMPLE_TABLE_NAME2                + "" (GenID INT, ""            + "" Nxtq INT);"");    db.execSQL(""INSERT INTO "" +            SAMPLE_TABLE_NAME2 +            "" Values (1,1);"");</code></pre><p>The error I get output is</p><blockquote>  <p>Failure 1 (table general has 4 columns but 2 values were supplied) when prepearing  'INSERT INTO general values (1,1)</p></blockquote><p>There is some stuff before these two query's here it is in its entirety.</p><pre><code>    db =  this.openOrCreateDatabase(SAMPLE_DB_NAME, MODE_PRIVATE, null);    db.execSQL(""CREATE TABLE IF NOT EXISTS "" +            SAMPLE_TABLE_NAME +            "" (ID INT(3), Questions VARCHAR, Answer1 VARCHAR,"" +            "" Answer2 VARCHAR, Answer3 VARCHAR,"" +            "" Answer4 VARCHAR, CorrectAnswer INT(1), Reason VARCHAR);"");    db.execSQL(""CREATE TABLE IF NOT EXISTS "" +            SAMPLE_TABLE_NAME2                + "" (GenID INT, ""            + "" Nxtq INT);"");    db.execSQL(""INSERT INTO "" +            SAMPLE_TABLE_NAME2 +            "" Values (1,1);"");</code></pre>","614460","","614460","","2011-02-15 22:34:54","2011-02-19 04:08:38","SQLITE Query forces application close","<android><sqlite>","5","3","","",""
"5008568","1","5009097","","2011-02-15 19:30:15","3","2248","<p>I am working with an existing ical file at work.  I'm not sure who is creating it, and I would like to become more familiar with ical before I contact them - so I can have an intelligent conversation.  </p><p>Can someone point me to a good beginner tutorial for iCal?  </p><p>Most of what I've found so far has been very vague, and assumes too much user knowledge.  I need something that covers the basics (tags/parameters, setup, publishing, etc), but also explains things like synching iPhone, Android, and Blackberry with calendar updates on the server.</p>","359519","","1167333","","2014-02-07 13:33:27","2014-02-07 13:33:27","iCal - Beginner Tutorial and Docs?","<android><iphone><blackberry><icalendar><rfc5545>","3","0","1","",""
"5008615","1","","","2011-02-15 19:34:13","0","95","<p>Could anyone plz tell what is the callback will be called when the screen orientation gets changed ?</p>","617510","","","","","2011-02-15 19:37:27","Usage of Measure change?","<android>","1","0","","",""
"5008616","1","5008735","","2011-02-15 19:34:19","1","977","<p>wchar_t is reportedly useless and not supported in Android NDK development. If this is the case what would I need to do so that wchar_t is defined as an unsigned short?</p><p>This would help immensely in porting over native library that references wchar_t and would also seem to be a better fit with JNI's understanding of Unicode.  GetStringUTFChars() returns const char * and GetStringChars() returns const jchar * with jchar being defined as an unsigned short (2 bytes). Defining wchar_t as an unsigned short would make it compatible with GetStringChars() and seemingly make my life much easier.</p><p>Is it possible? What would it take? I'm thinking it would require hacking up and rebuild the toolchain.</p>","511698","","","","","2011-02-15 19:47:09","Want to force wchar_t to be an unsigned short using the Android NDK","<android><android-ndk>","1","0","2","",""
"5008665","1","","","2011-02-15 19:39:42","5","2519","<p>AppBrain's <a href=""http://www.appbrain.com/info/fast-web-install"">Fast Web Install</a> is able to push apps from their web site directly onto an Android phone with no user intervention. This requires the user's Google account credentials or auth token, so clearly it's using some Google API. There's an unofficial <a href=""http://code.google.com/p/android-market-api/"">Android Market API</a> project, but that doesn't include app installation.</p><p>So how does it work?</p>","129976","","","","","2011-03-24 18:12:42","How do automatically push an Android app from the web onto a phone?","<android><push>","2","3","3","",""
"5008892","1","5008947","","2011-02-15 20:05:19","1","4770","<p>Hey I'm trying to insert data in the SQLite database, but everytime I try to insert the logcat shows the error. THe error ir shown on a service that gets the calllog data and insert in the DB.</p><p>Error:</p><blockquote>  <p>02-15 17:07:51.658: ERROR/AndroidRuntime(25392): java.lang.IllegalStateException: database not open</p></blockquote><p>And the error is in this line of the Service class:</p><blockquote>  <p>db.insert(DataHandlerDB.TABLE_NAME_2, null, values);</p></blockquote><p><strong>Here is the service:</strong></p><pre><code>public class TheService extends Service {    private static final String TAG = ""TheService"";    private static final String LOG_TAG = ""TheService"";    private Handler handler = new Handler();    private SQLiteDatabase db;    class TheContentObserver extends ContentObserver {        public TheContentObserver(Handler h) {            super(h);            OpenHelper helper = new OpenHelper(getApplicationContext());            SQLiteDatabase db = helper.getWritableDatabase();        }        @Override        public boolean deliverSelfNotifications() {            return true;        }        @Override        public void onChange(boolean selfChange) {            super.onChange(selfChange);            searchInsert();        }    }    @Override    public IBinder onBind(Intent arg0) {        return null;    }    @Override    public void onCreate() {        db = DataHandlerDB.createDB(this);        registerContentObservers();    }    @Override    public void onDestroy(){        db.close();    }    @Override    public void onStart(Intent intent, int startid) {    }    private void searchInsert() {        Cursor cursor = getContentResolver().query(                android.provider.CallLog.Calls.CONTENT_URI, null, null, null,                android.provider.CallLog.Calls.DATE + "" DESC "");        int numberColumnId = cursor                .getColumnIndex(android.provider.CallLog.Calls.NUMBER);        int durationId = cursor                .getColumnIndex(android.provider.CallLog.Calls.DURATION);        int contactNameId = cursor                .getColumnIndex(android.provider.CallLog.Calls.CACHED_NAME);        int numTypeId = cursor                .getColumnIndex(android.provider.CallLog.Calls.CACHED_NUMBER_TYPE);        int callTypeId = cursor                .getColumnIndex(android.provider.CallLog.Calls.TYPE);        Date dt = new Date();        int hours = dt.getHours();        int minutes = dt.getMinutes();        int seconds = dt.getSeconds();        String currTime = hours + "":"" + minutes + "":"" + seconds;        SimpleDateFormat dateFormat = new SimpleDateFormat(""M/d/yyyy"");        Date date = new Date();        cursor.moveToFirst();        String contactNumber = cursor.getString(numberColumnId);        String contactName = (null == cursor.getString(contactNameId) ? """"                : cursor.getString(contactNameId));        String duration = cursor.getString(durationId);        String numType = cursor.getString(numTypeId);        String callType = cursor.getString(callTypeId);        ContentValues values = new ContentValues();        values.put(""contact_id"", 1);        values.put(""contact_name"", contactName);        values.put(""number_type"", numType);        values.put(""contact_number"", contactNumber);        values.put(""duration"", duration);        values.put(""date"", dateFormat.format(date));        values.put(""current_time"", currTime);        values.put(""cont"", 1);        values.put(""type"", callType);        if (!db.isOpen()) {            getApplicationContext().openOrCreateDatabase(                    ""/data/data/com.my_app/databases/mydb.db"",                    SQLiteDatabase.OPEN_READWRITE, null);        }        db.insert(DataHandlerDB.TABLE_NAME_2, null, values);        cursor.close();    }    public void registerContentObservers() {        this.getApplicationContext()                .getContentResolver()                .registerContentObserver(                        android.provider.CallLog.Calls.CONTENT_URI, true,                        new TheContentObserver(handler));    }}</code></pre><p><strong>And here is the DataHandlerDB Class:</strong></p><pre><code>public class DataHandlerDB {    private static final String DATABASE_NAME = ""mydb.db"";    private static final int DATABASE_VERSION = 1;    protected static final String TABLE_NAME = ""table1"";    protected static final String TABLE_NAME_2 = ""table2"";    protected String TAG = ""DataHandlerDB"";//create the DB         public static SQLiteDatabase createDB(Context ctx) {        OpenHelper helper = new OpenHelper(ctx);        SQLiteDatabase db = helper.getWritableDatabase();        helper.onOpen(db);        db.close();        return db;    }public static class OpenHelper extends SQLiteOpenHelper {        private final Context mContext;        OpenHelper(Context context) {            super(context, DATABASE_NAME, null, DATABASE_VERSION);            this.mContext = context;        }        @Override        public void onCreate(SQLiteDatabase db) {            String[] sql = mContext.getString(R.string.ApplicationDatabase_OnCreate).split(""\n"");            db.beginTransaction();            try{                execMultipleSQL(db, sql);                db.setTransactionSuccessful();            } catch (SQLException e) {                Log.e(""Error creating tables and debug data"", e.toString());                throw e;            } finally {                db.endTransaction();            }        }        private void execMultipleSQL(SQLiteDatabase db, String[] sql) {            for(String s : sql){                if(s.trim().length() &gt; 0){                    db.execSQL(s);                }            }        }        @Override        public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {            /*Log.w(""Application Database"",                    ""Upgrading database, this will drop tables and recreate."");            db.execSQL(""DROP TABLE IF EXISTS "" + TABLE_NAME);            onCreate(db);*/        }        @Override         public void onOpen(SQLiteDatabase db){            super.onOpen(db);        }    }}</code></pre>","399459","","135152","","2011-07-05 17:46:58","2011-07-05 17:46:58","Error database not open","<java><android><sqlite>","1","9","","",""
"5008935","1","","","2011-02-15 20:08:23","0","3582","<p>Without starting from the middle of the stack of images how do I rotate them in the infinite loop left to right and right to left? I tried setSelection(position) but for some reason I get that method called few times and inconsistently. My images increment has to be saved int he app state so it makes it a bit more complicated.</p><pre><code>@Override    public void setSelection(int position){        int sectionPos = getCurrentPositionFromState();        if (sectionPos == (this._images - 1)){              setCurrentPositionFromState(0);            sectionPos = 0;        }        else {            setCurrentPositionInState(sectionPos +1);        }        if (sectionPos &lt;= (this._images - 1) ){            super.setSelection(sectionPos);        }    }gallery.setOnItemSelectedListener(new OnItemSelectedListener() {                 @Override            public void onItemSelected(AdapterView parent, View view, int position, long id) {                gallery.setSelection(position);            @Override            public void onNothingSelected(AdapterView parent) {            }        });</code></pre><p>I should also mention that I have an onFling() overriden like so:</p><pre><code>@Override       public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) {         return super.onFling(e1, e2, 0, velocityY);       }</code></pre>","538428","","","","","2012-07-23 21:24:58","Android Gallery control - need infinite loop of images","<android><image-gallery>","3","0","2","",""
"5008940","1","5009003","","2011-02-15 20:09:11","0","382","<p>I plan to create a representation of a 2D (topographical) map in Android (3.0) in the following way</p><ul><li>a class <code>MapCoordinate</code>, which is just a 'struct' and consist of public attributes x,y of type int and represents a MapCoordinate</li><li>a class <code>MapPoint</code> (not a good name probably), which encapsulates methods to access and alter data of a point in a map (for one map coordinate)</li><li><p>a class <code>Map</code>, which has one instance / Map (there is only one in my app) and encapsulates a Map by having a <code>HashMap</code>:</p><pre><code>public class Map {    HashMap&lt;MapCoordinate, MapPoint&gt; mapPoint = new HashMap&lt;MapCoordinate, MapPoint&gt;();}</code></pre></li></ul><p>So, my question would be: Is it performance-critical to have many (Java) object instances on Android (only tablet PCs are the target of my app). Of course this map is only a tiny fragment of my whole application. The map can get rather large.</p><p>Thanks for your feedback.</p>","616194","","772385","","2014-02-24 05:52:29","2014-02-24 05:52:29","are many object instances an issue in android?","<java><android><android-3.0-honeycomb>","1","0","","",""
"5008959","1","5009647","","2011-02-15 20:12:11","1","4298","<p>I need advice how exactly to achieve the following functionality under Android: I need an image that represents something like a graph (from discrete math), with vertices and edges, where I can click every vertice or edge and fire a different action. Please advise me how can I achieve this (maybe with imagebuttons) or another approach to represent this functionality.</p>","268627","","","","","2012-08-20 20:30:15","Android image with clickable areas","<android>","5","0","3","",""
"5008986","1","5009033","","2011-02-15 20:14:33","2","2876","<p>I'm trying to show a progress message when a preference is selected:</p><pre><code>        Preference prefLocation = (Preference) findPreference(""location"");    prefLocation.setOnPreferenceClickListener(new OnPreferenceClickListener() {        public boolean onPreferenceClick(Preference preference) {            ProgressDialog pDialog = ProgressDialog.show(this, ""Location"" , ""Finding location..."", true);            return true;        }    });</code></pre><p>However I'm getting an error in Eclipse: </p><pre><code>The method show(Context, CharSequence, CharSequence, boolean) in the type ProgressDialog is not applicable for the arguments (new Preference.OnPreferenceClickListener(){}, String, String, boolean)</code></pre><p>However, when I execute the line before the setOnPreferenceClickListener, it compiles fine!</p><p>I'm probably revealing my severe inexperience in Java, but would appreate a clue!</p>","181098","","244296","","2011-02-15 20:28:53","2014-04-15 06:28:59","Not Applicable for the Arguments","<java><android>","4","0","","",""
"5009066","1","5009088","","2011-02-15 20:21:42","0","666","<p>We are developing an Android Application (Java) that reads an image, encode the bytes in base64 to send them over HTTP (via GET) to a WebService written in VB.NET.</p><p>On .NET side, they are using this :</p><pre><code>Dim Pix As ImagePix = Image.FromFile(""C:\Users\Public\Pictures\Sample Pictures\Tree.jpg"")Dim ms As New MemoryStreamPix.Save(ms, ImageFormat.Jpeg)Dim ImByte() As Byte = ms.GetBufferms.Close()</code></pre><p>Sounds great.</p><p>How can I pass the correct string to them to correctly decode the image from Java encoding (unsigned) to .NET decoding (signed)?</p><p>Many thanksNicolas.</p>","390749","","9453","","2011-02-15 20:23:48","2011-02-15 20:23:48","Convert Java Byte[] to VB.NET MemoryStream","<java><android><vb.net><web-services><base64>","1","1","","",""
"5009072","1","5406638","","2011-02-15 20:22:16","3","627","<p>I am writing an android activity that displays information about contacts (contact name, last time contacted, etc.) I am trying to show the number of times a contact is contacted using the ContactsContract.Contacts.TIMES_CONTACTED column but I always get a 0 value for all contacts. I am using a Samsung galaxy S device and I saw somewhere else on the Internet that this is a problem specific to some devices (including Samsung GS). Is there another way to get this information?</p><p>Thanks</p>","501223","","","","","2013-02-17 10:35:01","Problem with TIMES_CONTACTED value in android contacts data","<android><contacts>","2","1","","",""
"5009170","1","5095553","","2011-02-15 20:32:19","0","505","<p>I have a JNI function that returns a UChar array (from the ICU4C library) which I'd like to convert to a Java character array so I can call this from Java. I am not sure where the problem is as whenever I access this JNI function, everything crashes and hangs but I get no error message anywhere, including in the logcat... very difficult to debug!</p><p>Can the UChar array map directly to a jcharArray type? also, can I use it as a return type? or could I pass it in as a parameter that the JNI function then populates?</p><p>Here is a snippet of basically what I am trying to do:</p><pre><code>static jint testFunction(JNIEnv* env, jclass c, jobject obj, jcharArray chsArray,                           int offset, int len, jcharArray dstArray) {jchar* dst = env-&gt;GetCharArrayElements(dstArray, NULL);if (dst != NULL) {    UChar *str = new UChar[len];    //populate str here from an ICU4C function    for (int i=0; i&lt;len; i++)        dst[i] = str[i];      //this might be the problematic piece of code (can I issue an assignment like this?)    }}env-&gt;ReleaseCharArrayElements(dstArray, dst, 0);}</code></pre><p>Any help is appreciated!</p><p>Thanks</p>","618532","","","","","2012-06-20 02:51:05","JNI - mapping UChar type to","<java><android><jni><icu>","4","3","","",""
"5009262","1","","","2011-02-15 20:41:46","3","1341","<p>I have an android photo upload script that uploads fine if I use $_GET to read some data, I want to use all $_POST. The problem is I need to append data do the posted request to include basic name value pairs along with the file upload. I can get this to work if I have the server use $_GET and just add the extra data in the url string, but I want to use post. Is there a way to encode other post data in the file upload that the server can read using $_POST. Heres the function, notice the URL string where, I'm trying to get the variables api_key,session_key, and method to be sent in the POST request.</p><pre><code>public void uploadPhoto(FileInputStream fileInputStream, String sessionKey) throws IOException, ClientProtocolException {    URL connectURL = new URL(API_URL +""?api_key="" +API_KEY+ ""&amp;session_key="" + sessionKey + ""&amp;method="" + ApiMethods.UPLOAD_PHOTO); //server ignores this data    String lineEnd = ""\r\n"";    String twoHyphens = ""--"";    String boundary = ""*****"";    HttpURLConnection conn = (HttpURLConnection) connectURL.openConnection();    // Allow Inputs    conn.setDoInput(true);    // Allow Outputs    conn.setDoOutput(true);    // Don't use a cached copy.    conn.setUseCaches(false);    // Use a post method.    conn.setRequestMethod(""POST"");    conn.setRequestProperty(""Connection"", ""Keep-Alive"");    conn.setRequestProperty(""Content-Type"", ""multipart/form-data;boundary=""+ boundary);    DataOutputStream dos = new DataOutputStream(conn.getOutputStream());    dos.writeBytes(twoHyphens + boundary + lineEnd);    dos.writeBytes(""Content-Disposition: form-data; name=\""uploadedfile\"";filename=\""""+ ""file.png"" + ""\"""" + lineEnd);    dos.writeBytes(lineEnd);    // create a buffer of maximum size    int bytesAvailable = fileInputStream.available();    int maxBufferSize = 1028;    int bufferSize = Math.min(bytesAvailable, maxBufferSize);    byte[] buffer = new byte[bufferSize];    // read file and write it into form...    int bytesRead = fileInputStream.read(buffer, 0, bufferSize);    while (bytesRead &gt; 0) {        dos.write(buffer, 0, bufferSize);        bytesAvailable = fileInputStream.available();        bufferSize = Math.min(bytesAvailable, maxBufferSize);        bytesRead = fileInputStream.read(buffer, 0, bufferSize);        /*         * dos.writeBytes(lineEnd); dos.writeBytes(twoHyphens + boundary +         * twoHyphens + lineEnd);         */    }    // send multipart form data necesssary after file data...    dos.writeBytes(lineEnd);    dos.writeBytes(twoHyphens + boundary + twoHyphens + lineEnd);    dos.flush();    // Log.d(TAG, ""  dos5: "" + dos.toString());    InputStream is = conn.getInputStream();    // retrieve the response from server    int ch;    StringBuffer b = new StringBuffer();    while ((ch = is.read()) != -1) {        b.append((char) ch);    }    String s = b.toString();    dos.close();}</code></pre><p>EDITI'm thinking something like the following is needed for each added param</p><pre><code>    dos.writeBytes(""--"" + boundary + lineEnd);    dos.writeBytes(""Content-Disposition: form-data;name=api_key="" + lineEnd + lineEnd + API_KEY);    dos.writeBytes(lineEnd);    dos.writeBytes(""--"" + boundary + ""--"" + lineEnd);</code></pre>","461631","","461631","","2011-02-15 21:56:08","2011-02-15 21:56:08","How do I add name value data to an android HTTP file upload POST request","<php><android><post><file-upload><httprequest>","1","0","","",""
"5009288","1","5009342","","2011-02-15 20:45:16","2","1091","<p>I set up a progressdialog in an Android AsyncTak and it works. </p><p>My question is it possible to update in the onProgressUpdate method of the AsyncTask the string that the ProgressDialog displays. I would like to update the string with a publishProgress call to show progress of the task.</p><p>I can update the string if instead of the progressDialog I have my own textview. The progressDialog looks better and has the spinning wheel. </p>","327415","","","","","2013-07-31 17:10:47","Can I Update the string message of a ProgressDialog?","<android><android-widget>","2","0","","",""
"5009447","1","5009487","","2011-02-15 21:01:13","1","365","<p>We have a database on our master server (PHP/MySQL) that stores our data thats updated through a website. I'm trying to figure out the best way to copy this data down to a local SQLite database (running on android). Because of the constraints of mobile internet speeds etc i'm going to need to build in checks to see if each row needs updating. Thought a versioning number for each row might be the best solution.</p><p>What are peoples thoughts on this?</p><p>Thanks,Nathan</p>","618579","","","","","2011-02-15 21:22:02","Master MySQL DB feeding down the SQLite DBs (Android)","<android><mysql><sqlite>","2","0","","",""
"5009523","1","","","2011-02-15 21:09:25","4","1497","<p>I intend to start an iphone/android project with the <a href=""http://www.appcelerator.com/products/titanium-mobile-application-development/"" rel=""nofollow"">titanium SDK for mobile</a>. Do you know what are the main feature-wise pitfalls to avoid ? what sort of features will be very hard or impossible to achieve ?</p><p>I understand that there is a plugin system to circumvent these limitations. Do you have information on that ?</p><p>Thank you for your help,</p><p>Jerome Wagner</p>","292712","","","","","2011-03-07 11:23:16","what are the main limitations of titanium as a mobile development platform?","<iphone><android><titanium>","4","1","1","",""
"5009602","1","","","2011-02-15 21:17:23","8","4834","<p>I'm receiving an incoming C2DM notification while the screen is locked.  I'd like to wake up the screen and display the notification message on top of the lock screen using an Activity.  I'm launching the notification Activity from my C2DM BroadcastReceiver as follows:</p><pre><code>Intent new_intent= new Intent().setClass( context, EIAlertDialog.class );           new_intent.addFlags( Intent.FLAG_ACTIVITY_CLEAR_TOP );      new_intent.addFlags( Intent.FLAG_ACTIVITY_NEW_TASK );      context.startActivity( new_intent );</code></pre><p>and within the notification Activity's onCreate method, I wake up the screen as follows:</p><pre><code>PowerManager powerManager= (PowerManager)getSystemService( Context.POWER_SERVICE );if (!powerManager.isScreenOn()) {    mWakeLock= powerManager.newWakeLock(                   PowerManager.FULL_WAKE_LOCK |                   PowerManager.ACQUIRE_CAUSES_WAKEUP,                    ""My Tag"" )    mWakeLock.acquire();}</code></pre><p>The screen is woken up, but the notification Activity is not visible until I unlock the screen.</p><p>I realize that I can avoid the lock screen with the code below, but that is not desired.  I want the user to unlock the phone, only if he/she is interested in reading/responding to the notification.</p><pre><code>getWindow().addFlags(    WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD |    WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED |    WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON );</code></pre>","464024","","464024","","2011-02-15 23:51:43","2012-12-03 13:11:30","How do I create an Activity that is visible on top of the lock screen","<android><locking><wakeup>","3","3","2","",""
"5009653","1","5009847","","2011-02-15 21:22:46","0","222","<p>Is there a way to get all let say pictures (*.jpg) and list them in a listview /adapter?And find all pictures within subfolders too.</p><p>Thank you!Regards user564612</p>","564612","","","","","2011-02-15 21:39:23","Android Development: Find every picture on SD?","<android>","1","0","","",""
"5009694","1","5009779","","2011-02-15 21:26:05","1","690","<p>i'm new to android and i'm having some trouble accessing variables within an application. ive tried accessing it in the onClick method but its giving me erros. how do i read it?here is the simplyfied code:</p><pre><code>public class DBDetails extends Activity {    protected void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.dbdetails);        new fetchDBDetails(this).execute();        Button ButtonCall = (Button) findViewById(R.id.ButtonCall);        ButtonCall.setOnClickListener(new OnClickListener() {        public void onClick(View v) {            //READING VALUE BELOW        startActivityForResult(new Intent(Intent.ACTION_DIAL, Uri.parse(""tel:"" + phone)), 1);           }        });      }}    class fetchDBDetails extends AsyncTask&lt;String, Void, String&gt; {        private DBDetails fetchDBDetailsContext = null;        String phone;        public fetchDBDetails(DBDetails context) {            fetchDBContext = context;        }        @Override        protected String doInBackground(String... params) {                    phone = ""12345678""; //ASSIGNING VALUE HERE        }    }</code></pre><p>thanks in advance</p>","563020","","","","","2011-02-15 21:54:56","Variable scope in Android","<android><variables><scope>","1","0","","",""
"5009751","1","5009828","","2011-02-15 21:30:55","5","9827","<p>I want the class below to display some textviews/buttons/spinners, and also a ListView containing parsed data. However the listview/adapter/addview are causing some trouble.Heres the error I'm getting:</p><blockquote>  <p>java.lang.UnsupportedOperationException: addView(View, LayoutParams) is not supported in AdapterView</p></blockquote><p>I've a feeling its to do with my xml files, but Im not too sure.Here's my code:</p><pre><code>public class StatisticsScreen extends ListActivity{private List&lt;Message&gt; messages; @Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.statisticsscreen);    loadFeed();    //other textviews and listeners added}private void loadFeed() {    try{        BaseFeedParser parser = new BaseFeedParser();        messages = parser.parse();        List&lt;String&gt; titles = new ArrayList&lt;String&gt;(messages.size());        for (Message msg : messages){            titles.add(msg.getTitle());        }        ArrayAdapter&lt;String&gt; adapter =         new ArrayAdapter&lt;String&gt;(this, R.layout.xmldatarow,titles);        this.setListAdapter(adapter);               } catch (Throwable t){        Log.e(""AndroidNews"",t.getMessage(),t);    }       }</code></pre><p>My statisticsscreen xml:    </p><pre><code>&lt;ListView xmlns:android=""http://schemas.android.com/apk/res/android""android:layout_width=""fill_parent"" android:layout_height=""fill_parent""&gt;&lt;LinearLayout android:id=""@+id/statsviewlayout""    android:orientation=""vertical"" android:layout_width=""fill_parent""    android:layout_height=""fill_parent"" android:background=""@color/black""&gt;    //other layouts/textviews/buttons added    &lt;include  layout=""@layout/xmllayout"" android:id=""@+id/xmllist"" /&gt;&lt;/LinearLayout&gt;&lt;/ListView&gt;</code></pre><p>xmllayout 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=""wrap_content""    android:layout_height=""wrap_content""&gt;    &lt;ListView android:id=""@+id/xmllist""     android:layout_width=""wrap_content""     android:layout_height=""wrap_content""/&gt;    &lt;/LinearLayout&gt;</code></pre><p>xmldatarow is a simple textView.</p><p>EDIT:</p><p>Ok so ive updated some of the files and I'm getting a runtime exception error:</p><blockquote>  <p>Your content must have a ListView whose attribute is 'android.R.id.list'</p></blockquote><p>here are the updated files:</p><p><strong>class:</strong></p><pre><code>setContentView(R.layout.statisticsscreen);    loadFeed();        getListView().addHeaderView(View.inflate(this, R.layout.xmllayout, null));private void loadFeed() {    try{        BaseFeedParser parser = new BaseFeedParser();        messages = parser.parse();        List&lt;String&gt; titles = new ArrayList&lt;String&gt;(messages.size());        for (Message msg : messages){            titles.add(msg.getDate());        }        ArrayAdapter&lt;String&gt; adapter =             new ArrayAdapter&lt;String&gt;(this, R.layout.xmldatarow,titles);        this.setListAdapter(adapter);    } catch (Throwable t){        Log.e(""AndroidNews"",t.getMessage(),t);    }       }</code></pre><p>My statsscreenlayout stil has all of the linearlayouts with textviews etc. and I deleted this from it:</p><pre><code>&lt;include  layout=""@layout/xmllayout"" android:id=""@+id/xmllist"" /&gt;</code></pre><p>Then my other two layouts are a simple textview(xmldatarow), and a listview(xmllayout).So just to clarify, there isnt any listview or any 'include' in my statsscreenlayout.</p><p>Any advice? Thanks</p>","604469","","932225","","2012-07-13 09:29:13","2012-07-13 09:29:13","Trouble with AdapterView and addView","<android><parsing><listview><adapter><android-adapterview>","1","0","2","",""
"5009810","1","5011643","","2011-02-15 21:36:04","-1","1562","<p>Is it possible to use Android OS for creating apps for Blackberry phone?</p>","270531","","","","","2013-07-05 07:59:15","Does Blackberry support Android OS","<android><blackberry>","3","0","0","",""
"5009816","1","5009894","","2011-02-15 21:36:21","33","81764","<p>I have an activity, and in that I have a class.</p><pre><code>text=new Dynamictext(...);text.setText(""txt"");</code></pre><p>in my DynamicText java i have this code:</p><pre><code>    public void setText(String text) {        this.text=text;        new asyncCreateText().execute();        //this.createText(text);    }    //private Handler handler = new Handler();    private class asyncCreateText extends AsyncTask&lt;Void, Void, Void&gt;     {        @Override        protected Void doInBackground(Void... unused) {            return null;        }        @Override        protected void onPostExecute(Void unused) {        }    }</code></pre><p>I get : 02-15 22:32:37.328: ERROR/AndroidRuntime(5176): Caused by: java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare()</p><p>How can i handle this error?</p><p>edited:</p><p>error:</p><pre><code>02-15 22:52:43.483: ERROR/AndroidRuntime(5370): java.lang.ExceptionInInitializerError02-15 22:52:43.483: ERROR/AndroidRuntime(5370):     at com.l.start.DynamicText.setText(DynamicText.java:125)02-15 22:52:43.483: ERROR/AndroidRuntime(5370):     at com.l.start.OpenGLRenderer.initfonts(OpenGLRenderer.java:168)02-15 22:52:43.483: ERROR/AndroidRuntime(5370):     at com.l.start.OpenGLRenderer.init(OpenGLRenderer.java:119)02-15 22:52:43.483: ERROR/AndroidRuntime(5370):     at com.l.start.OpenGLRenderer.onSurfaceChanged(OpenGLRenderer.java:90)02-15 22:52:43.483: ERROR/AndroidRuntime(5370):     at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1120)02-15 22:52:43.483: ERROR/AndroidRuntime(5370):     at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:975)02-15 22:52:43.483: ERROR/AndroidRuntime(5370): Caused by: java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare()02-15 22:52:43.483: ERROR/AndroidRuntime(5370):     at android.os.Handler.&lt;init&gt;(Handler.java:121)02-15 22:52:43.483: ERROR/AndroidRuntime(5370):     at android.os.AsyncTask$InternalHandler.&lt;init&gt;(AsyncTask.java:421)02-15 22:52:43.483: ERROR/AndroidRuntime(5370):     at android.os.AsyncTask$InternalHandler.&lt;init&gt;(AsyncTask.java:421)02-15 22:52:43.483: ERROR/AndroidRuntime(5370):     at android.os.AsyncTask.&lt;clinit&gt;(AsyncTask.java:152)02-15 22:52:43.483: ERROR/AndroidRuntime(5370):     ... 6 more</code></pre>","472537","","472537","","2011-02-15 21:54:34","2013-07-08 09:39:35","Android Can't create handler inside thread that has not called Looper.prepare()","<android>","4","3","18","",""
"5009898","1","5010166","","2011-02-15 21:43:37","0","163","<p>I wrote simple aplication for android. It works great in emulator. But when I installed it on real device (htc wildfire) then the interface became ugly. Except that it works good. TextViews look fine but the buttons, sprinners and list items look bad. Button corners seem wretched. All the lists (list view and list preference have no delimeter(line) between rows! When I scroll a bit the delimeter appears). Why?</p>","577841","","","","","2011-02-16 00:37:10","android: UI on real device problem","<android><user-interface>","3","2","","",""
"5009918","1","5113288","","2011-02-15 21:46:35","0","685","<p>I have a bitmap created from java code and updating the pixels from native code. I was just wondering if we can call invalidate from the native code.</p><p>My code is as follows. </p><p>C Code : </p><pre><code>AndroidBitmapInfo  info;void*              pixels;int                ret;if ((ret = AndroidBitmap_getInfo(env, bitmap, &amp;info)) &lt; 0) {return;}if (info.format != ANDROID_BITMAP_FORMAT_RGB_565) {return;}if ((ret =AndroidBitmap_lockPixels(env, bitmap, &amp;pixels)) &lt; 0) {}memcpy(pixels, pictureRGB, 480*320);AndroidBitmap_unlockPixels(env, bitmap);</code></pre><p>Java Code</p><pre><code>     Bitmap mBitmap = Bitmap.createBitmap(480, 320, Bitmap.Config.RGB_565);     renderbitmap(mBitmap, 0);     canvas.drawBitmap(mBitmap, 0, 0, null);</code></pre>","574911","","574911","","2011-02-22 15:21:49","2012-02-23 19:52:35","How to call postinvalidate from android native code on bitmap","<android><bitmap><jni><android-ndk>","3","1","","",""
"5009960","1","","","2011-02-15 21:51:54","1","1678","<p>In my class, Main extends Activity, I've this:</p><pre><code>@Overrideprotected void onActivityResult(int requestCode, int resultCode, Intent data) {    super.onActivityResult(requestCode, resultCode, data);    switch (requestCode) {    case ...    case CREDENTIAL_VIEW:        new SetStatusProgressBar(this).execute();</code></pre><p>And there is this nested class:</p><pre><code>private class SetStatusProgressBar extends AsyncTask&lt;String, Void, Boolean&gt; {    private ProgressDialog dialog;    private Main ctx;    public SetStatusProgressBar(Main ctx) {        this.ctx = ctx;        dialog = new ProgressDialog(ctx);    }    // progress dialog to show user that contacting server.    protected void onPreExecute() {        this.dialog = ProgressDialog.show(ctx, null,                ""Refreshing data from server..."", true, false);    }    @Override    protected void onPostExecute(final Boolean success) {        //...        //statements that refresh UI        //...        if (dialog.isShowing()) {            dialog.dismiss();            timerProgressBarStop();        }    }    protected Boolean doInBackground(final String... args) {        //...        //statements to download data from server        //...        return true;    }}</code></pre><p>In the Main class I open a second Activity, in this way:</p><pre><code>Intent myIntent = new Intent(Main.this, Credentials.class);startActivityForResult(myIntent, CREDENTIAL_VIEW);</code></pre><p>That second Activity returns to the Main activity in this way:</p><pre><code>Intent intent = new Intent();setResult(RESULT_OK, intent);finish();</code></pre><p>I don't understand why when I navigate from the second Activity to the Main, the ProgressDialog will show ONLY AFTER that the UI refreshes... In this way the Progress Dialog stays on the screen only for half second... and then hides! :( I'd like to see the ProgressDialog on top during all the download time!</p><p>Help, please.Thank you all</p>","489146","","","","","2011-02-15 23:23:45","ProgressDialog won't show, even in onPreExecute of AsyncTask","<android><android-intent><show><android-asynctask><progressdialog>","1","4","0","",""
"5010034","1","5010148","","2011-02-15 22:00:03","9","8195","<p>I've been through <a href=""http://stackoverflow.com/questions/1660650/different-drawable-resolutions"">this post</a> (and others) as well as through the <a href=""http://developer.android.com/guide/practices/screens_support.html"">documentation</a> about supporting different screen resolutions in Android, but I couldn't find a clear answer to a (simple) question:</p><p>Is it ok to just use ""res/drawable"" for images in an android app?</p><p>Background: The only images that are needed in this specific app are the app icon itself and an icon for a notification, there won't be any images in any layout.<br />So in my understanding, if no ""hdpi""-, ""mdpi""- and ""ldpi""-folders are found, Android will use ""res/drawable"" as the fallback.<br />As the only pitfall with different screen-resolution seems to be that Android will scale images for a specific resolution if no special one is found, this should only be a problem when UPscaling, because the image will get blurry. But if I provide all ""hdpi""-images in ""res/drawable"" (instead of 3 different ones), won't Android just DOWNscale those images if the size is too big?<br />If that's true, I could save some APK-space by just a third of the images.</p><p>Follow-Up question: I read that for API-level 3 a dir by the name ""drawable-v3"" is required. Is that true or is ""drawable"" the fallback for this API-level also?</p><p>Any hint is appreciated.</p>","255905","","255905","","2011-02-15 22:16:30","2013-01-13 00:01:42","Android: drawable resolutions","<android><drawable><screen-resolution>","6","0","3","",""
"5010145","1","5010892","","2011-02-15 22:15:00","3","3531","<p>my project requires me to be able to record audio on an android device. i implemented solution using the MediaRecorder() but the recorded audio is in a terrible quality. what am i doing wrong? i must think that this cant be the only way to record audio :) perhaps i am doing something wrong, i am including my code below. please point me to the right direction.</p><p>thanks!</p><pre><code>MediaRecorder recorder = new MediaRecorder();File outputFile = new File(Environment.getExternalStorageDirectory(), ""audio.3gp"");recorder.setAudioSource(MediaRecorder.AudioSource.MIC);recorder.setOutputFormat(MediaRecorder.OutputFormat.RAW_AMR);recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);recorder.setOutputFile(outputFile.getAbsolutePath());recorder.prepare();recorder.start();// stoprecorder.stop();recorder.reset(); recorder.release();</code></pre>","612286","","1228","","2013-11-14 21:25:31","2013-11-14 21:25:31","very poor quality of audio recorded on my droidx using MediaRecorder, why?","<android><audio><recording>","3","0","2","",""
"5010203","1","5110521","","2011-02-15 22:21:38","1","899","<p>I am trying to play video, where I get frames as bitmaps from the native code and I want to display the video on the screen. I do not understand how to display them, as there are view, surface, animation and graphics and I have no idea, which one to use from these. I am very beginner to android. Please help me choosing and let me know if there are any samples.</p><p>Thanks for any help</p>","574911","","","","","2011-02-24 21:11:21","need help to draw bitmaps for video streaming","<android><bitmap>","2","0","1","",""
"5010310","1","5010366","","2011-02-15 22:32:48","0","611","<p>I have a Service that is supposed to maintain a constant connection with a home automation controller (HAC). In the preferences of the App, I will give the User a choice to stay** connected to the HAC or to drop the connection to the HAC when the App is not in use. I intend to use startService(), with a look at the preferences to see if it's necessary to call stopSelf() from within the Service.</p><p>I basically have two questions:</p><ol><li><p>Is it necessary to Bind to the service from every Activity in the App? (I'm finding that the onBind() doesn't seem to execute after my SplashScreen Activity has started and binded to the Service). I even commented out the call to bindService() from an Activity and I'm still able to use the calls the Service. I was hoping to use the onBind() callback to verify if the Service still has a valid connection to the HAC.</p></li><li><p>If I use startService(), and then bindService(); will unBindService() then allow the service to stop if there are no other objects bound? Also, if I start the service with bindService() and then subsequently call startService(); what happens? I'm trying to understand how these two approaches to interacting with the Service affect the lifecycle.</p></li></ol><p>Thanks,J</p><p>** I realize this can be detrimental to battery life, but sometimes it's nice when the NotificationManager tells you that the Motion Detector on your front porch has just been tripped.</p>","312176","","312176","","2011-02-15 22:39:07","2011-02-15 22:40:02","Does each Activity need to Bind to a Service & What happens when it was created with startService()","<android><binding><service><activity>","1","0","","",""
"5010456","1","5905091","","2011-02-15 22:48:55","0","841","<p>I use this code to do a HttpGet request to my web server. It works fine on emulator but not in my HTC Sense. The excecution just end without doing any http request. Any idea ?</p><pre><code>File f = new File(user.getPhotopath());List&lt;NameValuePair&gt; reqparams = new LinkedList&lt;NameValuePair&gt;();reqparams.add(new BasicNameValuePair(""email"", user.getEmail()));reqparams.add(new BasicNameValuePair(""pwd"", user.getPassword()));reqparams.add(new BasicNameValuePair(""name"", user.getScreenName()));reqparams.add(new BasicNameValuePair(""photo"", f.getName()));reqparams.add(new BasicNameValuePair(""preference"", user.getPrefs()));reqparams.add(new BasicNameValuePair(""bluetoothid"", bid));String urlstring = ""http://www.mysite.com/me?""+ URLEncodedUtils.format(reqparams, ""utf-8"");try {    URL url = new URL(urlstring);URI myURI = null;try {    myURI = url.toURI();} catch (URISyntaxException e) {                e.printStackTrace();}HttpClient httpClient = new DefaultHttpClient();HttpGet getMethod = new HttpGet(myURI);HttpResponse webServerResponse = null;HttpEntity httpEntity = null;try {    webServerResponse = httpClient.execute(getMethod);    httpEntity = webServerResponse.getEntity();} catch (ClientProtocolException e) {    e.printStackTrace();} catch (IOException e) {    e.printStackTrace();}if (httpEntity != null) {    InputStream instream = httpEntity.getContent();    BufferedReader reader = new BufferedReader( new InputStreamReader(instream));    StringBuilder sb = new StringBuilder();    String line = null;    try {        while ((line = reader.readLine()) != null) {            sb.append(line + ""\n"");        }    } catch (IOException e) {            e.printStackTrace();    } finally {        try {            resultStr = sb.toString();            instream.close();        } catch (IOException e) {                e.printStackTrace();        }    }</code></pre>","599826","","","","","2011-05-05 23:07:33","HttpClient not working on real device","<android><android-emulator><http-get><htcsense>","2","2","","",""
"5010545","1","22429264","","2011-02-15 22:59:41","6","8293","<p>I am trying to access the raw data of a Bitmap in ARGB_8888 format on Android, using the <code>copyPixelsToBuffer</code> and <code>copyPixelsFromBuffer</code> methods. However, invocation of those calls seems to always apply the alpha channel to the rgb channels. I need the raw data in a byte[] or similar (to pass through JNI; yes, I know about bitmap.h in Android 2.2, cannot use that).</p><p>Here is a sample:</p><pre><code>    // Create 1x1 Bitmap with alpha channel, 8 bits per channel    Bitmap one = Bitmap.createBitmap(1,1,Bitmap.Config.ARGB_8888);    one.setPixel(0,0,0xef234567);    Log.v(""?"",""hasAlpha() = ""+Boolean.toString(one.hasAlpha()));    Log.v(""?"",""pixel before = ""+Integer.toHexString(one.getPixel(0,0)));    // Copy Bitmap to buffer    byte[] store = new byte[4];    ByteBuffer buffer  = ByteBuffer.wrap(store);    one.copyPixelsToBuffer(buffer);    // Change value of the pixel    int value=buffer.getInt(0);    Log.v(""?"", ""value before = ""+Integer.toHexString(value));    value = (value &gt;&gt; 8) | 0xffffff00;    buffer.putInt(0, value);    value=buffer.getInt(0);    Log.v(""?"", ""value after = ""+Integer.toHexString(value));    // Copy buffer back to Bitmap    buffer.position(0);    one.copyPixelsFromBuffer(buffer);    Log.v(""?"",""pixel after = ""+Integer.toHexString(one.getPixel(0,0)));</code></pre><p>The log then shows</p><pre><code>hasAlpha() = truepixel before = ef234567value before = 214161efvalue after = ffffff61pixel after = 619e9e9e</code></pre><p>I understand that the order of the argb channels is different; that's fine. But I don't want the alpha channel to be applied upon every copy (which is what it seems to be doing).</p><p>Is this how <code>copyPixelsToBuffer</code> and <code>copyPixelsFromBuffer</code> are supposed to work? Is there <em>any</em> way to get the raw data in a byte[]?</p><p><strong>Added in response to answer below:</strong></p><p>Putting in <code>buffer.order(ByteOrder.nativeOrder());</code> before the <code>copyPixelsToBuffer</code> does change the result, but still not in the way I want it:</p><pre><code>pixel before = ef234567value before = ef614121value after = ffffff41pixel after = ff41ffff</code></pre><p>Seems to suffer from essentially the same problem (alpha being applied upon each <code>copyPixelsFrom/ToBuffer</code>).</p>","120751","","120751","","2011-02-15 23:42:07","2014-03-15 20:21:26","Access to raw data in ARGB_8888 Android Bitmap","<android><bitmap><jni><alpha-transparency><argb>","2","2","5","",""
"5010588","1","","","2011-02-15 23:03:41","0","1006","<p>Apologies if this is a very mundane or simple issue. </p><p>I wrote a location listener class for my android device and set the requestupdate as follows:</p><p><code>locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, this);</code></p><p>I see the GPS icon come up, blink and then hold steady. In my log, I see location updates, but the problem is  there are very few updates, maybe once in 30 seconds or once a minute sometimes (whild driving in my car, well i am not driving :D).</p><p>Is this normal? Is there any way to get a higher frequency? </p><p>thanks,Luke</p>","618727","","","","","2011-02-15 23:36:05","Android: Frequency of location updates from location manager","<android><gps><location><manager><frequency>","1","0","0","",""
"5010708","1","","","2011-02-15 23:21:57","0","105","<p>i've a strange problem with maven and android</p><p>I've <strong>3</strong> maven project and <strong>2</strong> normal java maven project divided in this manner : </p><p><em>normal project :</em> </p><p><strong>model project</strong> ... packaged as jar ... contains java Pojo Bean and Interface.</p><p><strong>Dao Project</strong> ... packaged as jar ... contains Db Logic - Depend on model Project</p><p><em>Android Application Maven project</em> </p><p><strong>ContentProvider</strong> ... packaged as apk ... contains ContentProviders only. Depends on Dao Project </p><p><strong>Editors</strong> ... packaged as apk ... contains only Editor, Depends on Dao project </p><p><strong>MainApp</strong> ... packaged as apk ... contains MyApp, Depends on DAO ... </p><p>The Problem is that if i modify DAO Project , Then do a maven clean and maven install of all apk project, then run as Android Application within Eclipse, i don't see updated app on my Emulator.</p><p>Nicely if i shut down my ubuntu workstation and restart it i can see The updated app on my Emulator. </p><p>Do you know a solution for this issue ? </p><p>thanks and regards  </p>","618195","","","","","2011-11-11 18:37:34","Android Maven and Refresh Problem","<android><maven>","1","0","","",""
"5010714","1","","","2011-02-15 23:22:25","1","3426","<p>I am currently working on an app that requires a keyboard in a different language (Specifically Hebrew).</p><p>The problem is that I don't know where to begin. I don't want the user to have to go onto an app store, and install a separate app that has more languages in it just to use my app.</p><p>I only want the keyboard to be available in my app (i.e. it shouldn't effect anything outside my specific app). The way I am doing it right now is to create it as part of the main layout, and just make it visible whenever the user clicks on the Edit Text. </p><p>The problem with this approach is I can't get the size of it to readjust. I had originally tried using 2 different layouts (one in the res/layout folder, and one in the res/layout-lnd folder), but this caused different problems in my app, making it slower. </p><p>I am wondering 2 things, either of which should work. </p><ol><li>How would I create the layout for the keyboard to readjust.</li><li>How would I make a keyboard correctly. </li></ol><p>Here is the XML code that I am using specifically pertaining to the keyboard:  </p><pre><code>&lt;FrameLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:visibility=""gone""  android:background=""@color/puzzle_dark""    android:id=""@+id/hebrwKeyboardView""    android:layout_width=""fill_parent""    android:layout_height=""146dip""    android:layout_gravity=""right|center_vertical|center_horizontal|bottom""    android:fitsSystemWindows=""true""    android:clipChildren=""false""    android:orientation=""vertical"" &gt;  &lt;TableLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""wrap_content""    android:layout_height=""145dip""    android:clipChildren=""false""    android:layout_gravity=""center_vertical|center_horizontal|bottom""    android:fitsSystemWindows=""true""    android:orientation=""horizontal"" &gt;  &lt;TableLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:layout_width=""fill_parent""    android:layout_height=""145dip""    android:clipChildren=""false""    android:layout_gravity=""center_vertical|center_horizontal|bottom""    android:fitsSystemWindows=""true""    android:orientation=""vertical"" &gt;    &lt;TableRow android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:layout_gravity=""center_horizontal|center_vertical|center""    android:fitsSystemWindows=""true""    android:clipChildren=""false""    android:orientation=""horizontal""    android:stretchColumns=""true""&gt;    &lt;LinearLayout     android:baselineAligned=""true""    android:layout_width=""fill_parent""    android:layout_gravity=""center""    android:layout_height=""fill_parent""    android:fitsSystemWindows=""true""    android:clipChildren=""false""    android:orientation=""horizontal""&gt;    &lt;Button    android:id=""@+id/KoofButton""    android:layout_width=""wrap_content""    android:layout_height=""35dip""    android:text=""@string/Koof""    android:layout_gravity=""center""    android:fitsSystemWindows=""true""    android:ellipsize=""marquee""/&gt;    &lt;Button    android:soundEffectsEnabled=""true""    android:id=""@+id/raishButton""    android:layout_width=""wrap_content""    android:layout_height=""35dip""    android:text=""@string/Raish""    android:layout_gravity=""center_horizontal""    android:fitsSystemWindows=""true""    android:ellipsize=""marquee""/&gt;    &lt;Button   android:soundEffectsEnabled=""true""    android:id=""@+id/alephButton""    android:layout_gravity=""center_horizontal""    android:layout_width=""wrap_content""    android:layout_height=""35dip""    android:text=""@string/Alef""    android:fitsSystemWindows=""true""    android:ellipsize=""marquee""/&gt;    &lt;Button  android:soundEffectsEnabled=""true""    android:id=""@+id/tetButton""    android:layout_width=""wrap_content""    android:layout_gravity=""center_horizontal""    android:layout_height=""35dip""    android:text=""@string/Tet""    android:fitsSystemWindows=""true""    android:ellipsize=""marquee""/&gt;    &lt;Button  android:soundEffectsEnabled=""true""    android:id=""@+id/vuvButton""    android:layout_width=""wrap_content""    android:layout_height=""35dip""    android:layout_gravity=""center_horizontal""    android:text=""@string/Vuv""    android:fitsSystemWindows=""true""    android:ellipsize=""marquee""/&gt;    &lt;Button  android:soundEffectsEnabled=""true""    android:id=""@+id/nunSophitButton""    android:layout_width=""wrap_content""    android:layout_height=""35dip""    android:layout_gravity=""center_horizontal""    android:text=""@string/NunSofit""   android:fitsSystemWindows=""true""   android:gravity=""fill""   android:ellipsize=""marquee""/&gt;    &lt;Button   android:soundEffectsEnabled=""true""    android:id=""@+id/memSofitButton""    android:layout_width=""wrap_content""    android:layout_gravity=""center_horizontal""    android:layout_height=""35dip""    android:text=""@string/MemSofit""    android:fitsSystemWindows=""true""    android:ellipsize=""marquee""/&gt;    &lt;Button  android:soundEffectsEnabled=""true""    android:id=""@+id/payButton""    android:layout_width=""wrap_content""    android:layout_height=""35dip""  android:text=""@string/Pay""    android:fitsSystemWindows=""true""    android:layout_gravity=""center_horizontal""    android:ellipsize=""marquee""/&gt;    &lt;/LinearLayout&gt;    &lt;/TableRow&gt;    &lt;TableRow android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:clipChildren=""true""    android:layout_gravity=""center_horizontal|center_vertical|center""    android:fitsSystemWindows=""true""    android:orientation=""horizontal""&gt;    &lt;RelativeLayout android:layout_width=""fill_parent""    android:clipChildren=""true""    android:layout_height=""fill_parent""    android:layout_gravity=""center_horizontal|center""    android:gravity=""bottom""    android:orientation=""horizontal""&gt;    &lt;Button    android:layout_alignWithParentIfMissing=""true""   android:soundEffectsEnabled=""true""    android:id=""@+id/shinButton""    android:layout_width=""wrap_content""    android:layout_centerHorizontal=""true""    android:layout_gravity=""center_horizontal|center_vertical|center""    android:layout_height=""35dip""    android:text=""@string/Shin""    android:layout_alignParentLeft=""true""    android:fitsSystemWindows=""true""  /&gt;    &lt;Button    android:layout_centerHorizontal=""true""   android:soundEffectsEnabled=""true""   android:layout_toRightOf=""@id/shinButton""    android:id=""@+id/dalidButton""    android:layout_width=""wrap_content""    android:layout_gravity=""center_horizontal|center_vertical|center""    android:layout_height=""35dip""    android:text=""@string/Dalid""    android:layout_alignWithParentIfMissing=""true""    android:fitsSystemWindows=""true""  /&gt;    &lt;Button    android:layout_alignWithParentIfMissing=""true""    android:layout_centerHorizontal=""true""  android:soundEffectsEnabled=""true""    android:id=""@+id/gimleButton""    android:layout_toRightOf=""@id/dalidButton""    android:layout_width=""wrap_content""    android:layout_gravity=""center_horizontal|center_vertical|center""    android:layout_height=""35dip""    android:text=""@string/Gimle""    android:fitsSystemWindows=""true""  /&gt;    &lt;Button    android:layout_alignWithParentIfMissing=""true""    android:layout_centerHorizontal=""true""  android:soundEffectsEnabled=""true""    android:id=""@+id/chufButton""    android:layout_toRightOf=""@id/gimleButton""    android:layout_width=""wrap_content""    android:layout_gravity=""center_horizontal|center_vertical|center""    android:layout_height=""35dip""    android:text=""@string/Chuf""    android:fitsSystemWindows=""true""  /&gt;    &lt;Button    android:layout_alignWithParentIfMissing=""true""    android:layout_centerHorizontal=""true""  android:soundEffectsEnabled=""true""    android:id=""@+id/ieyinButton""    android:layout_toRightOf=""@id/chufButton""    android:layout_width=""wrap_content""    android:layout_height=""35dip""    android:layout_gravity=""center_horizontal|center_vertical|center""    android:text=""@string/Ieyin""    android:fitsSystemWindows=""true""  /&gt;    &lt;Button    android:layout_alignWithParentIfMissing=""true""    android:layout_centerHorizontal=""true""  android:soundEffectsEnabled=""true""    android:id=""@+id/yudButton""    android:layout_toRightOf=""@id/ieyinButton""    android:layout_width=""wrap_content""    android:layout_height=""35dip""    android:layout_gravity=""center_horizontal|center_vertical|center""    android:text=""@string/Yud""    android:fitsSystemWindows=""true""  /&gt;    &lt;Button    android:layout_alignWithParentIfMissing=""true""    android:layout_centerHorizontal=""true""    android:soundEffectsEnabled=""true""    android:id=""@+id/chetButton""    android:layout_toRightOf=""@id/yudButton""    android:layout_width=""wrap_content""    android:layout_height=""35dip""    android:layout_gravity=""center_horizontal|center_vertical|center""    android:text=""@string/Chet""    android:fitsSystemWindows=""true""  /&gt;    &lt;Button    android:layout_alignWithParentIfMissing=""true""    android:layout_centerHorizontal=""true""  android:soundEffectsEnabled=""true""    android:id=""@+id/lamidButton""    android:layout_toRightOf=""@id/chetButton""    android:layout_width=""wrap_content""    android:layout_height=""35dip""    android:layout_gravity=""center_horizontal|center_vertical|center""    android:text=""@string/Lamid""    android:fitsSystemWindows=""true""  /&gt;    &lt;Button    android:layout_alignWithParentIfMissing=""true""    android:layout_centerHorizontal=""true""    android:soundEffectsEnabled=""true""    android:id=""@+id/chufSofitButton""    android:layout_toRightOf=""@id/lamidButton""    android:layout_width=""wrap_content""    android:layout_height=""35dip""    android:layout_gravity=""center_horizontal|center_vertical|center""    android:text=""@string/ChufSofit""    android:fitsSystemWindows=""true""  /&gt;    &lt;Button    android:layout_alignWithParentIfMissing=""true""    android:layout_centerHorizontal=""true""    android:soundEffectsEnabled=""true""    android:id=""@+id/paySofitButton""    android:layout_toRightOf=""@id/chufSofitButton""    android:layout_width=""wrap_content""    android:layout_height=""35dip""    android:layout_gravity=""center_horizontal|center_vertical|center""    android:text=""@string/PaySofit""    android:fitsSystemWindows=""true""  /&gt;    &lt;/RelativeLayout&gt;    &lt;/TableRow&gt;    &lt;TableRow android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:layout_gravity=""center_horizontal|center_vertical|center""    android:fitsSystemWindows=""true""    android:orientation=""horizontal""&gt;    &lt;LinearLayout android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:layout_gravity=""center_horizontal|center""    android:gravity=""bottom""    android:orientation=""horizontal""&gt;    &lt;Button   android:soundEffectsEnabled=""true""    android:id=""@+id/zionButton""    android:layout_width=""wrap_content""    android:layout_gravity=""center_horizontal|center_vertical|center""    android:layout_height=""35dip""    android:text=""@string/Zion""    android:fitsSystemWindows=""true""  /&gt;    &lt;Button  android:soundEffectsEnabled=""true""    android:id=""@+id/samichButton""    android:layout_width=""wrap_content""    android:layout_gravity=""center_horizontal|center_vertical|center""    android:layout_height=""35dip""    android:text=""@string/Samich""    android:fitsSystemWindows=""true""  /&gt;    &lt;Button  android:soundEffectsEnabled=""true""    android:id=""@+id/betButton""    android:layout_width=""wrap_content""    android:layout_gravity=""center_horizontal|center_vertical|center""    android:layout_height=""35dip""    android:text=""@string/Bet""    android:fitsSystemWindows=""true""  /&gt;    &lt;Button  android:soundEffectsEnabled=""true""    android:id=""@+id/heyButton""    android:layout_width=""wrap_content""    android:layout_gravity=""center_horizontal|center_vertical|center""    android:layout_height=""35dip""    android:text=""@string/Hey""    android:fitsSystemWindows=""true""  /&gt;    &lt;Button  android:soundEffectsEnabled=""true""    android:id=""@+id/nunButton""    android:layout_width=""wrap_content""    android:layout_height=""35dip""    android:layout_gravity=""center_horizontal|center_vertical|center""    android:text=""@string/Nun""    android:fitsSystemWindows=""true""  /&gt;    &lt;Button  android:soundEffectsEnabled=""true""    android:id=""@+id/memButton""    android:layout_width=""wrap_content""    android:layout_height=""35dip""    android:layout_gravity=""center_horizontal|center_vertical|center""    android:text=""@string/Mem""    android:fitsSystemWindows=""true""  /&gt;    &lt;Button  android:soundEffectsEnabled=""true""    android:id=""@+id/tzadiButton""    android:layout_width=""wrap_content""    android:layout_height=""35dip""    android:layout_gravity=""center_horizontal|center_vertical|center""    android:text=""@string/Tzadi""    android:fitsSystemWindows=""true""  /&gt;    &lt;Button  android:soundEffectsEnabled=""true""    android:id=""@+id/tuffButton""    android:layout_width=""wrap_content""    android:layout_height=""35dip""    android:layout_gravity=""center_horizontal|center_vertical|center""    android:text=""@string/Tuff""    android:fitsSystemWindows=""true""  /&gt;    &lt;Button    android:soundEffectsEnabled=""true""    android:id=""@+id/tzadiSofitButton""    android:layout_width=""wrap_content""    android:layout_height=""35dip""    android:layout_gravity=""center_horizontal|center_vertical|center""    android:text=""@string/TzadiSofit""    android:fitsSystemWindows=""true""  /&gt;    &lt;/LinearLayout&gt;    &lt;/TableRow&gt;    &lt;TableRow android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:layout_gravity=""center_horizontal|center_vertical|center""    android:fitsSystemWindows=""true""    android:orientation=""horizontal""&gt;    &lt;LinearLayout android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:layout_gravity=""center_horizontal|center""    android:gravity=""bottom""    android:orientation=""horizontal""&gt;    &lt;Button  android:soundEffectsEnabled=""true""    android:id=""@+id/hebrewBackButton""    android:layout_width=""wrap_content""    android:layout_height=""35dip""    android:layout_gravity=""right""    android:fitsSystemWindows=""true""     android:text=""&amp;lt;--""/&gt;    &lt;Button  android:soundEffectsEnabled=""true""    android:id=""@+id/hebrewSpaceButton""    android:layout_width=""150dip""    android:layout_height=""35dip""    android:layout_gravity=""center_horizontal|center_vertical|center""    android:text=""""    android:fitsSystemWindows=""true""  /&gt;    &lt;Button  android:soundEffectsEnabled=""true""    android:id=""@+id/hebrewDoneButton""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:layout_gravity=""right""    android:text=""Done""    android:fitsSystemWindows=""true""  /&gt;    &lt;/LinearLayout&gt;    &lt;/TableRow&gt;  &lt;/TableLayout&gt;&lt;/TableLayout&gt;&lt;/FrameLayout&gt;`</code></pre><p>Here is a picture of what it looks like right now in portrait and landscape:<br><img src=""http://i.stack.imgur.com/Yd9U1.png"" alt=""enter image description here""></p><p><img src=""http://i.stack.imgur.com/hqKC0.png"" alt=""enter image description here""></p>","599402","","23199","","2011-02-15 23:26:47","2012-04-14 03:13:00","How do I make my own keyboard for an app in android?","<android><android-layout><android-softkeyboard>","0","3","","",""
"5010841","1","5011677","","2011-02-15 23:43:05","0","1832","<p>I want to add a custom view to a group view with a BaseExpandableListAdapter</p><p>This is The code: </p><p><strong>The custom view and layout.xml</strong> </p><pre><code>public class InfoView extends View{    private EditText nameEditText;    private EditText descriptionEditText;    private Spinner goalTypeSpinner;    private Spinner categorySpinner;    Button addGoalCategoryButton;    public InfoView(Context context) {        super(context);        inflate(context, R.layout.info_panel, parent);        nameEditText = (EditText) findViewById(R.id.nameEditText);        descriptionEditText = (EditText) findViewById(R.id.descriptionEditText);        goalTypeSpinner = (Spinner)                 findViewById(R.id.goalTypeSpinner);        categorySpinner = (Spinner)                 findViewById(R.id.categorySpinner);    }}</code></pre><p>infopanel.xml</p><pre><code>&lt;LinearLayout     android:layout_width=""wrap_content"" android:layout_height=""wrap_content""    xmlns:android=""http://schemas.android.com/apk/res/android"" android:orientation=""vertical"" &gt;    &lt;Spinner android:id=""@+id/goalTypeSpinner"" android:prompt=""@string/goalType""            android:entries=""@array/goalTypeList"" style=""@style/commonText.commonSpinner"" &gt;    &lt;/Spinner&gt;    &lt;TableRow style=""@style/commonText.commonTableRow""&gt;            &lt;Spinner android:id=""@+id/categorySpinner"" style=""@style/commonText.commonSpinner.right""                android:prompt=""@string/goalType""&gt;            &lt;/Spinner&gt;            &lt;Button android:id=""@+id/newCategoryButton"" style=""@style/commonText.commonButton""                android:text=""add category"" /&gt;    &lt;/TableRow&gt;     &lt;EditText android:id=""@+id/nameEditText"" android:hint=""@string/nameEditTextHint""        style=""@style/commonText.commonEditText"" &gt;    &lt;/EditText&gt;    &lt;EditText android:id=""@+id/descriptionEditText"" android:hint=""@string/descriptionEditTextHint""        style=""@style/commonText.commonTextArea""&gt;    &lt;/EditText&gt;&lt;/LinearLayout&gt;</code></pre><p>In the BaseExpandableListAdapter : </p><pre><code>..............InfoView infoView;public View getChildView(int groupPosition, int childPosition,            boolean isLastChild, View convertView, ViewGroup parent) {        if (group.equals(INFO) &amp;&amp; child.equals(INFO)) {            Log.i(TAG, ""group INFO("" + group + "")"");            if (infoView == null) {                // i don't want to recreate everytime                 // the view so i check if is null                         infoView = new InfoView(context);            }            return infoView;        }........</code></pre><p>The code works (ie doesn't throw any exception) but the view isn't displayed. </p><p>Do you know Why ? </p><p>thanks and regards</p>","618195","","71034","","2011-02-16 03:02:13","2011-02-16 03:02:13","Android Custom View and BaseExpandableListAdapter","<android><view><expandablelistview>","2","0","","",""
"5010970","1","5010993","","2011-02-16 00:01:06","1","540","<p>I am using the following code:</p><pre><code>SharedPreferences.Editor edit = mPrefs.edit();edit.putString(""UUID"", UUID.randomUUID().toString());edit.commit();//edit.apply();</code></pre><p>This works fine, but if I comment out the commit and uncomment the apply, the app force closes on my device with no error message, or exception thrown. Strangely, this runs fine in the emulator, under 2.2 and 2.3.3. It only closes on my Nexus one running 2.2.1</p><p>I have the workaround above, but am interested as to the cause of the close. </p><p>Can anyone help?</p><p>Cheers, Venatu</p>","431176","","","","","2013-06-25 12:02:13","SharedPreferences.Editor.apply force closes","<java><android><android-emulator><nexus-one>","2","1","","",""
"5011095","1","","","2011-02-16 00:21:08","0","463","<p>I'm currently trying to implement an SQLite database in an android app. It seems like the getEntry() and getAllEntries() and delete() methods in the databseAdapter class work properly. I'm having trouble with an updateEntry() method though. I'm pretty sure it's not working correctly because it's returning 0 when it should be returning 1 (I'm trying to update 1 entry only).  Here is my updateEntry method.</p><pre><code>public boolean updateEntry(long _rowIndex, Account a){    ContentValues updateValues = new ContentValues();    updateValues.put(KEY_ACCOUNTNUMBER, a.accountNumber);    updateValues.put(KEY_NAME, a.name);    updateValues.put(KEY_AMOUNT, a.amountOwed);    updateValues.put(KEY_AREA, a.areaCode);    updateValues.put(KEY_PHONE, a.phoneNumber);    String where = KEY_ID + ""="" + _rowIndex;    int i = db.update(DATABASE_TABLE, updateValues, where, null);    Log.i(TAG,  ""rows updated returned "" + i);    return i&gt;0;}</code></pre><p>this is the onClick method of another class CreateAccount that calls it.</p><pre><code>public void onClick(View arg0) {            String name = nameEditText.getText().toString();            int areaCode = Integer.parseInt(areaCodeEditText.getText().toString());            int phoneNumber = Integer.parseInt(phoneNumberEditText.getText().toString());            Account newAccount = new Account(1, name, areaCode, phoneNumber, 0);            if(b == true){                myAccountDbAdapter.updateEntry(rowIndex,newAccount);                finish();            }            else{                myAccountDbAdapter.insertEntry(newAccount);                finish();            }        }    });</code></pre><p>I'm not really sure what could be happening here. Obviously, no rows are being updated. My updateEntry looks exaclty like the ones I've seen in tutorials. I'm pretty lost at this point but it's probably something dumb haha.</p><p>here is the entire databaseAdapter class</p><pre><code>package com.scoracle.database;import com.scoracle.book.Account;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.SQLiteDatabase.CursorFactory;import android.database.sqlite.SQLiteOpenHelper;import android.util.Log;public class AccountDbAdapter {public static final String DATABASE_NAME = ""accountDatabase.db"";public static final String DATABASE_TABLE = ""accountTable"";public static final int DATABASE_VERSION = 1;public static final String KEY_ID = ""_id"";public static final String KEY_ACCOUNTNUMBER=""accountNumber"";public static final int ACCOUNTNUMBER_COLUMN=1;public static final String KEY_NAME=""name"";public static final int NAME_COLUMN=2;public static final String KEY_AREA=""areaCode"";public static final int AREA_COLUMN=3;public static final String KEY_PHONE=""phoneNumber"";public static final int PHONE_COLUMN=4;public static final String KEY_AMOUNT=""amountOwed"";public static final int AMOUNT_COLUMN=5;//SQL Statement to create databaseprivate static final String DATABASE_CREATE = ""create table "" + DATABASE_TABLE +                                                   "" ("" + KEY_ID +                                            "" integer primary key autoincrement, "" +                                            KEY_ACCOUNTNUMBER + "" INTEGER, "" +                                            KEY_NAME + "" text not null, "" +                                            KEY_AREA + "" INTEGER, "" +                                              KEY_PHONE + "" INTEGER, "" +                                            KEY_AMOUNT + "" REAL);""; private SQLiteDatabase db;private final Context context;private MyDBHelper dbHelper;private String TAG = ""ADAPTER"";public AccountDbAdapter(Context _context) {    context = _context;    dbHelper = new MyDBHelper(context, DATABASE_NAME, null, DATABASE_VERSION);}public AccountDbAdapter open() throws SQLException{    //dbHelper = new MyDBHelper(context, DATABASE_NAME, null,DATABASE_VERSION);    try{        db = dbHelper.getWritableDatabase();    } catch(SQLException e){        db = dbHelper.getWritableDatabase();    }    return this;}public void close(){    db.close();}public long insertEntry(Account _account){    ContentValues newAccountValues = new ContentValues();    newAccountValues.put(KEY_ACCOUNTNUMBER, _account.accountNumber);    newAccountValues.put(KEY_AREA, _account.areaCode);    newAccountValues.put(KEY_NAME, _account.name);    newAccountValues.put(KEY_PHONE, _account.phoneNumber);    newAccountValues.put(KEY_AMOUNT, _account.amountOwed);    return db.insert(DATABASE_TABLE, null, newAccountValues);}public boolean removeEntry(long _rowIndex){    return db.delete(DATABASE_TABLE,KEY_ID+ ""="" + _rowIndex, null) &gt; 0;}public Cursor getAllEntries(){    return db.query(DATABASE_TABLE, new String[] {KEY_ID,  KEY_ACCOUNTNUMBER,KEY_NAME,KEY_AREA, KEY_PHONE,KEY_AMOUNT},            null, null, null, null, null);}public Account getEntry(int _rowIndex) throws SQLException{    Cursor c = db.query(DATABASE_TABLE, null, null, null, null, null, null);    if(c.moveToPosition(_rowIndex)){    Account a = new Account();    a.accountNumber = c.getInt(ACCOUNTNUMBER_COLUMN);    a.name = c.getString(NAME_COLUMN);    a.areaCode = c.getInt(AREA_COLUMN);    a.phoneNumber = c.getInt(PHONE_COLUMN);    a.amountOwed = c.getFloat(AMOUNT_COLUMN);    return a;    }else {    throw new SQLException(""No entry at row "" + _rowIndex);    }}public boolean updateEntry(long _rowIndex, Account a){    ContentValues updateValues = new ContentValues();    updateValues.put(KEY_ACCOUNTNUMBER, a.accountNumber);    updateValues.put(KEY_NAME, a.name);    updateValues.put(KEY_AMOUNT, a.amountOwed);    updateValues.put(KEY_AREA, a.areaCode);    updateValues.put(KEY_PHONE, a.phoneNumber);    String where = KEY_ID + ""="" + _rowIndex;    int i = db.update(DATABASE_TABLE, updateValues, where, null);    Log.i(TAG,  ""rows updated returned "" + i);    return i&gt;0;}private static class MyDBHelper extends SQLiteOpenHelper {    private String TAG = ""databasehelper"";    public MyDBHelper(Context context, String name, CursorFactory factory, int version){        super(context,name,factory,version);    }    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 will destroy all old data"");            db.execSQL(""DROP TABLE IF EXISTS notes"");            onCreate(db);        }}//end db helper}</code></pre><p>and here is the entire class that calls the updateEntry method CreateAccount</p><pre><code>package com.scoracle;import com.scoracle.book.Account;import com.scoracle.database.AccountDbAdapter;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.EditText;public class CreateAccount extends Activity{private EditText nameEditText;private EditText areaCodeEditText;private EditText phoneNumberEditText;private Button myButton;private AccountDbAdapter myAccountDbAdapter;private String TAG = ""CREATE_ACCOUNT"";private int rowIndex;private Account a;private boolean b = false;public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.createaccountlayout);    myAccountDbAdapter = new AccountDbAdapter(this);    myAccountDbAdapter.open();    Bundle bundle = this.getIntent().getExtras();      if(bundle != null) {        rowIndex = bundle.getInt(""rowIndex"");        b = true;        a = myAccountDbAdapter.getEntry(rowIndex);      }    nameEditText = (EditText) findViewById(R.id.createaccountedittext01);    areaCodeEditText = (EditText) findViewById(R.id.createaccountedittext02);    phoneNumberEditText = (EditText) findViewById(R.id.createaccountedittext03);    if(b == true){        nameEditText.setText(a.name);        String s = new Integer(a.areaCode).toString();        areaCodeEditText.setText(s);        s = new Integer(a.phoneNumber).toString();        phoneNumberEditText.setText(s);    } else{}    myButton = (Button) findViewById(R.id.createaccountbutton01);    myButton.setOnClickListener(new OnClickListener(){        @Override        public void onClick(View arg0) {            String name = nameEditText.getText().toString();            int areaCode =  Integer.parseInt(areaCodeEditText.getText().toString());            int phoneNumber = Integer.parseInt(phoneNumberEditText.getText().toString());            Account newAccount = new Account(1, name, areaCode,  phoneNumber, 0);            if(b == true){                myAccountDbAdapter.updateEntry(rowIndex,newAccount);                finish();            }            else{                myAccountDbAdapter.insertEntry(newAccount);                finish();            }        }    });}public void onPause(){    super.onPause();    myAccountDbAdapter.close();}}</code></pre><p>Thanks for any help</p>","600859","","","","","2011-07-12 03:54:11","Why does my databaseAdapter class update method return 0?","<java><android><sqlite>","2","1","","",""
"5011108","1","","","2011-02-16 00:22:42","0","2940","<p>I've searched for couple days about sending MMS,all i can find is the intent.ACTION_SEND things.I'm building a messaging program and i really need this mms sending feature. Any tips about it? Is there any API for sending MMS?</p>","618797","","","","","2013-01-02 06:08:09","How to send MMS using my code","<android><mms>","2","1","1","",""
"5011134","1","5109900","","2011-02-16 00:25:24","2","2933","<p>I want to implement a rotating banner. What control is best suitable for such UI?</p><p>here is what it needs to do:</p><ol><li>rotate 1 image per view</li><li>rotate them only on swipe (or what's called onFling())</li><li>remember the index of the current banner and show next banner when user is redirected onto another activity</li><li>rotation is infinite in both directions</li></ol><p>So essentially when you land on first activity the first index is shown. When you do swipe it should show next or previous image depending if the swipe is to the left or to the right. This should iterate in the infinite loop.  </p><p>Thank you in advance</p>","538428","","","","","2011-02-24 20:13:37","android ad banner","<android><banner-ads>","2","0","6","",""
"5011159","1","","","2011-02-16 00:28:16","3","1684","<p>I'm trying to get a list of all events from the onboard Android calendar and use it to populate a list view in my application. How do I do this on 2.2 and above. The link below describes how to do it on &lt;= 2.1. </p><p><a href=""http://stackoverflow.com/questions/4302209/android-calendar-events"">Android Calendar Events</a></p><p>The same method doesn't seem to work on 2.2 and above though even when I change the events uri.</p><p>Thanks for the help!</p>","552384","","","","","2011-02-16 00:28:16","Get Events from the Android Calendar - 2.2","<android>","0","2","2","",""
"5011264","1","","","2011-02-16 00:42:18","3","5326","<p>Basic disclaimer; I am new to mobile app programming in general, and android in particular.</p><p>I have a button that, when clicked, should open the next activity:</p><pre><code>bCustom.setOnClickListener(new View.OnClickListener() {    public void onClick(View view) {        Intent i = new Intent(ctx, DiceCustomList.class);        startActivity(i);    }});</code></pre><p>(where ""private Context ctx = this;"" because putting ""this"" where ""ctx"" is did not get the context when inside onClick)</p><p>The program crashes before the current activity is obscured (though I'm not sure how transitions affect this). After commenting out nearly everything, here's the activity it's calling:</p><pre><code>public class DiceCustomList extends ListActivity {    @Override    public void onCreate(Bundle savedInstanceState){        super.onCreate(savedInstanceState);        setContentView(R.layout.custom_list);    }}</code></pre><p>And custom_list.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:text=""@string/rollText""        android:id=""@+id/textRoll2""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:textSize=""11pt""        android:gravity=""center""/&gt;    &lt;ListView android:layout_height=""wrap_content""        android:id=""@+id/listView1""        android:layout_width=""fill_parent""/&gt;&lt;/LinearLayout&gt;</code></pre><p>I think the problem lies in the button code, but I can't seem to get closer to the answer than that.</p><p>Edit: The android manifest file does have:</p><pre><code>&lt;activity android:name="".DiceCustomList""&gt;&lt;/activity&gt;</code></pre><p>Edit 2: Ah, after finally finding where Eclipse hides the stacktrace, it told me this: ""Your content must have a ListView whose id attribute is 'android.R.id.list'"", by which they actually mean ""@+id/android:list"". Well, that was interesting. (Edit3: By which I mean, it was the answer. Thanks for the prompting.)</p>","618833","","618833","","2011-02-16 01:15:22","2011-02-16 01:30:54","Android startActivity() crashing","<android><android-intent>","3","2","","",""
"5011405","1","5083602","","2011-02-16 01:00:13","1","1195","<p>I already have an application that uses the SQLite database and a listadapter. I am trying to update my application to use the Full Text Search capabilities but am struggling to find an answer to a problem. Basically when I create the virtual table with the necessary _id column, the database converts it to a text field and it is no longer an autoincrement primary key. How would I go about using the FTS3 capabilities with a listadapter?</p>","485438","","","","","2011-02-22 20:30:48","Android Full Text Search and ListAdapter","<android><listadapter><fts3>","1","0","1","",""
"5011427","1","","","2011-02-16 01:03:06","0","984","<p>I'm trying to make a 24 hour analog clock widget for android.I have my hour hand already set up like this in my widget.xml:</p><pre><code>&lt;ImageView    android:id=""@+id/hourimg""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:layout_gravity=""center""    android:background=""@drawable/widgethour""/&gt;</code></pre><p>Now, I need the Java code to be able to rotate that image 15 degrees every hour. Or .25 degrees every minute while in sync like a 24 hour clock. How can I go about doing that? I'm horrible at programming, I can pretty much only do the graphics and xml layouts, but I can't do the Java.</p><p>EDIT: I was trying to make out the java in a way for it to rotate the image 15 degrees every hour for 24 hours, and I was unsuccessful to a point to where I don't what I'm doing.</p><p>Here's my Java code(I'm pretty sure that you wont be able to make it out at all):</p><pre><code>    package com.ted417.minecraftclockwidget;import java.util.Calendar;import android.app.Activity;import android.appwidget.AppWidgetProvider;import android.graphics.Bitmap;import android.graphics.BitmapFactory;import android.graphics.Matrix;import android.os.Bundle;import android.view.View;import android.widget.AdapterView;import android.widget.ArrayAdapter;import android.widget.ImageView;public class Widget extends Activity {ImageView hourimg;private ArrayAdapter&lt;String&gt; adapterScale;private Calendar calendar;private float curRotate = 0F,imageRotate = calendar.get(Calendar.HOUR_OF_DAY) * 15;Bitmap bitmap;int bmpWidth, bmpHeight;/** Called when the activity is first created. */public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.widget);    hourimg = (ImageView)findViewById(R.id.hourimg);    bitmap = BitmapFactory.decodeFile(""@drawable/hourimg"");    bmpWidth = bitmap.getWidth();    bmpHeight = bitmap.getHeight();    drawMatrix();}private void drawMatrix(){    Matrix matrix = new Matrix();    matrix.postRotate(curRotate);}}</code></pre><p>I tried making out of a tutorial that I found online, but that got me nowhere.</p><p>Thank you</p>","618860","","618860","","2011-02-16 03:06:57","2012-05-05 11:41:42","How can I make a 24 hour analog clock widget?","<java><android><android-widget>","0","2","","",""
"5011448","1","5011772","","2011-02-16 01:05:55","0","1718","<p><strong>SOLVED</strong>  readline - a library for editing typed command lines</p><hr><p>After following the Android open source directions <a href=""http://source.android.com/source/download.html"" rel=""nofollow"">here</a>, for the life of me I cannot figure out what is missing. I am building on Fedora 14 x86_64.</p><pre><code>host Executable: sqlite3 (out/host/linux-x86/obj/EXECUTABLES/sqlite3_intermediates/sqlite3)/usr/bin/ld: cannot find -lhistorycollect2: ld returned 1 exit statusmake: *** [out/host/linux-x86/obj/EXECUTABLES/sqlite3_intermediates/sqlite3] Error 1</code></pre><p>So does anyone know what this could come from? I installed every sqlite library I could think of. Which ever library this is my searches have turned up nothing. Anyone?</p><p>Thanks!</p>","65928","","65928","","2011-02-16 02:29:54","2011-12-31 07:35:29","Android source build error: ld cannot find -lhistory","<android><linker-error>","1","0","","",""
"5011477","1","5011539","","2011-02-16 01:09:36","0","108","<p>I have a class that collects a series of strings (contact's names) and I need a way to save them all to a List.  I have searched everywhere but everything I find has to do with ListViews.  I need a method that will allow me to add, edit, and delete my strings from an .xml file.  I have tried to use  located in resources/values but it does not seem that you can edit the file within a class.  The reason I need this is so that the user can load specific lists on command by their name, so using a simple String array will not suffice.  When the user selects a specific list file, the string values within it would be placed in a string array and displayed in a ListView.  What methods would I use to achieve this (besides SQlite)?</p><p>I appreciate any and all advice</p><p>-Nate</p>","586859","","","","","2011-03-27 13:57:08","Creating, Editing, and Retrieving a List","<android>","1","0","","",""
"5011646","1","","","2011-02-16 01:39:24","0","288","<p>I am building an android app for fetching internet data and rendering it as a list. The data is changing every minute, so I made a service and used a Timer to load the data with an interval.</p><p>My question is that:</p><ul><li>I want to know when the app (not a particular activity) goes to the background, for example, user pressed the home button, in that case, I want to pause the service in order to save battery.</li><li>I want to know when the phone is sleeping (screen dimmed), in that case, I would like to pause the service too.</li></ul><p>Any ideas?</p>","238061","","","","","2011-06-24 03:57:29","How to make a better battery-saving data update service for an android app","<android><service><timer><battery>","1","0","","",""
"5011751","1","5011763","","2011-02-16 01:57:21","0","905","<p>i have been trying to call a PHP script with the android system.  i am using Eclipse helio and everything else i have written works fine on it - not much yet.   so i block copied this code and it does not work:  i have no warnings or errors and i can debug and step through it, but it always comes back with</p><p>""E log_tag : Error in http connection java.net.UnknownHostException: www.X.com""</p><p>here is the code:</p><pre><code>    List&lt;NameValuePair&gt; nameValuePairs = new ArrayList&lt;NameValuePair&gt;(2);      nameValuePairs.add(new BasicNameValuePair(""Lat"",""19.80""));    nameValuePairs.add(new BasicNameValuePair(""Lon"",""13.22""));    HttpClient httpclient = new DefaultHttpClient();    HttpPost httppost = new HttpPost(""http://www.X.com/new/getAllPeopleBornAfter.php"");    try{        httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));        HttpResponse response = httpclient.execute(httppost);        HttpEntity entity = response.getEntity();        InputStream is = entity.getContent();        Log.i(""postData"", response.getStatusLine().toString());    }    catch(Exception e)    {        Log.e(""log_tag"", ""Error in http connection ""+e.toString());    }       </code></pre><p>and the PHP which runs fine if i go there with a browser:</p><p><pre><code>mysql_connect(""mysql27.x.com"",""name"",""PW"");mysql_select_db(""dbname"");$q = mysql_query(""SELECT * FROM people"");while ($e = mysql_fetch_assoc($q))  $output[] = $e;mysql_close();echo (json_encode($output));</code></pre><p>?></p><p>if you guys want me to run anything in a different format or any more info - please let me know - i cant find any thing more than just unknownhostexception</p>","612079","","","","","2011-08-29 04:13:14","Android- UnknownHostException stumper","<php><android><mysql>","3","0","","",""
"5011793","1","","","2011-02-16 02:07:44","2","328","<p>I have decided i'll have to make a mobile version of my website. so ive tried reading about and come here to confirm and get your approval.</p><p>1) I have decided im going to use jquery mobile framework to create it. what are its limitations? according to me...none. educate me.</p><p>2) I don't have a smartphone or similar? how will i test the website during development? i have read about phone emulators... what is the best phone emulator you wud recommend that emulates a vast array of phones?</p><p>3)Once ive developed the website... i'll need a smart way of phone detection... so as it redirects to mobile website... i know there are libraries for this... again i need a recommendation here</p><p>Please help me answer these questions or direct me towards the right path... i know a lot of mobile website noobs need these questions answered.</p><p>btw, my website is veepiz.com. incase that can help</p>","384894","","","","","2011-02-16 03:33:57","Mobile Website essentials..?","<php><jquery><android>","2","1","","",""
"5011816","1","5671757","","2011-02-16 02:12:06","48","15989","<p>Periodically LogCat will stop showing messages even though I am in debug mode.  At other times it will display only one line at a time!  I have a solution, restart eclipse. But I would like to understand this better.  It takes too much time to restart eclipse when this happens.  I have seen this behavior on the emulator and connected to a device.  Either the LogCat shows one line with no history or nothing. </p>","602260","","","","","2014-04-13 18:23:59","LogCat Stops Running in Eclipse Needs Restart","<android><eclipse><logcat>","10","4","6","",""
"5011882","1","5011961","","2011-02-16 02:22:37","2","2801","<p>I have a simple web page that displays some text and images and trying to find a non complicated way to handle multiple screens.</p><p>I have looked through <a href=""http://developer.android.com/guide/webapps/targeting.html"" rel=""nofollow"">the docs</a> and the only way I can see to do it right now is having to create three separate css files, one for low, one for medium, and one for high res. Unfortunately each one of these have to have different font sizes and dimensions of every element/image.</p><p>This seems rather wasteful considering every hdpi element should just be exactly 1.5x the size of the normal one. Is there not a way to make Android just automatically scale this for us while using hdpi versions of the images instead of mdpi ones?</p><p>Am I missing something here?</p>","445348","","445348","","2011-02-16 02:44:20","2011-08-12 16:18:51","Android CSS for different screen sizes","<android><css>","2","0","1","",""
"5011932","1","5011981","","2011-02-16 02:31:32","41","10709","<p>I am storing a SQL query in my strings.xml file and I want to use String.Format to build the final string in code.  The SELECT statement uses a like, something like this:</p><p>SELECT Field1, Field2 FROM mytable WHERE Field1 LIKE '%something%'</p><p>In order to format that I replace 'something' with %1$s so it becomes:</p><p>SELECT Field1, Field2 FROM mytable WHERE Field1 LIKE \'%%1$s%\'</p><p>I escape the single quotes with the backslash.  However I am not able to escape the % sign.  How can I include a like statement in my strings.xml file?</p>","550587","","","","","2012-07-11 13:50:32","How to escape % in String.Format?","<java><android><syntax>","1","3","1","",""
"5011994","1","","","2011-02-16 02:44:24","1","4180","<p>I am trying to zoom/pan images in the android gallery widget. The images cover the full screen. Though I can zoom/pan images in the gallery, I am not able to swipe to the next/previous images. Zooming and panning for single image works fine.</p><p>I created a TouchImageView which extends ImageView with capability of zooming and panning from Hello Android book. Then I returned this TouchImageView in the getView() method of the Adapter class that returns images to the Gallery. </p><p>I found exactly same problem in google groups at <a href=""http://groups.google.com/group/android-developers/msg/97421179bfc5a3b2"" rel=""nofollow"">http://groups.google.com/group/android-developers/msg/97421179bfc5a3b2</a> but no replies over there.</p><p>Thank you.</p>","618926","","","","","2013-06-22 10:56:25","Image zooming/panning inside of a Gallery","<android>","2","1","2","",""
"5012004","1","5012104","","2011-02-16 02:45:57","4","12113","<p>I'm a long time windows developer looking to learn something about Android programming. I'm working my way through the Sams book Teach Yourself Android Application Programming in 24 hours. I've discovered some flaws with the book already but nothing that I couldn't figure out on my own, until now. I'm working on adding a second class to my project and in the New Java Class dialog, it says to click the Browse button next to the Superclass box and pick ""android.app.Activity"". However, the only thing shown is java.lang.Object. </p><p>I'm pretty certain that I've set thing up correctly, but then, maybe I haven't. </p><p>Can anyone give me guidance?</p><p>Thanks!</p><p>Bo</p>","618936","","488241","","2011-02-16 22:22:55","2011-02-16 22:22:55","Adding a new class to Android Project","<android><eclipse>","2","1","","",""
"5012129","1","5039474","","2011-02-16 03:11:19","9","1969","<p>I am a new developer for Android. Tried to rotate <code>MapView</code> in circular motion.But I don't know how to begin.</p><p>Do you have a simple code to rotate the <code>MapView</code>?</p>","164589","","119895","","2011-07-09 19:24:21","2012-09-06 21:39:51","How to rotate MapView?","<android><android-mapview>","2","0","4","",""
"5012163","1","9587798","","2011-02-16 03:15:23","8","6930","<p><code>repo status</code> shows me a lot of un-wanted changes. </p><p>It would be duplicated if I enter every project and use <code>git reset --hard</code>. </p><p>Is there a way to reset all the changes using repo, something like <code>repo reset --hard</code>?</p>","234939","","468793","","2011-05-04 06:48:14","2014-02-25 11:32:52","How to discard changes using repo","<android><android-source>","6","0","1","",""
"5012493","1","5012802","","2011-02-16 04:17:53","0","687","<p>I recently updated Eclipse, and now when I go to create a new project it will display an error that says ""The SDK doesn't have the directory tool/progaurd.cfg"".</p><p>How can I fix this?</p><p>Also, after you continue with the error there is no <code>r.java</code> file...</p>","583952","","200291","","2011-02-16 04:20:15","2011-02-16 05:46:59","After updating Eclipse, I get an error when creating a new Android project","<android><eclipse><upgrade>","3","0","","",""
"5012541","1","5012709","","2011-02-16 04:28:52","0","446","<p>I'm sending a POST to my development machine and it works with 10.0.2.2 in the emulator, but I can't get it to work when installed on my phone - the connection always times out. I tried 10.0.2.2, 192.168.1.3 (my computer) and my public IP.. </p><p>I turned off the firewall and I tried forwarding port 8000 which is the port my web server is listening on.</p><p>Which IP should it be?  Is port forwarding what I need to do? I have no clue how routers and my internal network work. </p>","317033","","","","","2011-02-16 05:09:31","Android - HttpPost works on emulator, but not on my phone","<android><http>","1","1","1","",""
"5012545","1","6433718","","2011-02-16 04:29:25","1","2603","<p>So, the goal is to have a scroll view behaving correctly inside a gallery.  I'm using an example posted by <a href=""http://stackoverflow.com/users/443659/atraudes"">atraudes</a> which you can see below:</p><pre><code>public class GalleryFriendlyScrollView extends ScrollView{    private static int NONE = -1;    private static int DOSCROLLVIEW = 0;    private static int DOGALLERY = 1;    private float lastx = 0;    private float lasty = 0;    private float firstx = 0;    private float firsty = 0;    private float lastRawx = 0;    private float lastRawy = 0;    private int gestureRecipient = NONE;    private boolean donewithclick = true;    private Gallery parent = null;    private boolean firstclick = true;    public GalleryFriendlyScrollView(Context context, AttributeSet attrs) {        super(context, attrs);    }    @Override    public boolean onTouchEvent(MotionEvent ev) {        boolean retthis = true;        //Indicating a fresh click        if(donewithclick){            firstx = ev.getX();            firsty = ev.getY();            lastx = firstx;            lasty = firsty;            lastRawx = ev.getRawX();            lastRawy = ev.getRawY();            donewithclick = false;            firstclick = true;        }        //We don't know where these gesture events are supposed to go to.         //We have movement on the x and/or why axes, so we can determine where they should go now.        if((gestureRecipient == NONE) &amp;&amp; (lastx != ev.getX() || lasty != ev.getY())){            //Determine whether there's more movement vertically or horizontally            float xdiff = ev.getX() - lastx;            float ydiff = ev.getY() - lasty;            if(xdiff &lt; 0)xdiff = xdiff * -1;            if(ydiff &lt; 0)ydiff = ydiff * -1;            if((xdiff) &gt; (ydiff)){                gestureRecipient = DOGALLERY;            } else {                gestureRecipient = DOSCROLLVIEW;            }        }        if(gestureRecipient == DOGALLERY){            if(!firstclick){                //After you drag the screen left or right a bit, the baseline for where it calculates                //x and y from changes, so we need to adjust the offset to our original baseline                float offsetx = (((ev.getX() - lastx) - (ev.getRawX() - lastRawx)) * -1);                float offsety = (((ev.getY() - lasty) - (ev.getRawY() - lastRawy)) * -1);                ev.offsetLocation(offsetx, offsety);            }            retthis = getGallery().onTouchEvent(ev);            Log.i(""TAG"", ""gallery"");            firstclick = false;        } else if(gestureRecipient == DOSCROLLVIEW){            retthis = super.onTouchEvent(ev); //FIXME This isn't actually scrolling            Log.i(""TAG"", ""scroll"");        }        if(ev.getAction() == MotionEvent.ACTION_UP){            //User's finger has been lifted            if(((firstx == ev.getX()) &amp;&amp; (firsty == ev.getY()))){                //Since there isn't any movement in either direction, it's a click                getGallery().onSingleTapUp(ev);                super.onTouchEvent(ev);            }            donewithclick = true;            gestureRecipient = NONE;            Log.i(""TAG"", ""END"");        }        //And record our coordinate data        lastx = ev.getX();        lasty = ev.getY();        lastRawx = ev.getRawX();        lastRawy = ev.getRawY();        return retthis;    }    @Override    public boolean onInterceptTouchEvent(MotionEvent ev) {        getGallery().onTouchEvent(ev);        return super.onInterceptTouchEvent(ev);    }    private Gallery getGallery(){        //Gets the gallery        if(parent == null)            parent = (Gallery) (this.getParent().getParent());        return parent;    }}</code></pre><p>This seems to be catching all the correct cases (horizontal, vertical and none) based on the log messages I've appended, but for some reason the scroll view isn't scrolling when super.onTouchEvent(ev) is being called in onTouchEvent(MotionEvent ev).</p>","591042","","","","","2011-06-22 00:53:37","Android -- ScrollView inside a Gallery","<android><gallery><scrollview>","2","1","","",""
"5012581","1","5012703","","2011-02-16 04:38:39","0","838","<p>all.   I want to insert some initial data in db(sqlite) when it was created.</p><p>if there is no insert operations, the programe works fine. but when I add it, It cause error.I can't understand.It seems to be android get a read-able db-handle to write it? I am not sure. Or maybe android doesn't allow to insert data at DatabaseHelper's onCreate() method? hope somebody can solve my problem.</p><pre><code>  02-16 12:34:20.445: ERROR/AndroidRuntime(24947): Caused by: android.database.sqlite.SQLiteException: Can't upgrade read-only database from version 0 to 3: /data/data/com.kbonez.prodo/databases/prodo.db02-16 12:34:20.445: ERROR/AndroidRuntime(24947):     at android.database.sqlite.SQLiteOpenHelper.getReadableDatabase(SQLiteOpenHelper.java:170)**02-16 12:34:20.445: ERROR/AndroidRuntime(24947):     at com.kbonez.prodo.ProdoProvider.query(ProdoProvider.java:164)**02-16 12:34:20.445: ERROR/AndroidRuntime(24947):     at android.content.ContentProvider$Transport.query(ContentProvider.java:130)02-16 12:34:20.445: ERROR/AndroidRuntime(24947):     at android.content.ContentResolver.query(ContentResolver.java:202)02-16 12:34:20.445: ERROR/AndroidRuntime(24947):     at android.app.Activity.managedQuery(Activity.java:1495)02-16 12:34:20.445: ERROR/AndroidRuntime(24947):     at com.kbonez.prodo.ProdoList.onCreate(ProdoList.java:129)</code></pre><p>I look at line 164 ,it is </p><pre><code>SQLiteDatabase db = mOpenHelper.getReadableDatabase();</code></pre><p>I just add those code in my Provider.DatabaseHelper.onCreate()</p><pre><code>final String insTemplate=""insert into %s (%s,%s)  values (%s);"";                    for(String i: ct.getResources().getStringArray(R.array.helpInit)){            db.execSQL(String.format(insTemplate,PRODO_TABLE_NAME,Structer.TITLE,Structer.NOTE,i));         }</code></pre><p>==========================================================solved!</p><p>Thanks all guys , I tried it . I use this</p><pre><code>    // Get the database and run the query    try{    SQLiteDatabase db = mOpenHelper.getReadableDatabase();    Cursor c = qb.query(db, projection, selection, selectionArgs, null,            null, orderBy);    // Tell the cursor what uri to watch, so it knows when its source data    // changes    c.setNotificationUri(getContext().getContentResolver(), uri);    return c;    }catch(SQLException e){        SQLiteDatabase db = mOpenHelper.getWritableDatabase();        return null;    }</code></pre><p>but I can't understand ,why android don't do it , and need ourself to do it.</p>","576472","","576472","","2011-02-16 05:54:25","2012-03-26 11:33:33","android Provider initial data","<android><provider>","3","0","","",""
"5012685","1","5013076","","2011-02-16 05:04:36","4","5597","<p>I want to draw an oval shape around the text on <code>Canvas</code>, I am displaying the 3 texts on <code>Canvas</code> using <code>drawwText()</code> method. </p><p>Now when I click on a particular text, I need to draw an oval around that text and again when we click on another text, the oval shape should appear on the clicked text. For this give me some code suggestions.Thanks in advance</p>","479027","","592025","","2012-10-17 12:36:09","2012-10-17 12:36:09","draw an oval shape around the text on canvas","<android>","1","0","1","",""
"5012773","1","","","2011-02-16 05:20:22","0","1446","<p>How can I connect to a mobile device and install android application in that device?</p>","619066","","589268","","2011-02-16 05:36:12","2011-02-16 05:36:12","How to connect a mobile device and install android application in that device?","<android><android-install-apk>","2","1","","",""
"5012840","1","5012893","","2011-02-16 05:31:46","4","4874","<p>Is it possible to specify the pixel unit in code. What I mean is, say I have a layout and I want the size to be 20dp, then is there any way to do so without writing in a layout xml</p>","266272","","","","","2012-07-23 08:09:17","Android specifying pixel units (like sp, px, dp) without using XML","<android><android-layout><pixel>","2","0","1","",""
"5012915","1","","","2011-02-16 05:43:59","0","1374","<pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;com.org.BatteryManager.BatteryView xmlns:android=""http://schemas.android.com/apk/res/android"" android:layout_width=""fill_parent""android:layout_height=""fill_parent""/&gt; package com.org.BatteryManager;import java.util.Map;import android.view.View;import android.content.Context;import android.graphics.Canvas;import android.graphics.Color;import android.graphics.Paint;import android.util.AttributeSet;import android.os.BatteryManager;public class BatteryView extends View{    public BatteryView(Context context){        super(context);        init();    }    public BatteryView(Context context, AttributeSet attrs){        super(context,attrs);        init();    }    public BatteryView(Context context, AttributeSet attrs, int defaultStyles){        super(context, attrs, defaultStyles);        init();    }    public void init(){    }    protected void onMeasure(int widthSpec, int heightSpec){        int measuredWidth = MeasureSpec.getSize(widthSpec);        int measuredHeight = MeasureSpec.getSize(heightSpec);        setMeasuredDimension( measuredWidth, measuredHeight);    }    @Override    protected void onDraw(Canvas canvas){        Paint mTextPaint =new Paint();        mTextPaint.setColor(Color.GREEN);        mTextPaint.setTextSize(40);        int height = getMeasuredHeight();        int width = getMeasuredWidth();        String displayText = ""Widget"";        float textWidth = mTextPaint.measureText(displayText);        int px= width/2;        int py=height/2;        canvas.drawText(displayText, px-textWidth/2, py, mTextPaint);        invalidate();    }}</code></pre><p>My constructors are perfect but I am not sure about that xml.</p>","619090","","","","","2011-02-17 02:26:33","Android AppWidget: Error inflating Class","<android>","1","1","","",""
"5012978","1","5114080","","2011-02-16 05:55:55","0","153","<p>From this link <a href=""http://code.google.com/intl/en/apis/maps/articles/android_v3.html#why"" rel=""nofollow"">http://code.google.com/intl/en/apis/maps/articles/android_v3.html#why</a></p><p>i have used JavaScriptInterface .In the above link the getLatitude() and getLongitude() functions are returning double value to the map but using the same concept when i try to return a string value to my own map that takes string value to achieve  some task, i am unable to receive  string value there.. </p><p>this is  so weird bcz  i just want to pass string value instead of double, but this is not working...her is my complete code  <a href=""http://stackoverflow.com/questions/4989811/javascriptinterface-is-not-working-in-android"">JavaScriptInterface() is not working in android.</a>any suggestions would be very much appreciated...</p><p>thanks,</p>","505580","","","","","2011-02-25 05:50:41","Unable to pass string value to my html google map","<javascript><android>","2","0","","",""
"5012979","1","5801840","","2011-02-16 05:55:59","0","141","<p>How to fetch data from android in EditText preferences &amp; save it to another variable?</p>","","user619098","493193","","2011-02-16 06:33:31","2011-04-27 09:18:08","Error in Preferences","<android>","2","2","0","",""
"5013040","1","5013113","","2011-02-16 06:05:15","0","483","<p>I am making an app that when a button is clicked, it will grab an image from a URL or server and display it.</p><p>EXAMPLE</p><p>App1</p><p>Button1 = clicked</p><p>Then Image from server or URL will be displayed on screen in app.</p>","583952","","","","","2011-02-16 06:16:57","Help making an app that will display an image that is from a server?","<android>","2","0","0","",""
"5013085","1","","","2011-02-16 06:11:42","3","2192","<p>I am working on an Android application. How can I get Phone wallpaper in Android? Please help me. Give me the sample code example.</p>","533787","","366904","","2011-02-16 06:49:57","2013-12-31 12:57:44","How can I get Phone wallpaper in Android?","<android>","4","3","","",""
"5013090","1","5013130","","2011-02-16 06:11:57","0","1732","<p>I'm trying to get live cricket scores from a cricket site.Part of the HTML source is as follows.</p><pre><code>&lt;html xmlns=""http://www.w3.org/1999/xhtml"" xmlns:fb=""http://www.facebook.com/2008/fbml"" xmlns:og=""http://opengraphprotocol.org/schema/"" xmlns:fb=""http://developers.facebook.com/schema/""&gt;&lt;head&gt; &lt;meta name=""google-site-verification"" content=""ZxdgH3XglRg0Bsy-Ho2RnO3EE4nRs53FloLS6fkt_nc"" /&gt; &lt;title&gt;Eng 132/4 (29.3 ov, MJ Prior 27*, IJL Trott 53*, JM Davison 0/10) | Live Scorecard | ESPN Cricinfo&lt;/title&gt;  &lt;meta http-equiv=""Content-Type"" content=""text/html;charset=utf-8"" /&gt; &lt;meta name=""keywords"" content=""Canada v England, Live cricket score, Khan Shaheb Osman Ali Stadium, Fatullah, Fatullah, Other one-day/limited-overs matches"" /&gt; &lt;meta name=""description"" content=""Live cricket score and commentary for ICC World Cup Warm-up Matches, Canada v England at Fatullah, Feb 16, 2011"" /&gt;</code></pre><p>My point of interest is the <code>&lt;title&gt;</code> tag. How do I parse through the file and retrieveinfo on the title tag?</p><p>P.S. I get the above HTML link from an XML file.Am planning to use the code in the following link to parse through the XML fileand retrieve the T</p><p><a href=""http://www.ibm.com/developerworks/opensource/library/x-android/"" rel=""nofollow"">http://www.ibm.com/developerworks/opensource/library/x-android/</a></p><p>Regards,Sam</p>","605040","","71724","","2011-02-16 08:01:43","2011-02-16 08:01:43","Android : How to Parse HTML tags and retrieve information from an HTML page","<android><html><xml><parsing><rss>","1","0","1","",""
"5013163","1","5023215","","2011-02-16 06:24:51","14","3477","<p>The documentation on this is extremely poor. I understand that ProGuard can be enabled by manually editing ""default.properties"" in the project's rot directory. And all the settings go into the ""proguard.cfg"" file in the same place, but I'd like to know which version of ProGuard is being used (I'm using Eclise Indigo). I would also like to be able to upgrade it to the latest versions whenever the are released. But I can't find any reference on how to do it.</p>","496854","","","","","2011-12-08 12:41:35","How can I check/upgrade Proguard version whn using it in Eclipse for Android development?","<android><eclipse><obfuscation><proguard>","2","0","4","",""
"5013176","1","5013231","","2011-02-16 06:26:32","0","1715","<p>is there any good sample code on this? (displaying photo thumbnails on map)</p><p>Below is the code that i've tried out by myself, but it just doesn't work:If the thumbnail path is found, set it as marker of the overlayitem, else use default Marker.</p><p>The problem is that only items with defaultMarker are shown. And over 100+ photos, only 1 photo's thumbnail path is found, it seems that the way I retrieve thumbnail is somehow not correct.</p><p>If you don't mind, it is quite verbose. Thanks!</p><pre><code>Drawable drawable = this.getResources().getDrawable(R.drawable.androidmarker);    PhotoOverlay itemizedoverlay = new PhotoOverlay(drawable, this);    String selection = MediaStore.Images.ImageColumns.LATITUDE + "" is not null"";    Cursor c = this.managedQuery(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, null, selection, null, null);    while ( c.moveToNext()){        int longitude = (int) (c.getDouble(c.getColumnIndex(MediaStore.Images.ImageColumns.LONGITUDE)) * 1e6);        int latitude = (int) ( c.getDouble(c.getColumnIndex(MediaStore.Images.ImageColumns.LATITUDE))* 1e6);        String title = c.getString(c.getColumnIndex(MediaStore.Images.ImageColumns.TITLE));        String description = c.getString(c.getColumnIndex(MediaStore.Images.ImageColumns.DESCRIPTION));        long imgId = c.getLong(c.getColumnIndex(MediaStore.Images.ImageColumns._ID));        long thumbId = c.getLong(c.getColumnIndex(MediaStore.Images.ImageColumns.MINI_THUMB_MAGIC));        GeoPoint point = new GeoPoint(latitude, longitude);        OverlayItem overlayitem = new OverlayItem(point, title, description);        //Cursor ct = Thumbnails.queryMiniThumbnail(this.getContentResolver(), imgId, Thumbnails.MICRO_KIND, null);        String[] args =  new String[]{String.valueOf(thumbId)};        Cursor ct = managedQuery(Thumbnails.EXTERNAL_CONTENT_URI, null, Thumbnails._ID + ""= ?"", args, null);        if( ct.moveToFirst() ){            String path = ct.getString(ct.getColumnIndex(Thumbnails.DATA));            BitmapDrawable d = new BitmapDrawable(this.getResources(), path);            itemizedoverlay.addOverlay(overlayitem, d);        } else {            itemizedoverlay.addOverlay(overlayitem, null);        }    }    c.close();    overlays.add(itemizedoverlay);</code></pre><p>PhotoOverlay.addItem()</p><pre><code>public void addOverlay(OverlayItem i, Drawable marker){    if( marker != null ){        i.setMarker(boundCenterBottom(marker));    }    mOverlays.add(i);    populate();}</code></pre>","211071","","","","","2011-02-16 06:32:27","displaying photo thumbnails on map","<android><map>","1","0","2","",""
"5013190","1","","","2011-02-16 06:27:58","0","128","<p>i'd like to aks, if someone were to create a web site, let's say for example: a site for storing information on an online database, what would be the recommended web service (SOAP or REST) and format to use (XML or JSON) if there will be server - client transactions/interactions and a client application will also be used in an android platform?</p><p>also, i'm curious. does anyone know if google uses REST web service and JSON format for the GMAIL in android?</p><p>thanks</p><p>ads</p>","619135","","619135","","2011-02-16 08:11:03","2011-02-17 07:08:20","what web service and format to use","<android><json><rest><service>","1","1","","",""
"5013251","1","5013272","","2011-02-16 06:35:07","0","130","<p>Is it possible to make the application password protected in Android mobile? ie; if a user tries to install an unauthorized application, we shud prevent that. for tht we will have to make some applications password protected. like ""LockMe"" in symbian.</p>","","Nimit ","","","","2011-02-16 06:39:47","Android Security Application","<android>","1","0","","",""
"5013254","1","5013504","","2011-02-16 06:35:36","1","348","<p>What is a network tickle?  And how to I go about sending one? </p>","374402","","308851","","2011-02-16 07:09:18","2011-02-16 07:09:52","What is a network tickle? And how to I go about sending one?","<c++><android><sockets><networking><android-c2dm>","1","5","","",""
"5013326","1","","","2011-02-16 06:48:17","0","4975","<p>i want Write a simple Android program to read and write details from SQL Database on the Android Device</p><p>how can i do this ?</p><p>thank you </p>","609433","","457982","","2011-02-16 07:14:59","2012-05-15 05:50:32","Android program to read and write details from SQLite Database","<android><database>","3","1","3","2013-05-21 11:03:54",""
"5013373","1","","","2011-02-16 06:54:05","6","18676","<p>There is a relevant question, but I could not get the answer clearly.</p><p>I would like to POST a short xml code</p><pre><code>&lt;aaaLogin inName=""admin"" inPassword=""admin123""/&gt;</code></pre><p>to a specific URL address over HTTP. The Web service will send me back a XML code. The important part is that I will parse the received XML, and I want to store that as a file.</p><pre><code>    // Create a new HttpClient and Post Header      HttpClient httpclient = new DefaultHttpClient();      HttpPost httppost = new HttpPost(""http://192.168.192.131/""); //URL address    StringEntity se = new StringEntity(""&lt;aaaLogin inName=\""admin\"" inPassword=\""admin123\""/&gt;"",HTTP.UTF_8); //XML as a string    se.setContentType(""text/xml""); //declare it as XML    httppost.setHeader(""Content-Type"",""application/soap+xml;charset=UTF-8"");    httppost.setEntity(se);    BasicHttpResponse httpResponse = (BasicHttpResponse) httpclient .execute(httppost);    tvData.setText(httpResponse.getStatusLine().toString()); //text view is expected to print the response</code></pre><p>there is something wrong with receiving the response. Besides, I did not write anything to save the received XML as a file. Can someone write a code snippet?</p>","619096","","","","","2014-01-05 15:38:55","Android, send and receive XML via HTTP POST method","<android><xml><http><http-post>","3","0","5","",""
"5013380","1","5013475","","2011-02-16 06:54:49","1","5440","<p>I'm trying to call .notifyDataSetChange() on a SimpleCursorAdapter displayed in a ListView from an XML-parsing non-UI thread and can't for the life of me figure out how. I've searched all over and all I've found are articles that talk about refreshing from within the ListView itself, which I'm not doing. I can't figure out a way to pass in the adapter or get it from the parent or whatever I need to do to call a method on it from another thread.</p><p>The ListView will update fine the next time I launch the activity, but I want it to refresh as soon as the XML parsing is done so that the user will see the new data immediately.</p><p>The answer's probably simple; it's just eluding me. Thanks in advance for any help!</p><p>Here's my code:</p><pre><code>public class DirectoryListActivity extends DirectoryActivity {public final Handler mHandler = new Handler();@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.directory_list);    // Populate the ListView    SQLiteQueryBuilder queryBuilder = new SQLiteQueryBuilder();    queryBuilder.setTables(        directoryPeople.PEOPLE_TABLE    );    String asColumnsToReturn[] = {             //snip    };    mCursor = queryBuilder.query(mDB, asColumnsToReturn, null, null,            null, null, directoryPeople.DEFAULT_SORT_ORDER);    startManagingCursor(mCursor);// HERE'S THE ADAPTER    SimpleCursorAdapter adapter = new SimpleCursorAdapter(this,            R.layout.directory_people_item, mCursor,            new String[]{                //snip            new int[]{                //snip    );     ListView av = (ListView)findViewById(R.id.listPeople);    av.setAdapter(adapter);    //Perform sync in background    startXMLParseThread();}    public void startXMLParseThread() {    new Thread () {        boolean success = false;        public void run() {            try {                // XML-Parsing and Table-Updating code            } catch (Exception e) {                success = false;            }            mHandler.post(new Runnable() {                public void run() {                    TextView txtUpdateStatus = (TextView)findViewById(R.id.txtUpdateStatus);                    if (success) {                        txtUpdateStatus.setText(R.string.synced);                    } else {                        txtUpdateStatus.setText(R.string.sync_failed);                    }                    adapter.notifyDataSetChanged(); // ECLIPSE HATES                }            });        }    }.start();    }}}</code></pre>","560089","","560089","","2011-03-25 06:29:26","2011-03-25 06:29:26","Refresh a SimpleCursorAdapter after performing work on a non-UI thread","<android>","2","0","","",""
"5013434","1","5028326","","2011-02-16 07:02:09","0","7347","<p>I am trying to create a table from a 2-D array of strings. However, I suck in creating views in code, so for some reason my image is never visible and my textviews won't break into multilines, instead they chop of the text.</p><p>Also, I put id on every textview in my code, when someone click the textview, I was hoping I could use that ID to identify whick row was clicked. Unfortunately that wasn't the case.</p><p>Are there any good ways to identify correct row?</p><p>Regards</p><pre><code>      for (int current=0; current&lt;cityArr.length; current++) {      TableRow tr = new TableRow(this);      tr.setId(100+current);      tr.setLayoutParams(new LayoutParams(              LayoutParams.FILL_PARENT,              LayoutParams.WRAP_CONTENT));         TextView labelTV = new TextView(this);      labelTV.setId(current);      labelTV.setText(cityArr[current][0]);      labelTV.setTextColor(Color.BLACK);      labelTV.setLayoutParams(new LayoutParams(              LayoutParams.FILL_PARENT,              LayoutParams.WRAP_CONTENT));      tr.addView(labelTV);      ImageView mapView = new ImageView(this);      mapView.setImageResource(R.drawable.list_icon_map);      mapView.setLayoutParams(new FrameLayout.LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.WRAP_CONTENT, 5));      tr.addView(mapView);      tlcity.addView(tr, new TableLayout.LayoutParams(              LayoutParams.FILL_PARENT,              LayoutParams.WRAP_CONTENT));  }</code></pre>","498112","","498112","","2011-02-16 12:16:34","2012-11-17 22:02:37","creating dynamic table in android","<android><tablelayout><tablerow><layoutparams>","2","0","","",""
"5013444","1","","","2011-02-16 07:03:10","5","14343","<p>This is my code:</p><pre><code>package com.example.userpage;import android.app.Activity;import android.content.Intent;import android.os.Bundle;import android.view.View;import android.widget.Button;import android.widget.EditText;import android.widget.TextView;public class UserPage extends Activity {     String tv,tv1;    EditText name,pass;     TextView x,y;    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);         Button button = (Button) findViewById(R.id.widget44);        button.setOnClickListener(new View.OnClickListener() {            public void onClick(View v) {                name.setText("" "");                pass.setText("" "");            }        });        x = (TextView) findViewById(R.id.widget46);        y = (TextView) findViewById(R.id.widget47);         name = (EditText)findViewById(R.id.widget41);         pass = (EditText)findViewById(R.id.widget42);        Button button1 = (Button) findViewById(R.id.widget45);        button1.setOnClickListener(new View.OnClickListener() {            public void onClick(View v) {              tv= name.getText().toString();               tv1 = pass.getText().toString();               x.setText(tv);               y.setText(tv1);           }        });    }}</code></pre><p>And this is my log cat:</p><pre><code>02-16 12:28:32.648: ERROR/AndroidRuntime(1039): FATAL EXCEPTION: main02-16 12:28:32.648: ERROR/AndroidRuntime(1039): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.userpage/com.example.userpage.UserPage}: java.lang.ClassCastException: android.widget.TextView02-16 12:28:32.648: ERROR/AndroidRuntime(1039):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)02-16 12:28:32.648: ERROR/AndroidRuntime(1039):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)02-16 12:28:32.648: ERROR/AndroidRuntime(1039):     at android.app.ActivityThread.access$2300(ActivityThread.java:125)02-16 12:28:32.648: ERROR/AndroidRuntime(1039):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)02-16 12:28:32.648: ERROR/AndroidRuntime(1039):     at android.os.Handler.dispatchMessage(Handler.java:99)02-16 12:28:32.648: ERROR/AndroidRuntime(1039):     at android.os.Looper.loop(Looper.java:123)02-16 12:28:32.648: ERROR/AndroidRuntime(1039):     at android.app.ActivityThread.main(ActivityThread.java:4627)02-16 12:28:32.648: ERROR/AndroidRuntime(1039):     at java.lang.reflect.Method.invokeNative(Native Method)02-16 12:28:32.648: ERROR/AndroidRuntime(1039):     at java.lang.reflect.Method.invoke(Method.java:521)02-16 12:28:32.648: ERROR/AndroidRuntime(1039):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)02-16 12:28:32.648: ERROR/AndroidRuntime(1039):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)02-16 12:28:32.648: ERROR/AndroidRuntime(1039):     at dalvik.system.NativeStart.main(Native Method)02-16 12:28:32.648: ERROR/AndroidRuntime(1039): Caused by: java.lang.ClassCastException: android.widget.TextView02-16 12:28:32.648: ERROR/AndroidRuntime(1039):     at com.example.userpage.UserPage.onCreate(UserPage.java:34)02-16 12:28:32.648: ERROR/AndroidRuntime(1039):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)02-16 12:28:32.648: ERROR/AndroidRuntime(1039):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)02-16 12:28:32.648: ERROR/AndroidRuntime(1039):     ... 11 more02-16 12:28:32.698: WARN/ActivityManager(67):   Force finishing activity com.example.userpage/.UserPage02-16 12:28:32.967: DEBUG/dalvikvm(292): GC_EXPLICIT freed 46 objects / 2240 bytes in 6840ms02-16 12:28:33.247: WARN/ActivityManager(67): Activity pause timeout for HistoryRecord{43ee7b70 com.example.userpage/.UserPage}02-16 12:28:36.947: INFO/Process(1039): Sending signal. PID: 1039 SIG: 902-16 12:28:37.017: INFO/ActivityManager(67): Process com.example.userpage (pid 1039) has died.02-16 12:28:37.128: WARN/InputManagerService(67): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@43e872f802-16 12:28:42.087: DEBUG/dalvikvm(176): GC_EXPLICIT freed 156 objects / 11488 bytes in 145ms02-16 12:28:45.391: WARN/ActivityManager(67): Activity destroy timeout for HistoryRecord{43ee7b70 com.example.userpage/.UserPage}02-16 12:28:47.177: DEBUG/SntpClient(67): request time failed: java.net.SocketException: Address family not supported by protocol</code></pre>","617356","","617356","","2011-02-16 07:32:07","2013-04-12 07:10:53","I am having a problem of class cast exception. Can anyone please help me out?","<android>","6","6","","",""
"5013482","1","5013535","","2011-02-16 07:07:38","1","835","<p>After going through few articles about performance, Not able to get this statement exactly.</p><p>""When a Drawable is attached to a view, the view is set as a callback on the drawable""<br>Soln: ""Setting the stored drawables’ callbacks to null when the activity is destroyed.""</p><p>What does that mean, e.g.</p><p>In my app , I initialize an imageButton in onCreate() like this,   </p><pre><code>imgButton= (ImageButton) findViewById(R.id.imagebtn);</code></pre><p>At later stage, I get an image from an url, get the stream and convert that to drawable, and  set image btn like this,</p><pre><code>imgButton.setImageDrawable(drawable);</code></pre><p>According to the above statement, when I am exiting my app, say in onDestroy()I have to set stored drawables’ callbacks to null, not able to understand this part !       In this simple case what I have to set as null ?</p><p>I am using Android 2.2 Froyo, whether this technique is required, or not necessary.</p>","207646","","71724","","2011-02-16 07:21:47","2011-02-16 07:39:32","Understanding memory leak in Android app","<android><performance>","2","0","","",""
"5013525","1","5013830","","2011-02-16 07:11:31","0","176","<p>Game engines like Quack, OGRE3D, JMonkeyEngine and Blender are used for PC games but how hard is to use it for Android games?</p>","190451","","","","","2011-02-16 07:52:07","using General game engines on Android, is it possible?","<android><graphics><game-engine>","1","2","","",""
"5013632","1","5013659","","2011-02-16 07:26:13","0","1600","<p>I want to create a string array in string.xml in values folder for my android application. How to do this.. can anybody help..</p>","489762","","1471203","","2013-01-09 10:04:26","2013-01-09 10:04:26","string array in string.xml in Android","<android>","1","0","","",""
"5013651","1","5013785","","2011-02-16 07:27:37","2","6485","<pre><code>String x=""Hello World"";String y=""You Rock!!!"";Intent sendIntent = new Intent(Intent.ACTION_VIEW);sendIntent.putExtra(""sms_body"", x); sendIntent.putExtra(""sms_body"", y); sendIntent.setType(""vnd.android-dir/mms-sms"");startActivity(sendIntent);</code></pre><p>I'm trying to send a multiple message bodies via SMS, but only ""You Rock!!!"" is displayed. What i want to do is be able to display multiple messages and have it pre-formatted (on different lines).</p><p>So for example...</p><pre><code>Hello WorldYou Rock!!!</code></pre>","359151","","2441810","","2013-06-01 02:23:47","2013-06-01 02:23:47","send SMS Intent in Android","<android><android-intent><sms><android-implicit-intent>","2","0","0","",""
"5013749","1","","","2011-02-16 07:42:14","0","3154","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/1709166/android-listview-elements-with-multiple-clickable-buttons"">Android: ListView elements with multiple clickable buttons</a>  </p></blockquote><p>how to do click event for the button inside listview in android.plz help me.if anybody know plz provide the example code</p>","533677","","","","","2012-05-20 19:34:27","click event for the button inside listview in android","<android>","0","2","","2012-05-20 21:18:31",""
"5013837","1","","","2011-02-16 07:53:07","0","2334","<p>I am at the beginning stage on developing an application, which needs scan the wifi APs per second. The scannin part works well on one HTC hero, however, it takes 6 seconds for my galaxy tab to finish one scan. I write a very simple program, scanning wifi continously and note down how long it takes for one scan. (from wifi.startScan() to receiver get results). In HTC phone, it's 500 ms, but in Samsung tab, it takes 6s on average. I wonder if anyone can help me to solve this problem. Is it because Samsung changed the os or because the hardware's problem?</p><p>Thanks very very very veyry very very very much for your help!</p><p>the program is as follows:</p><p>import java.util.Date;import java.util.List;</p><pre><code>import android.app.Activity;import android.content.BroadcastReceiver;import android.content.Context;import android.content.Intent;import android.content.IntentFilter;import android.net.wifi.ScanResult;import android.net.wifi.WifiManager;import android.os.Bundle;import android.util.Log;import android.widget.TextView;public class wifiScan extends Activity {    private class WifiReceiver extends BroadcastReceiver{        @Override      public void onReceive(Context c, Intent intent) {        List&lt;ScanResult&gt; results = wifi.getScanResults();        Date tempDate=new Date();        String info=testNumber+"" ""+(tempDate.getTime()-testDate.getTime())+"" ""+results.size();        Log.i(""wifiScan"", info);            wifiText.setText(info);        testNumber++;        testDate=new Date();        wifi.startScan();        }    }    private TextView wifiText;    private WifiManager wifi;    private WifiReceiver receiver;    private Date testDate;    private static int testNumber=0;    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        testNumber=0;        wifiText = (TextView) findViewById(R.id.wifiText);        receiver=new WifiReceiver();        registerReceiver(receiver, new IntentFilter(WifiManager.SCAN_RESULTS_AVAILABLE_ACTION));        wifi =(WifiManager)getSystemService(Context.WIFI_SERVICE);        if(!wifi.isWifiEnabled()){            wifi.setWifiEnabled(true);          }        startScan();    }    @Override    public void onStop(){        super.onStop();        finish();    }    public void startScan(){        testDate=new Date();        wifi.startScan();    }}</code></pre><p>The log info  is as follows:</p><pre><code>02-16 15:42:22.600: WARN/PowerManagerService(2484): Timer 0x1-&gt;0x0|0x102-16 15:42:22.600: ERROR/PowerManagerService(2484): CurLock p:3 mPS:102-16 15:42:22.600: WARN/PowerManagerService(2484): type=SCREEN_DIM_WAKE_LOCK           'StayOnWhilePluggedIn Screen Dim' active (minState=1) activeT=125722802-16 15:42:22.607: WARN/PowerManagerService(2484): type=PARTIAL_WAKE_LOCK              'StayOnWhilePluggedIn Partial' active (minState=0) activeT=125722802-16 15:42:24.005: DEBUG/dalvikvm(3374): GC_EXPLICIT freed 790 objects / 55536 bytes in 143ms02-16 15:42:24.775: DEBUG/AndroidRuntime(4056): &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;02-16 15:42:24.775: DEBUG/AndroidRuntime(4056): CheckJNI is OFF02-16 15:42:24.784: DEBUG/AndroidRuntime(4056): setted country_code = SINGAPORE02-16 15:42:24.784: DEBUG/AndroidRuntime(4056): setted sales_code = XSP02-16 15:42:24.784: DEBUG/AndroidRuntime(4056): found sales_code tag = &lt;XSP&gt;, &lt;/XSP&gt; 02-16 15:42:24.792: DEBUG/dalvikvm(4056): creating instr width table02-16 15:42:24.822: DEBUG/AndroidRuntime(4056): --- registering native functions ---02-16 15:42:24.904: DEBUG/LibQmg_native(4056): register_android_app_LibQmg02-16 15:42:24.986: DEBUG/AndroidRuntime(4056): Shutting down VM02-16 15:42:24.986: DEBUG/dalvikvm(4056): Debugger has detached; object registry had 1 entries02-16 15:42:24.993: INFO/AndroidRuntime(4056): NOTE: attach of thread 'Binder Thread #2' failed02-16 15:42:25.169: DEBUG/AndroidRuntime(4064): &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;02-16 15:42:25.169: DEBUG/AndroidRuntime(4064): CheckJNI is OFF02-16 15:42:25.176: DEBUG/AndroidRuntime(4064): setted country_code = SINGAPORE02-16 15:42:25.176: DEBUG/AndroidRuntime(4064): setted sales_code = XSP02-16 15:42:25.176: DEBUG/AndroidRuntime(4064): found sales_code tag = &lt;XSP&gt;, &lt;/XSP&gt; 02-16 15:42:25.184: DEBUG/dalvikvm(4064): creating instr width table02-16 15:42:25.212: DEBUG/AndroidRuntime(4064): --- registering native functions ---02-16 15:42:25.286: DEBUG/LibQmg_native(4064): register_android_app_LibQmg02-16 15:42:25.368: INFO/ActivityManager(2484): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=nus.master.test/.wifiScan }02-16 15:42:25.376: INFO/Launcher(3211): onPause()02-16 15:42:25.411: DEBUG/AndroidRuntime(4064): Shutting down VM02-16 15:42:25.411: DEBUG/dalvikvm(4064): Debugger has detached; object registry had 1 entries02-16 15:42:25.419: INFO/AndroidRuntime(4064): NOTE: attach of thread 'Binder Thread #2' failed02-16 15:42:25.450: INFO/wpa_supplicant(3810): CTRL-EVENT-STATE-CHANGE id=-1 state=2 BSSID=00:00:00:00:00:0002-16 15:42:25.450: INFO/WifiMonitor(2484): Event [CTRL-EVENT-STATE-CHANGE id=-1 state=2 BSSID=00:00:00:00:00:00]02-16 15:42:25.454: VERBOSE/WifiStateTracker(2484): Changing supplicant state: INACTIVE ==&gt; SCANNING02-16 15:42:25.454: DEBUG/NetworkStateTracker(2484): setDetailed state, old =IDLE and new state=SCANNING02-16 15:42:25.454: DEBUG/ConnectivityService(2484): Dropping ConnectivityChange for WIFI: DISCONNECTED/SCANNING02-16 15:42:25.611: INFO/Launcher(3211): onWindowFocusChanged(false)02-16 15:42:30.724: DEBUG/dalvikvm(3200): GC_EXPLICIT freed 4001 objects / 233800 bytes in 118ms02-16 15:42:30.892: INFO/WifiMonitor(2484): Event [ SCAN-RESULTS ]02-16 15:42:30.892: INFO/wpa_supplicant(3810): WPS-AP-AVAILABLE 02-16 15:42:30.892: INFO/wpa_supplicant(3810): CTRL-EVENT-NO-CONNECTION02-16 15:42:30.896: INFO/wpa_supplicant(3810): CTRL-EVENT-STATE-CHANGE id=-1 state=1 BSSID=00:00:00:00:00:0002-16 15:42:30.900: INFO/WifiMonitor(2484): Event [WPS-AP-AVAILABLE ]02-16 15:42:30.900: INFO/WifiMonitor(2484): Event [CTRL-EVENT-NO-CONNECTION]02-16 15:42:30.900: INFO/WifiMonitor(2484): Event [CTRL-EVENT-STATE-CHANGE id=-1 state=1 BSSID=00:00:00:00:00:00]02-16 15:42:30.947: INFO/wpa_supplicant(3810): SAN_RESULTS : [34] 02-16 15:42:30.958: INFO/wpa_supplicant(3810): SAN_RESULTS : [34] 02-16 15:42:30.970: VERBOSE/WifiStateTracker(2484): Changing supplicant state: SCANNING ==&gt; INACTIVE02-16 15:42:30.970: DEBUG/NetworkStateTracker(2484): setDetailed state, old =SCANNING and new state=IDLE02-16 15:42:30.970: DEBUG/ConnectivityService(2484): Dropping ConnectivityChange for WIFI: DISCONNECTED/IDLE02-16 15:42:31.009: INFO/NetworkStatusReceiver(2935): action: android.net.wifi.SHOW_AP_LIST_DIALOG02-16 15:42:31.021: ERROR/WifiManager(2935): showApDialog02-16 15:42:31.025: INFO/WifiService(2484): isShowingAccessPointListDialog():false02-16 15:42:31.029: INFO/WifiService(2484): setShowAccessPointListDialog():false02-16 15:42:31.060: INFO/wifiScan(4009): 0 5609 2102-16 15:42:31.064: INFO/wpa_supplicant(3810): CTRL-EVENT-STATE-CHANGE id=-1 state=2 BSSID=00:00:00:00:00:0002-16 15:42:31.064: INFO/WifiMonitor(2484): Event [CTRL-EVENT-STATE-CHANGE id=-1 state=2 BSSID=00:00:00:00:00:00]02-16 15:42:31.068: VERBOSE/WifiStateTracker(2484): Changing supplicant state: INACTIVE ==&gt; SCANNING02-16 15:42:31.068: DEBUG/NetworkStateTracker(2484): setDetailed state, old =IDLE and new state=SCANNING02-16 15:42:31.068: DEBUG/ConnectivityService(2484): Dropping ConnectivityChange for WIFI: DISCONNECTED/SCANNING02-16 15:42:36.536: INFO/WifiMonitor(2484): Event [ SCAN-RESULTS ]02-16 15:42:36.536: INFO/wpa_supplicant(3810): WPS-AP-AVAILABLE 02-16 15:42:36.536: INFO/wpa_supplicant(3810): CTRL-EVENT-NO-CONNECTION02-16 15:42:36.540: INFO/wpa_supplicant(3810): CTRL-EVENT-STATE-CHANGE id=-1 state=1 BSSID=00:00:00:00:00:0002-16 15:42:36.544: INFO/WifiMonitor(2484): Event [WPS-AP-AVAILABLE ]02-16 15:42:36.544: INFO/WifiMonitor(2484): Event [CTRL-EVENT-NO-CONNECTION]02-16 15:42:36.544: INFO/WifiMonitor(2484): Event [CTRL-EVENT-STATE-CHANGE id=-1 state=1 BSSID=00:00:00:00:00:00]02-16 15:42:36.587: INFO/wpa_supplicant(3810): SAN_RESULTS : [35] 02-16 15:42:36.611: INFO/wpa_supplicant(3810): SAN_RESULTS : [35] 02-16 15:42:36.634: VERBOSE/WifiStateTracker(2484): Changing supplicant state: SCANNING ==&gt; INACTIVE02-16 15:42:36.634: DEBUG/NetworkStateTracker(2484): setDetailed state, old =SCANNING and new state=IDLE02-16 15:42:36.661: INFO/NetworkStatusReceiver(2935): action: android.net.wifi.SHOW_AP_LIST_DIALOG02-16 15:42:36.665: DEBUG/ConnectivityService(2484): Dropping ConnectivityChange for WIFI: DISCONNECTED/IDLE02-16 15:42:36.665: ERROR/WifiManager(2935): showApDialog02-16 15:42:36.669: INFO/WifiService(2484): isShowingAccessPointListDialog():false02-16 15:42:36.669: INFO/WifiService(2484): setShowAccessPointListDialog():false02-16 15:42:36.724: INFO/wifiScan(4009): 1 5662 2202-16 15:42:36.728: INFO/wpa_supplicant(3810): CTRL-EVENT-STATE-CHANGE id=-1 state=2 BSSID=00:00:00:00:00:0002-16 15:42:36.728: INFO/WifiMonitor(2484): Event [CTRL-EVENT-STATE-CHANGE id=-1 state=2 BSSID=00:00:00:00:00:00]02-16 15:42:36.732: VERBOSE/WifiStateTracker(2484): Changing supplicant state: INACTIVE ==&gt; SCANNING02-16 15:42:36.732: DEBUG/NetworkStateTracker(2484): setDetailed state, old =IDLE and new state=SCANNING02-16 15:42:36.736: DEBUG/ConnectivityService(2484): Dropping ConnectivityChange for WIFI: DISCONNECTED/SCANNING02-16 15:42:41.247: DEBUG/BatteryService(2484): update start02-16 15:42:41.275: DEBUG/BatteryService(2484): updateBattery level:83 scale:100 status:4 health:2 present:true voltage: 4051 temperature: 330 technology: Li-ion AC powered:false USB powered:true icon:1730242102-16 15:42:41.314: DEBUG/CorePlayerService(3270): mSystemReceiver:onReceive(action=android.intent.action.BATTERY_CHANGED) is called02-16 15:42:41.357: DEBUG/WifiService(2484): ACTION_BATTERY_CHANGED pluggedType: 202-16 15:42:42.177: INFO/WifiMonitor(2484): Event [ SCAN-RESULTS ]02-16 15:42:42.177: INFO/wpa_supplicant(3810): WPS-AP-AVAILABLE 02-16 15:42:42.181: INFO/wpa_supplicant(3810): CTRL-EVENT-NO-CONNECTION02-16 15:42:42.181: INFO/wpa_supplicant(3810): CTRL-EVENT-STATE-CHANGE id=-1 state=1 BSSID=00:00:00:00:00:0002-16 15:42:42.185: INFO/WifiMonitor(2484): Event [WPS-AP-AVAILABLE ]02-16 15:42:42.189: INFO/WifiMonitor(2484): Event [CTRL-EVENT-NO-CONNECTION]02-16 15:42:42.193: INFO/WifiMonitor(2484): Event [CTRL-EVENT-STATE-CHANGE id=-1 state=1 BSSID=00:00:00:00:00:00]02-16 15:42:42.216: INFO/wpa_supplicant(3810): SAN_RESULTS : [36] 02-16 15:42:42.240: INFO/wpa_supplicant(3810): SAN_RESULTS : [36] 02-16 15:42:42.240: VERBOSE/WifiStateTracker(2484): Changing supplicant state: SCANNING ==&gt; INACTIVE02-16 15:42:42.240: DEBUG/NetworkStateTracker(2484): setDetailed state, old =SCANNING and new state=IDLE02-16 15:42:42.247: DEBUG/ConnectivityService(2484): Dropping ConnectivityChange for WIFI: DISCONNECTED/IDLE02-16 15:42:42.271: INFO/NetworkStatusReceiver(2935): action: android.net.wifi.SHOW_AP_LIST_DIALOG02-16 15:42:42.271: ERROR/WifiManager(2935): showApDialog02-16 15:42:42.275: INFO/WifiService(2484): isShowingAccessPointListDialog():false02-16 15:42:42.282: INFO/WifiService(2484): setShowAccessPointListDialog():false02-16 15:42:42.314: INFO/wifiScan(4009): 2 5588 2102-16 15:42:42.322: INFO/wpa_supplicant(3810): CTRL-EVENT-STATE-CHANGE id=-1 state=2 BSSID=00:00:00:00:00:0002-16 15:42:42.322: INFO/WifiMonitor(2484): Event [CTRL-EVENT-STATE-CHANGE id=-1 state=2 BSSID=00:00:00:00:00:00]02-16 15:42:42.326: VERBOSE/WifiStateTracker(2484): Changing supplicant state: INACTIVE ==&gt; SCANNING02-16 15:42:42.329: DEBUG/NetworkStateTracker(2484): setDetailed state, old =IDLE and new state=SCANNING02-16 15:42:42.329: DEBUG/ConnectivityService(2484): Dropping ConnectivityChange for WIFI: DISCONNECTED/SCANNING02-16 15:42:43.255: DEBUG/BatteryService(2484): update start02-16 15:42:43.294: DEBUG/BatteryService(2484): updateBattery level:83 scale:100 status:4 health:2 present:true voltage: 4080 temperature: 320 technology: Li-ion AC powered:false USB powered:true icon:1730242102-16 15:42:43.384: DEBUG/WifiService(2484): ACTION_BATTERY_CHANGED pluggedType: 202-16 15:42:43.388: DEBUG/CorePlayerService(3270): mSystemReceiver:onReceive(action=android.intent.action.BATTERY_CHANGED) is called02-16 15:42:47.783: INFO/WifiMonitor(2484): Event [ SCAN-RESULTS ]02-16 15:42:47.786: INFO/wpa_supplicant(3810): WPS-AP-AVAILABLE 02-16 15:42:47.786: INFO/wpa_supplicant(3810): CTRL-EVENT-NO-CONNECTION02-16 15:42:47.786: INFO/wpa_supplicant(3810): CTRL-EVENT-STATE-CHANGE id=-1 state=1 BSSID=00:00:00:00:00:0002-16 15:42:47.798: INFO/WifiMonitor(2484): Event [WPS-AP-AVAILABLE ]02-16 15:42:47.798: INFO/WifiMonitor(2484): Event [CTRL-EVENT-NO-CONNECTION]02-16 15:42:47.814: INFO/WifiMonitor(2484): Event [CTRL-EVENT-STATE-CHANGE id=-1 state=1 BSSID=00:00:00:00:00:00]02-16 15:42:47.826: INFO/wpa_supplicant(3810): SAN_RESULTS : [38] 02-16 15:42:47.853: INFO/wpa_supplicant(3810): SAN_RESULTS : [38] 02-16 15:42:47.872: VERBOSE/WifiStateTracker(2484): Changing supplicant state: SCANNING ==&gt; INACTIVE02-16 15:42:47.872: DEBUG/NetworkStateTracker(2484): setDetailed state, old =SCANNING and new state=IDLE02-16 15:42:47.904: INFO/NetworkStatusReceiver(2935): action: android.net.wifi.SHOW_AP_LIST_DIALOG02-16 15:42:47.919: DEBUG/ConnectivityService(2484): Dropping ConnectivityChange for WIFI: DISCONNECTED/IDLE02-16 15:42:47.923: ERROR/WifiManager(2935): showApDialog02-16 15:42:47.927: INFO/WifiService(2484): isShowingAccessPointListDialog():false02-16 15:42:47.931: INFO/WifiService(2484): setShowAccessPointListDialog():false02-16 15:42:47.970: INFO/wifiScan(4009): 3 5652 2602-16 15:42:47.974: INFO/wpa_supplicant(3810): CTRL-EVENT-STATE-CHANGE id=-1 state=2 BSSID=00:00:00:00:00:0002-16 15:42:47.974: INFO/WifiMonitor(2484): Event [CTRL-EVENT-STATE-CHANGE id=-1 state=2 BSSID=00:00:00:00:00:00]02-16 15:42:47.986: VERBOSE/WifiStateTracker(2484): Changing supplicant state: INACTIVE ==&gt; SCANNING02-16 15:42:47.986: DEBUG/NetworkStateTracker(2484): setDetailed state, old =IDLE and new state=SCANNING02-16 15:42:47.986: DEBUG/ConnectivityService(2484): Dropping ConnectivityChange for WIFI: DISCONNECTED/SCANNING02-16 15:42:53.423: INFO/WifiMonitor(2484): Event [ SCAN-RESULTS ]02-16 15:42:53.427: INFO/wpa_supplicant(3810): WPS-AP-AVAILABLE 02-16 15:42:53.427: INFO/wpa_supplicant(3810): CTRL-EVENT-NO-CONNECTION02-16 15:42:53.427: INFO/wpa_supplicant(3810): CTRL-EVENT-STATE-CHANGE id=-1 state=1 BSSID=00:00:00:00:00:0002-16 15:42:53.435: INFO/WifiMonitor(2484): Event [WPS-AP-AVAILABLE ]02-16 15:42:53.439: INFO/WifiMonitor(2484): Event [CTRL-EVENT-NO-CONNECTION]02-16 15:42:53.439: INFO/WifiMonitor(2484): Event [CTRL-EVENT-STATE-CHANGE id=-1 state=1 BSSID=00:00:00:00:00:00]02-16 15:42:53.462: INFO/wpa_supplicant(3810): SAN_RESULTS : [37] 02-16 15:42:53.482: INFO/wpa_supplicant(3810): SAN_RESULTS : [37] 02-16 15:42:53.493: VERBOSE/WifiStateTracker(2484): Changing supplicant state: SCANNING ==&gt; INACTIVE02-16 15:42:53.497: DEBUG/NetworkStateTracker(2484): setDetailed state, old =SCANNING and new state=IDLE02-16 15:42:53.525: DEBUG/ConnectivityService(2484): Dropping ConnectivityChange for WIFI: DISCONNECTED/IDLE02-16 15:42:53.529: INFO/NetworkStatusReceiver(2935): action: android.net.wifi.SHOW_AP_LIST_DIALOG02-16 15:42:53.529: ERROR/WifiManager(2935): showApDialog02-16 15:42:53.532: INFO/WifiService(2484): isShowingAccessPointListDialog():false02-16 15:42:53.532: INFO/WifiService(2484): setShowAccessPointListDialog():false02-16 15:42:53.575: INFO/wifiScan(4009): 4 5602 2402-16 15:42:53.579: INFO/wpa_supplicant(3810): CTRL-EVENT-STATE-CHANGE id=-1 state=2 BSSID=00:00:00:00:00:0002-16 15:42:53.579: INFO/WifiMonitor(2484): Event [CTRL-EVENT-STATE-CHANGE id=-1 state=2 BSSID=00:00:00:00:00:00]02-16 15:42:53.591: VERBOSE/WifiStateTracker(2484): Changing supplicant state: INACTIVE ==&gt; SCANNING02-16 15:42:53.591: DEBUG/NetworkStateTracker(2484): setDetailed state, old =IDLE and new state=SCANNING02-16 15:42:53.595: DEBUG/ConnectivityService(2484): Dropping ConnectivityChange for WIFI: DISCONNECTED/SCANNING02-16 15:42:59.040: INFO/WifiMonitor(2484): Event [ SCAN-RESULTS ]02-16 15:42:59.040: INFO/wpa_supplicant(3810): WPS-AP-AVAILABLE 02-16 15:42:59.044: INFO/wpa_supplicant(3810): CTRL-EVENT-NO-CONNECTION02-16 15:42:59.048: INFO/wpa_supplicant(3810): CTRL-EVENT-STATE-CHANGE id=-1 state=1 BSSID=00:00:00:00:00:0002-16 15:42:59.048: INFO/WifiMonitor(2484): Event [WPS-AP-AVAILABLE ]02-16 15:42:59.056: INFO/WifiMonitor(2484): Event [CTRL-EVENT-NO-CONNECTION]02-16 15:42:59.075: INFO/WifiMonitor(2484): Event [CTRL-EVENT-STATE-CHANGE id=-1 state=1 BSSID=00:00:00:00:00:00]02-16 15:42:59.091: INFO/wpa_supplicant(3810): SAN_RESULTS : [38] 02-16 15:42:59.115: INFO/wpa_supplicant(3810): SAN_RESULTS : [38] 02-16 15:42:59.122: VERBOSE/WifiStateTracker(2484): Changing supplicant state: SCANNING ==&gt; INACTIVE02-16 15:42:59.122: DEBUG/NetworkStateTracker(2484): setDetailed state, old =SCANNING and new state=IDLE02-16 15:42:59.138: DEBUG/ConnectivityService(2484): Dropping ConnectivityChange for WIFI: DISCONNECTED/IDLE02-16 15:42:59.142: INFO/NetworkStatusReceiver(2935): action: android.net.wifi.SHOW_AP_LIST_DIALOG02-16 15:42:59.154: ERROR/WifiManager(2935): showApDialog02-16 15:42:59.158: INFO/WifiService(2484): isShowingAccessPointListDialog():false02-16 15:42:59.161: INFO/WifiService(2484): setShowAccessPointListDialog():false02-16 15:42:59.204: INFO/wifiScan(4009): 5 5626 2202-16 15:42:59.204: INFO/wpa_supplicant(3810): CTRL-EVENT-STATE-CHANGE id=-1 state=2 BSSID=00:00:00:00:00:0002-16 15:42:59.204: INFO/WifiMonitor(2484): Event [CTRL-EVENT-STATE-CHANGE id=-1 state=2 BSSID=00:00:00:00:00:00]02-16 15:42:59.208: VERBOSE/WifiStateTracker(2484): Changing supplicant state: INACTIVE ==&gt; SCANNING02-16 15:42:59.208: DEBUG/NetworkStateTracker(2484): setDetailed state, old =IDLE and new state=SCANNING02-16 15:42:59.208: DEBUG/ConnectivityService(2484): Dropping ConnectivityChange for WIFI: DISCONNECTED/SCANNING02-16 15:43:00.025: VERBOSE/AlarmManager(2484): set: Alarm{47dfb360 type 1 android}</code></pre>","619233","","15541","","2011-06-15 08:45:41","2012-06-22 02:50:47","Android Wifi scanning too slow","<android><tabs><wifi><scan><galaxy>","2","0","1","",""
"5013960","1","5014081","","2011-02-16 08:08:44","0","428","<p>I have several distinct <code>View</code> objects, stored in the <code>views</code> array, that I want to show together on the screen. Therefore, as far as I understand it correctly, a <code>TableView</code> would do exactly that. However, I can only see one of the views, i.e. like there is a single row, not to rows. Here goes my code:</p><pre><code>class myApp extends Activity {    FrameLayout mainFrame = ...;    View[] views = ...;    ...    TableLayout grid = new TableLayout(this);    for (int i = 0; i &lt; views.length; i++) {        TableRow row = new TableRow(this);        row.addView(views[i]);        grid.addView(row);//, i);    }    mainFrame.addView(grid, 1);</code></pre><h2>UPDATE</h2><p>Turns out the previous code actually <em>didn't show anything</em>.</p><p>I can see something only if I don't use <code>TableRow</code>, but then I'd get one row only, i.e.:</p><pre><code>class myApp extends Activity {    FrameLayout mainFrame = ...;    View[] views = ...;    ...    TableLayout grid = new TableLayout(this);    for (int i = 0; i &lt; views.length; i++) {        grid.addView(views[i]);    }    mainFrame.addView(grid, 1);</code></pre><p>Any help would be highly appreciated! Thanks!</p>","348183","","348183","","2011-02-16 08:30:40","2011-02-16 08:30:40","TableLayout in Android","<android><layout><tableview>","1","0","","",""
"5014002","1","8035389","","2011-02-16 08:12:53","6","18054","<p>I am using a tab bar in android.</p><p>By default, it displays at the top.</p><p>I want it to be displayed at the bottom.</p><p>Can someone please explain how to do this?</p>","552027","","774691","","2012-08-08 07:11:30","2014-02-19 12:53:37","How to set tab bar at the bottom in android?","<android><tabbar>","3","0","4","",""
"5014004","1","6139976","","2011-02-16 08:13:29","6","3262","<p>Is it possible and worth trying to develop some server application using android NDK which will encrypt data (or just use some built in Linux encryption library) passed to it from normal Java based application? </p><p>I tried using Cipher library, but it took almost a minute to encrypt 2MB file with AES. And blowfish is not available in Cipher until Android 2.3(?). And I doubt it will be much faster. </p><p>I was using blowfish for encryption on Symbian and it was much faster (under 5-10 seconds) so I think in android it is slower because of using Java virtual machine and I'd like to try native app for it.</p><p>Have someone done it before?</p><p>EDIT: Encrypting in NDK is so much faster. Do it there. There is a similar question with the same answer for AES: <a href=""http://stackoverflow.com/questions/6257945/aes-decryption-on-android-too-slow-to-be-usable-will-ndk-be-faster-other-ideas"">AES decryption on Android too slow to be usable. Will NDK be faster? Other ideas?</a></p>","490114","","490114","","2011-09-08 12:02:42","2011-09-08 12:02:42","Using Android NDK for encryption of data passed from normal android app","<android><encryption><android-ndk><blowfish>","5","3","1","",""
"5014055","1","5014205","","2011-02-16 08:21:04","0","305","<p>My main screen has a process which can take 20-30 seconds to load the information on to the screen. While this is happening the screen is just black. I have tried using a ProgressDialog to let the user know the process is running but as the screen is black you cannot see it. Can I refresh the screen so that the dialog is visible or do I need to run my initial process in background so that the screen is visible?</p>","616076","","","","","2011-02-16 08:36:38","How can I refresh my screen or run initial process in background","<android>","1","0","","",""
"5014064","1","","","2011-02-16 08:22:19","0","1827","<p>I want to add an alert in my code, so that when the user clicks the button without filling fields, an error message occurs. Please suggest some measures.</p><p>This is my code:</p><pre><code>    Button button1 = (Button) findViewById(R.id.widget45);    button1.setOnClickListener(new View.OnClickListener() {        public void onClick(View v) {          tv= name.getText().toString();           tv1 = pass.getText().toString();           x.setText(tv);           y.setText(tv1);       }    });}</code></pre><p>}</p>","617356","","14860","","2011-02-16 08:25:16","2011-02-16 09:12:31","How to alert when user submits with empty fields","<android>","3","1","","",""
"5014065","1","5014163","","2011-02-16 08:22:23","1","1631","<p>My question is related to filesystem access in Android apps. Suppose I want to grab a file that another app just downloaded? Can I access the other apps file / doc-folder from within my ohwn app? My first guess is no...</p><p>Thanks for clarification ;-)</p><p>Greets, pawi</p>","399280","","52626","","2011-03-27 21:01:05","2013-03-28 12:02:41","Android App folder filesystem access","<android><file-permissions>","1","0","","",""
"5014122","1","5015047","","2011-02-16 08:28:12","1","2556","<p>i have 4 tabs on <strong>my main screen</strong>,    </p><p>main ( set to current ) , Call, Email, Web</p><p>When a user clicks on any of tab call, email or web, it starts making a call, or go to compose a email, or opens up the browser respectfully.</p><p><strong>Problem</strong> is, i want just three tabs  (Call, Email, Web) and <strong>i Dont want any tab to be selected by default</strong>, means they should only become active when a user Touch them..(a call or any service cant be main at all)</p><p>All java coding, XML file, and Manifest code is given below,</p><p><strong>XML File</strong> (tab_activity_layout)</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;RelativeLayout    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""            android:layout_alignParentBottom=""true""             /&gt;                  &lt;FrameLayout            android:id=""@android:id/tabcontent""            android:layout_width=""fill_parent""            android:layout_height=""fill_parent""            android:padding=""5dp""&gt;&lt;/FrameLayout&gt;    &lt;/RelativeLayout&gt;    &lt;/LinearLayout&gt;&lt;/TabHost&gt;</code></pre><p><strong>Java Coding</strong> (MainTabActivity)</p><pre><code>package com.NVT.android;import android.app.TabActivity;import android.content.Intent;import android.content.res.Resources;import android.os.Bundle;import android.widget.TabHost;public class MainTabActivity extends TabActivity{        public void onCreate(Bundle savedInstanceState) {            super.onCreate(savedInstanceState);            setContentView(R.layout.tab_activity_layout);            Resources res = getResources(); // Resource object to get Drawables            TabHost tabHost = getTabHost();  // The activity TabHost            TabHost.TabSpec spec;  // Resusable TabSpec for each tab            Intent intent;  // Reusable Intent for each tab            // Create an Intent to launch an Activity for the tab (to be reused)            intent = new Intent().setClass(this, Main.class);            // Initialize a TabSpec for each tab and add it to the TabHost            spec = tabHost.newTabSpec(""main"").setIndicator(""Main"",                              res.getDrawable(R.drawable.ic_tab_artists_grey))                          .setContent(intent);            tabHost.addTab(spec);            TabHost host=getTabHost();            host.addTab(host.newTabSpec(""one"")                    .setIndicator(""Call"")                    .setContent(new Intent(this, CallService.class)));            host.addTab(host.newTabSpec(""two"")                    .setIndicator(""Email"")                    .setContent(new Intent(this, EmailService.class)));            host.addTab(host.newTabSpec(""three"")                    .setIndicator(""Web"")                    .setContent(new Intent(this, WebService.class)));        }        }</code></pre><p><strong>Manifest file</strong></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.NVT.android""      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;!--            &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; --&gt;        &lt;/activity&gt;        &lt;activity android:name="".MainTabActivity""                  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="".Courses""&gt;        &lt;/activity&gt;        &lt;activity android:name="".CampusMap""&gt;        &lt;/activity&gt;        &lt;activity android:name="".GettingHere""&gt;        &lt;/activity&gt;        &lt;activity android:name="".ILoveNescot""&gt;        &lt;/activity&gt;        &lt;activity android:name="".FurtherEducationCourses""&gt;        &lt;/activity&gt;        &lt;activity android:name="".HigherEducationCourses""&gt;        &lt;/activity&gt;        &lt;activity android:name="".EmployersTrainingCourses""&gt;        &lt;/activity&gt;        &lt;activity android:name="".WebService""&gt;        &lt;/activity&gt;        &lt;activity android:name="".CallService""&gt;        &lt;/activity&gt;        &lt;activity android:name="".EmailService""&gt;        &lt;/activity&gt;    &lt;/application&gt;    &lt;uses-sdk android:minSdkVersion=""9"" /&gt;&lt;uses-permission android:name=""android.permission.CALL_PHONE""&gt;&lt;/uses-permission&gt;&lt;uses-permission android:name=""android.permission.INTERNET"" /&gt;&lt;/manifest&gt; </code></pre>","1090104","","","","","2012-06-08 10:36:37","setCurrentTab Android","<android>","4","3","1","",""
"5014128","1","","","2011-02-16 08:28:43","115","48640","<p>I know of Android Library projects, which allow you to create a shared-source project that can be pulled into Android Applications as needed. However, that requires that source be available.</p><p>I'm looking for a way to build and distribute a closed-source library that can be used in other Android projects like a traditional JAR. This will require usage of the Android compiler, so it's not a vanilla-Java JAR file. FWIW, I do not need to embed resources/layouts in the JAR.</p><p>I've seen <a href=""http://andparcel.com/"">http://andparcel.com/</a> but it feels like a workaround, and I would rather use something 'officially supported' by Google. Also, I need to make sure that the JAR I build is compatible with old/new version of the Android SDK (i.e. I need a way to set the target platform version, etc).</p><p>Do the latest Android toolsets allow for the creation/consumption of JAR binaries? Can you point to some documentation on how I can do it?</p>","106095","","106095","","2011-02-16 08:35:30","2014-02-06 06:55:46","Create an Android Jar library for distribution","<java><android><jar>","10","2","52","",""
"5014157","1","5014622","","2011-02-16 08:30:56","0","364","<p>Given the IMAGE_ID in by the ContentProvider, how do i get the thumbnail path of it?</p><pre><code> Cursor c = this.managedQuery(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, null, selection, null, null);            while ( c.moveToNext()){                String title = c.getString(c.getColumnIndex(MediaStore.Images.ImageColumns.TITLE));                String description = c.getString(c.getColumnIndex(MediaStore.Images.ImageColumns.DESCRIPTION));                long imgId = c.getLong(c.getColumnIndex(MediaStore.Images.ImageColumns._ID));           ... }</code></pre>","211071","","","","","2011-02-16 09:24:11","retrieving image thumbnail","<android>","1","0","","",""
"5014219","1","5037488","","2011-02-16 08:38:54","30","9558","<p>Is there a way to have a Multi-Line <code>EditText</code> present and use the IME Action Label ""Done""  on Android 2.3?</p><p>In Android 2.2 this is not a problem, the enter button shows the IME Action Label ""Done"" (<code>android:imeActionLabel=""actionDone""</code>), and dismisses Soft Input when clicked.</p><p>When configuring an <code>EditText</code> for multi-line, Android 2.3 removes the ability to show the ""Done"" action for the Soft Input keyboard.</p><p>I have managed to alter the behaviour of the Soft Input enter button by using a <code>KeyListener</code>, however the enter button still looks like an enter key.</p><hr><p>Here is the declaration of the <code>EditText</code></p><pre><code>&lt;EditText        android:id=""@+id/Comment""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:layout_marginTop=""10dp""        android:layout_marginBottom=""0dp""        android:lines=""3""        android:maxLines=""3""        android:minLines=""3""        android:maxLength=""60""        android:scrollHorizontally=""false""        android:hint=""hint""        android:gravity=""top|left""        android:textColor=""#888""        android:textSize=""14dp""        /&gt;&lt;!-- android:inputType=""text"" will kill the multiline on 2.3! --&gt;&lt;!-- android:imeOptions=""actionDone"" switches to a ""t9"" like soft input --&gt;</code></pre><p>When I check the <code>inputType</code> value after loading setting the content view in the activity, it shows up as:</p><pre><code>inputType = 0x20001</code></pre><p>Which is:</p><ul><li>class = <code>TYPE_CLASS_TEXT | TYPE_TEXT_VARIATION_NORMAL</code></li><li>flags = <code>InputType.TYPE_TEXT_FLAG_MULTI_LINE</code></li></ul>","178831","","","","","2012-11-26 11:31:55","Multiline EditText with Done SoftInput Action Label on 2.3","<android><edittext>","4","0","13","",""
"5014243","1","5014302","","2011-02-16 08:41:53","0","621","<p>e.g.I have a need where my ArrayList should contain hashmap at each index, e.g.</p><pre>Public class Testing {  private ArrayList &lt &lt HashMap&lt String, String>> myData ;  public static void main(String[] args) {    myData = new ArrayList &lt HashMap &lt String, String>>();    initialize();    //After initialize myData should contain different Hashmaps.  }  public static void initialize() {         for (int i= 0; i &lt 10 ;i++) {      myMap = new HashMap();  //Bad because,creating Objects inside the loop.      myMap.put(""title"", ""abc""+i); //Adding i, just to show that new values are stored everytime      myMap.put(""name"", ""xyz""+i);      myData.add(myMap);    }   }}</pre><p>Above code will create hash map objects every time in the loop, what is the better way to do it, so that I can avoid creation of objects every time ?I am using this code in Android , but I think this is more general and related to Java more.</p>","207646","","342852","","2011-02-16 09:40:59","2011-02-16 09:40:59","How to avoid frequent creation of objects in a loop in java?","<java><android><performance><memory-management>","3","6","","",""
"5014265","1","5014287","","2011-02-16 08:44:23","4","605","<p>I'd like to do something like this on Android :</p><p>from: </p><pre><code>*foo* bar*stuff*</code></pre><p>dest:   </p><pre><code>&lt;b&gt;foo&lt;/b&gt; bar&lt;b&gt;stuff&lt;/b&gt;</code></pre><p>In <code>C#</code>, I'd create a Regex and replace:</p><pre><code>string text = ""*foo* bar*stuff*"";Regex bold = new Regex(@""\*(.+?)\*"", RegexOptions.Singleline);html = bold.Replace(html, new MatchEvaluator(p =&gt; string.Format(""&lt;b&gt;{0}&lt;/b&gt;"", p.Groups[1].Value)));</code></pre><p>I've read Android's <code>java.util.regex.Matcher</code> <a href=""http://developer.android.com/reference/java/util/regex/Matcher.html#replaceAll%28java.lang.String%29"" rel=""nofollow"">documentation</a> and it says <code>replace()</code> method replaces the entire match with a (constant) string. Is there a trick way to replace each occurence with reference to that occurence's group?</p>","72746","","","","","2011-02-16 08:51:34","Can I do regex replace in Android with groups from the match?","<android><regex>","2","0","2","",""
"5014290","1","","","2011-02-16 08:47:14","1","2790","<p>i have got the following codes but my gps is not getting the current location, showing me the address on touch and no overlay. I got the latitude and longitude as 0.0. Basically only the map is showing up. Help is greatly appreciated. Thank you!</p><blockquote>  <p>public class Map extends MapActivity{</p></blockquote><pre><code>MapView mapView;MapController mc;GeoPoint p;private LocationManager lm;private LocationListener locationListener;Button btn_send;int lat, lng;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.pin);                    canvas.drawBitmap(bmp, screenPts.x, screenPts.y-50, 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());            Geocoder geoCoder = new Geocoder(                    getBaseContext(), Locale.getDefault());                 try {                    List&lt;Address&gt; addresses = geoCoder.getFromLocation(                        p.getLatitudeE6()  / 1E6,                         p.getLongitudeE6() / 1E6, 1);                    String add = """";                    if (addresses.size() &gt; 0)                     {                        for (int i=0; i&lt;addresses.get(0).getMaxAddressLineIndex();                              i++)                           add += addresses.get(0).getAddressLine(i) + ""\n"";                    }                    Toast.makeText(getBaseContext(), add, Toast.LENGTH_SHORT).show();                }                catch (IOException e) {                                    e.printStackTrace();                }                   return true;            }            else                                return false;    }}   public boolean onKeyDown(int keyCode, KeyEvent event)     {        MapController mc = mapView.getController();         switch (keyCode)         {            case KeyEvent.KEYCODE_3:                mc.zoomIn();                break;            case KeyEvent.KEYCODE_1:                mc.zoomOut();                break;        }        return super.onKeyDown(keyCode, event);    }    /** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState){    super.onCreate(savedInstanceState);    setContentView(R.layout.map);    lm = (LocationManager) getSystemService(Context.LOCATION_SERVICE);    lm.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0,            0, new GeoUpdateHandler());    Button btnSend = (Button) findViewById(R.id.btn_send);    btnSend.setOnClickListener(new View.OnClickListener(){        public void onClick(View v){                Intent new_intent = new Intent(""net.learn2develop.SendSMS"");                startActivity(new_intent);        }    });    mapView = (MapView) findViewById(R.id.mapView);    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);    mapView.setSatellite(false);    mapView.setStreetView(true);    mc = mapView.getController();    String latitude = Integer.toString(lat);    String longitude = Integer.toString(lng);     String coordinates[] = {latitude, longitude};    double lati = Double.parseDouble(coordinates[0]);    double lngi = Double.parseDouble(coordinates[1]);    System.out.println(""lat"" + lati + ""lng"" + lngi );    p = new GeoPoint(        (int) (lati * 1E6),         (int) (lngi * 1E6));    mc.animateTo(p);    mc.setZoom(17);     mapView.invalidate();  //---Add a location marker---    MapOverlay mapOverlay = new MapOverlay();    List&lt;Overlay&gt; listOfOverlays = mapView.getOverlays();    listOfOverlays.clear();    listOfOverlays.add(mapOverlay);            mapView.invalidate();}@Overrideprotected boolean isRouteDisplayed() {    // TODO Auto-generated method stub    return false;}public class GeoUpdateHandler implements LocationListener {    @Override    public void onLocationChanged(Location location) {        lat = (int) (location.getLatitude() * 1E6);        lng = (int) (location.getLongitude() * 1E6);        System.out.println(""lat shld b smth "" + lat + ""lng smth "" +lng);        //GeoPoint point = new GeoPoint(lat, lng);        //mc.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>","596379","","","","","2011-05-09 05:28:32","Android Map with current location","<android><gps>","2","1","","",""
"5014361","1","5021282","","2011-02-16 08:55:31","1","1538","<p>I am developing an Android Application using phonegap. Everything is working fine as request/response, now I have to handle the situation when no 3G network is available and wifi is disabled, in this case my jquery ajax() request does not do anything it does not come to error handler even. I have put the timeout of 10seconds.</p><p>Can somebody tell me what is going wrong with ajax request? why the error handler is not calling?</p><p>Thanks</p>","202461","","","","","2011-02-16 19:39:41","Handling ajax request when no network available and wifi is disabled on Android","<jquery><android><ajax><error-handling><phonegap>","2","2","1","",""
"5014387","1","","","2011-02-16 08:57:56","0","1879","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/5027509/implementing-counter-in-android"">Implementing counter in Android</a>  </p></blockquote><p>I need to implement the TimerTask. the Scenario is I am going to get a response from the server. If the server does not repond more than 10 seconds then i have to navigate to the next activity. </p><p>How to implement that? Please Help.</p>","267269","","21234","","2011-02-16 11:44:58","2012-05-22 12:35:31","TimerTask in Android?","<android><timertask>","0","0","0","2012-05-22 12:35:35",""
"5014390","1","","","2011-02-16 08:58:11","0","388","<p>I am a newbie in android development but having plans to become an active developerI had a c++/Java library called Wt. I need to install this library on android.<a href=""http://www.webtoolkit.eu/wt"" rel=""nofollow"">http://www.webtoolkit.eu/wt</a></p><p>Do I need to port the source code of library?</p><p>If yes please point to me a good resource to start with.</p><p>Expecting a good helping hand from this community</p>","619308","","229745","","2011-02-16 09:03:07","2011-02-16 09:09:30","porting a library to Android; beginner","<android><wt>","1","1","","",""
"5014437","1","5015122","","2011-02-16 09:03:24","0","747","<p>I have some html pages which I want to display as an additional information section. Is the only way I can display them on the screen using uri.parse(""htmlpage"") and if so is there a way I can hide the url string?</p>","616076","","","","","2011-02-16 10:15:43","Can I display html pages without a browser","<android><html>","3","0","2","",""
"5014539","1","","","2011-02-16 09:14:25","2","974","<p>Say I have multiple Overlay items in my map. Is it possible to draw some text (say the overlay number) on the default marker ?</p>","266272","","","","","2012-03-09 16:38:52","android map draw custom marker","<android><google-maps><overlay>","2","0","","",""
"5014542","1","5014786","","2011-02-16 09:14:44","3","2951","<p>I would like to know how to make the horizontalscrollview ""snapping"" like the home screen do, meaning i have two pages in my horizontalscrollview and i can swipe between each page.</p>","616647","","","","","2012-09-30 04:22:28","""snapping"" horizontalscrollview like the home screen do","<android><android-layout>","3","0","4","",""
"5014578","1","5014760","","2011-02-16 09:18:18","5","8239","<p>I have a text view with following XML attributes:</p><pre><code>&lt;TextView    android:layout_width=""match_parent""    android:layout_height=""wrap_content""    android:layout_marginTop=""14dip""    android:maxLines=""1""    android:scrollHorizontally=""true""    android:ellipsize=""marquee""    android:focusable=""true""    android:focusableInTouchMode=""true""    android:marqueeRepeatLimit=""1""    android:textColor=""@android:color/black""    android:id=""@+id/ticker""    /&gt;</code></pre><p>I'd like to be able to set the horizontal scroll rate, making it slightly faster than the default. How do I do with this (in XML)?</p><p>Thanking you in advance.</p>","283311","","","","","2012-12-11 02:37:52","Android and a TextView's horizontal marquee scroll rate","<android><animation><scroll><textview>","2","0","4","",""
"5014587","1","5014971","","2011-02-16 09:19:09","0","183","<p>HelloI'm beginning with android developmentI created two interfaces, the first a.xml and the second b.xml.</p><p>In the first I have an ImageButton. My goal is to switch to interface b when the user clicks on the ImageButton (button.setonclicklistner).</p><p>How can I use the activity and intent to navigate between the interfaces(I have one file java pg.java the intent function parameters ActivtyA.class. I don't inderstand it (I haven't a file pg.class)</p><p>Thank you</p>","616263","","50109","","2011-02-16 09:54:11","2012-07-11 22:45:46","pass from interface a to interface b with android","<android>","3","0","","",""
"5014679","1","","","2011-02-16 09:29:54","7","3829","<p>I'm been trying to combine a TextView and an EditText into one compound control which uses custom xml elements to pass in default values for each individual element. I've been looking at the tutorials/docs here:<br><a href=""http://m.androidside.com/docs/docs1.5/guide/topics/ui/custom-components.html#compound"">Building Compound Controls</a><br><a href=""http://blog.pocketjourney.com/2008/05/02/android-tutorial-42-passing-custom-variables-via-xml-resource-files/"">Passing Custom Attributes</a></p><p>What I have so far.</p><p>Attrs.xml:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;resources&gt;    &lt;declare-styleable name=""FreeText""&gt;        &lt;attr name=""label"" format=""string"" /&gt;        &lt;attr name=""default"" format=""string"" /&gt;    &lt;/declare-styleable&gt;&lt;/resources&gt;</code></pre><p>My Main Layout:</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/android""    android:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    &gt;    &lt;com.example.misc.FreeText          android:layout_width=""fill_parent""         android:layout_height=""wrap_content""        myapp:label=""label""        myapp:default=""default""    /&gt;&lt;/LinearLayout&gt;</code></pre><p>My Compound Control, FreeText:</p><pre><code>public class FreeText extends LinearLayout {    TextView label;    EditText value;    public FreeText(Context context, AttributeSet attrs) {        super(context, attrs);        this.setOrientation(HORIZONTAL);        LayoutParams lp = new LayoutParams(0, LayoutParams.WRAP_CONTENT);        lp.weight = 1;        label = new TextView(context);        addView(label, lp);        value = new EditText(context);        addView(value, lp);        TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.FreeText);        CharSequence s = a.getString(R.styleable.FreeText_label);        if (s != null) {             label.setText(s);        }        a.recycle();    }}</code></pre><p>When I run the program I see the views OK but the value of my CharSequence, s, is always null.  Can someone tell me where I'm going wrong?</p>","444439","","","","","2014-01-06 14:05:10","Creating Compound Controls With Custom XML Attributes","<android><android-layout>","1","0","2","",""
"5014684","1","","","2011-02-16 09:30:41","0","474","<p>Let just say I have a PDF and a Doc file on the SD Card -- how do I auto detect which program to use to open these files?</p><p>Is this even possible at all?</p>","42340","","","","","2012-12-28 02:49:36","How to detect and auto-open files of different types?","<android>","1","0","","",""
"5014706","1","","","2011-02-16 09:32:55","1","574","<p>I create an ImageButton on main.xml.And I want to scale the size and modify the position of ImageButton on the View.</p><p>main.xml</p><pre><code>&lt;ImageButton android:id=""@+id/BtnExplore"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content""android:src=""@drawable/btn_320x240_explorer""android:background=""@android:color/transparent""/&gt;</code></pre><p>I will set the size - iwidth and iheight when user click the button - Next and Prev.</p><p>Next button pressed.</p><pre><code>                iHeight++;                iWidth++;                BtnExplore.setMaxHeight(iHeight);                BtnExplore.setMaxWidth(iWidth);                BtnExplore.invalidate();                BtnExplore.postInvalidate();</code></pre><p>Prev button pressed.</p><pre><code>                iHeight--;                iWidth--;                BtnExplore.setMaxHeight(iHeight);                BtnExplore.setMaxWidth(iWidth);                BtnExplore.invalidate();</code></pre><p>I still can't scale the imagebutton.I also need how to change the position.</p><p>Here is the complete code.<a href=""http://dl.dropbox.com/u/2452511/AndroidAP/IconClickTest-stackoverflow.tar.gz"" rel=""nofollow"">http://dl.dropbox.com/u/2452511/AndroidAP/IconClickTest-stackoverflow.tar.gz</a></p>","523469","","","","","2011-02-16 09:47:01","How to scale and modify the position of ImageButton dynamically?","<android><android-widget><imagebutton>","1","0","1","",""
"5014737","1","5014768","","2011-02-16 09:36:52","2","614","<p>How can I delete this horizontal line?</p><p><img src=""http://i.stack.imgur.com/wB843.jpg"" alt=""enter image description here""></p>","338581","","","","","2011-02-16 09:39:00","Horizontal line between items in ExpandebleListView","<android><android-layout><expandablelistview>","1","0","1","",""
"5014815","1","","","2011-02-16 09:43:17","1","112","<p>I have a subclass of an abstract <code>Activity</code> subclass from the application I am testing that I am trying to instantiate in my test. The subclass lives in my test-application, not in the tested application. So how do I see to it that the instrumentation's <code>launchActivity</code> finds it? How do I specify it in my manifest?</p><p>I tried to add this to the <code>&lt;application&gt;</code>tag in the test-application manifest:</p><pre><code>    &lt;activity android:name=""com.my.company.application.dialogs.test.MockActivity2""&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>com.my.company.application.dialogs.test is the actual java-path to the activity. There is something mentioned about a package path which might not be the same in the instrumentation documentation. Where do I set this and how do I set it so that the correct activity is found (but I must still have access to the other activities in my application)?</p>","617988","","","","","2011-02-16 10:56:39","How do I launch an activity that lives in my test-application, not in the tested application","<android><unit-testing><activity>","0","0","","",""
"5014828","1","5017753","","2011-02-16 09:44:19","1","1594","<p>I want to know that is this possible to create neon affect in android as shown in image below</p><p><img src=""http://i.stack.imgur.com/BZJhg.jpg"" alt=""enter image description here""> </p><p>I want to draw text using this affect in different colors is it possible</p>","517247","","573432","","2011-09-20 15:56:46","2013-01-15 19:10:54","Android Neon Tubing","<android>","1","0","","",""
"5014882","1","5029239","","2011-02-16 09:49:25","1","4840","<p>I created a custom View, with two Bitmaps. When I use the Bitmap outside of my View, in an ImageView, the image is OK. I have to call <code>setDensity(240)</code> (hdpi device), but it's ok.However, in the custom View, when I draw the same Bitmap on a canvas, in the <code>onDraw(Canvas)</code> overridden method, it's scaled again, the same way when I don't call <code>setDensity(240)</code>. Via debugging, I ensured that the density of the canvas and bitmap is 240, after the call.  </p><p>Code:</p><pre><code>@Overrideprotected void onDraw(Canvas canvas) {        _ingredient.setDensity(240);    canvas.setDensity(240);    canvas.drawBitmap(_ingredient, new Matrix(), new Paint());    Matrix refMatrix = new Matrix();    refMatrix.postTranslate(0, _ingredient.getHeight()-35);    Paint paint = new Paint();    paint.setAlpha(60);}</code></pre><p>The working ImageView, outside of my View. </p><pre><code>Bitmap tertr = _cocktail.getCocktailBitmapImage();tertr.setDensity(240);ImageView in = new ImageView(this);in.setScaleType(ScaleType.CENTER);in.setImageBitmap(tertr);RelativeLayout relativeLayout = RelativeLayout)findViewById(R.id.cocktail_date_image_layout);LayoutParams params = new LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT);relativeLayout.addView(in, params);</code></pre><p>The first one is showing the image scaled up, just like the second one, without the setDensity call. The images were created at 72dpi. These images are given, I cannot change them. Am I missing one thing, or this is how Canvas works? The device used for testing is a DROID2.</p>","215331","","","","","2011-02-17 13:00:05","Drawing a Bitmap on a Canvas got scaled","<android><canvas><view>","2","0","1","",""
"5014949","1","","","2011-02-16 09:56:04","1","4959","<p>I have created two window frame in JAVA using awt and swing package. My Java code is like:</p><pre><code>import java.awt.*;import javax.swing.*;public class TopLevelWindow {    private static void createWindow() {        JFrame frame = new JFrame(""Simple GUI"");        //frame.setDefaultCloseOperation(JFrame.EXIT_ON_ CLOSE);         JLabel textLabel = new JLabel(""Hi Ans "",SwingConstants.CENTER);        textLabel.setPreferredSize(new Dimension(300, 100));        frame.getContentPane().add(textLabel, BorderLayout.CENTER);        //Display the window.         frame.setLocationRelativeTo(null);        frame.pack();        frame.setVisible(true);    }    public static void main(String[] args) {        createWindow();        createWindow();    }}</code></pre><p>Now on executing my code I am getting two window like frame and switching betweenthese two frames.</p><p>The same thing I want it to do in Android means </p><ol><li>How to create a window like frame in Android.</li><li>At a time two frames are there and we easily switch between frame.</li></ol><p>How do I proceed? Any guidance?</p>","587090","","66158","","2011-02-16 10:11:01","2013-04-10 14:48:16","how can we create a window frame in Android?","<android><window><frame>","2","0","","",""
"5015083","1","5015164","","2011-02-16 10:12:03","0","280","<p>I have 3 activities. A, B and C. From A to C and B to C. How can i from Activity C find out which activity was loaded previously and refereed to this Activity.</p>","155196","","","","","2011-02-16 10:57:55","How to find out which activity has been loaded","<android><activity><android-intent>","2","1","","",""
"5015094","1","5016350","","2011-02-16 10:13:00","162","40557","<p>Is there any way to determine current device category ?</p><p>Not the density, but the screen type.</p><p>Thanks</p>","404289","","","user1343631","2012-05-02 08:17:18","2013-11-08 13:07:57","Determine device screen category (small, normal, large, xlarge) using code","<android><screen>","6","0","58","",""
"5015144","1","7078608","","2011-02-16 10:17:49","0","4233","<p>I need to implement multilevel expandable list view, something like <code>ExpandableListView</code> but with more than 2 levels. </p><p>Now I use this data structure, but if need I can change it. It's not very important.</p><pre><code>public class NodeList implements Set&lt;NodeList&gt;public NodeList(String name) {        mChilds = new ArrayList&lt;NodeList&gt;();        mNodeName = name;}NodeList root = new NodeList(""root"");    NodeList lv_1 = new NodeList(""level_1"");    NodeList lv_2 = new NodeList(""level_2"");    NodeList lv_3 = new NodeList(""level_3"");    root.add(lv_1);    root.add(lv_2);    root.add(lv_3);    NodeList lv_21 = new NodeList(""level_21"");    NodeList lv_22 = new NodeList(""level_22"");    lv_2.add(lv_21);    lv_2.add(lv_22);    NodeList lv_211 = new NodeList(""level_211"");    lv_21.add(lv_211);    NodeList lv_2111 = new NodeList(""level_2111"");    NodeList lv_2112 = new NodeList(""level_2112"");    lv_211.add(lv_2111);    lv_211.add(lv_2112);    NodeList lv_31 = new NodeList(""level_31"");    NodeList lv_32 = new NodeList(""level_32"");    NodeList lv_33 = new NodeList(""level_33"");    lv_3.add(lv_31);    lv_3.add(lv_32);    lv_3.add(lv_33);    NodeList lv_321 = new NodeList(""level_321"");    lv_32.add(lv_321);`</code></pre><p>Can anyone tell me which is better base view and which adapter to use? What methods needs to override? Maybe someone has already developed it, because this problem occurs quite often. </p><p>Please help.</p><p>Thanks for all response!</p>","578594","","71724","","2011-02-16 10:38:15","2012-06-15 20:14:08","How to implement multilevel expandable list view?","<android><listview><expandablelistview>","1","1","","",""
"5015191","1","","","2011-02-16 10:22:22","5","3339","<p>Are there any Runnables from the UI thread MessageQueue executed between onCreate() an onPostCreate()? In other words, is it posible that my AsyncTask's onPostExecute() method will be called in between?</p>","243225","","","","","2011-02-16 10:50:40","Between onCreate() and onPostCreate()","<android>","1","0","","",""
"5015202","1","5031601","","2011-02-16 10:23:40","0","10027","<p>Hello I've been using this guide to determine the locationof the user: <a href=""http://developer.android.com/guide/topics/location/obtaining-user-location.html"" rel=""nofollow"">http://developer.android.com/guide/topics/location/obtaining-user-location.html</a></p><p>and my current code looks like this:</p><pre><code>    LocationManager locationManager = (LocationManager) this.getSystemService(Context.LOCATION_SERVICE);    LocationListener locationListener = new LocationListener() {        public void onLocationChanged(Location location) {            test = new GeoPoint((int)location.getLatitude()*1000000, (int)location.getAltitude()*1000000);            mapController.animateTo(test);        }        @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        }    };    locationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 0, 0, locationListener);}</code></pre><p>I only get error and the app shuts down though when I'm using this activity.</p><p>Thankful for help</p><p>/Ben</p>","497458","","","","","2011-02-17 16:20:50","Get user current position with gps/network android MapView","<android><gps><android-mapview>","3","8","1","",""
"5015204","1","7156664","","2011-02-16 10:23:57","1","3103","<p>anyone help me how to POST authentication details to a restful web service and to get response from it.I have to post Username, IsAuthenticated(ie. true or false), Password.Also explain the url encoding method too.I have shown my code below. I am a Beginner in Android.</p><pre><code>public class LoginActivity extends Activity{    String Username;    String Password;    String IsAuthenticated;    String answer;    @Override     public void onCreate(Bundle savedInstanceState) {           super.onCreate(savedInstanceState);           setContentView(R.layout.main);            try {                POST(Username,Password,IsAuthenticated);            } catch (Exception e) {                e.printStackTrace();            }      }     public String POST(String Username, String IsAuthenticated, String Password) {         String Returned = null;          HttpClient httpclient = new DefaultHttpClient();          HttpPost httppost = new HttpPost(""http://......./Authenticate"");          try {             List&lt;NameValuePair&gt; nameValuePairs = new ArrayList&lt;NameValuePair&gt;(2);             // Your DATA             nameValuePairs.add(new BasicNameValuePair(""UserName"", ""Username""));             nameValuePairs.add(new BasicNameValuePair(""IsAuthenticated"", ""false""));             nameValuePairs.add(new BasicNameValuePair(""Password"", ""Password""));             httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs, HTTP.UTF_8));             HttpResponse response = httpclient.execute(httppost);             HttpEntity resEntity = response.getEntity();             Returned = EntityUtils.toString(resEntity);            System.out.println(Returned);             Toast.makeText(this, Returned, Toast.LENGTH_LONG).show();          } catch (ClientProtocolException e) {             Toast.makeText(this, ""There was an issue Try again later"", Toast.LENGTH_LONG).show();          } catch (IOException e) {             Toast.makeText(this, ""There was an IO issue Try again later"", Toast.LENGTH_LONG).show();             e.printStackTrace();          }          return Returned;       }}</code></pre>","619441","","619441","","2012-08-01 10:11:21","2012-12-14 21:06:38","How to call Restful web service in android","<android><web-services><http><rest><client-server>","1","6","4","",""
"5015213","1","","","2011-02-16 10:25:11","-8","1024","<p>Hi now i am create one sample game...but its indicate error...now i am post my error please tell how to clear this error....explain me.....pls...</p><pre><code>The method addEntity(Sprite) is undefined for the type Layer    andengine.java    /andengine/src/org/anddev/andengine/examples    line 95    Java ProblemThe method addShapeModifier(SequenceShapeModifier) is undefined for the type Sprite    andengine.java    /andengine/src/org/anddev/andengine/examples    line 105    Java ProblemThe method setVelocity(float, float) is undefined for the type Sprite    andengine.java    /andengine/src/org/anddev/andengine/examples    line 100    Java Problem</code></pre><p>how to solve this error pls tell me...</p><p>This is for my coding</p><pre><code>package org.anddev.andengine.examples;import javax.microedition.khronos.opengles.GL10;import org.anddev.andengine.engine.Engine;import org.anddev.andengine.engine.camera.Camera;import org.anddev.andengine.engine.camera.hud.controls.AnalogOnScreenControl;import org.anddev.andengine.engine.camera.hud.controls.BaseOnScreenControl;import org.anddev.andengine.engine.camera.hud.controls.AnalogOnScreenControl.IAnalogOnScreenControlListener;import org.anddev.andengine.engine.options.EngineOptions;import org.anddev.andengine.engine.options.EngineOptions.ScreenOrientation;import org.anddev.andengine.engine.options.resolutionpolicy.RatioResolutionPolicy;import org.anddev.andengine.entity.scene.Scene;import org.anddev.andengine.entity.scene.background.ColorBackground;import org.anddev.andengine.entity.shape.modifier.ScaleModifier;import org.anddev.andengine.entity.shape.modifier.SequenceShapeModifier;import org.anddev.andengine.entity.sprite.Sprite;import org.anddev.andengine.entity.util.FPSLogger;import org.anddev.andengine.opengl.texture.Texture;import org.anddev.andengine.opengl.texture.TextureOptions;import org.anddev.andengine.opengl.texture.region.TextureRegion;import org.anddev.andengine.opengl.texture.region.TextureRegionFactory;import android.widget.Toast;/*** @author Nicolas Gramlich* @since 00:06:23 - 11.07.2010*/public class andengine extends BaseExample {    // ===========================================================    // Constants    // ===========================================================    private static final int CAMERA_WIDTH = 480;    private static final int CAMERA_HEIGHT = 320;    // ===========================================================    // Fields    // ===========================================================    private Camera mCamera;    private Texture mTexture;    private TextureRegion mFaceTextureRegion;    private Texture mOnScreenControlTexture;    private TextureRegion mOnScreenControlBaseTextureRegion;    private TextureRegion mOnScreenControlKnobTextureRegion;    // ===========================================================    // Constructors    // ===========================================================    // ===========================================================    // Getter &amp; Setter    // ===========================================================    // ===========================================================    // Methods for/from SuperClass/Interfaces    // ===========================================================    @Override    public Engine onLoadEngine() {            Toast.makeText(this, ""Also try tapping this AnalogOnScreenControl!"", Toast.LENGTH_LONG).show();            this.mCamera = new Camera(0, 0, CAMERA_WIDTH, CAMERA_HEIGHT);            return new Engine(new EngineOptions(true, ScreenOrientation.LANDSCAPE, new RatioResolutionPolicy(CAMERA_WIDTH, CAMERA_HEIGHT), this.mCamera));    }    @Override    public void onLoadResources() {            TextureRegionFactory.setAssetBasePath(""gfx/"");            this.mTexture = new Texture(32, 32, TextureOptions.BILINEAR_PREMULTIPLYALPHA);            this.mFaceTextureRegion = TextureRegionFactory.createFromAsset(this.mTexture, this, ""face_box.png"", 0, 0);            this.mOnScreenControlTexture = new Texture(256, 128, TextureOptions.BILINEAR_PREMULTIPLYALPHA);            this.mOnScreenControlBaseTextureRegion = TextureRegionFactory.createFromAsset(this.mOnScreenControlTexture, this, ""onscreen_control_base.png"", 0, 0);            this.mOnScreenControlKnobTextureRegion = TextureRegionFactory.createFromAsset(this.mOnScreenControlTexture, this, ""onscreen_control_knob.png"", 128, 0);            this.mEngine.getTextureManager().loadTextures(this.mTexture, this.mOnScreenControlTexture);    }    @Override    public Scene onLoadScene() {            this.mEngine.registerUpdateHandler(new FPSLogger());            final Scene scene = new Scene(1);            scene.setBackground(new ColorBackground(0.09804f, 0.6274f, 0.8784f));            final int centerX = (CAMERA_WIDTH - this.mFaceTextureRegion.getWidth()) / 2;            final int centerY = (CAMERA_HEIGHT - this.mFaceTextureRegion.getHeight()) / 2;            final Sprite face = new Sprite(centerX, centerY, this.mFaceTextureRegion);            scene.getTopLayer().addEntity(face);            final AnalogOnScreenControl analogOnScreenControl = new AnalogOnScreenControl(0, CAMERA_HEIGHT - this.mOnScreenControlBaseTextureRegion.getHeight(), this.mCamera, this.mOnScreenControlBaseTextureRegion, this.mOnScreenControlKnobTextureRegion, 0.1f, 200, new IAnalogOnScreenControlListener() {                    @Override                    public void onControlChange(final BaseOnScreenControl pBaseOnScreenControl, final float pValueX, final float pValueY) {                            face.setVelocity(pValueX * 100, pValueY * 100);                    }                    @Override                    public void onControlClick(final AnalogOnScreenControl pAnalogOnScreenControl) {                            face.addShapeModifier(new SequenceShapeModifier(new ScaleModifier(0.25f, 1, 1.5f), new ScaleModifier(0.25f, 1.5f, 1)));                    }            });            analogOnScreenControl.getControlBase().setBlendFunction(GL10.GL_SRC_ALPHA, GL10.GL_ONE_MINUS_SRC_ALPHA);            analogOnScreenControl.getControlBase().setAlpha(0.5f);            analogOnScreenControl.getControlBase().setScaleCenter(0, 128);            analogOnScreenControl.getControlBase().setScale(1.25f);            analogOnScreenControl.getControlKnob().setScale(1.25f);            analogOnScreenControl.refreshControlKnobPosition();            scene.setChildScene(analogOnScreenControl);            return scene;    }    @Override    public void onLoadComplete() {    }    // ===========================================================    // Methods    // ===========================================================    // ===========================================================    // Inner and Anonymous Classes    // ===========================================================   }</code></pre>","619128","","21234","","2011-02-16 11:03:11","2011-04-08 03:57:58","my coding indicate error?","<java><android><andengine>","3","1","","2012-08-22 13:48:43",""
"5015235","1","5015478","","2011-02-16 10:27:35","0","317","<p>i am making a app which generate buttons according to the value entered by user. each button have have there own function defined in XML. Now my main problem is how to shorten these codes. </p><pre><code>name[0].setClickable(true);    name[0].setOnClickListener(new View.OnClickListener() {        @Override        public void onClick(View v) {            // TODO Auto-generated method stub            name[0].setText(""kjghjbjhb"");        }    });    name[2].setClickable(true);    name[2].setOnClickListener(new View.OnClickListener() {        @Override        public void onClick(View v) {            // TODO Auto-generated method stub            name[2].setText(""kjghjbjhb"");        }    });name[1].setClickable(true);    name[1].setOnClickListener(new View.OnClickListener() {        @Override        public void onClick(View v) {            // TODO Auto-generated method stub            name[1].setText(""kjghjbjhb"");        }    });</code></pre><p>and soo on.....writing these codes again and again is not possible as button generated are dynamic, i dunno how many buttons will be generated. Please tell if there is a some other way to do this.</p>","614681","","24054","","2011-02-16 10:30:07","2011-02-16 10:50:24","Android Button Problem","<android><button><onclick>","2","0","","",""
"5015300","1","","","2011-02-16 10:32:58","1","440","<p>Is there a way to capture a new email sent event ? I tried using  a ContentObserver on ""content://gmail-ls/conversations"" but still no luck.</p><p>any ideas highly appreciated. </p><p>thanks</p>","192901","","","","","2011-02-16 10:32:58","Android's Gmail email sent event","<android><contentobserver>","0","1","","",""
"5015334","1","","","2011-02-16 10:36:09","0","2349","<p>I have created a custom list and managed to change the colors of the child items in normal and clicked view. But When I apply it to the focus view, then nothing happens and the default background color only gets displayed with the changed color of the text from white to black. Here are the xml files that I am using for what I have done so far. </p><p>Layout for listview (listview.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:padding=""18sp""    android:background=""@drawable/backgroundselector""&gt;    &lt;ImageView android:id=""@+id/imageView1""        android:layout_height=""fill_parent"" android:layout_gravity=""center_vertical""        android:layout_width=""wrap_content"" /&gt;    &lt;TextView android:text=""TextView"" android:id=""@+id/textView1""        android:layout_width=""wrap_content"" android:layout_height=""wrap_content""        android:paddingLeft=""10sp"" android:textSize=""20sp"" /&gt;&lt;/LinearLayout&gt;</code></pre><p>clicked.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;solid android:color=""#ffc61212"" /&gt; &lt;/shape&gt;</code></pre><p>focussed.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;solid android:color=""#ff26e0d7"" /&gt; &lt;/shape&gt;</code></pre><p>normal.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;solid android:color=""#ff0a4d66"" /&gt; &lt;/shape&gt;</code></pre><p>and finally backgroundselector.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:drawable=""@drawable/focussed"" /&gt; &lt;!-- focused --&gt;    &lt;item android:state_pressed=""true"" android:drawable=""@drawable/clicked"" /&gt; &lt;!-- pressed --&gt;    &lt;item android:drawable=""@drawable/normal"" /&gt; &lt;!-- default --&gt;&lt;/selector&gt; </code></pre><p>Please I need help on how can I change the color of the child item of my list view when a child item is focussed...</p>","619874","","","","","2011-02-16 15:03:51","Changing color of custom listview item on focus","<android><listview><colors><focus>","1","0","","",""
"5015358","1","5015513","","2011-02-16 10:38:24","0","672","<p>Let's say I got the absolute path into the photo. /mnt/sdcard/....jpg</p><pre><code>   String path = ""/mnt/sdcard/....jpg"";   BitmapDrawable d = new BitmapDrawable(this.getResources(), path);   d.setBounds(0, 0, d.getIntrinsicWidth(), d.getIntrinsicHeight());   overlayItem.setMarker(d);</code></pre><p>This is what i tried, however the photo does not display.</p><p>EDIT: fixed, wrong path to file.</p>","211071","","211071","","2011-02-16 11:30:03","2011-02-16 11:30:03","Set photo as marker in map","<android>","2","0","","",""
"5015507","1","5015554","","2011-02-16 10:53:28","1","3460","<p>In my app there is a service class and need to call an activity class from that service class,but it each time while calling the activity class its show me a message that application is not responding ,and below is my code..</p><pre><code>public class MyAlarmService_Movie extends Service {    @Override    public void onCreate() {        super.onStart(intent, startId);        Intent in=new Intent().setClass(MyAlarmService.this,Reminder.class);        startActivity(in);    }}</code></pre>","595226","","318465","","2011-02-16 11:39:20","2011-02-16 11:39:20","How to call An activity class from a service class","<android>","1","0","1","",""
"5015527","1","","","2011-02-16 10:56:00","0","1902","<p>I tried again this morning with the mediaPlayerVideo sample code provided with honeycomb SDK (in the APIDemo, section Media) and I got same error as before in ACodec.cpp.</p><p>Does it mean that Apple HTTP Streaming is not yet fixed in the preview ???</p><p>Did someone have a sucess story for that ???</p><p>Regards,Zbb</p><pre><code>02-16 09:41:24.233: VERBOSE/VideoViewDemo(634): startVideoPlayback02-16 09:41:24.262: INFO/LiveSession(600): onConnect 'http://xxx.xxx.xxx.xxx/downloads/ipad1/index.m3u8'02-16 09:41:24.262: INFO/NuHTTPDataSource(600): connect to xxx.xxx.xxx.xxx:80/downloads/ipad1/index.m3u8 @002-16 09:41:24.303: VERBOSE/TLINE(634): new: android.text.TextLine@4035cc5802-16 09:41:24.403: INFO/NuHTTPDataSource(600): connect to xxx.xxx.xxx.xxx:80/downloads/ipad1/02.m3u8 @002-16 09:41:24.534: INFO/NuHTTPDataSource(600): connect to xxx.xxx.xxx.xxx:80/downloads/ipad1/20110124T140613-02-246411.ts @002-16 09:41:25.142: DEBUG/VideoViewDemo(634): surfaceCreated called02-16 09:41:26.984: WARN/ActivityManager(35): Launch timeout has expired, giving up wake lock!02-16 09:41:28.553: INFO/NuHTTPDataSource(600): connect to xxx.xxx.xxx.xx:80/downloads/ipad1/20110124T140613-02-246412.ts @002-16 09:41:28.583: INFO/avc_utils(600): found AVC codec config (320 x 180, Main-profile level 1.3)02-16 09:41:28.794: INFO/ESQueue(600): found AAC codec config (24000 Hz, 2 channels)02-16 09:41:28.794: INFO/ESQueue(600): [ 02-16 09:41:28.833   600:0x283 F/ACodec   ]02-16 09:41:28.794: INFO/ESQueue(600): frameworks/base/media/libstagefright/ACodec.cpp:1594 CHECK_EQ( omx-&gt;allocateNode(componentName.c_str(), observer, &amp;node),(status_t)OK) failed: -2147483648 vs. 002-16 09:41:29.003: INFO/DEBUG(31): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***02-16 09:41:29.003: INFO/DEBUG(31): Build fingerprint: 'generic/sdk/generic:Honeycomb/HPI20B/eng.xav.20110125.162619:eng/test-keys'02-16 09:41:29.044: INFO/DEBUG(31): pid: 600, tid: 643  &gt;&gt;&gt; /system/bin/mediaserver &lt;&lt;&lt;02-16 09:41:29.086: INFO/DEBUG(31): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr deadbaad02-16 09:41:29.124: INFO/DEBUG(31):  r0 deadbaad  r1 0000000c  r2 00000027  r3 00000000</code></pre><hr><p>Http Streaming works on HoneyComb when using httplive as url scheme (instead of http) and using the Apple Stream. Samuh have sucess with AES-128 Encrypted streams.My stream cannot be read (althrough it can be on QuickTime)Now my question is how do you retreive those informations in the application</p><pre><code>02-21 17:43:11.480: INFO/NuHTTPDataSource(1298): connect to devimages.apple.com:80/iphone/samples/bipbop/gear4/prog_index.m3u8 @002-21 17:43:11.790: INFO/NuHTTPDataSource(1298): connect to devimages.apple.com:80/iphone/samples/bipbop/gear4/fileSequence90.ts @002-21 17:43:18.890: INFO/ESQueue(1298): found AAC codec config (22050 Hz, 1 channels)02-21 17:43:18.919: INFO/NuHTTPDataSource(1298): connect to devimages.apple.com:80/iphone/samples/bipbop/gear4/fileSequence91.ts @002-21 17:43:18.940: INFO/avc_utils(1298): found AVC codec config (480 x 360, Baseline-profile level 2.1)02-21 17:43:18.940: INFO/MPEG2TSExtractor(1298): haveAudio=1, haveVideo=1....02-21 17:43:26.470: INFO/NuHTTPDataSource(1298): connect to devimages.apple.com:80/iphone/samples/bipbop/gear4/fileSequence92.ts @002-21 17:43:28.800: WARN/AudioFlinger(1298): write blocked for 98 msecs, 237 delayed writes, thread 0xff40</code></pre>","617410","","106224","","2012-01-03 08:18:18","2013-08-18 18:33:29","Http Live Streaming in HoneyComb crashes","<android><streaming><live><android-3.0-honeycomb>","0","3","1","",""
"5015546","1","5243118","","2011-02-16 10:58:11","4","218","<p>I am wondering what <a href=""http://developer.android.com/reference/android/content/pm/InstrumentationInfo.html#functionalTest"" rel=""nofollow"">InstrumentationInfo#functionalTest</a> is supposed to achieve. Does it have any impact on how the application environment is started?</p>","127013","","","","","2011-03-09 08:30:35","InstrumentationTestRunner: What does android:functionalTest achieve?","<android><testing><instrumentation>","1","0","2","",""
"5015576","1","5016496","","2011-02-16 11:00:03","3","1167","<p>My team is working on an Android project which consists of several Android applications which exchange data (on the same phone). The idea is to have several applications which are collecting some data and send this data to the main application. The main challenge here is to do the exchange as cheap as possible in terms of CPU load &amp; battery usage.</p><p>As far as I know, there are two ways to achieve inter-process communications:</p><ol><li>Intents &amp; activities - one activity catches the intents of another</li><li>Remote methods (through AIDL)</li></ol><p>I wonder which of these is more efficient in the following scenarios:</p><ol><li>Very frequent messages/method calls with very little data sent/traffic (e.g. just passing a bunch of primitives)</li><li>Less frequent messages/method calls with large traffic chunks (e.g. collect data and periodically send a few KB/MB of data)</li><li>Very frequent messages/method calls with large data chunks exchanged</li></ol><p>I would appreciate any help, either in terms of comparison or a reference/link to a benchmark.</p>","395744","","","","","2013-08-12 10:44:15","Android Remote methods (AIDL) vs Intents - performance & battery usage","<android><performance><android-intent><interprocess><aidl>","3","1","2","",""
"5015592","1","5015725","","2011-02-16 11:02:10","1","11915","<p>So people are probably going to tell me this is a bad idea, but I'd like to at least give it a go. </p><p><strong>EDIT</strong> The intention of this app is that it can only work when the device is part of the same network the oracle db is on or is connected to the network via VPN. The information in the database is not going to be globally accessible, which is why I will need direct connection to the oracle db. </p><p>Now according to this thread</p><p><a href=""http://stackoverflow.com/questions/4991334/connecting-the-oracle-in-android-application/5013285#5013285"">Connecting the oracle in android application </a></p><p>He was successful in querying the oracle db.</p><p>So I have a fairly basic class that when initialised will try to get a connection to my database.</p><pre><code>package com.producermobile;import java.sql.Connection;import java.sql.DriverManager;import java.sql.ResultSet;import java.sql.SQLException;import java.sql.Statement;import android.util.Log;public class ConnectOra {    private Connection conn;    private Statement stmt;    public ConnectOra() throws ClassNotFoundException {        try {            Class.forName(""oracle.jdbc.driver.OracleDriver"");            String url = ""jdbc:oracle:thin:@x.x.x.x:1521:PR10"";            this.conn = DriverManager.getConnection(url,""xxx"",""xxx"");            this.conn.setAutoCommit(false);            this.stmt = this.conn.createStatement();        } catch(SQLException e) {            Log.d(""tag"", e.getMessage());        }           }    public ResultSet getResult() throws SQLException {        ResultSet rset = stmt.executeQuery(""select customer from customers"");        stmt.close();        return rset;                }}</code></pre><p>And in my main activity onCreate method I have this</p><pre><code>@Overridepublic void onCreate(Bundle savedInstanceState) {    try {        super.onCreate(savedInstanceState);        ConnectOra db = new ConnectOra();        ResultSet rs = db.getResult();        ArrayList&lt;String&gt; list = new ArrayList&lt;String&gt;();        while(rs.next()) {            list.add(rs.getString(1));        }        setListAdapter(new ArrayAdapter&lt;String&gt;(this, R.layout.list_item, list));        ListView lv = getListView();        lv.setTextFilterEnabled(true);              } catch(Exception e) {    }}</code></pre><p>In Eclipse I add the external ojdbc14.jar file to the build path.</p><p>However when I run</p><pre><code>this.conn = DriverManager.getConnection(url,""xxx"",""xxx"");</code></pre><p>I receive the following exception</p><blockquote>  <p>""Io exception: The Network Adapter  could not establish the connection""</p></blockquote><p>If however I create an instance of this class inside a standard java app with a main method, the connection works. Any ideas?</p>","564045","","564045","","2011-02-16 12:05:15","2014-02-21 09:17:59","Connecting to oracle in android","<java><android><oracle><jdbc>","4","0","3","",""
"5015598","1","","","2011-02-16 11:02:36","2","3479","<p>I'm making an http connection using following code:</p><pre><code>HttpClient client = new DefaultHttpClient();HttpPost httpPost = new HttpPost(url);HttpResponse response = client.execute(httpPost);</code></pre><p>I want to read a bytearray from the response object.</p><p>How would I do that?</p>","582788","","183172","","2011-02-16 11:07:43","2013-09-30 11:05:08","How can I read a bytearray from an HttpResponse?","<android>","3","1","3","",""
"5015635","1","","","2011-02-16 11:06:06","4","2033","<p>I have a problem.I'm trying to develop a program that uses the camera, everything is working in my device but like many of you know the <code>CameraPreview</code> doesn't work the same way in all devices, so I tried to integrate the code that google provides in this address:</p><p><a href=""http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/graphics/CameraPreview.html"" rel=""nofollow"">http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/graphics/CameraPreview.html</a></p><p>The problem I've faced is that I don't know how to integrate to my project, here is my code and what I've done without exceeding:</p><pre><code>Preview mPreview;private Camera mCamera;    @Overridepublic void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        mPreview = new Preview(this);        //ContentView----------------------------------------------------------        setContentView(R.layout.main);        mSurfaceView = (SurfaceView)findViewById(R.id.camera_surface);        mPreview.surfacemetod(mSurfaceView);   @Override   protected void onResume() {      // TODO Auto-generated method stub      super.onResume();          mCamera = Camera.open();      mPreview.setCamera(mCamera);</code></pre><p>Then the Preview class:</p><pre><code>class Preview extends ViewGroup implements SurfaceHolder.Callback {private final String TAG = ""Preview"";SurfaceView mSurfaceView;SurfaceHolder mHolder;Size mPreviewSize;List&lt;Size&gt; mSupportedPreviewSizes;Camera mCamera;Preview(Context context) {    super(context);    mSurfaceView = new SurfaceView(context);    addView(mSurfaceView);}public void surfacemetod(SurfaceView surface){    //mSurfaceView = new SurfaceView(context);    //addView(mSurfaceView);    // Install a SurfaceHolder.Callback so we get notified when the    // underlying surface is created and destroyed.    mHolder = mSurfaceView.getHolder();    mHolder.addCallback(this);    mHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);}public void setCamera(Camera camera) {    mCamera = camera;    if (mCamera != null) {        mSupportedPreviewSizes = mCamera.getParameters().getSupportedPreviewSizes();        requestLayout();    }}</code></pre><p>After this code there are all the methods in the link above that I didn't copy to save space.</p><p>The question is that when I run the code the mPreviewSize.with and mPreviewSize.height</p><pre><code>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(mPreviewSize.width, mPreviewSize.height);    requestLayout();    mCamera.setParameters(parameters);    mCamera.startPreview();}</code></pre><p>are null and I get a FORCE CLOSE</p><p>Essentially looks like it doesn't get inside OnMeasure to resolve them.Any idea?</p><p>This is the log:</p><pre><code>02-16 13:54:26.068: ERROR/AndroidRuntime(24374): FATAL EXCEPTION: main02-16 13:54:26.068: ERROR/AndroidRuntime(24374): java.lang.NullPointerException02-16 13:54:26.068: ERROR/AndroidRuntime(24374):     at com.dashboard.camera.lite.Preview.surfaceChanged(Preview.java:162)02-16 13:54:26.068: ERROR/AndroidRuntime(24374):     at android.view.SurfaceView.updateWindow(SurfaceView.java:554)02-16 13:54:26.068: ERROR/AndroidRuntime(24374):     at android.view.SurfaceView.dispatchDraw(SurfaceView.java:341)02-16 13:54:26.068: ERROR/AndroidRuntime(24374):     at android.view.ViewGroup.drawChild(ViewGroup.java:1638)02-16 13:54:26.068: ERROR/AndroidRuntime(24374):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1367)02-16 13:54:26.068: ERROR/AndroidRuntime(24374):     at android.view.ViewGroup.drawChild(ViewGroup.java:1638)02-16 13:54:26.068: ERROR/AndroidRuntime(24374):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1367)02-16 13:54:26.068: ERROR/AndroidRuntime(24374):     at android.view.View.draw(View.java:6796)02-16 13:54:26.068: ERROR/AndroidRuntime(24374):     at android.widget.FrameLayout.draw(FrameLayout.java:354)02-16 13:54:26.068: ERROR/AndroidRuntime(24374):     at android.view.ViewGroup.drawChild(ViewGroup.java:1640)02-16 13:54:26.068: ERROR/AndroidRuntime(24374):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1367)02-16 13:54:26.068: ERROR/AndroidRuntime(24374):     at android.view.View.draw(View.java:6796)02-16 13:54:26.068: ERROR/AndroidRuntime(24374):     at android.widget.FrameLayout.draw(FrameLayout.java:354)02-16 13:54:26.068: ERROR/AndroidRuntime(24374):     at com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:1894)02-16 13:54:26.068: ERROR/AndroidRuntime(24374):     at android.view.ViewRoot.draw(ViewRoot.java:1432)02-16 13:54:26.068: ERROR/AndroidRuntime(24374):     at android.view.ViewRoot.performTraversals(ViewRoot.java:1174)02-16 13:54:26.068: ERROR/AndroidRuntime(24374):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1752)02-16 13:54:26.068: ERROR/AndroidRuntime(24374):     at android.os.Handler.dispatchMessage(Handler.java:99)02-16 13:54:26.068: ERROR/AndroidRuntime(24374):     at android.os.Looper.loop(Looper.java:123)02-16 13:54:26.068: ERROR/AndroidRuntime(24374):     at android.app.ActivityThread.main(ActivityThread.java:4627)02-16 13:54:26.068: ERROR/AndroidRuntime(24374):     at java.lang.reflect.Method.invokeNative(Native Method)02-16 13:54:26.068: ERROR/AndroidRuntime(24374):     at java.lang.reflect.Method.invoke(Method.java:521)02-16 13:54:26.068: ERROR/AndroidRuntime(24374):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:858)02-16 13:54:26.068: ERROR/AndroidRuntime(24374):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)02-16 13:54:26.068: ERROR/AndroidRuntime(24374):     at dalvik.system.NativeStart.main(Native Method)</code></pre>","538092","","1553563","","2013-02-21 09:19:49","2013-02-21 09:19:49","android camera preview","<android><camera><preview>","1","0","","",""
"5015648","1","5376375","","2011-02-16 11:07:17","0","495","<p>can i merge three maven android project into a single one using maven ? </p><p>thanks </p><p>regards</p>","618195","","","","","2011-03-21 10:29:59","Maven android - merge different android project","<android><maven>","1","1","","",""
"5015686","1","6022474","","2011-02-16 11:11:22","19","18203","<p>How do I create spinner which allows to choose multiple items?</p>","468311","","2425452","","2013-08-01 21:25:18","2014-04-08 15:08:33","Android Spinner with multiple choice","<android><android-spinner>","4","3","14","",""
"5015691","1","5015970","","2011-02-16 11:12:21","0","1665","<p>How can I get name of an image button when I know its id?</p>","218679","","1288","","2011-02-16 12:25:46","2011-02-16 14:27:41","How can I get the name of an image button in Android?","<android>","2","2","0","2012-11-14 11:34:25",""
"5015716","1","","","2011-02-16 11:14:26","3","2722","<p>I am trying to implement Facebook into my app to allow things like sending stuff to the user's wall, updating status', etc.</p><p>So after downloading the stuff I was told to get a key using the keystore file. I decided to be brave and create my own keystore file (for publishing stuff later) and did so successfully. </p><p>After creating the file though I am having all sorts of problems trying to retreieve a key from it, i entered the command via keytool/command prompt and it asked me for my keystore password...</p><p>After entering the password i set in the first place, I am getting nothing but wierd ascii symbols and letters and my keystore details also in the middle of it. What is going wrong??</p><p>UPDATE:Ok, I am aware you may need to use OpenSSL to display the text correctly. I have installed OpenSSL but how do I use it to get the Hash code?</p>","601327","","601327","","2011-02-16 13:44:20","2014-03-23 06:25:41","Android - getting hash key for Facebook Integration","<java><android><facebook><sdk><keystore>","4","1","","",""
"5015841","1","","","2011-02-16 11:27:48","0","82","<p>I have developed an android game application.I want to save the values of sound like we save the value like name,email using shared preference.How can we keep the value of a variable saved even after app is terminated in android app?</p><p>I have uploaded my app on <a href=""http://www.megafileupload.com/en/file/301549/RoadTrip1-rar.html"" rel=""nofollow"">http://www.megafileupload.com/en/file/301549/RoadTrip1-rar.html</a> Can anyone help me</p><p>Thanks in advance</p><p>Regards Tushar</p>","475349","","","","","2011-02-16 14:20:54","saving values of sound in android","<android>","1","2","","",""
"5015856","1","5016485","","2011-02-16 11:29:54","2","909","<p>I have a <code>SAX</code> <a href=""http://developer.android.com/reference/org/xml/sax/helpers/DefaultHandler.html"" rel=""nofollow"">DefaultHandler</a> which parses an InputStream. I don't know how many elements are in the XML so I can't count them on <code>endElement</code> or simmilar. I <strong>do</strong> know the byte length of the <code>InputStream</code> (read from the http header) but I can't find a method to get the current bytewise progress of the parsing process.</p><p>Is there a way to get the current progress (i.e. bits processed) of the parsing process?</p><p>This is how the <code>DefaultHandler</code> gets called:</p><pre><code>SAXParserFactory factory = SAXParserFactory.newInstance();SAXParser parser = factory.newSAXParser();parser.parse(inputStream, myDefaultHandler);</code></pre>","288980","","493193","","2011-02-16 12:06:03","2013-03-23 12:12:19","Android: SAX parser progress monitoring","<android><xml><sax><saxparser>","2","0","0","",""
"5015910","1","","","2011-02-16 11:35:15","0","306","<p>What kind of technique does the Android Market Server use to build their server?I mean, like PHP, Ruby on rail? or something else?</p><p>Or it is just a web server like some web site and base on the HTTP protocol?</p><p>Why internet browser can not connect to the Android Market Server?</p>","487363","","288773","","2011-09-21 07:50:27","2011-09-21 07:50:27","Android Market Server","<android><web-services><google-play>","1","0","","",""
"5015994","1","","","2011-02-16 11:45:01","0","999","<p>I have been trying to make sense of some claims that Appcelerator Titanium makes. As per their site, if I know HTML and Java script, I can develop a native mobile app using their SDK. So I need someone to tell me this. </p><p>If I develop an app for calculating loan installments using a form in dream weaver that takes input (Down Payment Amount, Interest Rate, and Tenure) in text fields, apply form validation using Java script, and calculate the installment amount using Java Script, and then display the amount. </p><p>Will appcelerator turn all of this into a native app? Sounds too good to be true...</p>","619564","","","","","2011-02-16 14:38:09","Can you develop a mobile app in appcelerator using dreamweaver?","<iphone><android><appcelerator>","2","0","","",""
"5016021","1","","","2011-02-16 11:47:34","0","358","<p>I have a horizontal list of images. I want, if I long press the image and try to drag the image then...</p>","556807","","493193","","2011-02-16 12:01:45","2011-02-16 12:07:57","how to stop horizontal scrolling in case of long press","<android>","1","2","","",""
"5016097","1","5016398","","2011-02-16 11:56:51","3","4554","<p>I need to capture the screen shot of the present screen so I adopted the code below on the </p><pre><code>protected void onPause() {    // TODO Auto-generated method stub    super.onPause();    LinearLayout v = (LinearLayout) findViewById(R.id.mainLayout);    v.setDrawingCacheEnabled(true);    // this is the important code :)    // Without it the view will have a    // dimension of 0,0 and the bitmap will    // be null    v.measure(MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED),            MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED));    //v.layout(0, 0, v.getMeasuredWidth(), v.getMeasuredHeight());    v.layout(0, 0, v.getWidth(), v.getHeight());    v.buildDrawingCache(true);    Bitmap bm = Bitmap.createBitmap(v.getDrawingCache());    v.setDrawingCacheEnabled(false); //    if (bm != null) {        try {            String path = Environment.getExternalStorageDirectory()                    .toString();            OutputStream fOut = null;            File file = new File(path, ""screentest.jpg"");            fOut = new FileOutputStream(file);            bm.compress(Bitmap.CompressFormat.JPEG, 85, fOut);            fOut.flush();            fOut.close();            Log.e(""ImagePath"", ""Image Path : ""                    + MediaStore.Images.Media.insertImage(                            getContentResolver(), file.getAbsolutePath(),                            file.getName(), file.getName()));        } catch (Exception e) {            e.printStackTrace();        }    }}</code></pre><p>This code has worked fine for me but I need to capture the screen just after the screen loading is finished.</p><p>I have also tried the onPostCReate() but all goes to vain..</p><p>I also tried to call the code in the onPause() method but due to animation, the screen is triming a bit from the right and the bottom portion... so I cant even go for it...</p><p>Now its your turn to share your expertise.. </p><p>Any suggestions are greatly appreciated!!!!</p>","563735","","545691","","2011-02-16 12:01:40","2011-09-13 06:25:54","Screen capture from code","<android><screen><screenshot><capture>","1","1","3","",""
"5016152","1","5016391","","2011-02-16 12:02:30","1","1371","<p>I want to change my app name from ""com.myapp"" to ""MyApp""(this title is showing in the android app manager).</p><p>Thank you!</p>","449310","","","","","2012-03-27 01:13:57","android application title in application manager","<android><title>","2","2","","",""
"5016187","1","","","2011-02-16 12:05:23","1","899","<p>I made a little app on android where you can open (via the native file opener with filerefence.browse() it works beautifully) and save (directly to CameraRoll with addBitmapData also works perfectly) an image. Now i would like to share the saved image.</p><p>I would like to use the native android 'share picture via' popup. I found on a forum the native code for it ( <a href=""http://stackoverflow.com/questions/3553017/android-share-via-dialog"">Android Share Via Dialog</a> ).</p><p>Since we cannot execute native code for mobiles as i can read from the flash doc, is there a way to get this working at all?</p><p>Share via screenshot: <a href=""http://garr.me/wp-content/uploads/2009/12/sharevia.jpg"" rel=""nofollow"">http://garr.me/wp-content/uploads/2009/12/sharevia.jpg</a></p><p>Thanks a lot for the help!</p>","619585","","","","","2011-10-17 07:31:58","how to open 'share picture via' popup menu on Adobe AIR for android?","<android><air><adobe><popup><native>","3","0","1","",""
"5016203","1","5017201","","2011-02-16 12:06:34","1","266","<p>I am writing a jabber messenger for android and would like to check the Phone Contact list for potential chat partners ;)</p><p>Cannot figure out how to get the specific property of the Contact. Getting DisplayName is not the Problem but getting IM UserNames.</p><p>Can somebody maybe just post a query and the code where the jabber UserName is extracted? I just don't get it</p><p>Thanks in advanceM</p>","619590","","180538","","2011-02-16 13:46:06","2011-02-16 13:46:06","Getting an IM Property from Contact","<android><xmpp><android-contacts>","1","0","","",""
"5016215","1","5018917","","2011-02-16 12:07:33","2","3278","<p>My huge spinner: <a href=""http://i.stack.imgur.com/zNxdX.jpg"" rel=""nofollow"">http://i.stack.imgur.com/zNxdX.jpg</a></p><p>As you can see in the picture, my spinner is way too huge. I can't seem to find the problem.Here is the code:</p><pre><code>    RelativeLayout.LayoutParams lpSpinner = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.WRAP_CONTENT, RelativeLayout.LayoutParams.WRAP_CONTENT);    spTest = new Spinner(this);    String[] spinnerArray={""1"",""2"",""3"",""4"",""5"",""6"",""7"",""8"",""9"",""10""};    ArrayAdapter&lt;String&gt; spinnerArrayAdapter = new ArrayAdapter&lt;String&gt;(this, android.R.layout.simple_dropdown_item_1line, spinnerArray);    spTest.setAdapter(spinnerArrayAdapter);    spTest.setId(4);    lpSpinner.addRule(RelativeLayout.ALIGN_RIGHT, lblText.getId());    relative.addView(spTest, lpSpinner);</code></pre><p>what am i doing wrong?</p>","619569","","","","","2011-02-16 16:13:19","Size of my Spinner too big","<java><android>","2","0","1","",""
"5016224","1","5016270","","2011-02-16 12:08:26","2","300","<p>In a Nodelist.item[index].getChildNodes(), i am getting some junk values in between all the nodes like ""#text"", what could be the reason ? this is causing an error... Could anyone tell me any permanent fix for this.. is this some sort of namespace issue?</p>","448005","","","","","2011-02-17 00:32:35","XML Parsing issue in android","<android><xml>","4","0","","",""
"5016266","1","","","2011-02-16 12:12:56","2","1562","<p>I want to read and understand what is being written to traces.txt file whenever application forcecloses. I am iplementing app, in that I am fetching data from web and set it to imageview and textview . When I run that app , it takes more time to fetch image and set it to imageview inbetween forceclose is happening and saying activity not responding.</p><p>Thanks,Vishakha.</p>","613002","","","","","2011-02-16 12:17:44","how to get and read traces.txt file in android","<android>","2","0","","",""
"5016319","1","6472060","","2011-02-16 12:18:44","1","681","<p>Is it possible to define a 'virtual size' for ListView in Android and thereby have it allocate more views and get these earlier before they are visible on the screen? For example, if my listview is 400px high, and my items are 100px high, listview will allocate ~5 item views and reuse these as the list scrolls. Is it possible to define a virtual head and tail size for listview (off-screen) such that items in this space are getView()'ed? </p><p>My problem: I have a list with items that each contain a photo read async from storage (sd-card). This entails a certain latency for when the item is ready. When I fling the list, a few top/bottom (flinging down/up) number of new items are in the process of being loaded. The system can keep up => throughput is ok, but the read latency is the problem. If listview could have some extra off-screen items that were scrolled in, this would probably resolve my problem.</p><p>Any inputs?</p>","619586","","","","","2011-06-24 18:16:02","Virtual size of android ListView?","<android><listview>","2","0","1","",""
"5016368","1","","","2011-02-16 12:22:48","0","5387","<p>I am a novice at Android programming. How can I make a program that will draw an analog clock such that it can show time for various timezones as the user selects?</p><p>I had already Googled for the last few hours, but didn't find any particular solution to this problem. What I got completely puzzled me out. Please help me.</p>","606265","","2633423","","2013-10-05 12:18:14","2013-10-05 12:18:14","Android programming - drawing analog clock","<android><time>","5","3","1","",""
"5016448","1","","","2011-02-16 12:32:20","1","5326","<p>how can i stop the animation ..this is my code </p><pre><code>import android.app.Activity;import android.os.Bundle;import android.view.View;import android.view.animation.Animation;import android.view.animation.AnimationUtils;import android.widget.Button;import android.widget.ImageView;public class animation extends Activity {    ImageView img;    Animation an;    Button bt;    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        img = (ImageView)findViewById(R.id.ImageView01);        an = AnimationUtils.loadAnimation(this, R.anim.anim);        bt= (Button)findViewById(R.id.Button01);        bt.setOnClickListener(new View.OnClickListener() {            @Override            public void onClick(View v) {                // TODO Auto-generated method stub                img.startAnimation(an);            }        });    }}</code></pre>","607853","","180538","","2011-02-16 13:28:46","2012-05-23 08:46:26","how can i stop animation","<android><animation><cancel>","2","1","","",""
"5016460","1","5016557","","2011-02-16 12:34:06","0","251","<p>In my android application, i have a genre list where, according to the selections made the thumbnails are uploaded to the selected one. I do the uploading of thumbnails by parsing my xml file. Even at the second time of selecting a genre from the list, loading time is same.</p><p>If the thumbnails are stored or cached , can the time for loading be reduced?</p><p>Which is best- storing in hard disk or creating a database? </p><p>Thanks in Advance,Niki</p>","606335","","135152","","2011-05-25 02:56:19","2011-05-25 02:56:19","Which is best in performance speed for an android application: storing in database or hard disk?","<android><sqlite>","1","0","","",""
"5016523","1","5017323","","2011-02-16 12:39:42","2","4422","<p>There really seems to be no information on how to acess the front facing camera on android phones (gingerbread).</p><p>Could someone please point me to a page or post that explains how it's done?</p><p>Thanks!</p>","619622","","21234","","2011-02-16 14:27:06","2012-10-31 15:53:20","Android: Acessing front facing camera for Android 2.3","<android><camera><android-sdk-2.3>","2","1","2","",""
"5016582","1","","","2011-02-16 12:44:39","1","6908","<p>Any ideas why the followng fails on Android 2.2... </p><p>java.text.ParseException: Unparseable date: 2011-02-16 11:38:03.328 UTC</p><p>...while it works fine on a sun JRE 1.6 ?</p><pre><code>DateFormat dateFormat = new SimpleDateFormat(""yyyy-MM-dd HH:mm:ss.S z"");    try    {      Date date = dateFormat.parse(""2011-02-16 11:38:03.328 UTC"");    }    catch (ParseException e)    {      e.printStackTrace();    }</code></pre><p>As mentioned ion Comment, can make the test even simpler:</p><pre><code>new SimpleDateFormat(""z"").parse(""UTC"")</code></pre><p>This throws a parse exception. I am using a nexus one device, android 2.2</p>","508047","","508047","","2011-02-18 09:39:13","2012-08-16 13:29:24","Android SimpleDateFormat fails to parse datetime (works fine on sun 1.6 jre)","<android><date-format><simpledateformat>","4","5","","",""
"5016596","1","","","2011-02-16 12:46:21","1","3747","<p>my problem is, I have custom listView filled from Runnable returnRes. It fills particular data in layout I have named as lay (R.id.layoutList). My aim is to have different colour for each lay in my listView, I want to switch colours between each. 1st is dark blue, second light blue, thir dark blue and so on... This code is doing well, but with no result, my custom listView is still black, when I change it in XML, it is changing, but not when it is set from Java. Any ideas? </p><p>Thanks</p><pre><code>private Runnable returnRes = new Runnable() {    @Override    public void run() {        if(myTasks != null &amp;&amp; myTasks.size() &gt; 0){            TasksAdapter.notifyDataSetChanged();            LinearLayout lay=(LinearLayout)findViewById(R.id.layoutList);            for(int i=0;i&lt;myTasks.size();i++){                TasksAdapter.add(myTasks.get(i));                if(i&gt;0){                    if(i%2==0){                        lay.setBackgroundColor(R.color.background);                    }                }else{                    if(i&gt;0){                        lay.setBackgroundColor(R.color.lightBlue);                    }                }            }        }        ProgressDialog.dismiss();        TasksAdapter.notifyDataSetChanged();    }  };</code></pre>","513956","","795446","","2011-06-29 06:31:04","2012-10-20 20:49:21","Android - background change from Java code","<android><android-layout>","2","1","","",""
"5016660","1","5016729","","2011-02-16 12:53:46","3","10341","<p>I am trying to access to HTML5 database when I was building an Android App using PhoneGap + jQuery Mobile. It is strange that the following code can get different results. It can get correct result in Galaxy S 2.2 (chris, lulu, chris), but in Cliq TX (Android 2.1) the app get crushed (the last alert is createTable()), and in Emulator 2.3 the app crashed at the first alert. I pulled the database out and found that it is correctly created. I think it is hard to explain those problems, why such simple codes cause so many problems? Dose someone have success on accessing the database?</p><p>Thank you in advance.</p><pre><code>    function init() {    alert('init()');    document.addEventListener(""deviceready"", onDeviceReady, false);}function onDeviceReady() {    if (!window.openDatabase) {        alert('Local Databases are not supported.');    } else {        db = window                .openDatabase(""YCHW"", ""1.0"", ""YCHW"", 200000);    }    dropTable();    createTable();    insertData();    selectData();}function dropTable(){    alert('dropTable()');    db.transaction(        function (transaction) {            transaction.executeSql(""DROP TABLE measurements;"", [], nullDataHandler, errorHandler);        }    );    console.log(""Table 'measurements' has been dropped."");    // location.reload();}function createTable(){    alert('createTable()');    db.transaction(        function (transaction) {            transaction.executeSql('CREATE TABLE IF NOT EXISTS measurements(id INTEGER NOT NULL PRIMARY KEY, user TEXT NOT NULL, date TEXT NOT NULL, height INTEGER NOT NULL, weight INTEGER NOT NULL, bmi REAL NOT NULL, abnormal INTEGER NOT NULL);', [], nullDataHandler, errorHandler);        }    );    console.log(""Table 'measurements' has been created."");}function insertData(){    alert('insertData()');    db.transaction(        function (transaction) {            var data = ['1','chris','2000-02-22 00:00:00.000','170','60', '20', '0'];            transaction.executeSql(""INSERT INTO measurements(id, user, date, height, weight, bmi, abnormal) VALUES (?, ?, ?, ?, ?, ?, ?)"", [data[0], data[1], data[2], data[3], data[4], data[5], data[6]]);            data = ['2','lulu','2000-02-22 00:00:00.000','170','60', '20.12', '0'];            transaction.executeSql(""INSERT INTO measurements(id, user, date, height, weight, bmi, abnormal) VALUES (?, ?, ?, ?, ?, ?, ?)"", [data[0], data[1], data[2], data[3], data[4], data[5], data[6]]);            data = ['3','chris','2222-02-22 00:00:00.000','170','60', '20.12', '1'];            transaction.executeSql(""INSERT INTO measurements(id, user, date, height, weight, bmi, abnormal) VALUES (?, ?, ?, ?, ?, ?, ?)"", [data[0], data[1], data[2], data[3], data[4], data[5], data[6]]);        }    );    console.log(""Data has been inserted."");}function selectData(){    alert('selectData()');    db.transaction(        function (transaction) {            transaction.executeSql('SELECT * FROM measurements;', [], dataSelectHandler, errorHandler);        }    );    console.log(""Data has been selected."");}function dataSelectHandler(transaction, results){    alert('dataSelectHandler()');    for (var i=0; i&lt;results.rows.length; i++) {        var row = results.rows.item(i);        var measurement = new Object();        measurement.id   = row['id'];        measurement.user = row['user'];        alert(measurement.user);    }}function nullDataHandler(){    alert('nullDataHandler()');    console.log(""nullDataHandler()"");}function errorHandler(transaction, error){    alert('errorHandler()');    if (error.code==1){        // DB Table already exists        alert('DB Table already exists');    } else {        // Error is a human-readable string.        console.log('Oops.  Error was '+error.message+' (Code '+error.code+')');        alert('Oops.  Error was '+error.message+' (Code '+error.code+')');    }    return false;}</code></pre>","479927","","","","","2011-03-15 05:48:05","PhoneGap + jQuery Mobile access HTML5 Sqlite database problem in Android 2.1","<jquery><android><sqlite><html5><mobile>","1","0","","",""
"5016674","1","5063213","","2011-02-16 12:55:12","3","1804","<p>I want image being shown in imageview to be selected with particular portion(and only selected portion needs to highlighted and other portion to be semi transparent) and that portion can also be resized as needed or done done by user on touch event. </p><p>Now, the selected portion of image is needed to be croped and then show and save that cropped image.</p><p>EDIT:</p><p>I used Intent to open the image and crop it using intent.putExtra(""crop"",""true"");</p><p>But while passing intent I want to open image whose URI is already known instead of opening the whole album of image gallery. </p><p>Can anyone suggest, how can I open particular URI through intent passing for opening image.Thanks in advance.</p>","493193","","493193","","2011-02-21 13:39:51","2011-02-23 08:47:56","How do I crop an image whose URI is known in Android?","<android><image><crop>","3","31","3","",""
"5016695","1","5017136","","2011-02-16 12:57:57","2","784","<p>is there a way to do the ""slide to unlock"" text animation on iphone, developed on android?</p><p>Thanks</p><p>Daniel</p>","237115","","","","","2013-02-13 10:29:51","Android - ""slide to unlock"" text animation on iphone, developed on android?","<android><animation>","1","1","","",""
"5016698","1","5159570","","2011-02-16 12:58:04","2","1412","<p>I'm trying to create a word jumble game where you drag a letter right or left in the jumbled word and the letters swap. What is the best way to reorder items in a RelativeLayout programmatically so when the letter is dragged left the letters that the tile passes are positioned to the right of the dragged letter.</p><p>I've tried something like this as a basic test.</p><pre><code>public static void moveTile(Tile tile, int x, RelativeLayout parent) {    if (x &lt; tile.getWidth()) {        RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);        params.addRule(RelativeLayout.LEFT_OF, tile.getId() - 1);        tile.setLayoutParams(params);        RelativeLayout.LayoutParams p = new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);        p.addRule(RelativeLayout.RIGHT_OF, tile.getId());        Tile t = (Tile) parent.findViewById(tile.getId() - 1);        t.setLayoutParams(p);    }    parent.invalidate();}</code></pre><p>But this causes the app to crash with an error about ""Circular dependancies cannot exist in a RelativeLayout"" which I understand but I'm just not sure what other way to do this.</p><p>Any help will be much appreciated.</p>","305211","","","","","2011-03-01 19:52:01","Programmatically reorder RelativeLayout","<java><android>","3","0","1","",""
"5016774","1","5016834","","2011-02-16 13:06:13","1","1368","<p>I'd like to have an <code>EditText</code> and an <code>ImageView</code> next to each other; the <code>ImageView</code> has a fixed width, the <code>EditText</code> should take the rest.</p><p>I try to do it via</p><pre><code>            &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;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;EditText android:id=""@+id/edit_select_stop"" android:layout_width=""fill_parent"" android:layout_height=""wrap_content"" /&gt;            &lt;/LinearLayout&gt;            &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;ImageView android:layout_gravity=""center_vertical""                    android:layout_width=""39dp"" android:minWidth=""39dp""                    android:layout_height=""wrap_content"" android:src=""@drawable/icon_time""                    android:id=""@+id/image_select_time""&gt;&lt;/ImageView&gt;            &lt;/LinearLayout&gt;        &lt;/LinearLayout&gt;</code></pre><p>But now, the EditText takes the whole width and covers the Image. </p><p>How can I achieve that EditText ""ends"" before the ImageView?</p>","27404","","299797","","2013-01-02 04:18:12","2013-01-02 04:18:12","Android: EditText next to ImageView - EditText as wide as possible","<android><android-layout>","3","0","","",""
"5016821","1","5016863","","2011-02-16 13:10:53","2","1733","<p>I have a Listview that originally listed items from a menu item with one single TextView. The code I used to retrieve the item selected is </p><pre><code>  menuList.setOnItemClickListener(new AdapterView.OnItemClickListener() {    public void onItemClick(AdapterView&lt;?&gt; parent, View itemClicked, int position, long id)    {                  TextView textView = (TextView) itemClicked;                  String strText = textView.getText().toString();    });  </code></pre><p>I've now added another TextView so that I have two values for each item one under the other and my menu_item.xml looks like this</p><pre><code>&lt;RelativeLayout     xmlns:android=""http://schemas.android.com/apk/res/android""     android:layout_width=""fill_parent""     android:layout_height=""fill_parent""     android:orientation=""horizontal""     android:padding=""10sp""&gt;     &lt;TextView        android:id=""@+id/rowid""        android:layout_width=""wrap_content""         android:layout_height=""wrap_content""        android:textColor=""@color/exhibitor_header"" /&gt;      &lt;TextView        android:id=""@+id/rowidtwo""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:textColor=""@color/listview_background""        android:layout_below=""@+id/rowid""/&gt;  &lt;/RelativeLayout&gt;</code></pre><p>How can I retrieve the value for rowid when the item is selected?</p>","616076","","244296","","2011-02-16 13:17:08","2011-02-16 13:21:33","Retrieving a value from a Listview menu item that has two separate TextViews","<android><android-layout>","2","0","","",""
"5017080","1","","","2011-02-16 13:34:52","3","3779","<p>I tried to develop an like contacts ListView for my own listview, for do that I develop an activity with an ListView which use an my owm Adapter.</p><p>This adapter extends BaseAdapter and implements SectionIndexer, and I have got this result:</p><p><img src=""http://i.stack.imgur.com/GA7Mt.png"" alt=""My result""></p><p>But I would like have a result like this (this screenshot was captured on a Samsung Galaxy S):</p><p><img src=""http://i.stack.imgur.com/eSUz2.png"" alt=""Samsung Galaxy S""></p><p>Someone could give me the right way?</p><p>Thanks in advance.</p>","554892","","","","","2011-09-18 14:36:00","Contacts like ListView","<android><listview>","0","7","","2011-09-18 14:40:01",""
"5017093","1","5017146","","2011-02-16 13:35:52","3","8589","<p>Any one suggest some sample to upload an video to from sdcard to remote server.</p><p>Thanks in advance.</p>","555806","","","","","2013-04-11 06:41:03","Upload Video from android to server?","<android><video-processing>","4","2","7","",""
"5017135","1","5017161","","2011-02-16 13:39:37","7","792","<p>Do I need to restart the emulator everytime I make an edit to the app I'm working on? Also I have created a databse in one of my apps and open this app in the same emulator each time. Each time I open the app does it create a new database on the emulator or when I close it and re open it is the database still there with all the stored values?</p>","614460","","","","","2012-03-26 07:36:56","Emulator questions","<android><android-emulator>","4","0","0","",""
"5017176","1","5017380","","2011-02-16 13:43:08","3","765","<p>Is it a good practice to null references to Activity Context, when my Activity finishes? I have 3 AsyncTask's, each of them can be running in several instances simultaneously. The update the UI in onPostExecute(). Nulling all Activity Context references in onDestroy() would be quite difficult and make the code messy. What is the best thing to do?</p>","243225","","","","","2011-02-16 14:03:11","Should I null references to Activity Context, when my Activity finishes?","<android><android-asynctask>","4","0","1","",""
"5017285","1","","","2011-02-16 13:52:31","0","2412","<p>Hi I am totally new to android, so this is a very basic question.</p><p>I want to change the text in a Edittext from another class but the  program crashes every time. </p><p>My question is, how do i call newTxt() from another class (that extends homesc1 )?</p><p>This is my code.</p><pre><code>public class homesc1 extends Activity {    /** Called when the activity is first created. */    public EditText clickEditText;    int count =0;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        clickEditText = (EditText)findViewById(R.id.editTextClick);        newTxt(""Works fine. call from same class"");    }    public void newTxt(String txt) {        clickEditText.setText(txt);    }}public class SubC extends homesc1 { public void retur(){  //clickEditText.setText(""RETUR"");  newTxt(""this crashes the program, no compile error""); }} // called is other class with:SubC SC = new SubC();SC.retur();</code></pre><p>[EDIT] the Log Cat:</p><pre><code>02-16 18:40:44.705: ERROR/AndroidRuntime(447): ERROR: thread attach failed02-16 18:40:46.795: ERROR/AndroidRuntime(455): ERROR: thread attach failed02-16 18:40:47.705: WARN/dalvikvm(462): threadid=3: thread exiting with uncaught exception (group=0x4001b188)02-16 18:40:47.727: ERROR/AndroidRuntime(462): Uncaught handler: thread main exiting due to uncaught exception02-16 18:40:47.755: ERROR/AndroidRuntime(462): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.huskkage.android.but2ud/com.huskkage.android.but2ud.homesc1}: java.lang.NullPointerException02-16 18:40:47.755: ERROR/AndroidRuntime(462):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2496)02-16 18:40:47.755: ERROR/AndroidRuntime(462):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512)02-16 18:40:47.755: ERROR/AndroidRuntime(462):     at android.app.ActivityThread.access$2200(ActivityThread.java:119)02-16 18:40:47.755: ERROR/AndroidRuntime(462):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863)02-16 18:40:47.755: ERROR/AndroidRuntime(462):     at android.os.Handler.dispatchMessage(Handler.java:99)02-16 18:40:47.755: ERROR/AndroidRuntime(462):     at android.os.Looper.loop(Looper.java:123)02-16 18:40:47.755: ERROR/AndroidRuntime(462):     at android.app.ActivityThread.main(ActivityThread.java:4363)02-16 18:40:47.755: ERROR/AndroidRuntime(462):     at java.lang.reflect.Method.invokeNative(Native Method)02-16 18:40:47.755: ERROR/AndroidRuntime(462):     at java.lang.reflect.Method.invoke(Method.java:521)02-16 18:40:47.755: ERROR/AndroidRuntime(462):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)02-16 18:40:47.755: ERROR/AndroidRuntime(462):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)02-16 18:40:47.755: ERROR/AndroidRuntime(462):     at dalvik.system.NativeStart.main(Native Method)02-16 18:40:47.755: ERROR/AndroidRuntime(462): Caused by: java.lang.NullPointerException02-16 18:40:47.755: ERROR/AndroidRuntime(462):     at android.app.Activity.findViewById(Activity.java:1612)02-16 18:40:47.755: ERROR/AndroidRuntime(462):     at com.huskkage.android.but2ud.homesc1.newTxt(homesc1.java:67)02-16 18:40:47.755: ERROR/AndroidRuntime(462):     at com.huskkage.android.but2ud.SubC.retur(SubC.java:10)02-16 18:40:47.755: ERROR/AndroidRuntime(462):     at com.huskkage.android.but2ud.homesc1.onCreate(homesc1.java:56)02-16 18:40:47.755: ERROR/AndroidRuntime(462):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)02-16 18:40:47.755: ERROR/AndroidRuntime(462):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2459)02-16 18:40:47.755: ERROR/AndroidRuntime(462):     ... 11 more02-16 18:40:47.805: ERROR/dalvikvm(462): Unable to open stack trace file '/data/anr/traces.txt': Permission denied02-16 18:40:56.735: WARN/ActivityManager(63): Launch timeout has expired, giving up wake lock!02-16 18:40:57.247: WARN/ActivityManager(63): Activity idle timeout for HistoryRecord{43d5ed00 com.huskkage.android.but2ud/.homesc1}</code></pre>","619723","","23033","","2011-02-18 05:49:26","2013-03-06 12:23:43","EditText.settext from another class","<android>","5","11","1","",""
"5017292","1","","","2011-02-16 13:53:22","12","62052","<p>I want to save a file on internal storage into a specific folder. My code is </p><pre><code>File mediaDir = new File(""media"");if (!mediaDir.exists()){   mediaDir.createNewFile();   mediaDir.mkdir();}File f = new File(getLocalPath());f.createNewFile();FileOutputStream fos = new FileOutputStream(f);fos.write(data);fos.close();</code></pre><p><code>getLocalPath</code> returns <code>/data/data/myPackage/files/media/qmhUZU.jpg</code> but when I want to create the media folder I'm getting the exception ""java.io.IOException: Read-only file system"". Any ideas how to write my files on internal phone storage in in folder media? Thanks.</p>","517558","","1288","","2011-02-16 13:57:54","2013-09-27 11:57:50","Android create file on internal storage","<android><file><storage><internal>","5","3","8","",""
"5017349","1","5018172","","2011-02-16 14:00:30","0","727","<p>I decided to write simple alarm clock (using AlarmManager). When alarm works out I want to show simple dialog with 2 buttons: OK and Snooze. So I have a question: what should I connect with my Pending Intent? I mean Service, Activity or BroadcastReceiver?At present version I use BroadcastReceiver where I start Activity that shows the dialog. I start it with flag FLAG_ACTIVITY_NEW_TASK. In onStrat() method I start music service. When OK button's pressed I call finish() for activity and stop music. In OnPause() I call finish() also. I do it because if two alarms run simultaneously then according to activity life cycle method onPause() will be called. It works... but sometime the music starts for a few seconds then finishes....then start again and finishes and so on. Why? Thanks.</p>","577841","","","","","2011-02-16 15:13:02","android: AlarmManager and activity life cycle","<android><activity><dialog><alarmmanager>","1","0","","",""
"5017353","1","","","2011-02-16 14:00:56","0","561","<p>I have a problem while taking video , after 8 or 12 second it shows an error ""Size limit reached"" , i use <code>MediaStore.Video.EXTRA_SIZE_LIMIT=9999999999l</code> and <code>MediaStore.EXTRA_DURATION_LIMIT=90</code> in intent extra.Whether it is device problem or have a problem in manifest or code need to be changed ah?</p><p><img src=""http://i.stack.imgur.com/i3zVd.png"" alt=""This is the error i got""></p><p>Thanks in advance.</p>","483901","","180538","","2011-02-16 14:11:37","2011-02-16 14:13:38","SIZE LIMIT reached error in android?","<android><video>","1","1","","",""
"5017455","1","","","2011-02-16 14:11:45","9","28980","<p>I'm facing to a problem with a Samsung Galaxy Tab. I want to use the camera flash as torch.</p><p>Does anyone know how to enable it ?</p><p>Hereby a code that works to enable/disable the camera flash on a HTC Desire but fails on Samsung Galaxy Tab.</p><p><em><strong>FlashLight.java :</em></strong></p><pre><code>package com.example.FlashLight;import android.app.Activity;import android.hardware.Camera;import android.hardware.Camera.Parameters;import android.os.Bundle;import android.util.Log;import android.view.View;import android.view.View.OnClickListener;import android.widget.Button;public class FlashLight extends Activity {    private final static String LOG_TAG = ""FlashLight"";    private Button mOnBtn;    private Button mOffBtn;    private Camera mCamera;    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        mOnBtn = (Button) findViewById(R.id.on_btn);        mOnBtn.setOnClickListener(new OnClickListener() {            @Override            public void onClick(View v) {                processOnClick();            }        });        mOffBtn = (Button) findViewById(R.id.off_btn);        mOffBtn.setOnClickListener(new OnClickListener() {            @Override            public void onClick(View v) {                processOffClick();            }        });   }    @Override    protected void onResume() {        super.onResume();        try{            mCamera = Camera.open();        } catch( Exception e ){            Log.e(LOG_TAG, ""Impossible d'ouvrir la camera"");        }    }    @Override    protected void onPause() {        if( mCamera != null ){            mCamera.release();            mCamera = null;        }        super.onPause();    }    private void processOffClick(){        if( mCamera != null ){            Parameters params = mCamera.getParameters();            params.setFlashMode( Parameters.FLASH_MODE_OFF );            mCamera.setParameters( params );        }    }    private void processOnClick(){        if( mCamera != null ){            Parameters params = mCamera.getParameters();            params.setFlashMode( Parameters.FLASH_MODE_TORCH );            mCamera.setParameters( params );        }    }}</code></pre><p><em><strong>AndroidManifest.xml :</em></strong>                </p><pre><code>    &lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;        &lt;activity android:name="".FlashLight""                  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-permission android:name=""android.permission.CAMERA"" /&gt;    &lt;uses-feature android:name=""android.hardware.camera"" /&gt;    &lt;uses-feature android:name=""android.hardware.camera.autofocus"" /&gt;&lt;/manifest&gt;</code></pre><p><em><strong>layout/main.xml :</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:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    &gt;    &lt;Button          android:id=""@+id/on_btn""        android:layout_width=""fill_parent""         android:layout_height=""wrap_content""         android:text=""Flash ON"" /&gt;    &lt;Button          android:id=""@+id/off_btn""        android:layout_width=""fill_parent""         android:layout_height=""wrap_content""         android:text=""Flash OFF"" /&gt;&lt;/LinearLayout&gt;</code></pre><p>Thanks !</p>","590392","","590392","","2011-02-16 14:56:48","2013-06-24 17:35:12","How to use camera flash/led as torch on a Samsung Galaxy Tab?","<android><tabs><camera><galaxy><led>","4","3","8","",""
"5017469","1","5017640","","2011-02-16 14:13:36","0","2104","<p>I have a problem. I have 3 - 4 Activities. One of those is main and a second one is Preference Screen. I have a preference screen with different Preferences like ListPreference etc that have default values. How can i activate default Value of Settings when I start my project ?Because they activated only when I start Settings Activity. Shortly: I need to use default value in main activity without passing Settings Activity.</p>","602011","","","","","2011-02-16 14:48:05","Android: Preference default Value","<android>","3","0","","",""
"5017513","1","","","2011-02-16 14:17:51","2","1857","<p>I created a custom EditText (actually, I just set a background drawable). The problem is that its text is always top-aligned, and I want it to be vertical-center-aligned. I've already tried to set its gravity to CENTER_VERTICAL, but it doesn't work. This is the drawable I created:</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"" android:gravity=""center_vertical""&gt; &lt;solid android:color=""#FFFFFF""/&gt; &lt;stroke android:width=""1dp"" android:color=""#88BA52"" /&gt;   &lt;corners     android:bottomRightRadius=""10dp""     android:bottomLeftRadius=""10dp""     android:topLeftRadius=""10dp""     android:topRightRadius=""10dp""/&gt;&lt;/shape&gt;</code></pre><p>And here's how I create it:</p><pre><code>searchEditText = new EditText(getContext());searchEditText.setTextSize(12);searchEditText.setSingleLine();searchEditText.setGravity(Gravity.CENTER_VERTICAL);searchEditText.setHint(R.string.search_hint);searchEditText.setBackgroundDrawable(        getResources().getDrawable(R.drawable.search_field));addView(searchEditText);</code></pre>","595881","","595881","","2011-02-22 21:28:49","2013-01-16 16:18:20","Custom EditText vertical alignment","<android><edittext><custom-view><android-edittext>","2","0","1","",""
"5017555","1","5017977","","2011-02-16 14:21:31","0","3059","<p>Whenever I create a new Android project in Eclipse, it shows an error in the project name and not anywhere else. What is the problem? How can I solve it?</p>","596364","","1128737","","2012-01-13 11:05:22","2012-01-13 11:05:22","Error in Android project name in Eclipse","<java><android><eclipse>","2","6","","",""
"5017559","1","","","2011-02-16 14:21:55","0","1136","<p>I might like to parse the following XML that contains entrities.</p><pre><code>&lt;node&gt;    &lt;text&gt;&lt;title&gt;foo fo &amp;lt;BR&amp;gt;bar bar &lt;/title&gt;&lt;/text&gt;&lt;/node&gt;</code></pre><p>The parsing works. But after the entrities I do not receive any output. Using CDATA is not possible at the position.</p><p>I'm using the following code: </p><pre><code>        urlConnection.getInputStream());        DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();        factory.setExpandEntityReferences(false);        DocumentBuilder builder = factory.newDocumentBuilder();        doc = builder.parse(in);</code></pre><p>Does anyone got an idea? </p><p>Thx in advance!</p>","578953","","578953","","2011-02-16 16:53:25","2011-02-17 10:54:19","android DOM parsing with entities in tags","<android><xml><dom><xml-parsing>","2","3","","",""
"5017676","1","5017725","","2011-02-16 14:33:19","0","5233","<p>how to check wifi connection throught the entire application.is there any events or class that we can get message for that?thankx</p>","411359","","265167","","2011-12-18 10:30:13","2012-02-21 12:32:28","how to check wifi connection throught the entire application?","<android><android-wifi>","3","0","1","",""
"5017690","1","","","2011-02-16 14:34:52","0","487","<p>I have implemented the Demo version of HelloDatePicker provided by the API.</p><p><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>However I cannot maintain its value after rotating the screen. Can someone post an example or indicate how one can do this. </p><p>Thanks</p>","390517","","","","","2011-02-16 14:51:23","How to maintain DatePicKer State After Rotate Screen","<android><datepicker><screen><rotation>","2","0","","",""
"5017751","1","5854680","","2011-02-16 14:40:10","1","416","<p>while uploading images to server, it gives me expectation failed error response code 417.</p><p>My server side coding is in php, and client is android</p>","493423","","","","","2011-05-02 07:46:40","expectation failed in android during photo upload","<java><php><android>","2","0","1","",""
"5017783","1","5017854","","2011-02-16 14:42:32","2","486","<p>From developer prospective...How can I get to know if a calendar event from an android device is added/edited/deleted by the user. I need to do some operations if there is any update on calendar events.</p>","619827","","","","","2011-02-16 14:47:28","How to get information from android device if there is a calendar event update?","<android><calendar>","1","0","","",""
"5017885","1","5017940","","2011-02-16 14:49:59","0","1856","<p>I have an Android application that writes data to the SD card. I want to be able to see this data from my PC, when I connect via a USB cable. Unfortunately the application remains in the background when I quit it, and some system buffers do not get flushed properly (or at least I think that is what happens). As a result I cannot see the data properly, unless I manually force the application to stop. Then the data becomes visible on the PC, as if by magic.</p><p>I would like to have the program terminate automatically when I quit the main activity, or better still I would like to find some way to flush the system buffers. Does anyone have any ideas?</p>","619852","","","","","2011-02-16 16:01:24","How can I get my Android application to terminate properly?","<android><terminate>","2","3","","",""
"5017954","1","5017985","","2011-02-16 14:54:55","8","3248","<p>I want to obtain the least 32 bits from a number of type long, so I perform bitwise operation ""&amp;"" on the number with bits mask 0xFFFFFFFF, but the result is not correct, it still contains the other bits.</p><p>for example:</p><pre><code>long a = 0x1234567890ab; long b = (a &amp; 0xffffffff);</code></pre><p>I expect the value of b to be 0x567890ab</p><p>but in practice, it is still 0x1234567890ab</p>","583683","","","","","2011-02-16 15:00:54","Bitwise ""& "" on a long?","<java><android>","3","2","1","",""
"5018043","1","5018790","","2011-02-16 15:01:11","2","2385","<p>I am trying to implement Facebook into my Android app.</p><p>Everytime though, the facebook stuff fails because of an ""Invalid key"" error although I've been through the steps of setting up an app on FB and getting the key via keytool and so on.</p><p>Is there any ideas I can try to fix it ? Is it normal for a hash code to have symbols such as '/' or '=' in it?</p>","601327","","","","","2012-01-04 04:47:34","Android Facebook API - Invalid key problems","<java><android><facebook><api><key>","2","1","","",""
"5018056","1","5018118","","2011-02-16 15:02:50","1","881","<p>hi i created all my apps in a single package name, when i was to upload it, i was success in uploading my first app. when i was to upload my second app i came to know that 2 app with same package name cannot be uploaded. Its not possible for me to create the second app once again with a new package name so because of my urgent i searched for a solution in net and i found that by refactor (i am using eclipse) i can change the package name and i did the same. But the name is not changed in the manifest file and i changed manually. Then i found some errors in all of my java class file showing error in the line ""import.(package name).R"", so i deleted all those lines. Now there is no error but the new problem is the app is running partially. The parsing activities which have been designed in my app are not running. Main part of my app is that only. Is there any solution to overcome this, as i am a new developer pls help me........  </p>","596364","","","","","2011-02-16 15:14:19","error because of changing the package name","<java><android>","3","0","","",""
"5018069","1","9110480","","2011-02-16 15:04:23","3","23131","<p>I'd like to have a splash screen while loading resources (images and sounds). How do I know everything is loaded?Are all resources loaded at app startup?</p><p>Thanks</p>","326849","","","","","2012-10-15 15:53:11","Splash screen while loading resources in android app","<android><resources><splash-screen>","5","0","2","",""
"5018111","1","5018553","","2011-02-16 15:08:23","2","1523","<p>this is the code</p><pre><code>public void startAlarm(Context context) {    Intent intent = new Intent(context, SyncService.class);    PendingIntent sender = PendingIntent.getService(context, 0, intent, 0);    AlarmManager am = (AlarmManager) getSystemService(ALARM_SERVICE);        am.setRepeating(AlarmManager.ELAPSED_REALTIME_WAKEUP,                10 min, 20 min, sender);}</code></pre><p>This is my method where i start my alarm...I use it in my main activity in onCreate method...What if i change something in settings, and I want to change a time of Repeating ? How to do that ? I should kill that one and start new one ?</p>","602011","","964741","","2011-10-29 07:22:54","2011-10-29 07:22:54","Android: Alarm Manager","<android>","1","0","","",""
"5018155","1","","","2011-02-16 15:11:39","5","4274","<p>This is one horizontal menu I have to implement .And thismenu should scroll horizontally smoothly with left and right arrow like this Fox News application <a href=""https://market.android.com/details?id=com.foxnews.android"">https://market.android.com/details?id=com.foxnews.android</a> with the first app screen shot.</p><p>By using google and other post on this forum I used horizontalScrollView  to achieve it,but don't know how to set left and right transparent images with arrow to indicate that  there are more element to left or right depending on scroll.</p><p>Whatever I coded ,achieved  scrolling movement but its slow and struggling to show left and right images with arrow.</p><p>Kindly tell me if you have any solution on this.</p><p>This layout I am using </p><p></p><pre><code>&lt;HorizontalScrollView    android:id=""@+id/hor_svID""    android:layout_width=""wrap_content""    android:layout_height=""35dip""    android:scrollbars=""none""    android:fillViewport=""false""    android:focusable=""false""    android:background=""@drawable/submenu_bg""&gt;    &lt;LinearLayout        android:layout_width=""wrap_content""        android:layout_height=""fill_parent""        android:orientation=""horizontal""        android:focusable=""false""        android:background=""#FFFFFF""        android:gravity=""center""&gt;        &lt;TextView android:id=""@+id/TechnologyTxtVId""                 android:text=""TECHNOLOGY""                   android:textColor=""#342D7E""                android:textSize=""12sp""                android:textStyle=""bold""                android:gravity=""center""                android:layout_width=""wrap_content""                android:layout_height=""wrap_content""&gt;&lt;/TextView&gt;        &lt;TextView android:id=""@+id/SportsTxtVId""                 android:text=""SPORTS""                 android:textColor=""#342D7E""                 android:textStyle=""bold""                android:textSize=""12sp""                android:gravity=""center""                android:layout_height=""wrap_content""                 android:layout_width=""wrap_content""                 android:paddingLeft=""15dip""&gt;&lt;/TextView&gt;         &lt;TextView android:id=""@+id/EntntTxtVId""                 android:text=""ENTERTAINMENT""                    android:textStyle=""bold""                android:paddingLeft=""15dip""                android:textSize=""12sp""                android:gravity=""center""                android:textColor=""#342D7E""                android:layout_width=""wrap_content""                android:layout_height=""wrap_content""&gt;&lt;/TextView&gt;        &lt;TextView android:id=""@+id/LocalTxtVId""                 android:text=""LOCAL""                    android:textStyle=""bold""                android:paddingLeft=""15dip""                android:textSize=""12sp""                android:textColor=""#342D7E""                android:layout_width=""wrap_content""                android:layout_height=""wrap_content""&gt;&lt;/TextView&gt;                &lt;TextView android:id=""@+id/WorldTxtVId""                 android:text=""WORLD""                    android:textStyle=""bold""                android:textSize=""12sp""                android:paddingLeft=""15dip""                android:gravity=""center""                android:textColor=""#342D7E""                android:layout_width=""wrap_content""                android:layout_height=""wrap_content""&gt;&lt;/TextView&gt;            &lt;TextView android:id=""@+id/FeaturesTxtVId""                 android:text=""FEATURES""                 android:textStyle=""bold""                android:textSize=""12sp""                android:paddingLeft=""15dip""                android:gravity=""center""                android:textColor=""#342D7E""                android:layout_width=""wrap_content""                android:layout_height=""wrap_content""&gt;&lt;/TextView&gt;                &lt;TextView android:id=""@+id/RecentTxtVId""                 android:text=""RECENT""                   android:textStyle=""bold""                android:textSize=""12sp""                android:paddingLeft=""15dip""                android:gravity=""center""                android:textColor=""#342D7E""                android:layout_width=""wrap_content""                android:layout_height=""wrap_content""&gt;&lt;/TextView&gt;                                    &lt;/LinearLayout&gt;                                     &lt;/HorizontalScrollView&gt;</code></pre>","619861","","","","","2014-01-23 07:29:54","Horizontal menu with HorizontalScrollView-android","<android><horizontalscrollview>","1","2","2","",""
"5018302","1","","","2011-02-16 15:25:15","0","1033","<p>hey good people! i am new to android programming and I am unable to resolve this error.</p><pre><code>package com.android.dk1;import android.app.Activity;import android.graphics.Bitmap;import android.graphics.BitmapFactory;import android.os.Bundle;import android.view.View;import android.widget.ImageView;import android.content.Intent;import android.os.Environment;import android.util.Log;public class faced extends Activity {    private Bitmap jb=null;    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        ImageView imageView = (ImageView)findViewById(R.id.ImageView01); ==&gt;ERROR        jb = BitmapFactory.decodeFile(""C:/jb1.jpg"");                imageView.setImageBitmap(jb);    }}</code></pre><p>my main.xml is here:</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=""10dip""&gt;       &lt;ImageView android:id =""@+id/ImageView01""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""&gt;       &lt;/ImageView&gt;&lt;/LinearLayout&gt;</code></pre><p>Although i have clearly included the  tag, the id class in my R.java is not generated. This is my R.java:</p><pre><code>package com.android.dk1;public final class R {    public static final class attr {    }    public static final class drawable {        public static final int icon=0x7f020000;    }    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>please help!</p>","619918","","546999","","2011-02-18 09:44:45","2011-02-18 09:46:31","Android Question - “Id cannot be resolved or is not a field” error?","<android><android-layout>","0","2","","",""
"5018329","1","","","2011-02-16 15:27:18","0","756","<p>I have a TextView containing Editable text. There are pictures in this text (drawables, I used Html.ImageGetter) for that I want to register onTouch events. So, when the user touches the image, which is part of a spannable text, I want to know that. (And, which image he touched).</p><p>Is that possible? If so, maybe without dirty workarounds?</p><p>Best regards,Jan Oliver Oelerich</p>","169748","","169748","","2011-02-16 16:25:47","2011-03-05 13:28:42","Android: onTouch for Spans in Spannable Text","<android><textview><ontouchlistener><spanned>","1","0","","",""
"5018350","1","5018432","","2011-02-16 15:29:22","0","291","<p>In my application, I have a <code>DatagramSocket</code>. I want to set the socket so that it will receive <code>DatagramPackets</code> from any IP-Address, and not have to specify one. Would this be possible at all?</p><p>I have a list of <code>EndPoints</code> I want to send data to at some point, and expect the messages sent to me to come from these addresses, but I don't want to iterate through this list and individually receive packets.</p><p>Is there any way I can achieve this? I've done some extensive searches, but I can't seem to find a suitable answer...</p>","603059","","","","","2011-02-16 15:36:46","Is it possible to set a DatagramSocket to receive from any other IP-Address?","<java><android>","1","0","","",""
"5018429","1","5022162","","2011-02-16 15:36:42","0","532","<p>I am using Camera.Parameters.setPixelFormat(PixelFormat.JPEG) in my android 1.6 application. The documentation says this is deprecated, but the constant value is the same as the new ImageFormat...</p><p>Should I not worry about it?</p>","457577","","","","","2011-02-16 21:12:37","PixelFormat deprecated 1.6?","<android><camera><deprecated><pixelformat>","1","3","","",""
"5018545","1","6760019","","2011-02-16 15:45:22","159","107712","<p>I couldn't find a satisfying answer to this, so here we go: what's the deal with <code>Activity/Service.getApplication</code> and <code>Context.getApplicationContext</code>?</p><p>In our application, both return the same object. In an <code>ActivityTestCase</code> however, mocking the application will make <code>getApplication</code> come back with the mock, but <code>getApplicationContext</code> will still return a different context instance (one injected by Android). Is that a bug? Is it on purpose?</p><p>I don't even understand the difference in the first place. Are there cases outside a test suite where both calls may come back with different objects? When and why? Moreover, why is <code>getApplication</code> defined on <code>Activity</code> and <code>Service</code>, but not on <code>Context</code>? Shouldn't there always be a valid application instance available from <em>anywhere</em>?</p>","127013","","","user238033","2013-02-14 07:24:51","2013-05-27 15:15:16","getApplication() vs. getApplicationContext()","<android><android-activity><android-service><android-context>","4","1","86","",""
"5018724","1","","","2011-02-16 16:00:07","3","1285","<p>I am developing a RSS news feed app for Android, and using <code>Toast.makeText()</code> to show the news or current update. It must go on web on the click of that message/news. The problem is that the <code>Toast</code> has no API/features that I can click on that and go on web to read the full article.</p><p>The prime requirement is that I need to display the news one by one so I can not use list or any other widget.</p><p>Can anyone suggest what UI element should I use to solve this problem? </p>","619969","","810368","","2012-10-15 13:37:29","2012-10-15 13:37:29","I need a clickable UI element instead of Toast (can i create custom toast with clickable feature?)","<android><rss><feed>","4","0","","",""
"5018752","1","","","2011-02-16 16:02:09","3","528","<p>I try to use <a href=""http://sites.google.com/site/gson/Home"" rel=""nofollow"">Gson</a> on Android to marshall/unmarshall JAXB annotated classes.</p><p>The JAXB (XML) annotations are not provided on the Android device, thus the JSON library MUST not inspect annotations - otherwise we run into <code>java.lang.NoClassDefFoundError: javax.xml.bind.annotation.XmlElement</code>.</p><p>I have the same <a href=""http://stackoverflow.com/questions/4919996/use-jackson-json-processor-without-using-annotations"">problem</a> using <a href=""http://jackson.codehaus.org/"" rel=""nofollow"">Jackson</a> but that seems to be <a href=""http://jira.codehaus.org/browse/JACKSON-487"" rel=""nofollow"">fixed</a> (thanks to StaxMan). As I do not know when the fix will be released I thought Gson would be an alternative, because of this documentation statement:</p><pre>There is no need to use any annotations to indicate a field is to be included for serialization and deserialization. All fields in the current class (and from all super classes) are included by default.</pre><p>Unfortunately I nevertheless run into this problem:</p><pre><code>ERROR/AndroidRuntime(338): java.lang.NoClassDefFoundError: javax.xml.bind.annotation.XmlElementERROR/AndroidRuntime(338):     at java.lang.reflect.Field.getDeclaredAnnotations(Native Method)ERROR/AndroidRuntime(338):     at java.lang.reflect.Field.getDeclaredAnnotations(Field.java:196)ERROR/AndroidRuntime(338):     at java.lang.reflect.AccessibleObject.getAnnotations(AccessibleObject.java:199)ERROR/AndroidRuntime(338):     at com.google.gson.FieldAttributes.getAnnotations(FieldAttributes.java:159)</code></pre><p>Is there a way to turn of Annotation inspection in Gson?</p><p>Thanks  Klaus</p>","367285","","367285","","2011-02-17 14:21:47","2013-07-26 10:46:35","Stop Gson from introspecting class annotations","<java><android><json><gson>","1","2","","",""
"5018799","1","","","2011-02-16 16:05:44","0","653","<p>Ive follow the tutoria about how to make activity Gallery on [android-developer][1]</p><p>[1]: <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> but i got the next error:</p><pre><code>    02-12 17:54:06.221: ERROR/AndroidRuntime(1330): Uncaught handler: thread main exiting due to uncaught exception    02-12 17:54:06.301: ERROR/AndroidRuntime(1330): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.addsensor.CameraMap/com.addsensor.CameraMap.GalleryCamera}: java.lang.NullPointerException    02-12 17:54:06.301: ERROR/AndroidRuntime(1330):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2268)    02-12 17:54:06.301: ERROR/AndroidRuntime(1330):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2284)    02-12 17:54:06.301: ERROR/AndroidRuntime(1330):     at android.app.ActivityThread.access$1800(ActivityThread.java:112)    02-12 17:54:06.301: ERROR/AndroidRuntime(1330):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1692)    02-12 17:54:06.301: ERROR/AndroidRuntime(1330):     at android.os.Handler.dispatchMessage(Handler.java:99)    02-12 17:54:06.301: ERROR/AndroidRuntime(1330):     at android.os.Looper.loop(Looper.java:123)    02-12 17:54:06.301: ERROR/AndroidRuntime(1330):     at android.app.ActivityThread.main(ActivityThread.java:3948)    02-12 17:54:06.301: ERROR/AndroidRuntime(1330):     at java.lang.reflect.Method.invokeNative(Native Method)    02-12 17:54:06.301: ERROR/AndroidRuntime(1330):     at java.lang.reflect.Method.invoke(Method.java:521)    02-12 17:54:06.301: ERROR/AndroidRuntime(1330):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:782)    02-12 17:54:06.301: ERROR/AndroidRuntime(1330):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)    02-12 17:54:06.301: ERROR/AndroidRuntime(1330):     at dalvik.system.NativeStart.main(Native Method)    02-12 17:54:06.301: ERROR/AndroidRuntime(1330): Caused by: java.lang.NullPointerException    02-12 17:54:06.301: ERROR/AndroidRuntime(1330):     at com.addsensor.CameraMap.GalleryCamera.onCreate(GalleryCamera.java:20)    02-12 17:54:06.301: ERROR/AndroidRuntime(1330):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1123)    02-12 17:54:06.301: ERROR/AndroidRuntime(1330):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2231)</code></pre><p>I have also change one thing which someone comment here, on [stackoverflow][1]</p><p>[1]: <a href=""http://stackoverflow.com/questions/1717489/android-hello-gallery-tutorial-r-styleable-cannot-be-resolved"">Android Hello, Gallery tutorial -- ""R.styleable cannot be resolved""</a> but i am still getting the error. Its a simple activity and i dont know how to follow. Anyone knows?¿ or how to fix it?¿</p><p>thanks</p>","276421","","","","","2011-06-22 10:13:21","Problems with Gallery Activity","<android><activity><android-gallery>","1","0","","",""
"5018883","1","5032690","","2011-02-16 16:10:43","1","708","<p>I've been battling a hang (deadlock) in OpenGL for the past week.  I've finally realized that the system hangs after the garbage collector runs.  Here is an example from LogCat:</p><pre><code>02-16 08:49:32.609: INFO/ActivityManager(98): Displayed activity com.southernstars.skysafari/.SkySafariActivity: 2219 ms (total 2219 ms)02-16 08:49:37.369: DEBUG/dalvikvm(1863): GC_FOR_MALLOC freed 4144 objects / 387544 bytes in 46ms02-16 08:49:37.389: ERROR/Adreno200-ES20(1863): gsl_device_waittimestamp failed in rb_timestamp_wait_on_timestamp02-16 08:49:38.516: WARN/SharedBufferStack(1863): waitForCondition(LockCondition) timed out (identity=157, status=0). CPU may be pegged. trying again.</code></pre><p>Anytime the LogCat shows a GC_FOR_MALLOC or a GC_EXTERNAL_ALLOC, the app hangs with OpenGL in this LockCondition.  It appears that GC_EXPLICT, for the most part, does not cause a problem (maybe these are smaller allocs, I don't know).</p><p>Searching the internet, it seems that people are reporting things like this on the HTC phones.  Usually they say the problem is very sporadic and hard to reproduce.  I can reproduce it easily by simply putting a System.gc() call into my application flow or by doing something that allocates a chunk of memory forcing the GC to run.</p><p>I have this problem on an HTC Evo.  My development partner has a different phone and is not seeing this.</p><p>I'm totally at a loss what to do next.  Has anyone seen anything like this or have a plausible explanation for what is going on?  Is there any way it could be something unusual we are doing in the app?  Or is it just a bug in the HTC system or drivers?</p><p>Thanks for any help.</p>","178430","","44729","","2011-02-16 16:20:39","2011-07-22 15:45:46","Garbage collector hangs OpenGL on HTC Ev-es","<android><opengl-es><garbage-collection><htc>","1","5","","",""
"5018943","1","","","2011-02-16 16:15:38","0","1255","<p>I am doing a project that involves the development of an Android application that will grab an RSS feed from online, each Horoscope sign will need to retrieve the necessary information from RSS feed that contains the daily reading.</p><p>I have found a few useful sites but I am struggling on getting the buttons to successfully retrieve these RSS feeds from the website below.</p><p><a href=""http://my.horoscope.com/astrology/daily-horoscopes-rss.html"" rel=""nofollow"">http://my.horoscope.com/astrology/daily-horoscopes-rss.html</a></p><p>Very good website and good structure of RSS and all I need my Android App to do at this stage is grab the clicked Sign button RSS reading and display it.</p><p>Can anyone Help please, any help is appreciated.</p><p>Thanks </p>","269561","","","","","2011-02-16 17:32:41","Android Horoscope RSS","<android><xml><parsing><rss>","1","2","0","",""
"5019012","1","5019084","","2011-02-16 16:20:07","0","93","<p>I have been studying Java for a little bit now, and I'm ready to try building something.  I think I have the basic understanding of how to build simple parts, but I have a hard time planning out my project.  I was hoping you guys could tell me what I would need to make it work.</p><p>I am creating an app for work.  I work in the ATM business, and we provide tech support for all ATM models.  So we have a master list of atm error codes, what models they apply to, their descriptions, and solutions.</p><p>From the App I would like to make it searchable by ATM manufacturer->Model->List of error codes to choose from.  AND searchable by error code.</p><p>What I'm not sure about is how to save such a big list of codes.  I've got them formatted like this:(""Hyosung"", ""1000"", ""20001"", ""Unable to Detect Cassette"", ""Remove and replace cassette - Check the micro-switch located on the inside left wall"")</p><p>(MANUFACTURER, MODEL, CODE, DESCRIPTION, SOLUTION)</p><p>So depending on how the user chooses to search, it could pull all error</p><p>There are, maybe, 1000 error codes.  Would it be best to save this to a text file that the app can access?  How would you guys manage the error codes?</p>","557431","","3043","","2011-12-09 17:50:38","2011-12-09 17:50:38","Advice on managing a list of information","<android><information-retrieval>","2","1","","",""
"5019051","1","5020021","","2011-02-16 16:23:43","16","19310","<p>I've just recently started getting an error any time I interact with the Android SDK and AVD Manager in Eclipse Helios</p><p>I've tried reinstalling the Eclipse plugin and the Android SDK but to no avail.</p><p>If I go to the ""Installed packages"" page and click refresh (or install or remove a package) I get a popup box saying that </p><pre><code>'Android SDK Content Loader' has encountered a problem. parseSdkContent failed java.lang.NullPointerException.</code></pre><p>Here is the full log:</p><p>Stack Trace</p><pre><code>java.lang.NullPointerException   at com.android.ide.eclipse.adt.internal.sdk.Sdk.loadTarget(Unknown Source)   at com.android.ide.eclipse.adt.AdtPlugin$10.run(Unknown Source)   at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)</code></pre><p>Session Data</p><pre><code>eclipse.buildId=M20100909-0800java.version=1.6.0_20java.vendor=Sun Microsystems Inc.BootLoader constants: OS=linux, ARCH=x86, WS=gtk, NL=en_IEFramework arguments:  -product org.eclipse.epp.package.java.productCommand-line arguments:  -os linux -ws gtk -arch x86 -product org.eclipse.epp.package.java.product</code></pre><p>Has anyone else encountered this recently? It doesn't seem to be affecting actual Android development but its just kinda annoying. </p>","516286","","403455","","2012-05-05 12:09:05","2014-03-22 10:33:43","Android SDK Content Loader failing with NullPointerException","<android><nullpointerexception><avd>","18","1","3","",""
"5019134","1","","","2011-02-16 16:29:29","0","1118","<p>i try some way to post parameter to google c2dm server .like</p><p>get auth<code>curl <a href=""https://www.google.com/accounts/ClientLogin"" rel=""nofollow"">https://www.google.com/accounts/ClientLogin</a> -d Email=$1 -d ""Passwd=$2"" -d accountType=GOOGLE -d source=My-Server-Event-Alerter -d service=ac2dm</code></p><p>and use ""Auth"" to Send</p><p><code>curl --header ""Authorization: GoogleLogin auth=$1"" ""https://android.apis.google.com/c2dm/send"" -d registration_id=$2 -d ""data.payload=$3"" -d collapse_key=myappalert09</code></p><p>but only request 401 .</p><p>i  have consult <a href=""http://stackoverflow.com/questions/4915985/c2dm-server-with-php-401-error"">C2DM Server with PHP 401 Error</a>,and have same question.</p><p>Did i get auth  to use  mistake method? </p><p>what can i do?</p><p>thank,all</p>","491231","","","","","2011-02-16 16:29:29","post to google C2DM Server , but 401 with php and curl","<php><android><curl><android-c2dm>","0","3","","",""
"5019174","1","5019392","","2011-02-16 16:31:54","0","2596","<p>I installed the Eclipse Helios yesterday, because the Galileo threw me to the desktop a lot of time. I deleted it with it's file, and I downloaded Helios SR1. When I tried to Help -> Install new software... and wrote <a href=""https://dl-ssl.com/android/eclipse"" rel=""nofollow"">https://dl-ssl.com/android/eclipse</a>, it showed to me the Developer Tools. I checked it, and I clicked on the Next button. It displayed me the following ""error"":</p><p>Your original request has been modified.  ""Android Development Tools"" is already installed, so an update will be performed instead.  ""Android Hierarchy Viewer"" is already installed, so an update will be performed instead.  ""Android DDMS"" is already installed, so an update will be performed instead.</p><p>I tried to update them, but nothing changed.</p>","590898","","","","","2011-02-16 16:48:41","Have a big problem. I installed Eclipse Helios, but I can't install the packages from dl-ssl.com/android/eclipse","<android><eclipse>","1","0","","",""
"5019224","1","","","2011-02-16 16:35:30","1","128","<p>I'm trying to control lego mindstorm robot with the orientation of my phone. I already have a application that writes acceleration xyz + orientation azimuth pitch roll to a textfile. What I want to do is transfer this data to my PC and analyze the data with LabView.It should send new data about the orientation atleast every 500ms. Can be faster ofc :) </p><p>Any suggestions how this should be made? I need some tools to work with :(</p>","620024","","","","","2011-02-16 16:35:30","Orientation data of my androidphone to PC over bluetooth?","<android>","0","1","","",""
"5019318","1","5019426","","2011-02-16 16:42:34","0","637","<p>I need to update the score in one activity when an action is used in another activity. </p><p>In class 1 activity 1 - I have a score textview and this shows the score. The user then presses answer and this takes the user to another activity where they choose an answer from radio buttons. </p><p>In class 2 activity 2 - The user chooses an answer and the score in activity 1 gets updated if correct. </p><p>Is this possible?</p><p>Thanks. </p>","608658","","","","","2011-02-16 16:57:38","Update activity from a second activity","<android>","3","0","","",""
"5019360","1","5019608","","2011-02-16 16:45:24","1","293","<p>I have made a webapp for my android phone where I can check the sales at my store when I'm not there.</p><p>I would like to have notifications on my phone whenever a sale is made.</p><p>What is the best way of doing this? Any existing android apps that I can configure to check a php-script every 2 minutes or something?</p>","348776","","","","","2011-02-16 17:08:02","Webpage update notification in android","<php><android><notifications>","2","0","","",""
"5019373","1","5019669","","2011-02-16 16:47:20","1","1069","<p>I am trying to configure my manifest file to indicate my application can open pdf files.  The below configuration works, but it gives some funny behavior with the emulator: </p><ol><li>When the ""view"" action is present, my application is not started on install (when I run from eclipse, the application gets installed on the emulator.  but it does not start automatically).</li><li>When ""application/pdf"" is present, after running from eclipse the application doesn't show up in my emulator's application menu.  </li></ol><p>(I don't see either of these issues if my only intent's are ""main"" and ""launcher"")</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;action android:name=""android.intent.action.VIEW"" /&gt;        &lt;category android:name=""android.intent.category.DEFAULT"" /&gt;        &lt;data android:mimeType=""application/pdf"" /&gt;  &lt;/intent-filter&gt;</code></pre><p>*EDIT:  Ok, I was a little confused about intents.  The solution to my above issues is to have 2 different intent-filters, as shown below.  </p><p>However, I do have a second question.  Android succesfully launches my app for pdf files, but when it launches onCreate(bundle) is called and not startActivity(Intent).  How should I get the intent data?</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;&lt;intent-filter&gt;            &lt;action android:name=""android.intent.action.VIEW"" /&gt;            &lt;category android:name=""android.intent.category.DEFAULT"" /&gt;            &lt;data android:mimeType=""application/pdf"" /&gt; &lt;/intent-filter&gt;</code></pre>","426493","","426493","","2011-02-16 17:09:29","2011-03-23 14:27:41","Android: proper intent-filter to indicate my application can open a filetype?","<android><android-manifest><android-intent>","2","0","","",""
"5019455","1","5019497","","2011-02-16 16:54:41","0","340","<p>i want the EidtText to stop accepting input from the user if the input text length is more than 10   ..but it should be able to delete the already available text in the EditText even though the text length is more than 10 ...</p><p>can some one help me with the code pls..</p><p>thanks :)</p>","601142","","","","","2011-02-16 17:06:35","stop user from inputting in to the edit box?","<android><eclipse><edittext>","3","0","0","",""
"5019496","1","","","2011-02-16 16:57:57","2","931","<p>i'm trying to animate an EditText when i touch it using scale animation , i managed to do that by creating my own editText (extends EditText) .The animation works , but after it the EditText size(width) does not change it still the same . How can i change that ? I tried to callthis.setWidth() after the animation , but it does not work so well. Which is the best approach for my problem ?</p><pre><code>@Overridepublic boolean onTouchEvent(MotionEvent event) {    switch (event.getAction()) {    case MotionEvent.ACTION_DOWN:        focus = true;        this.setText("""");        this.setTextColor(Color.parseColor(""#000000""));        if (firstTime) {            animate();        }        break;    case MotionEvent.ACTION_UP:        text = this.getText().toString();        break;    }    return super.onTouchEvent(event);}private void animate() {    Log.i(""teste"", ""ed width: "" + this.getWidth());    Log.i(""teste"", ""parent width: "" + parent.getWidth());    float x = ((float) parent.getWidth() / this.getWidth());    Log.i(""teste"", ""x: "" + x);    ScaleAnimation sc = new ScaleAnimation(1, x, 1, 1, 0.5f, 0.0f);    sc.setStartOffset(100);    sc.setInterpolator(new AccelerateInterpolator());    sc.setFillAfter(true);    sc.setDuration(1000);    this.startAnimation(sc);    invalidate();    firstTime = false;}</code></pre>","569873","","","","","2011-02-16 16:57:57","Scale Animation on an EditText .. help","<android>","0","1","","",""
"5019517","1","","","2011-02-16 16:59:45","3","3576","<p>Ok...so here's the scenario.. Starting from scratch, I want to display THREE stars (i have an image that I want to use), centered. I want to post a different word in each star. Of course, I do not want it hard-coded, but once I can get the layout right, the rest will be easy. Can anyone help please? I would be greatly appreciated.</p>","620059","","","","","2011-02-16 19:09:51","ANDROID -- How to display text on an image?","<android><android-layout><android-image>","3","1","2","",""
"5019686","1","5019917","","2011-02-16 17:13:44","4","4803","<p>Let's say I have a Hello World single Activity application.  I start this application.</p><p>What methods are invoked in each case:</p><ul><li>Home button is pressed: ?<br>Back button is pressed: ?<br>Phone call is received: ?</li></ul><p>What methods are invoked once the user starts the application again via the app icon (assuming the OS hasn't had a ""other apps need memory condition""):</p><ul><li>Home button was pressed: ?<br>Back button was pressed: ?<br>Phone call was received: ?</li></ul><p>Thanks all.</p><p>Edit:  Extra Credit:  How can the user invoke <code>onPause</code> without invoking <code>onStop</code>?</p>","432209","","432209","","2011-02-16 17:47:29","2011-02-16 17:55:37","What methods are invoked in the Activity Lifecycle in the following cases:","<android><activity><lifecycle>","2","1","2","",""
"5019711","1","5040155","","2011-02-16 17:15:56","4","14005","<p>I read much about issues with onActivityResult, but it seems, that none of the described problems fit to mine, like putting a negative RequestCode in StartActivityForResult or something else. I'm playing with the camera in my Activity, which keeps capturing Photos from my webcam.If I have desired content in my SurfaceView I close cam releasing its resources, setResult(RESULT_OK, DataIntent) and hoping that onmActivityResult triggers in my parent. But it don't. If i set a result in onCreate of childActivity and finish child in onCreate the result is passed to onActivityResult. What possible reason could be, that onActivityResult is NOT getting triggered?I'll write some of my source down for understanding what I'm doing...</p><pre><code>public class MainActivity extends Activity {Button mButtonScan;/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    mButtonScan = (Button)findViewById(R.id.main_btn_scan);}/** * OnClick Event called from main.xml * @param v View that called that onClickEvent */public void btnCaptureClick(View v){    Intent intent = new Intent(this, CaptureActivity.class);    startActivityForResult(intent, Constants.REQUEST_CODE_CAPTURE);}/** * callback for this Activity. Called when an Activity which was started by * this.startActivityForResult(intent, requestCode) sets its result and calls finish() */@Overrideprotected void onActivityResult(int requestCode, int resultCode, Intent data) {    String foo = ""foo"";    switch (requestCode) {    case Constants.REQUEST_CODE_CAPTURE:        switch (resultCode) {        case RESULT_FIRST_USER:            Toast.makeText(this, data.getStringExtra(Config.SCAN_RESULT_TEXT), Toast.LENGTH_LONG).show();            break;        case RESULT_CANCELED:            break;        default:            break;        }        break;    default:        super.onActivityResult(requestCode, resultCode, data);        break;    }}}public class CaptureActivity extends Activity implements ActivityCallback , SurfaceHolder.Callback, PreviewCallback{private Preview mPreview;private Camera mCam;private SurfaceHolder mHolder;private Size size;protected void onCreate(Bundle savedInstanceState){    super.onCreate(savedInstanceState);    setContentView(R.layout.capture);    mPreview = (Preview)findViewById(R.id.capture_preview); }@Overridepublic void onValidDecodeResult(Result rawResult, Bitmap barcode) {    Intent intent = new Intent();    if (rawResult != null &amp;&amp; barcode != null){        intent.putExtra(Config.SCAN_RESULT_TEXT, rawResult.getText());        intent.putExtra(Config.SCAN_RESULT_FORMAT, rawResult.getBarcodeFormat().getName());        intent.putExtra(Config.SCAN_RESULT_BMP, barcode);    } else {        intent.putExtra(Config.SCAN_RESULT_TEXT, ""foo"");        intent.putExtra(Config.SCAN_RESULT_FORMAT, ""bar"");        intent.putExtra(Config.SCAN_RESULT_BMP, ""barcode"");    }    mPreview = null;    setResult(Activity.RESULT_FIRST_USER, intent);    finish();   }@Overridepublic void onPreviewFrame(byte[] data, Camera camera) {    MultiFormatReader reader = new MultiFormatReader();         PlanarYUVLuminanceSource source = new PlanarYUVLuminanceSource(data, size.width, size.height, 160, 60, 480, 360);    GlobalHistogramBinarizer binarizer = new GlobalHistogramBinarizer(source);    BinaryBitmap bb = new BinaryBitmap(binarizer);    Result result = null;    try {        result = reader.decode(bb);    }catch (NotFoundException e) {        //do NOTHING cause e == null    }catch (Exception e){        e.printStackTrace();    } finally {        reader.reset();    }    if (result != null){        mCam.stopPreview();        releaseCameraResources();        onValidDecodeResult(result, source.renderCroppedGreyscaleBitmap());    } else {        camera.setOneShotPreviewCallback(this);    }       }@Overridepublic void surfaceCreated(SurfaceHolder holder) {    try {        mCam = Camera.open();        mCam.setPreviewDisplay(mPreview.getHolder());    } catch (IOException e) {        releaseCameraResources();        e.printStackTrace();    }       }private void releaseCameraResources(){    mCam.release();    mCam = null;}@Overridepublic void surfaceChanged(SurfaceHolder holder, int format, int width,        int height) {    //begin Preview    Camera.Parameters parameters = mCam.getParameters();    List&lt;Size&gt; sizes = parameters.getSupportedPreviewSizes();    size = getOptimalPreviewSize(sizes, width, height);    parameters.setPreviewSize(size.width, size.height);    mCam.setParameters(parameters);    mCam.startPreview();    mCam.setOneShotPreviewCallback(this);}@Overridepublic void surfaceDestroyed(SurfaceHolder holder) {    if (mCam != null){        mCam.stopPreview();        releaseCameraResources();    }   }private Size getOptimalPreviewSize(List&lt;Size&gt; sizes, int width, int height){    final double ASPECT_TOLERANCE = 0.05;    double targetRatio = (double) width / height;    if (sizes == null) return null;     Size optimalSize = null;    double minDiff = Double.MAX_VALUE;    int targetHeight = height;    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){        //cannot find matching aspect-ratio        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;}}</code></pre>","620053","","620053","","2011-02-17 19:07:41","2012-06-20 21:36:39","Android onActivityResult not called / triggered","<android>","3","3","3","",""
"5019720","1","5019948","","2011-02-16 17:16:41","3","420","<p>Ok so I've finally cobbled enough working parts into my app that its just plain old refusing to do anything now. I understand how to use logcat, but that is about it.</p><p>The main problem at the moment is that I get the error </p><blockquote>  <p>Activity Idle Timeout for HistoryRecord then my package</p></blockquote><p>I need to learn how to do better debugging. Plus if anyone can suggest things I should do for this error please let me know.I think its something to do with the interactions with the database.</p><p>Cheers</p><p>EDIT:</p><blockquote>  <p>What IDE are you using, if any?  Eclipse with Android tool has  moderately good debugging facilities;  set a breakpoint and debug away.</p></blockquote><p>I am using EclipseAnd I know of breakpoints, but not their real use. Where would I set them for this error?</p><p>I am used to PHP where errors tell you a specific line to look at is there a way to do this in Eclipse?</p>","614460","","614460","","2011-02-16 17:30:42","2011-02-16 20:29:11","Android Debugging, how?","<android>","3","3","1","",""
"5019721","1","5020338","","2011-02-16 17:16:46","1","287","<p>I use Tab Widget like in documentation example <a href=""http://developer.android.com/guide/tutorials/views/hello-tabwidget.html"" rel=""nofollow"">TabWidget</a> </p><p>I have two tabs, and in every tab when I press some button I need to load another different activity. My question is how to achive that I have that two tab on another activities like headers ?I could create that tabs in new activities but it wouldn't remember choosen activity for another tab. How to solve this ?</p>","486578","","","","","2011-02-16 18:08:56","TabWidget problem with new activities","<android>","1","3","","",""
"5019808","1","","","2011-02-16 17:25:37","0","242","<p>I created an interface a.xml that contains 2 EditText and a file code.java  (containing the java code).I want to link my code and the interface with a SQLite Database</p><p>The database contains a single tablethe table contains 2 columns</p><p>how to make the connection to the database and execute a SQL query (Select) (the contents of DBHelper?)</p>","616263","","180538","","2011-02-16 17:37:25","2011-05-08 01:21:38","database connection","<android><database><sqlite><database-connection>","1","0","","",""
"5019834","1","5850299","","2011-02-16 17:27:42","18","5046","<p>Is there a way to add an admob advert to a PreferenceActivity? How to?</p>","472537","","","","","2014-02-14 02:03:07","Android Admob advert in PreferenceActivity","<android><admob>","4","0","7","",""
"5019847","1","5019947","","2011-02-16 17:28:39","1","902","<p>I'v seen on my android SDK tools folder an app named <strong>etc1tool</strong>.</p><p>It shoult convert PNG file in ETC1, but what is ETC1 file ?</p><p>I d'ont understand what is it and whenn use it.</p>","198843","","44729","","2012-05-01 19:16:10","2012-05-01 19:16:10","What is etc1tool?","<android><sdk>","1","0","","",""
"5019857","1","5019884","","2011-02-16 17:29:43","10","5168","<p>I want to set the button unclickable and look like a dark gray image of an button?</p><p>Is this possible?</p>","547995","","244296","","2011-02-16 20:56:12","2011-02-16 20:56:12","How to set a Button gray and unclickable?","<android>","3","0","","",""
"5019946","1","5020755","","2011-02-16 17:36:27","1","852","<p>I am drawing a line in opengl es from the Android NDK. I have been developing on the VM's and just recently tried my application on a phone. The application runs fine on the vm's. A line is drawn. However, on a motorola droid, the application just crashes, and on a HTC incredible it just shows a black screen. I have verified that the number being passed to the function are correct. The application haults on the glDrawArray(GL_LINES, 0, 2) call. The whole function looks like this:</p><pre><code>void drawLine(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2, GLfloat * color){    GLfloat vVertices[] =    {x1, y1,    x2, y2};    glEnableClientState(GL_VERTEX_ARRAY);    glEnableClientState(GL_COLOR_ARRAY);    glColor4f(color[0],color[1],color[2],color[3]);    glVertexPointer(2, GL_FLOAT, 0, vVertices);    glDrawArrays(GL_LINES, 0, 2);    __android_log_write(ANDROID_LOG_ERROR,""to mama"",""You drew arrays"");    glDisableClientState(GL_COLOR_ARRAY);    glDisableClientState(GL_VERTEX_ARRAY);}</code></pre><p>and the call to it looks like this:</p><pre><code>drawLine(0.0f,0.0f,1.0f,0.0f,colorx);/*x is green*/</code></pre><p>I can try drawelements next, but there is not reason draw arrays should not work (as far as i know).</p>","523412","","","","","2011-02-16 18:50:30","glDrawArrays works in vm, crashes on phone","<android><opengl-es><android-ndk>","1","2","","",""
"5019980","1","5020060","","2011-02-16 17:39:27","2","322","<p>I'm trying to learn how to program on android which of course uses Java. I understand Java vaugely, but this confuses me.</p><p>A method which I view as a function (PHP being my native programming language) can seemingly be declared anywhere in a java file and still be pulled out at any other point is this so? What I mean is in PHP you have to define a function(method) to then be able to call it. So everything has to be in order.</p><p>Also is calling a function like including that section of code in your method calling it. Example being:</p><p>method 1 contains opendb commandmethod 2 contains closedb commandoncreate method calls method 1 then 2 does it act accordingly.</p><p>Sorry may sound dumb but I like concrete answers and not assumptions of mine.</p>","614460","","180538","","2011-02-16 17:42:25","2011-02-16 20:15:05","Java methods flow","<java><android>","6","0","","",""
"5019990","1","","","2011-02-16 17:40:23","6","2833","<p>I need unzip a .zip file of 2.5mb(1087 files - *.html, *.css and *.db) in android, i have used java.util.zip, it works fine, but i need improve the performance, the unzip process last 1.10 minutes, i need reduce this time.I have followed some recomendations for improve the performance, for example :</p><ul><li>Use BufferedInputStream, FileOutputStream and BufferedOutputStream.</li><li>Read the zip in blocks : </li></ul><p>byte data[] = new byte[2048];while ((counter = bisMediaFile.read(data, 0, 2048)) != -1) {bosMediaFile.write(data, 0, counter);}</p><p>Is there any way to improve my code?. I was searching third party zip programs to use programatically, for example i tried the 7ZipJBinding, but it looks like android doesn't support this, because i referenced the sevenzipjbinding.jar and sevenzipjbinding-AllPlatforms.jar but i get an error : ""Native Libraries Detected in sevenzipjbinding-AllPlatforms"". At 7zip homepage there are versions for MAC, Windows, Linux, but i didn't see anything about android.Could you please recommend any other library to unzip files in android?</p><p>Thanks in advantage for the responses. This is my all code :</p><pre><code>public static void processZipFile(String strBinaryPath,String strExtractPath, String strDestinationDBPath) throws Exception{    ZipFile zipInFile = null;    try    {        if (strExtractPath != null)        {            zipInFile = new ZipFile(strBinaryPath);            for (Enumeration&lt;? extends ZipEntry&gt; entries = zipInFile.entries(); entries.hasMoreElements();)            {                ZipEntry zipMediaEntry = entries.nextElement();                if (zipMediaEntry.isDirectory())                {                    File mediaDir = new File(String.format(""%s\\%s"", strExtractPath, zipMediaEntry.getName()));                    mediaDir.mkdirs();                }                else                {                        BufferedInputStream bisMediaFile = null;                        FileOutputStream fosMediaFile = null;                         BufferedOutputStream bosMediaFile = null;                        try                        {                                String strFileName = String.format(""%s\\%s"", strExtractPath, zipMediaEntry.getName());                                File uncompressDir = new File(strFileName).getParentFile();                                uncompressDir.mkdirs();                                //if is a database file, extract to other path : android.movinginteractive.com/databases                                if(strFileName.contains("".db""))                                    strFileName = String.format(""%s\\%s"", strDestinationDBPath, ExtractDBName(zipMediaEntry.getName()));                                bisMediaFile = new BufferedInputStream(zipInFile.getInputStream(zipMediaEntry));                                fosMediaFile = new FileOutputStream(strFileName);                                bosMediaFile = new BufferedOutputStream(fosMediaFile);                                int counter;                                byte data[] = new byte[2048];                                while ((counter = bisMediaFile.read(data, 0, 2048)) != -1)                                 {                                    bosMediaFile.write(data, 0, counter);                                }                        }                        catch (Exception ex)                        {                            throw ex;                        }                        finally                        {                            if (bosMediaFile != null)                            {                                bosMediaFile.flush();                                bosMediaFile.close();                            }                            if (bisMediaFile != null)                                bisMediaFile.close();                        }                }            }        }    }    catch (Exception ex)    {        throw ex;    }    finally    {        if (zipInFile != null)            zipInFile.close();        File flZipToDelete = new File(strBinaryPath);        if(flZipToDelete.exists())            flZipToDelete.delete();    }}</code></pre>","620119","","","","","2011-02-17 09:26:21","Unzipping files in a faster way than using the java.util.zip in Android","<android><unzip><7zip><performance>","1","4","0","",""
"5020177","1","5021172","","2011-02-16 17:55:49","1","1137","<p>I have a couple of reports on my recent app of a bug related to a phone with a physical keyboard, an EditText, and an orientation change.</p><p>I don’t have a phone with a physical keyboard, so I have to try to replicate the problem somehow.  In the emulator creation screen under the AVD manager in Eclipse, there is an option for “keyboard support.”  Is this how I would replicate a physical keyboard phone on the emulator?</p><p>Are there any other ways I could debug my problem?  Thanks.</p><p><strong>Edit upon request</strong>:  Current symptoms as communicated by the user are</p><ol><li>EditText Preference not getting saved (I'm making this assumption based on their input)</li><li>Something to due with the activity not switching orientation properly when the user opens up the keypad.  It requires the user to open it twice.</li></ol><p>Complete Activity code.  NOTE: The <code>EditText</code> below is not the problem <code>EditText</code>.</p><pre><code>public class GreetingOptions extends PreferenceActivity {    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        addPreferencesFromResource(R.layout.greeting_options);        //Set the edit text preference to only accept positive integers        EditTextPreference fontSize = (EditTextPreference) findPreference(""fontSize"");        EditText myEditText = (EditText) fontSize.getEditText();        myEditText.setKeyListener(DigitsKeyListener.getInstance(false, false));    }}</code></pre>","432209","","432209","","2011-02-17 00:24:10","2012-03-06 07:23:27","Replicate physical keyboard on the Android emulator","<android><keyboard><emulator>","2","0","1","",""
"5020222","1","","","2011-02-16 17:58:46","0","226","<p>I need to put the list I get from a json api (also possible with xml) into a listpreference<br>could anyone please explain me as good as possible how to do it?<br>example output from api:</p><pre><code>JSON: (preferred)      [     ""+32486000001"",     ""+32486000002"" ]xml: &lt;response&gt;     &lt;resource&gt;+32486000001&lt;/resource&gt;     &lt;resource&gt;+32486000002&lt;/resource&gt;     &lt;/response&gt;</code></pre><p>the code I already have to get it:</p><pre><code>    String username = prefs.getString(""username"", null);    String password = prefs.getString(""password"", null);    String response = MVDataHelper.getResponse(username, password, URL_GET_MSISDN);</code></pre><p>so the thing I need is to transform the JSonarray to a proper format for the listpreference &amp; a way to add this function to the array.</p><p>please help me ASAP</p><p>Thanks in advance</p><p>p.s.: both entries &amp; entry values should be the array I get here, so no need for mapping or anything</p>","620141","","","","","2011-02-23 14:50:51","adding a JSON array (from an API) to a listpreference on the android SDK","<java><android><arrays><preferences><listpreference>","1","0","","",""
"5020276","1","5045148","","2011-02-16 18:03:34","8","3611","<p>Just trying to determine if there is an easy way to determine what contact changes when using registerContentObserver, or some other method? I can tell when the database changes, but not sure I want to check all the records each time an update/change happens.</p><p>Basically if I have a list of contacts, and one gets updated via manual method (i.e. I change phone number for a contact or add a new contact), or automatic (say ActiveSync photo gets added, changed). I want to be able to A) Know that something changed, and B) Know what contact had some data changed.</p><p>I am trying to look for certain users where I may be able to match their photos from a remote service. If more information gets added to a user account, I want to be able to examine it to see if it provides for a match. I don't want to schedule it though, I would like to do it after an update happens. </p><p>Chris.</p>","393258","","393258","","2011-02-17 01:23:55","2012-07-24 14:15:37","Can you determine what contact changes w/ registerContentObserver?","<android><contacts><contentobserver>","2","4","3","",""
"5020279","1","5021104","","2011-02-16 18:03:42","0","832","<p>I'm implementing a custom search bar in my Android application. This search bar is just an EditText with a magnifier set to leftDrawable property. My problem is that I don't know how to get noticed when the user clicks the magnifier. Is there any listener for doing this? Am I using the recommended approach to implement this search bar? I know I could use an EditText and an ImageButton on its right side, but I want the magnifier to be inside the EditText. </p>","595881","","119280","","2011-02-16 18:12:38","2012-11-15 07:58:30","Handling click on EditText's rightDrawable image","<android><edittext><android-edittext>","1","0","","",""
"5020340","1","5020760","","2011-02-16 18:09:03","0","306","<p>When a Call is received, is there a intent of broadcast received? </p>","389161","","","","","2011-02-16 20:21:41","Android callscreen Intent/broadcast?","<android>","1","0","1","",""
"5020346","1","","","2011-02-16 18:09:25","1","1315","<p>I'm trying to use <code>INSTALL_REFERRER</code> on Android 2.2, and my broadcast receiver is getting called so I know my AndroidManifest.xml is correct. However, the information being passed to my receiver is not what I'm putting in the URL. To me, it looks like default Android Market info and its ignoring the parameters in the URL generated by Google.</p><p>Here's my receiver:</p><pre><code>public void onReceive(Context context, Intent intent) {    String referrer = URLDecoder.decode(intent.getStringExtra(""referrer""));    Log.d(""TEST_RCVR"", referrer); }</code></pre><p>Here's the log output:</p><pre><code>02-16 05:22:06.095: DEBUG/TEST_RCVR(24599): utm_source=androidmarket&amp;utm_medium=device&amp;utm_campaign=search&amp;utm_term=arbitrary software&amp;rowindex=4&amp;hl=en&amp;correctedQuery=</code></pre><p>On my Android device, I opened a browser to the Google Analytics site and had it generate a URL for me. I pasted it into the Android browser so it took me to the right place in the Market, I installed my app just fine, but the output doesnt match whats in the URL. </p><p>Here's the URL Google made for me that I pasted into the Android browsers address bar...<a href=""https://market.android.com/details?id=com.arbitrarysoftware.test&amp;referrer=utm_source%3Dcampsrc%26utm_medium%3Dmedium%26utm_term%3Dterm%26utm_content%3Dcontent%26utm_campaign%3Dnamed"" rel=""nofollow"">https://market.android.com/details?id=com.arbitrarysoftware.test&amp;referrer=utm_source%3Dcampsrc%26utm_medium%3Dmedium%26utm_term%3Dterm%26utm_content%3Dcontent%26utm_campaign%3Dnamed</a></p><p>I'm really interested in getting the utm_source to be ANYTHING other than ""androidmarket."" I'm clearly not understanding why the Android Market overrode / ignored my settings. In my mind, I referred myself to the Market through the browser so they should be honoring my utm_source.</p>","620152","","436938","","2013-11-19 12:43:36","2013-11-19 12:43:36","Android install_referrer gives incorrect utm_source and information","<android><google-analytics><install><google-play>","1","1","2","",""
"5020368","1","","","2011-02-16 18:11:43","-1","803","<p>I have a listview, for each list item i have unique drawer. So my question is </p><p>1.how to achieve opening of single drawer (onclick of handle) at a time resulting into other drawers to be closed if opened.  </p><p>2.how to decrease the space/gap in both portrait/landscape between the handle and its content container.</p><p>Help Appreciated. </p>","478700","","","","","2011-02-16 18:21:20","Multiple Sliding drawers in a listview","<android><slidingdrawer>","1","1","","",""
"5020466","1","5020776","","2011-02-16 18:20:44","1","3023","<p>I have the following piece of HTML code which I need to parse to retrieve the player name and the runs he has scored.In this case it's 'Ross Taylor' and 9.What's the best way to do parse this info? Don't want to use an HTML parser.Is REGEX the best way (I know people are dead against this! But I just want these 2 bits of info and hence don't want to use a parser)?I've been racking my brains on how I should figure out where the player name is in the html file and the consequent row which has the runs scored.The HTML comment part below is a hard coded one. I can reach this place. Then retrieve the name between the   tags. Is this a good way to do it?Also how do I retrieve the runs part in the immediate next row?</p><hr><pre><code>&lt;!-- &lt;a href=""javascript:void(0);"" onClick=""return showHwkTooltip(this, 'lvpyrbat1');"" class=""livePlayerCurrent""&gt;*Luke Woodcock&lt;/a&gt;--&gt;&lt;a href=""/icc_cricket_worldcup2011/content/current/player/38920.html"" target=""_blank"" class=""livePlayerCurrent"" title=""view the player profile for Ross Taylor""&gt;*Ross Taylor&lt;/a&gt;    &lt;span style=""margin-left:5px;"" title=""left-hand bat""&gt;(lhb)&lt;/span &gt;   &lt;/td &gt;   &lt;td&gt;&lt;b&gt;9&lt;/b&gt;&lt;/td&gt;   &lt;td&gt;9&lt;/td&gt;   &lt;td&gt;1&lt;/td&gt;   &lt;td&gt;0&lt;/td&gt;   &lt;td&gt;100.00&lt;/td&gt;   &lt;td&gt;&lt;/td&gt;   &lt;td colspan=""3"" align=""left""&gt;&lt;span class=""batStyl""&gt;striker&lt;/style&gt;&lt;/td&gt;   &lt;td&gt;&lt;/td&gt;   &lt;td colspan=""8""&gt;&lt;/td&gt;  &lt;/tr&gt;</code></pre><hr><p>Please let me know if you need more info.</p><p>Regards,Sam</p>","605040","","424509","","2011-02-16 18:29:31","2012-03-22 07:15:22","Android : Parse HTML block of code","<java><android><html><regex><parsing>","3","3","1","",""
"5020468","1","6347742","","2011-02-16 18:20:58","2","2450","<p>I am looking to use a custom XML for a status bar notification.</p><p>To use as a starting point, is there anywhere to find the default notification's xml code?</p><p>Thankyou.</p>","574940","","","","","2012-09-18 14:36:53","Default XML for Status Notification","<android><android-layout><android-xml>","2","0","1","",""
"5020708","1","5020914","","2011-02-16 18:45:49","1","448","<p>hey everyone, i am new in android</p><p>i have five activity's and one result activityi want to send some data/parameter to result activity</p><p>first_activity,<br>sec_activity,<br>third_activity,<br>four_activity,<br>five_activityeach     </p><p>each have some data like name and age</p><p>onclicking, i want the data to be saved/send to result_activity.thnks</p>","611225","","","","","2011-02-16 19:34:03","how to pass parameter from many activity to one activity","<android><activity>","4","0","1","",""
"5020829","1","5021106","","2011-02-16 18:58:42","0","2582","<p>I'm developing an Android application and it's coming along fairly well.  A couple of days ago my boss surprised us with a Galaxy Tab (sweet!!), so now I'm developing for both the Droid Incredible AND the Galaxy Tab.</p><p>The thing that's bugging me right now is if I long-press the menu key on the Droid, I get the soft keyboard, but no matter what I do on the Galaxy, I can't display the soft keyboard in my application.</p><p>Is there some magic key sequence to display the soft keyboard on a Galaxy Tab???</p><p>Thanks,R.</p>","453989","","18071","","2011-02-16 19:06:48","2011-02-16 19:23:49","How To Display the Soft Keyboard in my Application with the Galaxy Tab","<android><hardware><galaxy>","1","2","","",""
"5020871","1","5021181","","2011-02-16 19:03:27","0","1501","<p>I am thinking about when an android application load a native library, how the library be executed?The dex file in apk is executed by the dalvik VM, but when the logic in OPcodes calls a method in a library(not in dex format), does the VM suspend and wait for the process(that this app &amp; VM is running on) to execute the library?Thanks </p>","470452","","","","","2011-02-24 06:09:48","How native library be executed in Android?","<android><android-ndk><dalvik>","2","0","","",""
"5021090","1","5994467","","2011-02-16 19:22:33","3","6885","<p>If I trace out the screen.width with my DroidX native browser, I first receive 320 as expected, but on subsequent reloads (without changing orientation) I receive 800... why is this?</p>","518116","","","","","2011-05-13 15:50:06","screen.width + android","<javascript><android><width><screen>","1","3","3","",""
"5021099","1","","","2011-02-16 19:23:16","0","3498","<p>I am writing an app containing the WebView. and I want to put in some functionality to interecpt the ""Page Not Found"" message in case the content I am trying to show in my app ever is offline or for some other reason unreachable.I tried using the onReceivedError() but to no avail. Unless perhaps my syntax is wrong, but if soI don't see the error. can someone help?</p><p>code:</p><pre><code>public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    mWebView = (WebView) findViewById(R.id.webview);    mWebView.getSettings().setJavaScriptEnabled(true);    mWebView.loadUrl(""http://www.somesite.net"");    mWebView.setWebViewClient(new HelloWebViewClient());     mWebView.setWebViewClient(new WebViewClient() {    @Override    public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) {        Log.i(""WEB_VIEW_TEST"", ""error code:"" + errorCode);        super.onReceivedError(view, errorCode, description, failingUrl);        //TO DO - do something else in here if the site is down        }      });}private class HelloWebViewClient extends WebViewClient {    @Override    public boolean shouldOverrideUrlLoading(WebView view, String url) {        view.loadUrl(url);        return true;    }}</code></pre>","616323","","","","","2012-06-29 14:00:41","How does one intercept the ""Page Not Found"" error in webview?","<android><webview>","2","3","","",""
"5021203","1","5021284","","2011-02-16 19:33:07","1","794","<p>Android:Hello, i am trying to get index of the item that is clicked but i don't know how i can do it.I want if i click on any item in listview it will open SmsManager with number of this item(Phone Number).Can somebody tell me how i can do it?</p><p>There is source code:</p><pre><code> list1.setOnItemClickListener(new OnItemClickListener() {            @Override            public void onItemClick(AdapterView&lt;?&gt; arg0, View view, int position,                    long id) {                SmsManager m = SmsManager.getDefault();                Uri uriSMSURIs = Uri.parse(""content://sms/inbox"");                Cursor cc = getContentResolver().query(uriSMSURIs, null, null, null, null);                String phoneNumber  = cc.getString(cc.getColumnIndex(""address""));                m.sendTextMessage(phoneNumber , null, phoneNumber , null, null);            }        });</code></pre>","617683","","250260","","2011-10-19 16:30:41","2011-10-19 16:30:41","Index of the item that is clicked in ListView","<android>","2","0","1","",""
"5021334","1","5021682","","2011-02-16 19:45:15","1","1529","<p>I've a number of activities where the handler method to be executed when the user taps certain UI elements is being stripped by Proguard because it can't see that it's being used.</p><p>What's the best solution to this?</p><ul><li><p>Turn off the code shrink feature in proguard (not ideal as it is beneficial in many areas)</p></li><li><p>Is there a way to annotate methods I want it to leave in?</p></li><li><p>How can I tweak a proguard config to never remove methods that start with ""on""?</p></li></ul><p>I tried adding this line (i.e. don't trim methods inheriting from my sublass of the Activity object) but it didn't have the desired effect. I assume it applies to the classes, but not their methods.</p><pre><code>-keep public class * extends com.myapp.CustomActivity</code></pre>","477415","","477415","","2011-02-16 20:57:21","2011-02-16 20:57:21","How do I configure Proguard with Android so it doesn't remove event handler methods referenced only in XML layouts?","<java><android><android-layout><proguard>","1","0","1","",""
"5021385","1","5021706","","2011-02-16 19:50:34","1","357","<p>So I wanted to test my app on an actual android device. I've debugged it on the virtual device and it's working smoothly, but I want it to be able to work on actual phones now for debugging and whatnot as well. I changed the IP I use to access a locally hosted server from 10.0.2.2 to my own. So every time I call up the server which my app queries, it went from:</p><pre><code>HttpPost httpPost = new HttpPost(""http://10.0.2.2/pagemyappwants.php"");</code></pre><p>to</p><pre><code>HttpPost httpPost = new HttpPost(""http://76.blahblah.etc/pagemyappwants.php"");</code></pre><p>the latter being my own computer's IP, which I have used to run remotely accessed servers in the past. I've tested this for the wamp/apache server I'm running, and using this IP you can access the php pages from other computers. However, when I try to use my app, the app freezes up for a few minutes, then moves on as if the task was completed, but when checking the mysql db which would log a change/addition made via the app, nothing has happened.</p><p>So in summary, is there any port forwarding I need to do in order for a locally hosted server for android use to work? Or anything else, for that matter, which would fix this problem? Thank you.</p>","588758","","","","","2011-02-16 20:25:03","Is there any port forwarding I need to do when hosting a server locally for Android app use?","<android><localhost><ports>","1","0","","",""
"5021418","1","5021434","","2011-02-16 19:53:30","6","8361","<p>I understand that it's possible. At least I see that various applications used to put in notification tray their icons (e.g. Skype).</p><p>What about my application? What should I do to put my icon or message in notification bar?</p>","472270","","","","","2014-04-07 09:41:19","How to add application icon in notification tray?","<android><notifications><tray>","2","1","1","",""
"5021600","1","5021726","","2011-02-16 20:13:40","6","11655","<p>My XML menu definition sets the item R.id.menu_refresh's enabled state to false. When the app runs the menu item is greyed and disabled. Why is this code in the app not enabling the item?</p><pre><code>public boolean onCreateOptionsMenu(Menu menu){    MenuInflater inflater = getMenuInflater();    inflater.inflate(R.menu.main, menu);    MenuItem refresh = menu.getItem(R.id.menu_refresh);    refresh.setEnabled(true);    return true;}</code></pre><p>What am I missing?</p>","477415","","","","","2011-02-16 20:39:04","How do I inflate an Android options menu and set an item to Enabled=false?","<android>","2","0","0","",""
"5021802","1","","","2011-02-16 20:34:42","0","2397","<p>This might be an obvious question but I really don't see how to access a crash dump that occurs on my Samsung Device when testing. I see core dump and then some options to like #<em>9900</em> to access it. It tells where the file went, but how do I access the directory from my PC and or copy it over to my PC.  I have kies installed I tried switching also to mass storage but I just don't see how to access file system.  Thanks</p>","602260","","","","","2011-02-16 23:32:16","Android Crash Dump data Accessing on Device","<android><crash><crash-dumps>","2","0","","",""
"5021832","1","5024247","","2011-02-16 20:38:51","0","74","<p>My application crashes when trying to open a connection in the following code. I believe it is because the port is being used, but im not sure. Let me know if you see anything wrong with the code below or have any idea what the problem may be. The application makes it to </p><blockquote>  <p>Log.v(""connectdevice"", ""after  ipadress"");</p></blockquote><p>SOME times it will make it past that point. But is rarely. Also, there is no exception caught.</p><p>Thanks in advance!</p><pre><code>    try {        Log.v(""connectdevice"", ""inside make connection"");        InetAddress host = InetAddress.getByName(""192.168.201.65"");        Log.v(""connectdevice"", ""after ipadress"");        socket = new Socket(host.getHostName(), 7777);        Log.v(""connectdevice"", ""after socket"");        connected = true;        } catch (UnknownHostException e) {            connected = false;            e.printStackTrace();        } catch (IOException e) {            connected = false;            e.printStackTrace();        }</code></pre>","427763","","","","","2011-02-17 01:42:54","application dying at port creation","<java><android><sockets><port>","2","5","1","",""
"5021898","1","5022157","","2011-02-16 20:45:41","0","833","<p>i don't get it. i can plot one point successfully with the BalloonItemizedOverlay, however, when i plot multiple points, the background switches from a street view to a solid ocean blue color. the markers are plotted correctly on the overlay and i can click on the markers and it does what it's told, but i just don't get why my street view disappears and gets replaced by a ocean blue background. anyone else run into this? What am i doing wrong? I noticed that when it gets to the animateTo() command, it switches to blue.</p><pre><code>List&lt;Overlay&gt; mapOverlays = mapView.getOverlays();Drawable drawable = getResources().getDrawable(R.drawable.marker);LocatorItemizedOverlay itemizedOverlay = new LocatorItemizedOverlay(drawable, mapView);for (SingleLocation mloc : Locations){  String strLocationAddress = mloc.AddressLine1 + "", "" + mloc.City + "", "" + mloc.State + ""  "" + mloc.ZipCode;  point = new GeoPoint((int) (Double.parseDouble(mloc.Longitude) * 1E5),(int) (Double.parseDouble(mloc.Latitude) * 1E5));  overlayItem = new OverlayItem(point,mloc.LocName,strLocationAddress);  itemizedOverlay.addOverlay(overlayItem);} mapOverlays.add(itemizedOverlay);mapView.getController().animateTo(point);mapView.getController().setZoom(10);</code></pre><p><img src=""http://i.stack.imgur.com/AT20n.png"" alt=""blue background image""></p>","250043","","244296","","2011-02-16 20:54:59","2011-02-16 21:12:01","Anyone implemented the BalloonItemizedOverlay (with multiple points) successfully?","<android><android-mapview><itemizedoverlay><android-maps>","1","1","","",""
"5022205","1","","","2011-02-16 21:16:35","0","1105","<p>I am trying to build a char using the library from achartengine (http://www.achartengine.org/). So i try to run SalesGrowthChart.java on my own aplication so when someone clicks on a button it will show him the chart .</p><p>This is my code :</p><pre><code>private IChart[] mCharts = new IChart[]{new generatedchart()};</code></pre><p>And i try to generate it like this</p><pre><code>bt.setOnClickListener(new View.OnClickListener() {            public void onClick(View view) {                 Intent myIntent = new Intent(view.getContext(), generatedchart.class);                 myIntent=mCharts[0].execute(this);            }        });</code></pre><p>But this won't work. How can i make it to work.Hope you understand what i am saying.This is the error :</p><blockquote>  <p>The method execute(Context) in the type IChart is not applicable for the arguments (new View.OnClickListener(){})</p></blockquote>","609831","","","","","2011-02-16 21:27:22","Problems with achartengine","<android><charts><achartengine>","2","0","","",""
"5022416","1","","","2011-02-16 21:35:46","2","4432","<p>New to Android need help with one solid build that I can refer to and study for future projects. </p><p>The first activity is a background image with a button,when clicked the it takesyou to the second activity which is a form with 5 data fields and 2 buttons.</p><p>One button calls an intent to take a picture within the app and one button that submits the data from the form along with the picture to URL.</p><p>lastly a third activity that says complete thank you. I can make some of this but don't know how to link button or open and merge camera with the app to be sent as a package of data. I suppose I could also hook into GPS acquire location as well as the camera call? </p>","607536","","331473","","2011-11-26 15:13:29","2013-10-31 15:51:39","How to create a splash activity , call a second activity via a button, simple data form 5 fields and 2 buttons","<android>","2","0","2","",""
"5022423","1","5022606","","2011-02-16 21:36:17","0","302","<p>I am using two tabs in my android application.</p><p>In Tab A, the user enters some values and a database is updated based on the entered values.</p><p>In Tab B, I am trying to display the updated values of the database using TextViews.</p><p>But when I switch from Tab A to Tab B after entering the values in Tab A (i.e. after updating the database), the Tab B appears empty.</p><p>Only when I restart the app, the Tab B appears correctly with updated values.</p><p>Please suggest to me what could be the problem...</p>","620404","","318749","","2011-02-16 21:45:09","2011-02-16 21:54:42","views in tab not getting displayed after database update","<android><database><tabs><textview>","2","2","","",""
"5022478","1","5023503","","2011-02-16 21:42:24","0","348","<p>I am developing an application in which I want to use the exchange domain, username, and password of one of the users accounts for authentication.</p><p>Selecting and fetching the account object is no problem. The issues arises when I attempt to access any of the confidential information contained within the account. Since my application was not the creating activity, I receive a <code>SecurityException</code> complaining about uids.</p><p>Google allows for third-party applications to authenticate against their Google account seamlessly with a special confirmation activity upon first access. Is there something like this available which will allow me to access an exchange account's domain, username, and password?</p>","132047","","","","","2011-02-16 23:32:17","Obtain Exchange Domain, User, and Password","<android><authentication><exchange-server>","1","0","","",""
"5022868","1","","","2011-02-16 22:23:30","4","1188","<p>I am trying to detect when widget button is clicked but none of the <code>Intent</code> extras are showing up in the <code>onReceive</code> method.</p><p><code>onReceive</code> gets called with every click but none of my <code>Intent</code> extras show up.</p><p>My code is below:  I only hook up the toggle button in on update so not sure if this is correct.  None of the extras show up and categories are <code>null</code> even though I set this.</p><p><strong>onUpdate(Context context etc):</strong></p><pre><code>RemoteViews remoteViews = new RemoteViews(context.getPackageName(),                                 R.layout.my_widget);Intent buttonIntent = new Intent(context, MyWidgetProviderClass.class);buttonIntent.setAction(ACTION_WIDGET_RECEIVER);buttonIntent.putExtra(""BUTTON_CLICKED"", ""buttonClick"");buttonIntent.putExtra(""BUTTON"",899);PendingIntent muPendingIntent = PendingIntent.getBroadcast(context, 0,                                         buttonIntent,                                         PendingIntent.FLAG_CANCEL_CURRENT);buttonIntent.addCategory(""buttonclick"");remoteViews.setOnClickPendingIntent(R.id.ToggleImageButton, myPendingIntent);appWidgetManager.updateAppWidget(appWidgetIds, remoteViews);</code></pre><p><strong>onReceive():</strong></p><pre><code>intent.getIntExtra(""BUTTON"",-1);    ---&gt; 1intent.getCategories()   --- &gt; null</code></pre>","602260","","234938","","2011-02-16 22:29:56","2011-02-16 23:37:39","WidgetProvider Intent extras sent with button click not found in onReceive","<android><widget><android-intent><broadcastreceiver>","2","0","","",""
"5022912","1","5023188","","2011-02-16 22:28:10","0","2022","<p>Does Apple or anyone have a glossary of terms used in iphone and android app development?  Screens, Skins, Pages...all names I have seen used for the same thing. I really want a list of tech terms for all aspects of a mobile app. That way, idea guy and developer guy don't spend 20 emails and 3 days figuring out that they are saying the same thing.  </p>","599032","","","","","2011-02-16 22:59:01","Glossary of mobile app development terms","<iphone><android>","1","2","","",""
"5023074","1","5026547","","2011-02-16 22:41:47","2","1658","<p>I have a very simple Activity that extends ListActivity.I am overriding the method onListItemClick do perform some custom operations.</p><p>What I have seen in the logs is that the adapter methode <code>getView</code> is called after I click a list item (which I am overriding too in order to get my list made up by custom views).</p><p>Now, I would like to know if this is the correct behavior or not. If it is I might have a problem.</p><p>The problem is that my list items have images, those are fetched from web and when I click on a list item, the call to the adapter causes calls to the web refreshing the images in the list and messing them up fro some reason.</p><p>Can anyone shade some light?</p><p>this is my <code>getView</code>:</p><pre><code>@Override    public View getView(int position, View convertView, ViewGroup parent) {        ContentListItemView cv = null;        if (convertView == null) {            LayoutInflater inflater = LayoutInflater.from(this.context);            convertView = (RelativeLayout) inflater.inflate(this.layout, null);            cv = new ContentListItemView(convertView);        } else {            cv = (ContentListItemView) convertView.getTag();        }        Log.d(this.getClass().getSimpleName(), ""position: "" + position);        cv.init(getItem(position));        convertView.setTag(cv);        return convertView;    }</code></pre><p>and this is my <code>OnListItemClick</code></p><pre><code>protected void onListItemClick(ListView l, View v, int position, long id) {        super.onListItemClick(l, v, position, id);        //Log.d(this.getClass().getSimpleName(), position + "" "" + id);        Intent contentDetailsIntent = new Intent(this, ContentDetailsActivity.class);        contentDetailsIntent.putExtra(""com.tamtamy.jatta.content_list_item_selected"", position);        contentDetailsIntent.putExtra(""com.tamtamy.jatta.datasource"", ContentDetailsActivity.CONTENT_LIST);        contentDetailsIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);        startActivity(contentDetailsIntent);    }</code></pre>","448660","","448660","","2011-02-17 08:13:16","2011-02-17 08:23:30","Android ListActivity onListItemClick calls adapter getView","<android><listactivity><listadapter>","1","2","3","",""
"5023078","1","","","2011-02-16 22:42:10","0","865","<p>I am having a lot of problems displaying pictures from the SD card in a GridView. I am writing the code for an application that is supposed to allow the user to display images from the SD card in a gridview. The code I have so far crashes every time although there are no errors being picked by the compiler. Here it is:</p><pre><code>package com.newtest1;import android.app.Activity;import android.os.Bundle;import android.database.Cursor;import android.view.View;import android.widget.GridView;import android.widget.Adapter;import android.widget.AdapterView;import android.widget.Toast;import android.provider.MediaStore;import android.provider.MediaStore.Images;import android.provider.MediaStore.Images.Media;import android.provider.MediaStore.Images.Thumbnails;import android.net.Uri;import android.widget.AdapterView.OnItemClickListener;public class MainActivity extends Activity {    public Cursor myImageCursor;    public int columnNumber;    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);String[] imageIDs = new String[]{Thumbnails._ID};    Uri myImagesSource = Thumbnails.EXTERNAL_CONTENT_URI;   myImageCursor = managedQuery(myImagesSource,                 imageIDs, null, null, MediaStore.Images.Thumbnails._ID);     columnNumber = myImageCursor.getColumnIndexOrThrow(MediaStore.Images.Thumbnails._ID);    GridView PhoneImageView = (GridView)findViewById(R.id.photogrid);    PhoneImageView.setAdapter(new ImageAdapter(this));    PhoneImageView.setOnItemClickListener(new OnItemClickListener() {         public void onItemClick(AdapterView&lt;?&gt; parent, View v,int position, long id) {              String[] data = { MediaStore.Images.Media.DATA };             Cursor  viewImageCursor = managedQuery(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, data,null, null, MediaStore.Images.Thumbnails._ID );           int imageColumnIndex = viewImageCursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA);       viewImageCursor.moveToPosition(position);       String filepath = viewImageCursor.getString(imageColumnIndex);       Toast.makeText(MainActivity.this, filepath, Toast.LENGTH_LONG).show();         }   });    }}package com.newtest1;import android.content.Context;import android.database.Cursor;import android.view.View;import android.view.ViewGroup;import android.widget.BaseAdapter;import android.widget.GridView;import android.widget.ImageView;import android.net.Uri;import android.provider.MediaStore;import android.provider.MediaStore.Images.Thumbnails;public class ImageAdapter extends BaseAdapter{final   MainActivity pca = new MainActivity();    private Context context;    public ImageAdapter(Context localContext) {        context = localContext;    }    public int getCount() {        return pca.myImageCursor.getCount();    }    public Object getItem(int position) {        return position;    }    public long getItemId(int position) {        return position;    }    public View getView(int position, View convertView, ViewGroup parent) {        ImageView picturesView;        if (convertView == null) {            picturesView = new ImageView(context);            // Move cursor to current position            pca.myImageCursor.moveToPosition(position);            // Get the current value for the requested column            int imageID = pca.myImageCursor.getInt(pca.columnNumber);            // Set the content of the image based on the provided URI            picturesView.setImageURI(Uri.withAppendedPath(                    MediaStore.Images.Thumbnails.EXTERNAL_CONTENT_URI, """" + imageID));            picturesView.setScaleType(ImageView.ScaleType.FIT_CENTER);            picturesView.setPadding(8, 8, 8, 8);            picturesView.setLayoutParams(new GridView.LayoutParams(100, 100));        }        else {            picturesView = (ImageView)convertView;        }        return picturesView;    }}&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=""wrap_content""            &gt;    &lt;GridView     android:id=""@+id/photogrid""    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>Can somebody please help me as soon as possible? Any help would be much appreciated. </p>","610642","","53501","","2011-02-16 22:43:54","2011-02-16 22:43:54","Displaying pictures from the SD card in a gridview","<android>","0","3","","",""
"5023116","1","","","2011-02-16 22:45:44","2","4484","<p>I have a problem and it is really doing my head in. All I want to do is a very simple task, determine the rotation of the screen. Now Display.getRotation() does exactly this.</p><p><a href=""http://developer.android.com/reference/android/view/Display.html#getRotation%28%29"" rel=""nofollow"">http://developer.android.com/reference/android/view/Display.html#getRotation%28%29</a></p><p>However when I try to use it I just get ""The method getRotation() is undefined for the type Display"" and Eclipse tells me to change it to the deprecated function getOrientation() which will not work for what I need because it only returns Landscape/Portrait, not 0/90/180/270.</p><p>Does anyone have an idea why this might not be working?</p>","620488","","","","","2011-02-26 16:50:18","Android: Display.getRotation();","<android><rotation><screen>","2","2","","",""
"5023133","1","5023198","","2011-02-16 22:47:00","0","352","<p>URl of page - <a href=""http://developer.android.com/resources/tutorials/notepad/index.html"" rel=""nofollow"">http://developer.android.com/resources/tutorials/notepad/index.html</a>Under ""Preparing for the Exercise"" the instructions say to </p><ol><li>Download the project exercises archive (.zip).</li><li>Unpack the archive file to <em>a suitable location</em> on your machine.</li><li>Open the NotepadCodeLab folder.</li></ol><p>QUESTION 1 - <strong>What is considered a suitable location?</strong>I unpacked the samples to.<br>  -    *c:\Development\NotePadTutorieal*    -<br>BUT I don't want to modify the files here. Sometimes I need (or just want to) work the tutorial 2 or 3 times from scratch, and would prefer my base files serve as an untouched template, so I can restart from scratch if necessary. I'd like to have the working code for the tutoriel end up where all my other Android Projects are stored at <em>c:\Development\eclipse...</em> but weather I select ""Create Project from from existing source"" - or - ""Create project from existing sample"" it seems to leave the files where they are, and work on them in suite (modifying what I'd like to keep as a reusable template) - Am I missing something?</p><p>Thanks in advance for any helpful comments.Joe</p>","515453","","","","","2011-02-16 22:56:52","Questions on Notepad Tutorial:","<android><eclipse>","2","0","","",""
"5023170","1","14763254","","2011-02-16 22:51:18","20","9735","<p>In my application I am using sound pool for the button click audio effect.The problem is that if in the device's settings ""Audible selection"" is ticked, then my buttons will produce two sounds: the system one and my one at the same time.</p><p>It seems that if in each button properties I set ""Sound Effects Enabled"" to false, the system sound is not heard any more. But I have many buttons across a dozen of activities, plus I am adding a matrix of buttons in code, so it is rather inconvenient to set ""Sound Effects Enabled"" to false manually for each one of them. Not sure how I do this in code..</p><p>Is there a more global way to stop ""Audible selection"" in my application or at least for the one activity?</p>","562497","","562497","","2011-02-17 19:32:28","2013-05-14 11:12:57","How to disable default sound effects for all my application or activity","<android>","4","1","7","",""
"5023185","1","","","2011-02-16 22:53:05","1","640","<p>I want to make a simple SNMP set request within an Android app.I just want to set one single value to a device. But I can't make it work.</p><p>I tried to use the Snmp4Android.jar package.I tried importing from org.snmp4j</p><p>Right now it fails at some example codes I am following on this line:transport = new DefaultUdpTransportMapping();It throws an exception: Permission denied</p><p>After adding the INTERNET permission it just stops unexpectedly.</p><p>I'm stuck!</p><p>Please advise, anyone got an example that works?</p>","620494","","","","","2011-08-01 19:54:40","Making SNMP set request on Android 2.2","<android><snmp>","1","1","","",""
"5023289","1","5023943","","2011-02-16 23:07:26","4","2524","<p>I have an issue I have not been able to figure out and it is only happening on devices running &lt;2.1.  It works fine on android 2.2.  I have ansynchronous task that displays a loading dialog while it loads all the tabs.  Here is the code for the TabActivity:</p><pre><code>public class OppTabsView extends TabActivity {Dialog dialog;String errorText;boolean save;final int OPP_SAVE = 0;public static boolean edited;public void onCreate(Bundle icicle) {    try {        super.onCreate(icicle);        new DoInBackground().execute();    } catch (Exception e) {        Toast.makeText(this, ""Error occured. Please try again later."",                Toast.LENGTH_SHORT).show();    }}@Overrideprotected void onResume() {    super.onResume();}@Overrideprotected void onStop() {    super.onStop();}@Overrideprotected void onPause() {    super.onPause();}public boolean onCreateOptionsMenu(Menu menu) {    menu.add(0, OPP_SAVE, 0, ""Test"");    return true;}public boolean onOptionsItemSelected(MenuItem item) {    switch (item.getItemId()) {    case OPP_SAVE:        save = true;        new DoInBackground().execute();        return true;    }    return false;}public void LoadOpp() {    handler.sendEmptyMessage(0);}public void SaveOpp() {    DoStuff();}public void LoadLayout() {    setContentView(R.layout.view_opptabs);    /* TabHost will have Tabs */    TabHost tabHost = (TabHost) findViewById(android.R.id.tabhost);    /*     * TabSpec used to create a new tab. By using TabSpec only we can able     * to setContent to the tab. By using TabSpec setIndicator() we can set     * name to tab.     */    /* tid1 is firstTabSpec Id. Its used to access outside. */    TabSpec firstTabSpec = tabHost.newTabSpec(""tid1"");    TabSpec secondTabSpec = tabHost.newTabSpec(""tid1"");    TabSpec thirdTabSpec = tabHost.newTabSpec(""tid1"");    /* TabSpec setIndicator() is used to set name for the tab. */    /* TabSpec setContent() is used to set content for a particular tab. */    firstTabSpec.setIndicator(""General"",            getResources().getDrawable(R.drawable.tab_moneybag))            .setContent(new Intent(this, OppTabGeneral.class));    secondTabSpec.setIndicator(""Details"",            getResources().getDrawable(R.drawable.tab_papers)).setContent(            new Intent(this, OppTabDetails.class));    thirdTabSpec.setIndicator(""Contact"",            getResources().getDrawable(R.drawable.tab_contact)).setContent(            new Intent(this, OppTabContact.class));    /* Add tabSpec to the TabHost to display. */    tabHost.addTab(firstTabSpec);    tabHost.addTab(secondTabSpec);    tabHost.addTab(thirdTabSpec);}private void do_update() {    if (save) {        SaveOpp();    } else {        LoadOpp();    }}Handler handler = new Handler() {    public void handleMessage(Message msg) {        LoadLayout();    }};private class DoInBackground extends AsyncTask&lt;Void, Void, Void&gt; implements        DialogInterface.OnCancelListener {    protected void onPreExecute() {        String verb = ""Connecting"";        if (save) {            verb = ""Saving"";        }        dialog = ProgressDialog.show(OppTabsView.this, """", verb                + "".  Please Wait..."", true, true, this);    }    protected Void doInBackground(Void... v) {        do_update();        return null;    }    protected void onPostExecute(Void v) {        dialog.dismiss();    }    public void onCancel(DialogInterface dialog) {        cancel(true);        dialog.dismiss();        finish();    }}}</code></pre><p>Here is the stack trace from the error:</p><pre><code>java.lang.NullPointerExceptionat android.widget.TabWidget.dispatchDraw(TabWidget.java:206)at android.view.ViewGroup.drawChild(ViewGroup.java:1529)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.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.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 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:860)at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)at dalvik.system.NativeStart.main(Native Method)</code></pre><p>I have tried stepping through it but the error seems to come out of no where, not at a specific line.  Any help is greatly appreciated.</p>","408079","","180538","","2011-02-17 23:22:08","2013-10-04 12:33:03","Android 2.1 NullPointerException with TabWidgets","<android><tabs><tabwidget><tabactivity>","4","3","2","",""
"5023361","1","5023402","","2011-02-16 23:14:42","0","313","<p>I have a Runnable that transfers data(a few hundred files) from an android device to a PC by doing the following in its run method</p><ol><li>Creates a process and executes a command using Runtime.exec(CMD)</li><li>The CMD is a command that transfers data from a device to the PC that runs this thread.(This is an adb pull command for android )</li></ol><p>I have a main program that creates a Thread and starts this runnable. The runnable starts running and it executes the ""adb pull"" command and starts transferring the data, BUT it seems to pause soon after before it completes the full transfer. IF I force quit the main program, the transfer runs to completion.</p><p>Also had I executed the command from the main program itself without using another thread, I face no issues.</p><p>Why am I facing this issue?</p>","414752","","","","","2011-02-16 23:33:31","Java thread not running to completion, why?","<java><android><multithreading><process><adb>","1","0","","",""
"5023382","1","5023678","","2011-02-16 23:16:16","2","1154","<p>At the moment my parser parses data and stores it in a listView which can be displayed easily.</p><p>However I want to use a textView to display this data instead but I'm not sure how.</p><p>Here's the code that works using a listview:</p><pre><code>public class StatisticsScreen extends ListActivity{private List&lt;Message&gt; messages;ListView lv;@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.statisticsscreen);        loadFeed();                lv = (ListView) findViewById(android.R.id.list);    private void loadFeed() {    try{        BaseFeedParser parser = new BaseFeedParser();        messages = parser.parse();        List&lt;String&gt; titles = new ArrayList&lt;String&gt;(messages.size());        for (Message msg : messages){            titles.add(msg.getTemperature());            titles.add(msg.getRain());            titles.add(msg.getWind());        }        ArrayAdapter&lt;String&gt; adapter =             new ArrayAdapter&lt;String&gt;(this, R.layout.xmldatarow,titles);        getListView().addHeaderView(View.inflate(this, R.layout.xmllayout, null));        this.setListAdapter(adapter);    } catch (Throwable t){        Log.e(""AndroidNews"",t.getMessage(),t);    }       }</code></pre><p>So like I said this works perfectly, but I want to use a TextView instead of a ListView to store/display the data..</p><p>Any advice? Thanks</p><p>EDIT: HERE'S THE SOLUTION</p><p>Here's the updated code that works now:</p><pre><code>public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.statisticsscreen);            tv = (TextView) findViewById(R.id.xmltextview);          tv1 = (TextView) findViewById(R.id.xmltextview1);    tv2 = (TextView) findViewById(R.id.xmltextview2);    loadFeed();    private void loadFeed() {      try{        BaseFeedParser parser = new BaseFeedParser();        messages = parser.parse();        for (Message msg : messages){            tv.setText(msg.getTemperature());            tv1.setText(msg.getRain());            tv2.setText(msg.getWind());         }                 } catch (Throwable t){         Log.e(""Weather"",t.getMessage(),t);      }           } }</code></pre>","604469","","604469","","2011-02-22 23:27:29","2011-02-22 23:27:29","How to insert parsed XML data in to a TextView","<android><xml><parsing><data><textview>","2","0","1","",""
"5023557","1","5023596","","2011-02-16 23:41:10","0","1128","<p>How to change main activity at application startup in Android?</p><p>I want to implement lock screen asking for password, before allow user to interact with application. Password screen can be turned of in application's settings and in such case (when application should not ask for password) I want to start Main application activity not Password activity. How it is possible?</p>","585743","","","","","2011-02-16 23:47:44","Change main activity in code","<android><activity>","2","0","","",""
"5023573","1","5161950","","2011-02-16 23:42:54","0","4052","<p>So I'm working on adding some web view stuff and will eventually make this more complicated but for now am just trying to get the basics working. I have my xml built and such and I am inflating it on top of another view. So its in like a dialog box. </p><pre><code>web = (WebView)findViewById(R.id.WebView);name = (TextView) findViewById(R.id.name);name.setOnClickListener(new View.OnClickListener() {    public void onClick(View v) {        final Dialog dialog = new Dialog(Hydrogen.this);        dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);        dialog.setContentView(R.layout.web);        dialog.setCancelable(true);        web.loadUrl(""http://en.wikipedia.org/wiki/"" + name.getText().toString());        RelativeLayout btn = (RelativeLayout) dialog.findViewById(R.id.close);        btn.setOnClickListener(new View.OnClickListener() {            public void onClick(View v) {                dialog.dismiss();                        }            });             dialog.show();}});</code></pre><p>Basically thats my code regarding the WebView etc. The problem is on line 145 which is the web.loadUrl line. I'n not sure whats wrong but every time I try to open the Dialog it crashs. Thanks. </p><pre><code>02-16 17:16:08.313: ERROR/AndroidRuntime(8122): FATAL EXCEPTION: main02-16 17:16:08.313: ERROR/AndroidRuntime(8122): java.lang.NullPointerException02-16 17:16:08.313: ERROR/AndroidRuntime(8122):     at table.periodic.Hydrogen$1.onClick(Hydrogen.java:145)02-16 17:16:08.313: ERROR/AndroidRuntime(8122):     at android.view.View.performClick(View.java:2408)02-16 17:16:08.313: ERROR/AndroidRuntime(8122):     at android.view.View$PerformClick.run(View.java:8816)02-16 17:16:08.313: ERROR/AndroidRuntime(8122):     at android.os.Handler.handleCallback(Handler.java:587)02-16 17:16:08.313: ERROR/AndroidRuntime(8122):     at android.os.Handler.dispatchMessage(Handler.java:92)02-16 17:16:08.313: ERROR/AndroidRuntime(8122):     at android.os.Looper.loop(Looper.java:123)02-16 17:16:08.313: ERROR/AndroidRuntime(8122):     at android.app.ActivityThread.main(ActivityThread.java:4627)02-16 17:16:08.313: ERROR/AndroidRuntime(8122):     at java.lang.reflect.Method.invokeNative(Native Method)02-16 17:16:08.313: ERROR/AndroidRuntime(8122):     at java.lang.reflect.Method.invoke(Method.java:521)02-16 17:16:08.313: ERROR/AndroidRuntime(8122):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)02-16 17:16:08.313: ERROR/AndroidRuntime(8122):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)02-16 17:16:08.313: ERROR/AndroidRuntime(8122):     at dalvik.system.NativeStart.main(Native Method)</code></pre><p>I also just tried making a seperate project in which to load the web page. Just a WebView loading the URL. It partly worked. It worked to the point that it opened the URL but it did it inside the browser instead of inside the webview. Could be because I named the WebView browser but will try more.</p>","288437","","288437","","2011-02-19 19:45:48","2011-03-02 00:07:31","WebView loading Url","<android><webview>","3","3","2","",""
"5023645","1","5051180","","2011-02-16 23:54:44","28","13591","<p>I want to use an AutoCompleteTextView in my activity and populate the data as the user types by querying a web API.  How do I go about doing this?  Do I create a new class and override AutoCompleteTextView.performFiltering, or do I use a custom list adapter and provide a custom android.widget.Filter that overrides performFiltering?  Or is there a better way to obtain my end goal?  I've done something somewhat similar, but it was for the Quick Search box and it involved implementing a service, but I believe that's not what I want to do here.</p>","147862","","","","","2013-11-10 17:57:41","How do I Use AutoCompleteTextView and populate it with data from a web API?","<android><networking><filter><autocompletetextview>","2","0","24","",""
"5023647","1","5023776","","2011-02-16 23:55:00","1","4038","<p>I'm in and android widget and checking elapsed time between two calls of System.nanoTime() and the number is huge.  How do you measure elapsed time with this?  it should be a fraaction of a second and instead its much more.  Thanks</p>","602260","","","","","2011-07-27 18:31:29","Java System.nanoTime() huge difference in elapsed time","<java><android><nanotime>","3","2","1","",""
"5023759","1","5023772","","2011-02-17 00:14:06","0","2456","<p>I'm new to Android and very unfamiliar with Eclipse. I'm trying to get a simple Hello World project started, as per</p><p><a href=""http://developer.android.com/guide/developing/eclipse-adt.html"" rel=""nofollow"">Developing In Eclipse, with ADT</a></p><p>I've downloaded the latest Eclipse dev environment (64 bit), the latestes JVM (64 bit) and the latest Android SDK.</p><p>I've used Android SDK and AVD Manager to create an AVD targeting Honeycomb to Windows 7 64 bit. I did the default install for everything.</p><p>When I start Eclipse, I click File > New > Project I expected to see a folder for Android, but there's nothing there except the project optins that were there when I first installed Eclipse: General, CVS, Java &amp; Examples</p><p>Is there something I'm doing wrong? Can somebody tell me if there's a way to get this going?</p>","181771","","750987","","2011-05-29 06:44:43","2011-05-29 06:44:43","How to Create an Android Application with Eclipse","<android><eclipse><android-3.0-honeycomb>","1","0","","",""
"5023944","1","5023976","","2011-02-17 00:45:33","8","3720","<p>I'm trying to create an Android project with Eclipse, but the 'Next' button is greyed out in the New Android Project window.</p><p>The Build Target section is presenting the message 'No Target Avaliable'. I have everything else filled in. Is there something else I need to have in place for this to work?</p>","181771","","","","","2011-05-16 06:48:31","What to do when trying to create an Android app, and 'No Target Available'?","<android><eclipse>","4","0","1","",""
"5023968","1","5023999","","2011-02-17 00:50:01","1","60","<p>I need the same functionality that my widget provides in another part of my application. Inside a list activity.  How could I reuse my widget in a custom view?  I would like to put the Widget unto a View?  How can this be done?  Building a custom host.  I mean I think I would need for whatever I build to be a broadcast receiver anyway, so how can I resuse the Widget provider Thanks</p>","602260","","","","","2011-02-17 00:55:46","Reuse WidgetProvider outside Home?","<android><widget><host>","1","0","","",""
"5024016","1","","","2011-02-17 00:59:09","0","210","<p>I have an app that checks GPS position and interacts with four websites.  I am thinking of using ASync tasks within a Service.  The result from each website does not depend on any other website.</p><p>As finding the location and interacting with each website will take a different amount of time, does this mean I should have five services?  Or should it all be combined into one service?</p>","620593","","","","","2011-02-17 01:23:51","How many Services should I have?","<android><multithreading><service><android-asynctask>","1","0","1","",""
"5024053","1","","","2011-02-17 01:06:09","0","1326","<p>I am trying to make a relativeLayout with three textViews in a column on the left and two buttons next to each other on the right. The problem is, when the first textView is short ""i.e. 3 or 4 characters"" the textViews below get wrapped whenever they are longer then the first textView. I don't want this and want them to go all the way to the buttons if possible. I know I'm probably missing a parameter or something similar. Can anybody help me?</p><pre><code>&lt;LinearLayout android:id=""@+id/LinearLayout02"" android:orientation=""vertical"" android:layout_height=""fill_parent"" android:layout_width=""fill_parent""&gt;&lt;RelativeLayout android:layout_width=""fill_parent"" android:layout_height=""wrap_content"" android:id=""@+id/RelativeLayout_class1"" android:visibility=""visible""&gt;&lt;TextView android:layout_width=""wrap_content"" android:text=""@+id/TextView01"" android:layout_height=""wrap_content"" android:layout_alignParentTop=""true"" android:id=""@+id/TextView_class1_name"" android:textColor=""@color/Button_Text1""&gt;&lt;/TextView&gt;&lt;TextView android:layout_width=""wrap_content"" android:text=""@+id/TextView01"" android:layout_below=""@+id/TextView_class1_name"" android:layout_height=""wrap_content"" android:layout_alignLeft=""@+id/TextView_class1_name"" android:layout_alignRight=""@+id/TextView_class1_name"" android:id=""@+id/TextView_class1_building"" android:textColor=""@color/Button_Text1""&gt;    &lt;/TextView&gt;&lt;TextView android:text=""@+id/TextView01"" android:layout_below=""@+id/TextView_class1_building"" android:layout_alignLeft=""@+id/TextView_class1_building"" android:layout_alignRight=""@+id/TextView_class1_building"" android:id=""@+id/TextView_class1_room"" android:textColor=""@color/Button_Text1"" android:layout_height=""wrap_content"" android:width=""0dip"" android:layout_width=""wrap_content""&gt;&lt;/TextView&gt;&lt;Button android:layout_alignParentRight=""true"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:id=""@+id/Button_class1_map"" android:minHeight=""@dimen/button_small_size"" android:minWidth=""@dimen/button_small_size"" android:maxHeight=""@dimen/button_small_size"" android:maxWidth=""@dimen/button_small_size"" android:text=""@string/text_map"" android:layout_centerVertical=""true""&gt;&lt;/Button&gt;&lt;Button android:layout_toLeftOf=""@+id/Button_class1_map"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:layout_alignTop=""@+id/Button_class1_map"" android:layout_alignBottom=""@+id/Button_class1_map"" android:id=""@+id/Button_class1_edit"" android:minHeight=""@dimen/button_small_size"" android:minWidth=""@dimen/button_small_size"" android:maxHeight=""@dimen/button_small_size"" android:maxWidth=""@dimen/button_small_size"" android:text=""@string/text_edit"" android:layout_centerVertical=""true""&gt;&lt;/Button&gt;&lt;/RelativeLayout&gt;&lt;/LinearLayout&gt;</code></pre>","543010","","","","","2012-06-29 12:20:04","Android TextView in RelativeLayout wrapping","<android><textview><relativelayout>","2","0","","",""
"5024081","1","","","2011-02-17 01:13:21","3","1435","<p>I am trying to render a tagCloud from a set of given terms and weights on some Android devices. It seems that there is little support for jscript, esp. those based on jquery.</p><p>are you aware of any sort of library?any hints are welcome.</p><p>cheers</p>","585642","","","","","2012-12-12 10:47:19","TagCloud for Android","<android><tag-cloud>","1","3","1","",""
"5024121","1","5075686","","2011-02-17 01:19:27","3","2433","<p>I am trying to build Droid-Fu as specified on the GitHub page but the build is failing. Here is the message which I got after running <strong>mvn package</strong> inside the Droid-Fu folder</p><pre><code>[INFO] artifact junit:junit: checking for updates from centralDownloading: http://powermock.googlecode.com/svn/repo//com/google/android/maps/maps/9_r1/maps-9_r1.jar[INFO] Unable to find resource 'com.google.android.maps:maps:jar:9_r1' in repository powermock-repo (http://powermock.googlecode.com/svn/repo/)Downloading: http://repo1.maven.org/maven2/com/google/android/maps/maps/9_r1/maps-9_r1.jar[INFO] Unable to find resource 'com.google.android.maps:maps:jar:9_r1' in repository central (http://repo1.maven.org/maven2)[INFO] ------------------------------------------------------------------------[ERROR] BUILD ERROR[INFO] ------------------------------------------------------------------------[INFO] Failed to resolve artifact.Missing:----------1) com.google.android.maps:maps:jar:9_r1  Try downloading the file manually from the project website.  Then, install it using the command:       mvn install:install-file -DgroupId=com.google.android.maps -DartifactId=maps -Dversion=9_r1 -Dpackaging=jar -Dfile=/path/to/file  Alternatively, if you host your own repository you can deploy the file there:       mvn deploy:deploy-file -DgroupId=com.google.android.maps -DartifactId=maps -Dversion=9_r1 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]  Path to dependency:     1) com.github.droidfu:droid-fu:jar:1.0-SNAPSHOT    2) com.google.android.maps:maps:jar:9_r1----------1 required artifact is missing.for artifact:   com.github.droidfu:droid-fu:jar:1.0-SNAPSHOT</code></pre><p>Any idea what I may be doing wrong?</p>","48066","","296677","","2011-11-28 14:26:55","2012-10-28 10:15:43","Droid-Fu build error","<android><maven><droid-fu>","5","0","1","",""
"5024140","1","5024310","","2011-02-17 01:21:39","12","9755","<p>I'm building an app that displays some content in a WebView. I'm styling this content to fit the screen and no zooming is needed. Is there a way do turn off the zooming features of a WebView?</p>","97120","","","","","2011-07-02 06:08:15","Disable pinch zoom in WebView?","<android><webview><zoom>","2","0","1","",""
"5024163","1","5024186","","2011-02-17 01:25:24","2","810","<p>I have an <code>Activity</code> with a fixed orientation, <code>android:screenOrientation=""portrait""</code> in my manifest.  I noticed that when pressing Cntl-F11 on the emulator and when a user slides out the keyboard on a device the <code>Activity</code> is destroyed and <code>onCreate</code> is called.</p><p>Yet when I use a non-slide out keyboard device the <code>Activity</code> is never destroyed, simply because it is locked to portrait.</p><p>Why is there a difference in behavior between devices?  Why is an Activity that is locked to portrait, invoking a configuration change?  This is really irritating.</p><p><strong>Edit:</strong>  I also experimented with <code>android:configChanges=""orientation</code> without any noticeable difference.</p>","432209","","432209","","2011-02-17 01:32:16","2011-02-17 01:32:16","Fixed orientation Activity lifecycle on a slide out keypad phone","<android><activity><lifecycle><onconfigurationchanged>","1","2","","",""
"5024195","1","5038247","","2011-02-17 01:31:36","10","7376","<p>i need help parsing a response with the jackson mapper to a POJO. i have this as a response: </p><pre><code> ""data"": [{        ""item"": {            ""downloaded"": false,            ""moderated"": false,            ""add"": false        }    },    {        ""item"": {            ""downloaded"": false,            ""moderated"": false,            ""add"": false }// more</code></pre><p>so how do i bind this one with the mapper to a POJO?here is my class that i am trying but it returns that ""item"" is not recognized and not allowed to be ignored.</p><pre><code>public ArrayList&lt;Item&gt; data =  new ArrayList&lt;Item&gt;();</code></pre><p>where item is a public static class Item with constructors and all the fields above with getters and setters.</p><p>how do i do this. i cant seem to find anywhere how to read data from an array this way.</p>","448192","","180538","","2011-02-17 01:37:25","2013-03-07 13:18:15","android jackson json object mapper array deserialization","<android><json><jackson><pojo>","3","1","1","",""
"5024223","1","5024277","","2011-02-17 01:38:39","13","15233","<p>I am trying to create a local database on an android phone using <code>sqlite</code>.</p><p>I have a helper class, shown below, that is used to create the database and provide the ""help"". </p><p>I am wanting to create an object of this class in the main part of my code and it create the database and tables there as well.</p><p><strong>The problem:</strong></p><p>Whenever i create an object of the class, it does not seem to be calling the <code>onCreate</code> method in the helper. I thought this is supposed to happen. I thought that <code>onCreate</code> was basically a constructor for the class. (I believe i am wrong) </p><ul><li>So, why is it not calling the <code>onCreate</code> method? </li><li>Or how do i get it to create the database and tables where i am creating the object of the class? </li><li>What would be a better way to do this, if this is not a good approach?</li></ul><hr><pre><code>public class SmartDBHelper extends SQLiteOpenHelper {    private static final String DATABASE_NAME = ""smart_lite_db.db"";    private static final int DATABASE_VERSION = 2;    private static final String NOTIFY_TABLE_NAME = ""user_notify_data"";    private static final String HR_TABLE_NAME = ""user_hr_data"";    private static final String NOTIFY_TABLE_CREATE =         ""CREATE TABLE "" + NOTIFY_TABLE_NAME +         "" (counter INTEGER PRIMARY KEY, "" +         ""userresponse INTEGER, "" +         ""notifytime INTEGER);"";    private static final String DATA_TABLE_CREATE =         ""CREATE TABLE "" + HR_TABLE_NAME +        "" (counter INTEGER PRIMARY KEY, "" +        ""hr INTEGER, "" +        ""act INTEGER, "" +        ""timestamp INTEGER);"";          public SmartDBHelper(Context context) {        super(context, DATABASE_NAME, null, DATABASE_VERSION);        // TODO Auto-generated constructor stub    }    @Override    public void onCreate(SQLiteDatabase db) {        // TODO Auto-generated method stub        Log.v(""smartdbhelper"", ""before creation"");        db.execSQL(NOTIFY_TABLE_CREATE);        Log.v(""smartdbhelper"", ""middle creation"");        db.execSQL(DATA_TABLE_CREATE);        Log.v(""smartdbhelper"", ""after creation"");    }    @Override    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {        // TODO Auto-generated method stub    }}</code></pre><hr><pre><code>public class SmartApp extends Activity implements OnSharedPreferenceChangeListener {   private SmartDBHelper dBHelper;   public void onCreate(Bundle savedInstanceState) {      //where i am wanting to create the database and tables      dBHelper = new SmartDBHelper(getContext());   }}</code></pre>","427763","","427763","","2012-08-01 17:35:43","2013-03-04 23:50:44","SQLiteOpenHelper failing to call onCreate?","<java><android><sqlite><oncreate>","2","0","6","",""
"5024273","1","","","2011-02-17 01:47:43","1","700","<p>HI~everyone!I have gotten the registration_id for the phone and an auth token from google for my gmail account that is performing a push. </p><p>But When I send my auth token and registration id to Ubuntu and try to post it by php , php's curl and only curl to request to C2DM to get a message. And I always get the 401 Unauthorized.</p><p>And this is my php code ....</p><pre><code>$post_params = array ( ""Email"" =&gt; $MY_GOOGLE_ACC, ""Passwd"" =&gt;$MY_GOOGLE_PWD, ""accountType""=&gt;""GOOGLE"", ""source="" . $MY_GOOGLE_SRC, ""service=ac2dm"" );     $first = true;   $data_msg = """";    foreach ($post_params as $key =&gt; $value) {      if ($first)       $first = false;     else       $data_msg .= ""&amp;"";      $data_msg .= urlencode($key) .""="". urlencode($value);    }   $x = curl_init(""https://www.google.com/accounts/ClientLogin"");curl_setopt($x, CURLOPT_HEADER, 1);    curl_setopt($x, CURLOPT_POST, 1);    curl_setopt($x, CURLOPT_POSTFIELDS, $data_msg);    curl_setopt($x, CURLOPT_RETURNTRANSFER, 1);   $data = curl_exec($x);    curl_close($x);   $response = $data;$authKey = trim(substr($response, 4+strpos($response, ""SID="")));echo $authKey;   $collapse_key = 'something';   $post_params = array ( ""registration_id"" =&gt; $DEVICE_TOKEN, ""collapse_key"" =&gt;$collapse_key, ""data.payload""=&gt;""cakephp"" );$first = true;   $data_msg = """";    foreach ($post_params as $key =&gt; $value) {       if ($first)      $first = false;     else       $data_msg .= ""&amp;"";      $data_msg .= urlencode($key) .""="". urlencode($value);    }    $size=strlen($data_msg); $x = curl_init(""https://android.apis.google.com/c2dm/send"");    curl_setopt($x, CURLOPT_HTTPHEADER, array('Content-Type: application/x-www-form-urlencoded', 'Content-Length:'. $size, 'Authorization: GoogleLogin auth=' . $authKey));curl_setopt($x, CURLOPT_HEADER, 1);    curl_setopt($x, CURLOPT_POST, 1);    curl_setopt($x, CURLOPT_POSTFIELDS, $data_msg);    curl_setopt($x, CURLOPT_RETURNTRANSFER, 1);    $data = curl_exec($x);    curl_close($x);    $response = $data; </code></pre><p>Am I miss somthing or do something wrong?</p><p>AND any help would be much appreciated,thanks!! </p>","517011","","469983","","2011-10-27 09:04:45","2011-11-10 10:23:51","Using C2DM get 401 problem?","<android><push><android-c2dm>","1","0","","",""
"5024344","1","5024439","","2011-02-17 02:04:01","1","1099","<p>I am trying to load a local javascript file from a webview. The file ""search.js"" is located under the assets folder in my project.I used this line to load my webpage : </p><pre><code>mWebView.loadDataWithBaseURL(""file:///android_asset/"", data, ""text/html"", ""utf-8"", null);</code></pre><p>on my webpage, I am using this line : </p><pre><code>&lt;script type=""text/javascript"" src=""search.js""&gt;&lt;/script&gt;</code></pre><p>to load my javascript file. </p><p>When I run the program, I just get a white page..............</p><p>I don't know what to do. Do you have any ideas ?</p><p>Thanks !!</p>","112976","","","","","2011-02-17 02:26:01","Access to local data from an android webview","<android><html><file><webview>","1","0","2","",""
"5024374","1","5024408","","2011-02-17 02:11:36","0","435","<p>I register and buy an android market account and publish the application. But now I want to publish it using another account. Is there any easy way to transfer my published application from A account to B?</p><p>Thanks.</p>","386594","","750987","","2011-05-29 06:28:26","2011-05-29 06:28:26","How to publish Android application with different accounts","<android><google-play><google-account>","1","0","","2013-12-11 08:12:03",""
"5024399","1","","","2011-02-17 02:16:55","0","6767","<p>I want to make seekbar like this: <a href=""http://img687.imageshack.us/img687/2371/volumec.png"" rel=""nofollow"">http://img687.imageshack.us/img687/2371/volumec.png</a>The thing is, that I<code>ve already found customizing seekbars over here <a href=""http://groups.google.com/group/android-developers/browse"" rel=""nofollow"">http://groups.google.com/group/android-developers/browse</a>_thread/thread/be3fed0b4f766cc?pli=1but the problem is, that I need **those gaps** between in my drawable and I don</code>t know how to manage that.Would you be so kind some of you, I`ll appreciate it very much.Thanks in advance, wishing all the best!</p><p>this is my resources style.xml file that is applied to seekbar:</p><pre><code>&lt;item name=""android:indeterminateOnly""&gt;false&lt;/item&gt;&lt;item name=""android:progressDrawable""&gt;@drawable/seekbarcolors&lt;/item&gt;&lt;item name=""android:indeterminateDrawable""&gt;@drawable/seekbarcolors&lt;/item&gt;&lt;item name=""android:minHeight""&gt;20dip&lt;/item&gt;&lt;item name=""android:maxHeight""&gt;20dip&lt;/item&gt;&lt;item name=""android:thumbOffset""&gt;8px&lt;/item&gt;&lt;item name=""android:focusable""&gt;true&lt;/item&gt;</code></pre><p>and here is my @drawable/seekbarcolors:</p><pre><code>&lt;layer-list xmlns:android=""http://schemas.android.com/apk/res/android""&gt;&lt;item android:id=""@android:id/background""&gt;    &lt;shape&gt;        &lt;solid android:color=""#ff0000"" /&gt;    &lt;/shape&gt;&lt;/item&gt;&lt;item android:id=""@android:id/secondaryProgress""&gt;    &lt;clip&gt;        &lt;shape&gt;            &lt;solid android:color=""#00ff00"" /&gt;        &lt;/shape&gt;    &lt;/clip&gt;&lt;/item&gt;&lt;item android:id=""@android:id/progress""&gt;    &lt;clip&gt;        &lt;shape&gt;            &lt;solid android:color=""#0000ff"" /&gt;        &lt;/shape&gt;    &lt;/clip&gt;&lt;/item&gt;</code></pre><p></p>","620649","","","","","2013-08-07 05:58:56","Android SeekBar [ProgressBar] style - how to set custom background drawable","<android><coding-style><progress-bar><seekbar>","3","0","","",""
"5024455","1","5047388","","2011-02-17 02:29:01","10","2539","<p>I'm creating a news reader app that, at times, loads web pages into a <code>WebView</code>.</p><p>I noticed that with default behavior, the cache can get very unreasonable very quickly.  Whether or not Android will clear out that cache when memory gets low, I'm not okay with my users seeing a 15MB news app when everything except the web cache is about 1MB.</p><p>However, I would love to use the cache to some extent.  I saw WebSettings#setAppCacheMaxSize() and it seemed like it was just the ticket.  </p><p>It doesn't seem like it does anything.  I hardcoded the following into a method that is called by my activity's onCreate(), before anything is loaded:</p><p><code>originalSourceWebView.getSettings().setAppCacheMaxSize(300*1024);</code> (I was using a larger, configurable value but dropped it lower to confirm my problem).</p><p>I blow right by 300KB without any fanfare, as shown by <code>settings-&gt;applications-&gt;manage applications-&gt;click on my app</code>.  I'm listening in WebChromeClient#onReachedAppMaxCacheSize for events, but that never seems to trigger.</p><p>Has anyone successfully used this?  Is there some different cache I should be trying to manage?  The docs seem pretty sparse.  I went into the android source but it just sends values off to native code, and I don't know how to delve into that.</p><p>My test environment is a nexus one on 2.2.2.  I know that I'll need to make the cache calls by reflection in order to support 1.5 and 1.6, but if I can't make this work, there will be no need.</p>","574859","","914220","","2013-03-05 14:41:12","2013-03-05 14:41:12","Has anyone successfully limited the size of their WebView's cache?","<android><caching><webview>","1","2","2","",""
"5024465","1","","","2011-02-17 02:30:32","4","268","<p>Most Android framework components are not thread safe—at least this is the assumption that I usually work with.</p><p>However, is it safe to invoke <code>startService()</code> from a background thread?</p><p>I came across a post from Dianne Hackborn who says that it is safe to call <code>sendBroadcast()</code> from any thread, so I want to assume that this is also true for <code>startService()</code> (<a href=""http://groups.google.com/group/android-developers/msg/38a09b52de93f70a"" rel=""nofollow"">http://groups.google.com/group/android-developers/msg/38a09b52de93f70a</a>).</p><p>Can anyone with framework experience comment?</p><p>Thanks!</p>","300368","","9636","","2013-12-05 20:32:00","2013-12-05 20:32:00","Can startServce() be invoked from any thread?","<android>","1","0","1","",""
"5024523","1","","","2011-02-17 02:41:19","0","1808","<p>I'm new to Android Programming and I am trying to create a new project from the sample code provided. I follow the instructions exactly but I keep getting this error:</p><p>Could not write file: C:\Program Files (x86)\Android\android-sdk-windows\samples\android-10\JetBoy.project.C:\Program Files (x86)\Android\android-sdk-windows\samples\android-10\JetBoy.project (Access is denied)</p><p>I go check the properties of the directories and they are all read only. When i uncheck that box and re-open the properties, it's still read only!!!!</p><p>How can I make these directories not read only so I can u</p>","620657","","","","","2011-04-27 22:04:24","Can't create new project from Android Sample Apps","<android>","1","0","","",""
"5024708","1","","","2011-02-17 03:13:59","2","683","<p>So I know some websites check to see if it's being hit by an iPhone App Mode browser by checking window.navigator.standalone. Is it possible to mask an Android webview as an iPhone App Mode browser?</p><p>I've tried the following code, but it doesn't seem to do the trick against the site I'm trying to get to work.</p><pre><code>WebView webView = new WebView(this);    webView.getSettings().setJavaScriptEnabled(true);    /* WebViewClient must be set BEFORE calling loadUrl! */    webView.setWebViewClient(new WebViewClient() {        @Override public void onPageStarted(WebView view, String url, Bitmap favicon) {        }        // intercept page finished event        @Override public void onPageFinished(WebView view, String url) {            if(DEBUG) Log.v(TAG, ""done"");            view.loadUrl(""javascript:javascript:(function() { "" +                    ""window.navigator.standalone=1;"" +                    ""})()"");        }        // intercept clicked link event--load in this webview        @Override public boolean shouldOverrideUrlLoading(WebView view, String url) {            view.loadUrl(url);            return true;        }    });    webView.loadUrl(""&lt;website&gt;"");</code></pre>","501754","","","","","2011-05-07 16:25:23","Is it possible to mask an Android WebView as an iPhone ""App Mode"" safari browser?","<iphone><android><webview><mobile-safari>","2","0","","",""
"5024847","1","5035948","","2011-02-17 03:44:19","0","493","<p>Like switch radio channel by AT command</p>","425329","","","","","2011-02-17 23:18:40","Is it possible to use RFCOMM API to write customize AT command to use bluetooth headset","<android><bluetooth><rfcomm>","1","0","","",""
"5024892","1","5268736","","2011-02-17 03:54:29","2","4251","<p>I have followed the onTouch example from google located <a href=""http://android-developers.blogspot.com/2009/04/introducing-glsurfaceview.html"" rel=""nofollow"">here</a>. However, I get nothing out in my logs. As far as I can tell, my view is not picking up any of the on touch events. This is my code:</p><pre><code>package com.test;import javax.microedition.khronos.egl.EGLConfig;import javax.microedition.khronos.opengles.GL10;import android.app.Activity;import android.content.Context;import android.opengl.GLSurfaceView;import android.os.Bundle;import android.util.Log;import android.view.MotionEvent;import android.view.View;import android.view.Window;public class intro extends Activity {    static{        System.loadLibrary(""graphrender"");    }    private GLSurfaceView mGLView;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        requestWindowFeature(Window.FEATURE_NO_TITLE);        mGLView = new GraphGLSurfaceView(this);        setContentView(mGLView);    }    @Override    protected void onPause() {        super.onPause();        mGLView.onPause();    }    @Override    protected void onResume() {        super.onResume();        mGLView.onResume();    }}class GraphGLSurfaceView extends GLSurfaceView {    GraphRenderer mRenderer;        public GraphGLSurfaceView(Context context) {        super(context);        mRenderer = new GraphRenderer();        setRenderer(mRenderer);    }    public boolean onTouch(View v, MotionEvent event)    {        queueEvent(new Runnable(){            public void run() {                mRenderer.shout();            }});            return true;    }}class GraphRenderer implements GLSurfaceView.Renderer {     private static native void nativeSetup();    private static native void nativeSize(int w, int h);    private static native void nativeRender();    private float _red = 0.9f;    private float _green = 0.2f;    private float _blue = 0.2f;    public void onSurfaceCreated(GL10 gl, EGLConfig config) {        nativeSetup();        Log.d(""intro"", ""Got to intro 4"" );    }    public void onSurfaceChanged(GL10 gl, int w, int h) {        nativeSize(w,h);    }    public void onDrawFrame(GL10 gl) {        nativeRender();    }    public void shout()    {        Log.d(""Graph Page"", ""gotta graph"");    }}</code></pre><p>The only thing I can think of is that I have to have something fancy in the xml file or set its focus. Any help would be appreciated.</p>","523412","","","","","2011-03-11 03:49:24","GLSurfaceview not getting onTouch events","<android><opengl-es>","1","0","","",""
"5024901","1","","","2011-02-17 03:56:32","1","222","<p>hello i was setting up environment for android and when ever i try to launch the android emulator i get this</p><p>Before launching emulator screenshot(WITH FIREFOX IN THE BACKGROUND)<img src=""http://i.stack.imgur.com/16PK9.jpg"" alt=""enter image description here""></p><p>After launching emulator screenshot(WITHOUT FIREFOX) <img src=""http://i.stack.imgur.com/KFvu4.jpg"" alt=""enter image description here""></p><p>when i freshly start my system PF usage is exactly 290MB after launching Android Emulator it gets to nearly 850MB and as soon as i open Eclipse it nearly gets to 1.01GB</p><p>i have Intel Pentium D with 1GB of RAM(as you can see in task manager) and i have only installed SDK 2.3.3 API 10,revision 1 package.</p><p>So, is it normal?? cause all things get very slow and response of emulator is very very slow</p>","574649","","408863","","2011-02-17 04:35:41","2011-02-17 04:35:41","is it normal with android emulator?","<android><process><emulator>","2","1","","",""
"5025009","1","5036795","","2011-02-17 04:16:42","0","352","<p>I hope the terminology is correct as I am relatively new to Android App development, but...</p><p>How can I tell the following:</p><p>1) If another App provides a 'service' that my App can use?2) How to access it?</p><p>Here is an example of what I'm talking about.</p><p>Suppose I know of an App that provides the locations of restaurants (I think there are a few) and I create an App that Rates Italian Restaurants. A user puts in the name of an Italian Restaurant (into my App) and my App spits out a Review and ALSO uses information provided by the 'Restaurant Locator App' to display to the user WHERE this restaurant is.</p><p>My question is: How do I know if the 'Restaurant Locator App' provides this information for my App to use and - IF SO - how do I access it?</p><p>Not looking for code examples here - just general explanations.</p><p>Thanks!</p>","615525","","","","","2011-02-18 01:32:53","How to Tell if a Service Can be Used in My App","<android>","2","0","","",""
"5025023","1","5025057","","2011-02-17 04:19:30","1","776","<p>I need to save a series of large bitmaps to disk in Android in a lossless format. However, I've found that the built-in PNG encoder is quite slow e.g. it's taking about 8 seconds to save 3 large images when I need something that takes around 2 seconds. Are there any other lossless options for saving bitmaps in Android?</p><p>I'm happy to sacrifice a little disk space for speed. However, the compression level parameter for saving PNG images in Android is ignored for PNGs (by design). Perhaps there are some easy to use options that involve the NDK?</p>","580100","","","","","2011-02-17 04:27:13","Fast lossless image compression in Android?","<java><android><graphics><mobile>","1","2","1","",""
"5025052","1","5025169","","2011-02-17 04:26:38","1","519","<p>I dont like others do my duties, but i'm not a RegEx expert and i think you guys would be a great help.</p><p>I'm building a newsletter Android app which consumes an array exposed in a http like this:</p><pre><code>Array(    [Last_News] =&gt; Array    (        [last-news-1] =&gt; Array            (                [ID] =&gt; 711                [Title] =&gt; Here goes the title text                [Bullet] =&gt; Here goes the basic description of the news.            ))</code></pre><p>I'm trying with RegEx this:</p><pre><code>String pattern = "".Ultima_Hora. =&gt; Array . .ultima_hora-[0-9]*."";    Pattern p = Pattern.compile(pattern);    Matcher m = p.matcher(str);    while (m.find()) { // Find each match in turn; String can't do this.        //String s = m.group();    String s = m.toString();         txt.setText(s);    }</code></pre><p>But then, when i run my app, i can see all the text downloaded from my httpclient implementation. Someone can give a example of how i can print the arrays inside [last-news-1]?Thank you very much.</p>","416832","","278899","","2011-02-17 04:35:20","2011-02-17 05:20:31","How can i parse a PHP array from Android SDK?","<java><php><android><regex><arrays>","1","10","1","",""
"5025100","1","5025113","","2011-02-17 04:36:59","0","655","<pre><code>ArrayList&lt;String&gt; myArr = new ArrayList&lt;String&gt;();</code></pre><p>then add some stuff to it</p><pre><code>myArr.add(""Hello"");    myArr.add(""Testing"");    myArr.add(""Testing 1 2 3 "");</code></pre><p>And then I try to convert it to a String array by doing this:</p><pre><code>String[] s = (String[])myArr.toArray();</code></pre><p>I am going to use this array to eventually populate a listview. . . but it crash when casting and throws this </p><pre><code>02-16 22:31:14.835: ERROR/AndroidRuntime(21666): java.lang.RuntimeException: Unable to start activity ComponentInfo{org.IRE.toolbox/org.IRE.toolbox.Mods}: java.lang.ClassCastException: [Ljava.lang.Object;02-16 22:31:14.835: ERROR/AndroidRuntime(21666):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2787)02-16 22:31:14.835: ERROR/AndroidRuntime(21666):     at android.app.ActivityThread.startActivityNow(ActivityThread.java:2627)02-16 22:31:14.835: ERROR/AndroidRuntime(21666):     at android.app.LocalActivityManager.moveToState(LocalActivityManager.java:127)02-16 22:31:14.835: ERROR/AndroidRuntime(21666):     at android.app.LocalActivityManager.startActivity(LocalActivityManager.java:339)02-16 22:31:14.835: ERROR/AndroidRuntime(21666):     at android.widget.TabHost$IntentContentStrategy.getContentView(TabHost.java:651)02-16 22:31:14.835: ERROR/AndroidRuntime(21666):     at android.widget.TabHost.setCurrentTab(TabHost.java:323)02-16 22:31:14.835: ERROR/AndroidRuntime(21666):     at android.widget.TabHost$2.onTabSelectionChanged(TabHost.java:129)02-16 22:31:14.835: ERROR/AndroidRuntime(21666):     at android.widget.TabWidget$TabClickListener.onClick(TabWidget.java:453)02-16 22:31:14.835: ERROR/AndroidRuntime(21666):     at android.view.View.performClick(View.java:2408)02-16 22:31:14.835: ERROR/AndroidRuntime(21666):     at android.view.View$PerformClick.run(View.java:8817)02-16 22:31:14.835: ERROR/AndroidRuntime(21666):     at android.os.Handler.handleCallback(Handler.java:587)02-16 22:31:14.835: ERROR/AndroidRuntime(21666):     at android.os.Handler.dispatchMessage(Handler.java:92)02-16 22:31:14.835: ERROR/AndroidRuntime(21666):     at android.os.Looper.loop(Looper.java:144)02-16 22:31:14.835: ERROR/AndroidRuntime(21666):     at android.app.ActivityThread.main(ActivityThread.java:4937)02-16 22:31:14.835: ERROR/AndroidRuntime(21666):     at java.lang.reflect.Method.invokeNative(Native Method)02-16 22:31:14.835: ERROR/AndroidRuntime(21666):     at java.lang.reflect.Method.invoke(Method.java:521)02-16 22:31:14.835: ERROR/AndroidRuntime(21666):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)02-16 22:31:14.835: ERROR/AndroidRuntime(21666):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)02-16 22:31:14.835: ERROR/AndroidRuntime(21666):     at dalvik.system.NativeStart.main(Native Method)02-16 22:31:14.835: ERROR/AndroidRuntime(21666): Caused by: java.lang.ClassCastException: [Ljava.lang.Object;02-16 22:31:14.835: ERROR/AndroidRuntime(21666):     at org.IRE.toolbox.Mods.onCreate(Mods.java:60)02-16 22:31:14.835: ERROR/AndroidRuntime(21666):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1069)02-16 22:31:14.835: ERROR/AndroidRuntime(21666):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2751)02-16 22:31:14.835: ERROR/AndroidRuntime(21666):     ... 18 more</code></pre><p>When I comment out that line it runs fine. Any ideas how I can do this with out it crashing, is it even possible?</p>","614820","","20654","","2011-02-17 04:59:01","2011-02-17 04:59:01","Converting ArrayList to an array causes crash","<java><android><arrays>","3","1","1","",""
"5025102","1","5025172","","2011-02-17 04:37:35","1","363","<p>I am using the URI class to break apart a string url.</p><p>The getHost() method returns null when there are special characters in it.</p><p>Such as:  http://?df.ws/g44</p><p><a href=""http://stackoverflow.com/questions/3803490/java-net-uri-chokes-on-special-characters-in-host-part"">It was suggested to use the IDN class to work around this</a>.  However, that class is only available in the Android API level 9 and above, which means 2.3 and above.</p><p>Is there another way to do this without the IDN class?</p><p>I want to be able to break apart a string url into the various pieces and be able to handle modern urls.</p><p>Thanks</p><p><strong>Update</strong> It looks like the WebView doesn't support these types of urls either. So, it looks like I need to find a way to support or convert these urls for pre 2.3 devices. </p><p>Is there a way to convert these urls without the IDN class? </p>","445348","","445348","","2011-02-17 09:20:16","2011-02-17 09:20:16","Handling special characters in domain names (without IDN)?","<java><android><url><utf-8><idn>","1","0","","",""
"5025152","1","5393594","","2011-02-17 04:47:29","1","8824","<p>I'm working ""Exercise 1"" of the <code>Notepad Tutorial</code></p><p>and have done step #1, and am just beginning on step #2<br>1 Start a new Android Project by clicking <code>File &gt; New &gt; Android Project</code>.<br>2 In the <code>New Android Project dialog</code>, select <code>Create project from existing source.</code>    </p><p>So, the tutorial says to click [File], [New], [Android Project] -BUT- what I seem to have to do is click on[File], [New], <strong>[Project]</strong>, [Android Project] Maybe this is a typeo in the tutorial, or am I missing something?    </p><p>Anyway things seem to be OK until I follow the instructions to click on<br><strong>[x] Create project from existing source</strong><br>And then I instantly get 2 entries into the error log that both readUnable to read C:\Andriod\Andriod-SDK-Windows\AndroidManifest.xml: java.io.FileNotFoundException: C:\Andriod\Andriod-SDK-    </p><p>Since I have never tried to create a project from existing code before, maybe something went wrong with the original install, and I'm just stumbling across the problem now?</p><p>If anyone really wants to read it, Full error log output follows<br>Thanks Joe</p><p>=-=-=-=-=-=-=-=-=-=-=-=-=-=-=  Error Log Follows -=-=-=-=-=-=-=-=-=-=    </p><pre><code>~ !SESSION 2011-02-16 23:08:27.651 -----------------------------------------------eclipse.buildId=unknownjava.version=1.6.0_23java.vendor=Sun Microsystems Inc.BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_USFramework arguments:  -product org.eclipse.epp.package.java.productCommand-line arguments:  -os win32 -ws win32 -arch x86 -product org.eclipse.epp.package.java.product!ENTRY com.android.ide.eclipse.adt 4 0 2011-02-16 23:09:28.468!MESSAGE Unable to read C:\Andriod\Andriod-SDK-Windows\AndroidManifest.xml: java.io.FileNotFoundException: C:\Andriod\Andriod-SDK-Windows\AndroidManifest.xml (The system cannot find the file specified)!STACK 0com.android.sdklib.io.StreamException: java.io.FileNotFoundException: C:\Andriod\Andriod-SDK-Windows\AndroidManifest.xml (The system cannot find the file specified)    at com.android.sdklib.io.FileWrapper.getContents(FileWrapper.java:92)    at com.android.sdklib.xml.AndroidManifestParser.parse(AndroidManifestParser.java:608)    at com.android.ide.eclipse.adt.internal.project.AndroidManifestHelper.parse(Unknown Source)    at com.android.ide.eclipse.adt.internal.project.AndroidManifestHelper.parseForData(Unknown Source)    at com.android.ide.eclipse.adt.internal.wizards.newproject.NewProjectCreationPage.extractNamesFromAndroidManifest(Unknown Source)    at com.android.ide.eclipse.adt.internal.wizards.newproject.NewProjectCreationPage.access$16(Unknown Source)    at com.android.ide.eclipse.adt.internal.wizards.newproject.NewProjectCreationPage$3.widgetSelected(Unknown Source)    at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:228)    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:3910)    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3503)    at org.eclipse.jface.window.Window.runEventLoop(Window.java:825)    at org.eclipse.jface.window.Window.open(Window.java:801)    at org.eclipse.ui.actions.NewProjectAction.run(NewProjectAction.java:117)    at org.eclipse.jface.action.Action.runWithEvent(Action.java:498)    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:3910)    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3503)    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)Caused by: java.io.FileNotFoundException: C:\Andriod\Andriod-SDK-Windows\AndroidManifest.xml (The system cannot find the file specified)    at java.io.FileInputStream.open(Native Method)    at java.io.FileInputStream.&lt;init&gt;(Unknown Source)    at com.android.sdklib.io.FileWrapper.getContents(FileWrapper.java:90)    ... 42 more!ENTRY com.android.ide.eclipse.adt 4 0 2011-02-16 23:09:28.597!MESSAGE Unable to read C:\Andriod\Andriod-SDK-Windows\AndroidManifest.xml: java.io.FileNotFoundException: C:\Andriod\Andriod-SDK-Windows\AndroidManifest.xml (The system cannot find the file specified)!STACK 0com.android.sdklib.io.StreamException: java.io.FileNotFoundException: C:\Andriod\Andriod-SDK-Windows\AndroidManifest.xml (The system cannot find the file specified)    at com.android.sdklib.io.FileWrapper.getContents(FileWrapper.java:92)    at com.android.sdklib.xml.AndroidManifestParser.parse(AndroidManifestParser.java:608)    at com.android.ide.eclipse.adt.internal.project.AndroidManifestHelper.parse(Unknown Source)    at com.android.ide.eclipse.adt.internal.project.AndroidManifestHelper.parseForData(Unknown Source)    at com.android.ide.eclipse.adt.internal.wizards.newproject.NewProjectCreationPage.extractNamesFromAndroidManifest(Unknown Source)    at com.android.ide.eclipse.adt.internal.wizards.newproject.NewProjectCreationPage.access$16(Unknown Source)    at com.android.ide.eclipse.adt.internal.wizards.newproject.NewProjectCreationPage$3.widgetSelected(Unknown Source)    at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:228)    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:3910)    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3503)    at org.eclipse.jface.window.Window.runEventLoop(Window.java:825)    at org.eclipse.jface.window.Window.open(Window.java:801)    at org.eclipse.ui.actions.NewProjectAction.run(NewProjectAction.java:117)    at org.eclipse.jface.action.Action.runWithEvent(Action.java:498)    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:3910)    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3503)    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)Caused by: java.io.FileNotFoundException: C:\Andriod\Andriod-SDK-Windows\AndroidManifest.xml (The system cannot find the file specified)    at java.io.FileInputStream.open(Native Method)    at java.io.FileInputStream.&lt;init&gt;(Unknown Source)    at com.android.sdklib.io.FileWrapper.getContents(FileWrapper.java:90)    ... 42 more ~$~</code></pre>","515453","","457982","","2011-02-17 04:57:46","2012-04-05 14:27:22","Can't read ... AndroidManifest.xml - while attempting Android Notepad Tutorial - Exercise 1","<android><eclipse>","2","2","","",""
"5025228","1","","","2011-02-17 05:02:10","0","455","<p>I have come up with a small camera application. It is working as expected in the Android emulator, but when I load the same in the SD card of an Android phone, the apk is not listed in the app installer of the phone. Please advise.</p>","620776","","698590","","2012-06-13 20:42:53","2012-06-13 20:42:53","apk not listed in app installer in phone","<android><apk><android-install-apk>","1","0","","",""
"5025261","1","","","2011-02-17 05:06:30","2","310","<p>How does Lookout Mobile wipe an Android device without using the Administrative API?  There is no administrator activation required when installing lookout, so it cannot be using the API, correct?</p>","590185","","19750","","2011-06-22 03:32:25","2011-06-22 03:32:25","How does Lookout Mobile implement Android wipe functionality without the Admin API?","<android><device-admin>","0","0","2","",""
"5025269","1","5025320","","2011-02-17 05:08:12","1","1378","<p>UiApplication.getUiApplication().invokeLater(new Runnable() {}) </p><p><strong>How can I change this function into an android??</strong></p>","620787","","","","","2011-02-17 05:16:29","In ANDROID which function will be used instead of UiApplication.getUiApplication().invokeLater(new Runnable() {})?","<android>","2","1","2","",""
"5025270","1","","","2011-02-17 05:08:15","0","80","<p>Here is my code:</p><pre><code>package com.example.userpage;import android.app.Activity;import android.app.AlertDialog;import android.app.Dialog;import android.content.DialogInterface;import android.content.Intent;import android.os.Bundle;import android.view.View;import android.widget.Button;import android.widget.EditText;import android.widget.TextView;public class UserPage extends Activity {     AlertDialog.Builder builder;    private final static int EMPTY_TEXT_ALERT = 0;        @Override        public Dialog onCreateDialog(int id) {            switch(id) {                case EMPTY_TEXT_ALERT: {                builder = new AlertDialog.Builder(this);                    builder.setMessage(""Message:Fields Empty!!!"")                           .setPositiveButton(""OK"", new DialogInterface.OnClickListener() {                               @Override                               public void onClick(DialogInterface dialog, int which) {                                   dialog.cancel();                               }                     });                     return builder.create();                }            }            return null;        }     String tv,tv1;    EditText name,pass;     TextView x,y;    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);         Button button = (Button) findViewById(R.id.widget44);        button.setOnClickListener(new View.OnClickListener() {            public void onClick(View v) {                Intent obj = new Intent(UserPage.this,UserPage.class);                startActivity(obj);            }        });        x = (TextView) findViewById(R.id.widget46);        y = (TextView) findViewById(R.id.widget47);         name = (EditText)findViewById(R.id.widget41);         pass = (EditText)findViewById(R.id.widget43);        Button button1 = (Button) findViewById(R.id.widget45);        button1.setOnClickListener(new View.OnClickListener() {            public void onClick(View v) {              //tv= name.getText().toString();               //tv1 = pass.getText().toString();               x.setText(tv);               y.setText(tv1);               tv = name.getText().toString();               if(tv.trim().equals("""")) {                   // text is empty                   showDialog(EMPTY_TEXT_ALERT);               }               tv1 = pass.getText().toString();              if (tv1.trim().equals(""""))               {                   showDialog(EMPTY_TEXT_ALERT);               }           }        });    }   }</code></pre>","617356","","457982","","2011-02-17 05:15:56","2011-02-17 05:20:46","I want to display seperate alerts for name and pass fields","<android>","1","0","","",""
"5025311","1","5025472","","2011-02-17 05:14:16","3","6457","<p>In my project, I need to catch the Window focus change. I have logged out the results for all the stages of an activity. When the screen is on, the result is as follows:</p><pre><code>02-17 13:50:03.898: DEBUG/InquiryInterface(3829): onCreate screen state : false02-17 13:50:03.898: DEBUG/InquiryInterface(3829): onStart screen state : false02-17 13:50:03.898: DEBUG/InquiryInterface(3829): onResume screen state : false02-17 13:50:08.998: DEBUG/InquiryInterface(3829): onPause screen state : true02-17 13:50:09.178: DEBUG/InquiryInterface(3829): onWindowFocusChanged : false02-17 13:50:09.228: DEBUG/InquiryInterface(3829): onStop screen state : false02-17 13:50:09.228: DEBUG/InquiryInterface(3829): onDestroy screen state : false</code></pre><p>onWindowFocusChanged is the method provided by the class Activity. And the value shown in the list is the input value(boolean hasFocus) of the method onWindowFocusChanged.</p><p>I have used the following code to get the state of window focus for every state of the method, onCreate, onStart, etc.</p><pre><code>@Override    public void onResume() {        super.onResume();        Log.d(TAG, ""onCreate screen state : ""                 +String.valueOf(this.hasWindowFocus()));}</code></pre><p>But in the Android documention, I read : the method onResume() is <strong>Called when the activity will start interacting with the user. At this point your activity is at the top of the activity stack, with user input going to it.</strong> </p><p>So in this way, I should get ""True"" for the window focus within onResume, but not in onPause(). Anyone has an idea why this happens?</p>","453676","","453676","","2011-02-17 05:26:47","2013-03-25 14:50:01","When does the *Window focus* change in Android?","<android><activity><focus><window>","2","0","1","",""
"5025332","1","5760946","","2011-02-17 05:16:42","1","910","<p>I'm new to Android development and I've been working on a custom music player for my own use.  After quite a bit of searching, I finally tracked down some code I could use to search the MediaStore for music files.  This is the code I'm using.</p><pre><code>Uri uri = MediaStore.Audio.Media.EXTERNAL_CONTENT_URI;StringBuilder where = new StringBuilder();where.append(MediaStore.Audio.Media.TITLE + "" != ''"");// Add in the filtering constraintsString [] keywords = null;if (query != null) {    String [] searchWords = query.split("" "");    keywords = new String[searchWords.length];    Collator col = Collator.getInstance();    col.setStrength(Collator.IDENTICAL);    for (int i = 0; i &lt; searchWords.length; i++) {        keywords[i] = '%' + MediaStore.Audio.keyFor(searchWords[i]) + '%';    }    for (int i = 0; i &lt; searchWords.length; i++) {        where.append("" AND "");        where.append(MediaStore.Audio.Media.ARTIST_KEY + ""||"");        where.append(MediaStore.Audio.Media.TITLE_KEY + "" LIKE ?"");    }}String selection = where.toString();String[] projection = {        BaseColumns._ID,           MediaStore.Audio.Media.MIME_TYPE,         MediaStore.Audio.Artists.ARTIST,        MediaStore.Audio.Albums.ALBUM,        MediaStore.Audio.Media.TITLE};Cursor cursor = this.managedQuery(        uri,        projection,        selection,        keywords,        MediaStore.Audio.Media.TITLE);</code></pre><p>If I search for ""Laredo"", I expect it to come back with just ""The Streets of Laredo"" by Johnny Cash.  It's included in the results, but there's a couple dozen other songs being returned that don't seem to match my query at all.</p><p>The built-in music player seems to be doing the same thing, although it's returning even more unrelated matches.  Is this the expected behavior?  If it is, I can add some additional code to filter my list down to exact matches.  If it's not, what am I doing wrong?</p>","226411","","","","","2011-04-22 23:20:17","Querying the MediaStore is coming up with results that don't appear to match","<android>","1","0","","",""
"5025372","1","","","2011-02-17 05:23:27","0","595","<p>in my application i would like to get sms information while is deleting from inbox by user. For this is there any listener or else? any one of you plz help me. is there any aletrnate....ThanQ.</p>","247921","","","","","2011-02-17 05:43:05","any listener for delete sms in android","<android><sms>","1","3","","",""
"5025473","1","","","2011-02-17 05:41:15","0","3302","<p>So I see there are a lot of questions regarding Barcode Scanning in Android applications, but this one is relating to Barcode Scanning in the App Inventor.</p><p>I followed a tutorial I found online to create a barcode scanning application where you press a button, it launches the scanner and then based on the results, the second button on the screen launches a URL with a passed variable through it. I developed the app myself in App Inventor so I could modify it to my needs, but I have encountered a problem. The barcode scanner launches, scans successfully (Product Found confirmation), but then upon returning to the main screen, the resultLabel.Text value is not changed and neither is the resultActionButton.Text value. Below is the block diagram of my application and a link to the tutorial I followed. </p><p>Thank you in advance!</p><p>Here is the block diagram image: <br><img src=""http://i.stack.imgur.com/O7TBU.jpg"" alt=""http://imm.io/3N60""></p><p>Link to tutorial: <a href=""http://androidadvice.blogspot.com/2010/09/app-inventor-sample-project-barcode.html"" rel=""nofollow"">http://androidadvice.blogspot.com/2010/09/app-inventor-sample-project-barcode.html</a></p>","620824","","234976","","2011-11-26 06:06:36","2013-06-14 17:21:37","Android App Inventor Barcode Scanning","<android><barcode-scanner><app-inventor>","1","1","","",""
"5025485","1","5025564","","2011-02-17 05:43:24","0","3817","<p>I got to create a fixed menubar on the top of the screen with two image buttons in it.How can i do that ?</p><p>Thanks,</p>","598331","","","","","2011-02-17 05:57:23","Create a fixed menu bar","<android>","1","0","","",""
"5025496","1","5025597","","2011-02-17 05:46:15","0","445","<p>My code:</p><pre><code>package com.example.linkingpage;import android.app.Activity;import android.app.AlertDialog;import android.app.Dialog;import android.content.DialogInterface;import android.content.Intent;import android.os.Bundle;import android.view.View;import android.widget.Button;import android.widget.EditText;import android.widget.TextView;public class LinkingPage extends Activity {     String tv,tv1;    EditText name,pass;     TextView x,y;    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);         Button button = (Button) findViewById(R.id.widget44);        button.setOnClickListener(new View.OnClickListener() {            public void onClick(View v) {                Intent obj = new Intent(LinkingPage.this,LinkingPage.class);                startActivity(obj);            }        });        x = (TextView) findViewById(R.id.widget46);        y = (TextView) findViewById(R.id.widget47);         name = (EditText)findViewById(R.id.widget41);         pass = (EditText)findViewById(R.id.widget43);        Button button1 = (Button) findViewById(R.id.widget45);        button1.setOnClickListener(new View.OnClickListener() {            public void onClick(View v) {                 x.setText(tv);                 y.setText(tv1);                 tv = name.getText().toString();                 if(tv.trim().equals("""")) {                     // text is empty                     showDialog(EMPTY_TEXT_ALERT);                 }                 tv1 = pass.getText().toString();                 if (tv1.trim().equals(""""))                 {                   showDialog(EMPTY_TEXT_ALERT);                 }                  else                  {Intent obj = new Intent(LinkingPage.this,ResourcePage.class);                  obj.putExtra(""name"", name.getText().toString());                                                            obj.putExtra(""pass"", pass.getText().toString());                      startActivity(obj);                  }           }        });    }    private final static int EMPTY_TEXT_ALERT = 0;    @Override    public Dialog onCreateDialog(int id) {        switch(id) {            case EMPTY_TEXT_ALERT: {                AlertDialog.Builder builder = new AlertDialog.Builder(this);                builder.setMessage(""Message:Field Empty!!!"")                       .setPositiveButton(""OK"", new DialogInterface.OnClickListener() {                           @Override                           public void onClick(DialogInterface dialog, int which) {                               dialog.cancel();                           }                 });                 return builder.create();            }        }        return null;    }}</code></pre><p>When both fields are kept empty, and button is clicked alert is generated. Same happens when only name field is filled. But when name field is kept empty and passwor is filled , then though an alert is generated but link to other page is also generated showing my password.How can i prevent this??</p>","617356","","153430","","2011-02-17 05:53:46","2011-02-17 06:03:13","If password field not filled it should not make link to next activity & show alert. How can i do that?","<android>","2","1","","",""
"5025516","1","5025671","","2011-02-17 05:50:18","0","806","<p>i am trying to use weka on Android. i need to increase the heapspace to use that. i have tried various combinations of -xmx and -xms but it fails to start the jvm.currently i have this set up, but it does not work </p><blockquote>  <p>--launcher.XXMaxPermSize 1024m  -vmargs  -Xms256m  -Xmx1024m</p></blockquote><p>currently i have a 64bit arch machine, but 32bit Win 7 installed on it. 4gb memory.kindly advise</p>","377337","","","","","2013-06-19 05:25:59","eclipse crashes - failed to start jvm","<android><eclipse><jvm><weka><jvm-crash>","2","1","","",""
"5025527","1","5025535","","2011-02-17 05:51:35","0","541","<p>I start a new activity from my main activity with</p><pre><code>Intent i = new Intent(this, Game.class);startActivity(i);</code></pre><p>The game activity has a timer which counts down to 0. I would like to pop back to the main activity (killing the game activity).</p><p>How do I enact this?</p><p>(I've already defined <code>onDestroy()</code> etc. correctly in my game activity.)</p>","283311","","","","","2011-02-17 05:53:31","Android and back to main activity when time is up","<android><activity><kill>","1","0","1","",""
"5025582","1","","","2011-02-17 06:00:18","27","6307","<p>One of my Android apps has about 100,000 users and, about 10 times a week, I get the following exception being reported to me via Google's market tool:</p><pre><code>java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{org.rebm.asp/org.rebm.asp.MainActivity}:  java.lang.ClassNotFoundException: org.rebm.asp.MainActivity in loader dalvik.system.PathClassLoader[/mnt/asec/org.rebm.asp-1/pkg.apk]at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2659)at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2753)at android.app.ActivityThread.access$2500(ActivityThread.java:129)at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2107)at android.os.Handler.dispatchMessage(Handler.java:99)at android.os.Looper.loop(Looper.java:143)at android.app.ActivityThread.main(ActivityThread.java:4701)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: org.rebm.asp.MainActivity in loader dalvik.system.PathClassLoader[/mnt/asec/org.rebm.asp-1/pkg.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.newActivity(Instrumentation.java:1021)at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2651)... 11 more</code></pre><p>From searching online, this error usually indicates something is wrong with the manifest file and the package names being used. However, I can't reproduce this error on my own devices or on the emulator. I only know of this error through the market tool. All I can conclude is that it's a rare error because I know lots of people are using the app and none of the reviews indicate it crashes.</p><p>Does anyone know what the issue might be or how I can diagnose it?</p>","580100","","","","","2013-10-11 06:26:57","""Unable to instantiate activity"" error","<java><android><mobile>","6","7","6","",""
"5025605","1","5025633","","2011-02-17 06:03:36","0","270","<p>I would like to implement a settings activity which will look the same as Sound settings in android devices. First thing I'd like to know is it one big list view with many custom extended list items?</p><p>My problem is I don't know how to implement styles in xml that are on General (which is a TextView I guess) and Sound profile Button.</p>","607767","","","","","2011-02-17 06:10:08","Applying default styles in android","<android><coding-style><themes>","1","0","","",""
"5025606","1","5043224","","2011-02-17 06:03:46","0","212","<p>I am compiling ffmpeg for android. Just wondering which filters are mandatory in the configuration. If anybody knows please suggest me.</p>","574911","","","","","2011-02-18 15:35:22","ffmpeg - mandatory filters to use","<android><filter><ffmpeg><libavcodec><libavformat>","1","0","","",""
"5025652","1","5025763","","2011-02-17 06:13:10","16","22145","<p>How can i show an Activity Indicator in Android? Is there any Android Library given method? If no, please let me know the techniques used to show activity indicator in Android?.</p>","2311189","","","","","2013-08-16 12:20:44","Android Activity Indicator?","<android><android-layout>","4","2","6","",""
"5025698","1","5025748","","2011-02-17 06:20:38","0","183","<p>Im making a chess app and I have a class for each square of the board, for example:</p><p>public class square {</p><pre><code>public String squarecolor; // white or redpublic int row, col;public chesspiece myPiece = null; // null if emptypublic ImageButton myButton;public Drawable myDrawables[26];</code></pre><p>}</p><p>in my activity class, each square on the board is an imagebutton. Everytime i try and reference either the drawable or the imagebutton in the square class my program crashes. for example </p><pre><code>public class NewGameActivity extends Activity {        square [][] chessboard = new square[8][8];        chessboard[0][0].myButton = (ImageButton) findViewById(R.id.aone);        }</code></pre><p>Is there anyway to allow something like this to work?</p>","620864","","100957","","2011-02-17 06:29:54","2011-02-17 06:29:54","Android Dev - How do you pass Drawables and Buttons through classes?","<java><android>","1","0","","",""
"5025703","1","5025724","","2011-02-17 06:21:00","-1","123","<p>I am a beginner in android and have no idea of creating list view.</p>","617356","","759866","","2014-02-20 17:48:48","2014-02-20 17:48:48","Can anyone give me code for list view?","<android>","2","1","","2012-06-26 13:44:37",""
"5025734","1","5026000","","2011-02-17 06:26:18","11","8908","<p>I have a application which shows list of items. i need to display a fadeout image before start of main activity.i tried something like thatin onCreate method of main activity i startedone animation activity like</p><pre><code>Intent animationIntent=new Intent(this,AnimationActivity.class);startActivityForResult(AnimationIntent);</code></pre><p>in onCreate method of AnimationActivity.class</p><pre><code>super.onCreate(savedInstanceState);    setContentView(R.layout.main);    ImageView introanim = (ImageView) findViewById(R.id.imgView);    AnimationSet StoryAnimation = (AnimationSet)AnimationUtils.loadAnimation(this, R.anim.alphanim);StoryAnimation.setAnimationListener(new AnimationListener() {        @Override        public void onAnimationStart(Animation animation) {            // TODO Auto-generated method stub        }        @Override        public void onAnimationRepeat(Animation animation) {                AnimationSubActivity.this.finish();        }        @Override        public void onAnimationEnd(Animation animation) {            AnimationSubActivity.this.finish();        }    });    introanim.clearAnimation();    introanim.startAnimation(StoryAnimation);</code></pre><p>and my main.xml 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:orientation=""vertical""android:layout_width=""fill_parent""android:layout_height=""fill_parent""&gt;&lt;ImageView  android:id=""@+id/imgView""android:layout_width=""fill_parent"" android:layout_height=""fill_parent"" android:src=""@drawable/icon""/&gt;&lt;/LinearLayout&gt;</code></pre><p>problem with this approach is that it display an amimation but imageview come to screen for a while and main activity comes with slide transition effect </p><p>but i want i image fade out and my activity should fade in</p><p>any help will be appreciated. Thanks in advance</p>","609765","","609765","","2011-10-21 10:56:09","2011-10-28 15:55:15","How to implement splash screen in android","<android>","2","1","10","",""
"5025772","1","5025791","","2011-02-17 06:32:00","0","425","<p>I am able to calculate route between two locations. Is it possible to show a route demo for the prepared route and show a car or some arrow travelling the route.</p>","569938","","","","","2011-02-17 06:35:34","Is it possible to get a route demo for a prepared route in android?","<android><google-maps><location>","1","0","","",""
"5025776","1","","","2011-02-17 06:32:26","1","710","<p>I am creating a Log-In page, Where I need to mask the password field. I dunno the syntax.I am using eclipse.</p>","620871","","21234","","2012-01-28 14:00:03","2012-01-28 14:00:03","How to mask password in android using java?","<android><passwords><maskedtextbox>","2","0","","",""
"5025786","1","5347466","","2011-02-17 06:34:54","2","692","<p>When my app starts up, I post a login request to a web service and receive a Cookie.  I want to use that Cookie in my WebView, which I do with the following code:</p><pre><code>List&lt;Cookie&gt; cookies = this.get_my_cookies_from_somewhere();CookieSyncManager cookieSyncManager = CookieSyncManager.createInstance(this);CookieManager cookieManager = CookieManager.getInstance();cookieManager.removeAllCookie();for (Cookie cookie : cookies) {    String rawUrl = (cookie.isSecure() ? ""https"" : ""http"") + ""://"" + cookie.getDomain() + cookie.getPath();    cookieManager.setCookie(rawUrl, cookie.getName() + ""="" + cookie.getValue() + ""; domain="" + cookie.getDomain());}cookieSyncManager.sync();</code></pre><p>Ideally, I would like to have the cookie url and ""Set-Cookie"" header value required by the CookieManager be built by the Cookie class or some utility class.  Does such a thing exist?</p><p>I tried RFC2109Spec and RFC2965Spec, but they produce the ""Cookie"" header, not the ""Set-Cookie"" header.</p>","9636","","","","","2011-03-18 02:37:28","Is there a class in Android for formatting Cookies into the value for a CookieManager?","<java><android><cookies><setcookie>","1","0","1","",""
"5025803","1","5074674","","2011-02-17 06:36:27","6","8073","<p>I'm writing an Android application that should upload photos to Facebook.</p><p>Everything works just fine except one thing. When I called the Facebook.authorize() method for the first time the Facebook dialog was shown with requested permissions and 'Allow'/'Don't Allow' buttons. That was OK. But when I run my app for the secong time I've got the same dialog, but with message that my application allowed already and suggestion to press OK button.</p><p>Is there a way to avoid this second dialog? Should I skip the authorize method in some conditions?</p><p>I tried to call the Facebook.isSessionValid() method before authorize method, but this did not help.</p><p>Here is my simplified code:</p><pre><code>    mFacebook = new Facebook(APPLICATION_ID);    mFacebookAsync = new AsyncFacebookRunner(mFacebook);    if (mFacebook.isSessionValid()) {        uploadPictureFile();    }    else {        mFacebook.authorize(this, new String[] {""publish_stream""}, new Facebook.DialogListener() {            @Override            public void onFacebookError(FacebookError e) {                Toast.makeText(PhotoFeederFacebookSendActivity.this, ""Facebook error: "" + e.getLocalizedMessage(), Toast.LENGTH_LONG).show();                finishWithResultCode(RESULT_CANCELED);            }            @Override            public void onError(DialogError e) {                Toast.makeText(PhotoFeederFacebookSendActivity.this, ""Facebook dialog error: "" + e.getLocalizedMessage(), Toast.LENGTH_LONG).show();                finishWithResultCode(RESULT_CANCELED);            }            @Override            public void onComplete(Bundle values) {                uploadPictureFile();            }            @Override            public void onCancel() {Toast.makeText(PhotoFeederFacebookSendActivity.this, ""Facebook authorization cancelled."", Toast.LENGTH_LONG).show();                finishWithResultCode(RESULT_CANCELED);            }        });    }</code></pre><p>And here is my onActivityResult method:</p><pre><code>    @Override    protected void onActivityResult(int requestCode, int resultCode, Intent data) {        mFacebook.authorizeCallback(requestCode, resultCode, data);    }</code></pre><p>Any help appreciated. Thanks.</p>","145218","","","","","2012-04-05 14:19:50","Android Facebook SDK authorize methods shows dialog every time","<android><facebook><sdk><single-sign-on>","2","4","4","",""
"5025842","1","","","2011-02-17 06:42:32","0","361","<p>I have a listview and two textveiws in it for two columns. My goal is to set the colour of e.g. the 5th row of the listview to blue. Details:</p><p>config.xml has the layout for the acitivty: buttons and the listview. Part of it:</p><pre><code> &lt;ListView android:id=""@+id/ListView01""     android:layout_width=""wrap_content""     android:layout_height=""wrap_content""    android:layout_below=""@+id/TextView01""&gt;&lt;/ListView&gt;</code></pre><p>row.xml defines the two coloumns 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:paddingTop=""4dip""     android:paddingBottom=""6dip""     android:layout_width=""fill_parent""     android:layout_height=""wrap_content""     android:orientation=""horizontal""    android:id=""@+id/linlay0""&gt; &lt;LinearLayout android:orientation=""horizontal""    android:id=""@+id/linlay""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""&gt;     &lt;TextView android:id=""@+id/left""         android:layout_width=""160px""         android:layout_height=""wrap_content""         android:textColor=""#FF0000""         android:paddingLeft=""5px""/&gt;         &lt;TextView android:id=""@+id/right""         android:layout_width=""140px""         android:layout_height=""wrap_content""         android:maxWidth=""140px""         android:singleLine=""false""/&gt;  &lt;/LinearLayout&gt;&lt;/LinearLayout&gt;</code></pre><p>MainActivity.java is for the management for the activity, as well as the listview. So contentview is set to config.xml:<code>setContentView(R.layout.config);</code></p><p>This is how i upload the listview with data:</p><pre><code>lv1=(ListView)findViewById(R.id.ListView01);        ArrayList&lt;HashMap&lt;String, String&gt;&gt; mylist = new ArrayList&lt;HashMap&lt;String, String&gt;&gt;();        for (int i=0; i&lt;31; i++)        {            HashMap&lt;String, String&gt; map = new HashMap&lt;String, String&gt;();            map.put(""left1"", date[i]);            map.put(""right1"", name[i]);            mylist.add(map);        }        simpleAdapter = new SimpleAdapter(this, mylist, R.layout.row,                new String[] {""left1"", ""right1""}, new int[] {R.id.left, R.id.right});lv1.setAdapter(simpleAdapter); </code></pre><p>date[i] and name[i] are arrays declared and uploaded at the beginning of the class.</p><p>I am running some queries, comparing arrays and now i want to the set colour of a specific row in the ListView to blue. Like i said contentview is set to config.xml, while the TextViews of the ListView is in row.xml.So <code>TextView txt1 = (TextView) findViewById(R.id.left);</code> is uninterpretable for Eclipse.</p>","571648","","","","","2011-02-17 07:17:16","Android setcolour listview row","<android><listview>","3","0","","",""
"5025910","1","5025971","","2011-02-17 06:52:31","134","60059","<blockquote>  <p>What is the diffirence between the <code>@id/</code> and <code>@+/id</code>?</p></blockquote><p>As in the <strong><code>@+id/</code></strong> : The + (plus) symbol indicates that we are creating the new resource name and it must be created and added in to our <code>R.java</code> file but what about the <strong><code>@id/</code></strong>? As from the documentation of <a href=""http://developer.android.com/guide/topics/ui/declaring-layout.html#id""><code>ID</code></a> when referencing an Android resource ID, you do not need the plus-symbol, but must add the android package namespace, like so:</p><pre><code>android:id=""@android:id/list""</code></pre><p>But as in the below image eclipse dosen't suggesting me any kind of <code>@android:id/</code>.</p><p><img src=""http://i.stack.imgur.com/zgbUz.png"" alt=""Image showing the suggestion for the @/id and @+/id""></p><blockquote>  <p>Are <code>@id/</code> and <code>@android:id</code> the same? </p></blockquote><p>I would really appreciate any of your ideas with an elaborate example.</p>","457982","","621810","","2013-05-03 20:24:30","2013-09-09 21:16:18","Difference between ""@id/"" and ""@+id/"" in Android","<android>","8","1","42","",""
"5025968","1","5026065","","2011-02-17 07:00:42","2","1848","<p>is there some working sample of code of adding item into phone's calendar in Android? I want to add events with name, place, time and date.</p><p>Thanks</p>","513956","","","","","2011-02-17 07:12:01","Android - add item into calendar","<android><calendar>","1","0","","",""
"5025986","1","","","2011-02-17 07:02:53","8","14178","<p>Amusing windows xp, cygwin &amp; ndk for my project. I mapped all path in the cygwin.batch file. I am trying to compile hello-jni by cygwin. </p><p><strong>Contents of cygwin.bat</strong></p><p>@echo off</p><pre><code>F:chdir F:\Cygwin\binbash --login -iset IS_UNIX=set DEV_ROOT=E:/android/android-ndk-r5b/samples/hello-jniset JAVA_HOME=C:/Program Files/Java/jdk1.5.0_13set CLASSPATH=d:/work_code/android/BlueInput/objset PATH=E:/android/android-sdk-windows/tools;E:/android/android-ndk-r5bset ANDROID_NDK_ROOT=/cygdrive/e/android/android-ndk-r5bset NDK_PROJECT_PATH=/cygdrive/e/android/android-ndk-r5b/samples/hello-jni</code></pre><p><strong>on executing the command ./ndk-build, am getting the error...</strong></p><pre><code>Android NDK: Could not find application project directory!Android NDK: Please define the NDK_PROJECT_PATH variable to point to it.cygdrive\e\android\android-ndk-r5b\build\core\build-local.mk:""Android NDK aborting""</code></pre>","205929","","1002260","","2013-02-07 02:19:11","2013-02-07 02:19:11","Ndk-cygwin path specific issues","<android><path><cygwin><native><android-ndk>","2","6","1","2013-02-07 08:40:05",""
"5026021","1","","","2011-02-17 07:07:23","0","401","<p>Hi i want read the tamil unicode characters in android can ....</p><pre><code>char ch1='\u0B95';Character.UnicodeBlock block = Character.UnicodeBlock.of(ch1);textView2.setText(block.toString());</code></pre><p>in Android emulator skin its coming TAMIL its detecting the language but,not showing the character symbol....How Can i read that some one help me ...</p>","620893","","71724","","2011-02-17 07:49:41","2011-02-17 07:49:41","Android Character.UnicodeBlock","<android>","0","2","","",""
"5026057","1","","","2011-02-17 07:11:17","4","975","<p>Is there a way to create an ""Add to homepage"" from within an Android web app using JavaScript?</p><p>The standard way to do this is complicated:</p><ul><li>Bookmark the page</li><li>Go to the home screen</li><li>Long-press in an empty space to bring up the “Add to Home Screen”menu</li><li>select “Shortcuts”</li><li>select “Bookmark”</li><li>choose your bookmark</li></ul><p>Thanks-</p>","499809","","40352","","2011-03-01 03:53:57","2012-06-24 02:59:58","How do you add an android bookmark for a webapp using javascript?","<javascript><android><bookmarks>","1","2","3","",""
"5026066","1","","","2011-02-17 07:12:01","2","4055","<p>In my expandable list view I have a <code>textView</code> and an <code>imagebutton</code>. When I click on the <code>textView</code> or child view of expandable list, it should show an <code>alertbox</code>. I can achieve this by using <code>onChildClick</code> but I have an <code>imagebutton</code> inside the child view after <code>textView</code>. When I click on this, it should perform another activity. I don't know how to implement this in an expandable list.</p><p>Here is my expandable list code. Please check it. I tried <code>android:onClick=""myClickHandler""</code> too. I'm getting some <code>illegalstateException</code>.</p><p>Here is my code:</p><pre><code>import android.app.ExpandableListActivity;import android.graphics.Color;import android.os.Bundle;import android.view.View;import android.view.ViewGroup;import android.view.View.OnClickListener;import android.widget.Button;import android.widget.ExpandableListView;import android.widget.ImageButton;import android.widget.ImageView;import android.widget.LinearLayout;import android.widget.SimpleExpandableListAdapter;import android.widget.TextView;import android.widget.Toast;import java.util.List;import java.util.ArrayList;import java.util.HashMap;import android.util.Log;public class CoctailsActivity extends ExpandableListActivity implements OnClickListener{    private static final String LOG_TAG = ""ElistCBox"";    public static ImageButton img_button;    static final String Group[] = {      ""A"",      ""B"",      ""C"",      ""D""    };    static final String Children[][] = {      {        ""lightgrey"",        ""dimgray"",        ""sgi gray 92""      },      {        ""dodgerblue 2"",        ""steelblue 2"",        ""powderblue"",      },      {        ""yellow 1"",        ""gold 1"",        ""darkgoldenrod 1"",      },      {        ""indianred 1"",        ""firebrick 1"",        ""maroon"",      }    };    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle icicle)    {        super.onCreate(icicle);        setContentView(R.layout.exp_list);        SimpleExpandableListAdapter expListAdapter =new SimpleExpandableListAdapter            (                this,                createGroupList(),                  R.layout.group_row,                 new String[] { ""Group"" },                   new int[] { R.id.group_name },                      createChildList(),                  R.layout.child_row,                 new String[] { ""Children""},                 new int[] { R.id.child_name }               );        setListAdapter( expListAdapter );    }    public void  onContentChanged  ()     {        super.onContentChanged();        Log.d( LOG_TAG, ""onContentChanged"" );    }    public void myClickHandler(View v)     {        Log.v( LOG_TAG, ""insideMyHandler"" );        ExpandableListView lvItems = getExpandableListView();        for (int i=0; i &lt; lvItems.getChildCount(); i++)         {            lvItems.getChildAt(i).setBackgroundColor(Color.BLUE);                }        LinearLayout vwParentRow = (LinearLayout)v.getParent();        TextView child = (TextView)vwParentRow.getChildAt(0);        Button btnChild = (Button)vwParentRow.getChildAt(1);        btnChild.setText(child.getText());        btnChild.setText(""I've been clicked!"");        int c = Color.CYAN;        vwParentRow.setBackgroundColor(c);         vwParentRow.refreshDrawableState();           }   public boolean onChildClick(ExpandableListView parent,View v,int groupPosition,int childPosition,long id)    {        Log.d( LOG_TAG, ""onChildClick: ""+childPosition );        return false;    }    public void  onGroupExpand  (int groupPosition) {        Log.d( LOG_TAG,""onGroupExpand: ""+groupPosition );    }    private List&lt;HashMap&lt;String, String&gt;&gt; createGroupList() {      ArrayList&lt;HashMap&lt;String, String&gt;&gt; result = new ArrayList&lt;HashMap&lt;String, String&gt;&gt;();      for( int i = 0 ; i &lt; Group.length ; ++i ) {        HashMap&lt;String, String&gt; m = new HashMap&lt;String, String&gt;();        m.put( ""Group"",Group[i] );        result.add( m );      }      return (List&lt;HashMap&lt;String, String&gt;&gt;)result;    }  private List&lt;ArrayList&lt;HashMap&lt;String, String&gt;&gt;&gt; createChildList() {    ArrayList&lt;ArrayList&lt;HashMap&lt;String, String&gt;&gt;&gt; result = new ArrayList&lt;ArrayList&lt;HashMap&lt;String, String&gt;&gt;&gt;();    for( int i = 0 ; i &lt; Children.length ; ++i )     {// Second-level lists      ArrayList&lt;HashMap&lt;String, String&gt;&gt; secList = new ArrayList&lt;HashMap&lt;String, String&gt;&gt;();      for( int n = 0 ; n &lt; Children[i].length ; n += 2 )       {        HashMap&lt;String, String&gt; child = new HashMap&lt;String, String&gt;();        child.put( ""Children"", Children[i][n] );        //child.put( ""rgb"", shades[i][n+1] );        secList.add( child );      }      result.add( secList );    }    return result;  }@Overridepublic void onClick(View v) {    // TODO Auto-generated method stub    img_button =(ImageButton)v.findViewById(R.id.img01);    if(img_button!=null){        Log.v( LOG_TAG, ""onclick clickedddddd"" );    }}}</code></pre><p>Please help me.</p>","543393","","1128737","","2012-01-13 15:09:14","2013-11-09 03:05:39","How to implement different click events for child of expandable list?","<android><click><expandablelistview>","2","0","","",""
"5026068","1","","","2011-02-17 07:12:09","2","1566","<p>This is what I am doing to upload a video to a server:</p><p><em>email<br/>gameId<br/>source<br/>uploadedfile</em></p><p>are the parameters that have to be sent. <code>email</code>, <code>gameId</code> and <code>source</code> are string values, whereas <code>uploadedfile</code> is the filebody to be uploaded.</p><p>Running this code gives response <code>error0</code>.</p><pre><code> HttpClient client = new DefaultHttpClient();                   String postURL = GlobalConfig.url+""uploadBlogData.php"";                 HttpPost post = new HttpPost(postURL);                  FileBody bin = new FileBody(file);                 MultipartEntity reqEntity = new MultipartEntity(HttpMultipartMode.BROWSER_COMPATIBLE);               reqEntity.addPart(""email"", new StringBody(GlobalConfig.pref.getString(GlobalConfig.KEY_User_Emailid,""""), ""text/plain"", Charset.forName( ""UTF-8"")));             reqEntity.addPart(""gameId"", new StringBody(GlobalConfig.pref.getString(                    GlobalConfig.KEY_Game_Created_id,                    """"), ""text/plain"", Charset.forName( ""UTF-8"")));         reqEntity.addPart(""source"", new StringBody(""phone"", ""text/plain"", Charset.forName(""UTF-8"")));          reqEntity.addPart(""uploadfile"", bin);         post.setEntity(reqEntity);           HttpResponse response = client.execute(post);           Log.d(""resP"",GlobalConfig.getStringFromResponse(response));         HttpEntity resEntity = response.getEntity();  </code></pre>","620903","","717214","","2012-07-03 11:32:44","2012-07-03 11:32:44","to upload video to a php server through android","<android>","1","0","","",""
"5026080","1","","","2011-02-17 07:12:53","0","224","<p>first time when i dynamic ""vamp up"" strings to a well-formed html.webview it worked well, including <code>&lt;input = 'text'</code>, but the next time the same webview doesn't work, especially <code>&lt;input = 'text'</code></p><p>When one touches it, the keyboard appears, but one can not enter any word.</p><p>The webView setting is as follows:</p><pre><code>webView.getSettings().setJavaScriptEnabled(true);webView.getSettings().setSaveFormData(false);webView.getSettings().setSupportZoom(false);webView.getSettings().setSavePassword(false);webView.addJavascriptInterface(new runJavaScript(), ""myjs"");webView.requestFocus();webView.requestFocusFromTouch();</code></pre><p>This only happens in SDK 2.0.1 &amp; 2.1-update.</p>","620906","","418613","","2012-06-19 13:49:46","2012-06-19 13:49:46","html component can't work when webview(android) reload html component again","<android><webview><enter>","1","0","","",""
"5026203","1","5026609","","2011-02-17 07:31:02","0","884","<p>Hi friendsI am getting the value from webservice while unescape xml value .I am storing in stringBuffer . I am getting the lot of value from webservice .so I am getting out of memory error .can any body tell how to avoid that?</p><p>My UnescapeXml code</p><pre><code>public  String unescapeXML(String str) {            if (str == null || str.length() == 0)              return """";            StringBuffer buf = new StringBuffer();            int len = str.length();            for (int i = 0; i &lt; len; ++i) {              char c = str.charAt(i);              if (c == '&amp;') {                int pos = str.indexOf("";"", i);                if (pos == -1) { // Really evil                  buf.append('&amp;');                } else if (str.charAt(i + 1) == '#') {                  int val = Integer.parseInt(str.substring(i + 2, pos), 16);                  buf.append((char) val);                  i = pos;                } else {                  String substr = str.substring(i, pos + 1);                  if (substr.equals(""&amp;amp;""))                    buf.append('&amp;');                  else if (substr.equals(""&amp;lt;""))                    buf.append('&lt;');                  else if (substr.equals(""&amp;gt;""))                    buf.append('&gt;');                  else if (substr.equals(""&amp;quot;""))                    buf.append('""');                  else if (substr.equals(""&amp;apos;""))                    buf.append('\'');                  else if (substr.equals(""&amp;nbsp;""))                      buf.append("" "");                  else                    // ????                    buf.append(substr);                  i = pos;                }              } else {                buf.append(c);              }            }            return buf.toString();          }</code></pre><p>Thanks</p>","426344","","426344","","2011-02-17 08:28:43","2011-02-17 08:36:54","How to avoid out of memory error in android","<android>","2","1","","",""
"5026207","1","","","2011-02-17 07:31:35","2","6241","<p>I use the <code>Intent</code> <code>MediaStore.ACTION_VIDEO_CAPTURE</code> video recording method. </p><p>By default, the recorded video is stored as a <code>.3gp</code> file. I want to record and store the video as a <code>.mp4</code> file.  </p><p>Is this possible?.</p>","555806","","293280","","2014-03-15 19:33:17","2014-03-15 19:33:17","Video recording format(.3gp or mp4) in android?","<android><video><android-intent><android-camera>","2","0","","",""
"5026228","1","","","2011-02-17 07:35:24","0","31","<p>I am developing an application for comparing the wound images and point out how much centimeter the wound is cured ,Is it possible to do can anyone share your ideas as early as possible</p>","558304","","","","","2011-02-17 07:35:24","Android Image comparision","<android>","0","2","","",""
"5026250","1","5026291","","2011-02-17 07:39:40","2","1195","<p>We want to build on the froyo android release, but I am having difficulty understanding what the releation is between the different froyo branches.</p><p>What is the relation between the Android source branches:</p><ul><li>korg/froyo</li><li>korg/froyo-plus-aosp</li><li>korg/froyo-release</li></ul><p>Are some frozen? Which are regularly merged to the other, if at all?</p><p>(Bonus points if you can provide the git/repo commands to answer the questions. :) )</p><p>Thanks</p>","81398","","","","","2011-02-17 07:44:38","Android source branches","<android><git>","1","0","2","",""
"5026303","1","","","2011-02-17 07:46:43","0","1665","<p>im new to android development i want to acess ""data/app folder in android eclipse emulator to take backup of apk file that store in that directory but unfortunatly i unable to get access to that directory, </p><p>i have tried FACTORY_TEST to get root access permission but still no sucess, please help me in this regrads it is urgent thanks in advance.</p>","620952","","","","","2011-03-17 11:17:42","How to get root acess to data/app folder in Android eclipse emulator?","<android>","2","0","","",""
"5026304","1","10530597","","2011-02-17 07:46:46","11","4196","<p>I've created custom ToggleButtons in Android and since all buttons inherit from the same xml I want to change how they act depending on state, so when the state is checked I want to change the shadow color but this does not seem to possible with the current SDK.</p><p>I've created an xml file which holds button_colors: </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_checked=""true""    android:color=""#FFFFFF""  /&gt;&lt;item    android:color=""#000000"" /&gt; &lt;/selector&gt;</code></pre><p>But this only seems to work with text-color and not shadow color on the text.Is there something I'm missing?And rather not do this for every button manually in code since I want this to apply to every button in the app.</p><p><strong>UPDATE EDIT:</strong> </p><p>My selector currently looks like this</p><pre><code>&lt;selectorxmlns:android=""http://schemas.android.com/apk/res/android""&gt;&lt;item    android:state_checked=""true""    android:drawable=""@drawable/button_gradient_selected"" /&gt;&lt;item    android:drawable=""@drawable/button_gradient"" /&gt;&lt;/selector&gt;</code></pre><p>But as I mentioned to the commentator below I can't seem to change the style/text-color-shadow from here since it only can take in a drawable it seems.</p><p>When I try to put in a different style on the button in here it force closes or either does not change the style depending on state. When I only try to put in the style here and have the drawable be set in the style it force closes. Either way it does not work it seems.</p>","525016","","525016","","2011-02-17 11:01:45","2012-05-29 13:02:16","Shadow color on buttons depending on state in XML - Android","<android><xml><button>","4","1","3","",""
"5026349","1","","","2011-02-17 07:52:54","2","26330","<p>I am designing an app, with several button for users to click on. Once button is clicked, user is directed to appropriate website. How do I accomplish this?</p>","620959","","507810","","2012-08-06 02:40:29","2013-08-07 12:45:09","How to open a website when a Button is clicked in Android application?","<android><url><button><browser><android-intent>","5","2","1","",""
"5026353","1","5026466","","2011-02-17 07:53:40","0","65","<p>I am creating a layout,I have total 10 textviews placed vertically.On th e left side of   4th text i have to place image.Can anybody help</p><p>Thanks in advanceTushar</p>","475349","","","","","2011-02-17 08:10:13","problem while designing xml layout","<android>","3","3","","",""
"5026434","1","5026728","","2011-02-17 08:05:08","2","623","<p>I have a broadcast receiver which I want to pass onto an activity but if and only if the activity is visible.  I don't want to start it up unless its already visible.  Is there an option for this?  Or a way to pass it but not have the activity become visible?  Or if you know a way for an activity be register as a broadcast receiver that would work too I suppose.</p>","602260","","881229","","2014-04-01 21:47:15","2014-04-01 21:47:15","Android Pass Intent to Activity only if activity is already active?","<android><android-activity><broadcastreceiver>","1","0","1","",""
"5026459","1","","","2011-02-17 08:09:41","2","701","<p>i want to display the listview's scroll item by item, means single item height is equal to listview height, so on listview there is only one item will display at a time, and after scrolling the listview, remaining item will display. But problem is that if i scroll listview, it scroll many items, but i need to scroll only by one item.</p><p>in-short listview scroll by many row at a time but i want only one row scroll at a time</p><p>please suggest me some tips or method :)thank you</p>","620955","","517247","","2011-02-17 09:12:49","2011-07-28 08:39:58","how to display listview's scroll item by item","<android><listview><android-layout>","1","2","","",""
"5026511","1","5257413","","2011-02-17 08:18:17","8","4104","<p>I have to provide the functionality of showing PDF docs in my app without using any external PDF viewer. I know Android doesn't have such kind of widget and WebView can't load a PDF doc. </p><p><strong>So I want to know, is there any widget available which can be used to show the PDF docs in Activity (like WebView is used to show web pages)?</strong></p>","476747","","476747","","2011-03-07 05:34:29","2013-04-30 18:48:20","PDF Viewer Widget in Android","<android><pdf><widget><viewer>","3","2","5","",""
"5026549","1","5029078","","2011-02-17 08:23:38","0","1566","<p>I need to have my app monitor whether the GPS adapter is anabled or disabled. I don't care about the actual GPS functionality running at the monemt or not -- I need the status of the GPS adapter.</p><p>I can manually do it bu calling :<code>String providers = Settings.Secure.getString(getContentResolver(), Settings.Secure.LOCATION_PROVIDERS_ALLOWED)</code></p><p>If ""gps"" is listed, then it's active, otherwise it's not. But I can't find any documentation on getting notified when GPS is enabled or disabled by the user. I did try to use addGpsStatusListener in LocationManager, but that only notifies when the actual GPS fix is being acquired (like if the Maps app is being used).</p><p>Any ideas?</p>","496854","","","","","2012-08-08 02:07:58","How can I monitor the status of the GPS adapter using Android SDK?","<android><gps><location>","1","2","2","",""
"5026551","1","5026939","","2011-02-17 08:23:44","1","4859","<p>I have a radiogroup with custom radiobuttons. Icons are set using</p><pre><code>rbFirst.setButtonDrawable(R.drawable.first);</code></pre><p>But icon is not in the center, how do I fix it?I tried different attributes in xml file and inside class but it had no effect.</p>","468311","","","","","2012-07-19 21:04:55","Android radiobutton image","<android>","1","0","","",""
"5026646","1","5040714","","2011-02-17 08:36:40","2","293","<p>I have a Spinner that's populated using a cursor containing data from a database.  It appears that it's impossible to set the selected item in the spinner using the value of the ID column of a row.  And that the only way to set the selected item is by using the <em>position</em> of the row within the dataset.  Is this correct?  If so, is there a more efficient way of determining the row's position than by iterating through the dataset using the cursor?</p><p>The inefficient (to my mind) way is outlined <a href=""http://stackoverflow.com/questions/2559611/setselection-on-spinner-based-on-rowid"">here</a>.</p><p>Thanks much!</p>","369722","","369722","","2011-02-17 09:44:17","2011-02-18 11:26:59","How can I get the position of a row in a dataset in order to set the selected item in an Android Spinner?","<android><cursor><spinner><selecteditem>","1","0","1","",""
"5026653","1","5026865","","2011-02-17 08:37:01","5","8232","<p>I have a tab layout containing 3 tabs. I want to add 4th tab at run time and hide this tab after some time. Please let me know how to hide a tab in Android.</p>","536091","","","","","2011-02-17 09:01:42","How to hide a tab in Android tab layout?","<android>","1","0","1","",""
"5026669","1","","","2011-02-17 08:39:37","0","1102","<p>Hi Guys i m using following code but getting error0 as response . Please help in following code as i m near to success.     </p><pre><code> public void video() {    File file = new File(exsistingFileName);    try {        HttpClient client = new DefaultHttpClient();          String postURL = ""http://10.0.0.27/sportscloud/devices/uploadBlogData.php"";        HttpPost post = new HttpPost(postURL);         FileBody bin = new FileBody(file);        MultipartEntity reqEntity = new MultipartEntity(HttpMultipartMode.BROWSER_COMPATIBLE);          reqEntity.addPart(""email"", new StringBody(""test1@nga.com"", ""text/plain"", Charset.forName( ""UTF-8"")));        reqEntity.addPart(""gameId"", new StringBody(""1024"", ""text/plain"", Charset.forName( ""UTF-8"")));        reqEntity.addPart(""source"", new StringBody(""phone"", ""text/plain"", Charset.forName(""UTF-8"")));         reqEntity.addPart(""uploadfile"",bin );        post.setEntity(reqEntity);          HttpResponse response = client.execute(post);             HttpEntity resEntity = response.getEntity();          if (resEntity != null) {                       Log.i(""RESPONSE"",EntityUtils.toString(resEntity));        }    } catch (Exception e) {        e.printStackTrace();    }</code></pre><p>}</p>","620903","","545691","","2011-02-17 08:45:08","2012-07-03 11:34:21","How to upload video to PHP SERver from Android","<php><android>","1","0","","",""
"5026747","1","","","2011-02-17 08:48:56","2","214","<p>I'm developing mobile website and I have one problem with security some of data.</p><p>First time the user browse my site, the page requests a server to get some private user's data (i.e. RSA private key) which is used in future operations. This private key must be stored somewhere in local device memory (as a file on device, browser cache...).Next time when the same user launches the page (some functionality on page), the page has to load the file from local data when needed and use it (i.e. encrypt some string with private key).</p><p>The problem is where to store this key and how to read it?</p><p>First, I thought about cookies. But the cookie will be sent with all requests, so doing it with private key IMHO is not a good idea.The connection of course will be via SSL, but even that I don't want to send private key to server (it has to be as secure as possible!).So, how to solve to problem...? </p><p>I can add, it's not necessary to get the private key from server. It can be load as a file to device via its file manager or something like that. Simply - the browser has to read the private key when it will be needed and use it. I don't think that browser allows to save/read file from JavaScript, am I right? </p><p>Solution of the problem must work on most of available devices and browsers nowadays (especially iPhone, Android, Symbian + Opera Mobile(/Mini?).</p><p>Maybe HTML5 and its 'localStorage' could solve it but I have to assume, I CAN'T use HMTL5 with all its features.I consider using jQueryMobile framework.</p><p>Please, help! Thanks in advance!!</p>","621016","","","","","2011-02-23 17:52:03","Mobile web page - where to keep private data on devices?","<iphone><android><cookies><mobile><webpage>","2","0","","",""
"5026751","1","","","2011-02-17 08:49:17","5","2085","<p>I can use android-market-api to get nearly all information about my app from  Android Market.</p><p>But with published function from android-market-api, I cannot get download count number as it is in the Publisher's page (market.android.com/publish)</p><p>Is there any way to get this number with my android market developer account?Thank you.</p>","307480","","","","","2013-06-11 13:52:26","get app download count from android market","<android><google-play>","3","0","2","",""
"5026798","1","","","2011-02-17 08:55:00","1","329","<p>I am developing an application wherein i have added Google Maps and i am able to calculate aerial distance but i want the travelling distance between two points on the map and the marker on the directions. Kindly help me with the code</p>","576605","","","","","2011-02-17 08:55:00","to calculate travelling distance on google maps and add marker on the directions in android","<android><maps>","0","0","2","",""
"5026917","1","8230224","","2011-02-17 09:07:51","1","513","<p>I am now, writing some android code to access the WebDav server using Slide API.I can successfully access ""http://webdav.host.com"" to put and get.But I can't access the secured WebDav server, i.e. ""https://webdav.host.com"".</p><p>My code is as follows:</p><pre><code>HttpsURL homeUrl = new HttpsURL(webDavHost, 443, webDavPath);//set user name and password homeUrl.setUserinfo(webDavUser,webDavPassword);         Credentials cred = new UsernamePasswordCredentials(""user"", ""pwd""); res = new WebdavResource(homeurl,cred);</code></pre><p>I get the following error message: ""Certificate not Trusted"".</p><p>How should I do to modify the attribute of HttpsURL object therefore to trust all certication?</p>","559011","","","","","2011-11-22 18:02:04","WebDav, Certificate not Trusted","<android><https><webdav>","1","2","","",""
"5026918","1","5028442","","2011-02-17 09:08:02","1","1037","<p>I am trying to stop a media player and get out  of my activity class whenever the stop option of the process dialog is pressed,but by using the below code i am able to getting out of my activity class but unable to stop the media player sound ,and it is running continuously  till the thread stop..</p><p>Please help me on this matter Thanx in advance..</p><pre><code>public class Test_Service extends Activity {private MediaPlayer mp;private Thread welcomeThread;@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    mp = MediaPlayer.create(Test_Service.this,R.raw.alarm1);    welcomeThread=new Thread() {      int wait = 0;            @Override        public void run() {            try {                super.run();                    while (wait &lt;30000) {                     mp.start();                     sleep(3000);                    wait +=3000;                    }            } catch (Exception e) {                System.out.println(""EXc="" + e);            } finally {        }        }    };    new AlertDialog.Builder(Test_Service.this)    .setTitle(""Alarm is running"")    .setPositiveButton(""Stop"",new DialogInterface.OnClickListener() {    public void onClick(DialogInterface dialog, int whichButton) {        mp.stop();                    welcomeThread.stop();         Test_Service.this.finish();    }    })    .setNegativeButton(""Cancel"", new DialogInterface.OnClickListener() {    public void onClick(DialogInterface dialog, int whichButton) {        mp.stop();        Test_Service.this.finish();}    })    .create().show();    welcomeThread.start();        }    }</code></pre>","595226","","","","","2011-02-17 11:40:09","how to stop media player running inside a thread","<android>","1","1","","",""
"5026926","1","5027921","","2011-02-17 09:09:48","64","44117","<p>I've had severe trouble getting LayoutInflater to work as expected, and so did other people (<a href=""http://stackoverflow.com/questions/4735847/help-for-using-layoutinflator-to-add-views-at-runtime"">help-for-using-layoutinflator-to-add-views-at-runtime</a>).</p><p>The recurring question is: why does LayoutInflater ignore the layout parameters I've specified? E.g. why are the layout_width and layout_height values from my resources XML not honored?</p>","608395","","608395","","2011-02-17 10:46:46","2013-09-16 06:57:44","Making sense of LayoutInflater","<android><android-layout>","1","4","68","",""
"5026935","1","5113116","","2011-02-17 09:10:45","4","9675","<p>Hello I have an application which I can touch to scroll across several screens like the <a href=""http://stackoverflow.com/questions/4969226/android-homescreen"">Android Homescreen</a> app.</p><p>I have now managed to add a button on each page which changes from this to a new activity, but the scrolling is left to right and I want it to scroll down when the button is clicked but I can't figure out how to do it.</p><p>(This is probably a very noob question - sorry for that.)</p><p>Here is my main.java file</p><pre><code>public class main extends Activity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        Button onebutton = (Button)findViewById(R.id.soundsone);        onebutton.setOnClickListener(new OnClickListener() {    public void onClick(View v) {        Intent i = new Intent(main.this, series1button.class);        startActivity(i);    }});        Button twobutton = (Button)findViewById(R.id.soundstwo);        twobutton.setOnClickListener(new OnClickListener() {    public void onClick(View v) {        Intent i = new Intent(main.this, series2button.class);        startActivity(i);    }});          Button threebutton = (Button)findViewById(R.id.soundsthree);        threebutton.setOnClickListener(new OnClickListener() {    public void onClick(View v) {        Intent i = new Intent(main.this, series3button.class);        startActivity(i);    }});        Button fourbutton = (Button)findViewById(R.id.soundsfour);        fourbutton.setOnClickListener(new OnClickListener() {    public void onClick(View v) {        Intent i = new Intent(main.this, series4button.class);        startActivity(i);    }});        Button fivebutton = (Button)findViewById(R.id.soundsfive);        fivebutton.setOnClickListener(new OnClickListener() {    public void onClick(View v) {        Intent i = new Intent(main.this, series5button.class);        startActivity(i);    }});        Button sixbutton = (Button)findViewById(R.id.soundssix);        sixbutton.setOnClickListener(new OnClickListener() {    public void onClick(View v) {        Intent i = new Intent(main.this, series6button.class);        startActivity(i);    }});        Button sevenbutton = (Button)findViewById(R.id.soundsseven);        sevenbutton.setOnClickListener(new OnClickListener() {    public void onClick(View v) {        Intent i = new Intent(main.this, series7button.class);        startActivity(i);    }});        Button eightbutton = (Button)findViewById(R.id.soundseight);        eightbutton.setOnClickListener(new OnClickListener() {    public void onClick(View v) {        Intent i = new Intent(main.this, series8button.class);        startActivity(i);    }});    }}</code></pre>","613038","","244296","","2011-02-25 02:48:23","2011-02-25 03:05:05","How do I Change the default animation when changing activity?","<android><animation><button><activity><homescreen>","2","0","0","",""
"5026995","1","5027142","","2011-02-17 09:17:14","6","6455","<p>If i defined a color in resources</p><pre><code>&lt;resources&gt;    &lt;color name=""someColor""&gt;#123456&lt;/color&gt;&lt;/resources&gt;</code></pre><p>it's possible to set color by its id, like</p><pre><code>view.setTextColor(R.color.someColor);</code></pre><p>Is it also possible to get color string value from colors.xml?</p><p>Something like </p><pre><code>colorStr = getColor(R.color.someColor);// -&gt; colorStr = ""#123456""</code></pre><p>If yes, can anybody give an example?</p><p>Thank you</p>","408780","","","","","2011-02-17 09:32:53","Android get color as string value","<android><colors>","2","0","2","",""
"5027014","1","5201886","","2011-02-17 09:18:33","0","883","<p>I'm working on an Android app to be used in an experiment we are running in our lab. The application monitors the users movement using the accelerometers, performs calculations on this data at a regular interval, and writes the results to a file.</p><p>I'm currently having a very difficult time trying to find a way to run this process for the 15-20 minutes our trials require without it being killed. Despite declaring applications persistent, trying various service approaches (startForeground(), START_STICKY, ..), etc... I cannot seem to keep the Android OS from deciding to pause or kill my service/process.</p><p>I've done some research and the only advice I can find is how to set up your processes to gracefully recover from being killed, however I cannot afford to have gaps in my data and therefore need this process to run continuously.</p><p>Could someone point me in the right direction?</p>","535961","","","","","2011-03-05 05:25:12","How to run a continuous process","<android><service><processes>","2","0","1","",""
"5027015","1","5027221","","2011-02-17 09:18:34","1","4629","<p>Might be a silly question but I don't know how to include the src URL for my javascript into the Webview?</p><p>I build a huge html tag in code, passing in variables, and then print them using flot diagrams. The javascript files reside in my asset folder, so in static html page I simply refer to them as file:///android_asset/jquery.flot.js.</p><p>But how do I do that when it's all built up by code? This doesn't seem to work</p><pre><code>""&lt;script language=\""javascript\"" type=\""text/javascript\"" src=\""file:///android_asset/jquery.flot.js\""&gt;&lt;/script&gt;"" +</code></pre><p>Regards</p>","498112","","467900","","2011-10-21 07:41:37","2011-10-21 07:41:37","android webview include javascript","<javascript><android><webview><android-webview>","1","0","","",""
"5027084","1","5034933","","2011-02-17 09:26:23","4","1821","<p>If I push this HTML into <code>WebView</code>:</p><pre><code>webView.loadData(""&lt;html&gt;&lt;body&gt;&lt;pre&gt;line 1\nline 2&lt;/pre&gt;&lt;/body&gt;&lt;/html&gt;"", ""text/html"", ""utf-8"");</code></pre><p>it renders as (in emulator and also on device)</p><pre><code>line 1line 2</code></pre><p>as opposed to</p><pre><code>line 1line 2</code></pre><p>as I would expect. If I save this HTML to the sdcard and open the file in the browser, it renders fine. I suppose I am doing something wrong, or this may be a bug. Any way, I want to programatically push HTML with preformatted newlines into a <code>WebView</code> and have the newlines rendered. </p>","72746","","","","","2014-02-15 12:13:13","Android WebView incorrectly handling newlines in preformatted text","<android><html><webkit><webview>","3","0","1","",""
"5027125","1","","","2011-02-17 09:30:10","0","577","<p>I'm new to Android application development and i'm trying to create screen full of small buttons. For the purpose i have created TableLayout class where i overwrite onSizeChanged method with following code:</p><pre><code>    @Overrideprotected void onSizeChanged(int w, int h, int oldw, int oldh) {    super.onSizeChanged(w, h, oldw, oldh);    if(mRows == null &amp;&amp; mButtons == null){        Integer height = new Integer(mActivity.getString(R.string.buttonHeight));        Integer width = new Integer(mActivity.getString(R.string.buttonWidth));        mColumnCount = h / height.intValue();        mRowCount = w / width.intValue();           mRows = new ArrayList&lt;TableRow&gt;();        mButtons = new ArrayList&lt;Button&gt;();        int buttonID = 0;        for(int i = 0; i &lt; mColumnCount ; i++) {             mRows.add(new TableRow(mActivity));            mRows.get(i).setPadding(0, 0, 0, 0);            addView(mRows.get(i));            for(int j = 0; j &lt; mRowCount; j++){                mButtons.add(new Button(mActivity));                 mButtons.get(buttonID).setLayoutParams(new TableRow.LayoutParams(width.intValue(), height.intValue()));                mButtons.get(buttonID).setBackgroundResource(R.drawable.btn_normal);                mButtons.get(buttonID).setClickable(true);                mButtons.get(buttonID).setSelected(false);                mButtons.get(buttonID).setPadding(0, 0, 0, 0);                mButtons.get(buttonID).setOnClickListener(this);                mButtons.get(buttonID).setId(buttonID);                mRows.get(i).addView(mButtons.get(buttonID));                buttonID++;            }        }    defineBorders();     }   }</code></pre><p>Now the code works fine when runnings against android 2.2 or higher but i'll get blank screen when i run it against android 2.1 or lower. I don't have any components that requires android 2.2 in order to execute. Actually all the components are pretty much API level 1 stuff. </p><p>Besides the code works fine also on 2.1, if the layout is created before it's passed as a parameter on Activity.setContentView(). But i need screen size parameter to make the layout adapt on different screen sizes and based on my understanding i can only get it from view.onSizeChanged method.</p><p>Also, when i search the call stack. it shows following sequence on android 2.1 when framework calls view.onSizeChanged:</p><p>onSizeChanged(),onLayout()</p><p>When as the sequence on android 2.2 is:</p><p>onSizeChanged(),onLayout(),onMeasure(),onLayout()</p><p>Is this possibly framework view defect? Or is the view framework changed after 2.1? Any suggestions on course of action?</p>","621084","","","","","2011-03-14 09:21:45","Dynamically created content won't display when running against android 2.1 or lower","<android><view><tablelayout>","2","0","","",""
"5027147","1","5027741","","2011-02-17 09:32:37","39","48537","<p>I want to create a service which will run on a separate thread (not on UI Thread), so I implemented a class which will extend IntentService. But I haven't got any luck. Here is the code.</p><pre><code>public class MyService extends IntentService {    public MyService(String name) {        super(name);        // TODO Auto-generated constructor stub    }    @Override    public IBinder onBind(Intent arg0) {        // TODO Auto-generated method stub        return null;    }    @Override    public void onCreate() {        // TODO Auto-generated method stub        super.onCreate();        Log.e(""Service Example"", ""Service Started.. "");        // pushBackground();    }    @Override    public void onDestroy() {        // TODO Auto-generated method stub        super.onDestroy();        Log.e(""Service Example"", ""Service Destroyed.. "");    }    @Override    protected void onHandleIntent(Intent arg0) {        // TODO Auto-generated method stub        for (long i = 0; i &lt;= 1000000; i++) {            Log.e(""Service Example"", "" "" + i);            try {                Thread.sleep(700);            } catch (InterruptedException e) {                // TODO Auto-generated catch block                e.printStackTrace();            }        }    }}</code></pre><p>Service Consumption in an Activity Button click:</p><pre><code>public void onclick(View view) {Intent svc = new Intent(this, MyService.class);    startService(svc);}</code></pre>","563593","","1318946","","2014-01-17 07:01:32","2014-01-17 07:01:32","Android RuntimeException: Unable to instantiate the service","<android><android-service><android-intentservice>","5","2","14","",""
"5027195","1","5027377","","2011-02-17 09:37:58","0","173","<p>hi i have created a question answer based app, the question's used to be a random one based on the pictures. There was no error in the coding, the app runs successfully. It enters the main page and to second one too but when i move on to the question answer part the image is been displayed and no more further action on it, the parsing activity of my code starts here it is not going further.</p><p>when i placed a try catch block in my coding,  in the logcat it showed us</p><pre><code>02-17 14:49:20.582: ERROR/Parsing Pack(1194): Packthumb = butenemethylpropane02-17 14:49:21.502: ERROR/(1194): orientationvalue1 width = 320 Height = 48002-17 14:49:21.502: ERROR/(1194): 213083751502-17 14:49:21.502: ERROR/(1194): butene_vs_2butene02-17 14:49:21.532: ERROR/Timerview(1194): L= 20W= 15H= 20002-17 14:49:21.562: ERROR/ParsingActivity oncreate(1194): ERROR =     android.content.res.Resources$NotFoundException: Resource ID #0x0</code></pre><p>the following is my coding of the parsing activity</p><pre><code>try         {            resID = getResources().getIdentifier(name, ""raw"", ""com.menteon.speedimage0102"");            saxparserfactory = SAXParserFactory.newInstance();            saxparser = saxparserfactory.newSAXParser();            xmlreader = saxparser.getXMLReader();            //getting the path of xml to parse            inputstream = this.getResources().openRawResource(resID);            xmlreader.setContentHandler(myXMLHandler);            //parsing the xml            xmlreader.parse(new InputSource(inputstream));            //getting the values of xml            item = myXMLHandler.getitem();            menteon = myXMLHandler.getmenteon();            polygon = myXMLHandler.getpolygon();            point = myXMLHandler.getpoint();            orientation = menteon.getOrientation();            o = menteon.getItem().size();            Log.e(""ParsingActivity"", ""Orientation = ""+orientation);            Log.e(""ParsingActivity"", ""menteon size = ""+o);            //calling function for random number            qnumber();            if(orientation.equalsIgnoreCase(""portrait"") &amp;&amp; orientationvalue==2 )            {                alertportrait(orientation, orientationvalue);               }            else  if(orientation.equalsIgnoreCase(""landscape"") &amp;&amp; orientationvalue==1 )            {                alertlandscape(orientation, orientationvalue);            }            if(orientation.equalsIgnoreCase(""portrait"") &amp;&amp; orientationvalue==1)            {                setRequestedOrientation(1);                alertstart();            }            else if(orientation.equalsIgnoreCase(""landscape"")&amp;&amp; orientationvalue==2)            {                setRequestedOrientation(2);                alertstart();            }        }        catch (Exception e)         {            e.printStackTrace();            Log.e(""ParsingActivity oncreate"", ""ERROR = ""+e);        }}   </code></pre><p>pls help me in debugging my error</p>","596364","","416564","","2011-02-17 09:44:57","2011-02-17 09:57:16","error during the parsing activity","<java><android>","2","1","","",""
"5027205","1","","","2011-02-17 09:39:12","2","748","<p>I am trying to make the Gallery scroll with animation to left or right when user click on either the left or right buttons. It works well if I use the below code to invoke the keyevent to scroll the gallery:</p><pre><code>gallery.onKeyDown(KeyEvent.KEYCODE_DPAD_LEFT,  new KeyEvent(0, 0));</code></pre><p>or</p><pre><code>KeyEvent evtKey = new KeyEvent(0, KeyEvent.KEYCODE_DPAD_RIGHT);gallery.dispatchKeyEvent(evtKey);</code></pre><p>But once I set any value to the Gallery spacing, the code above stop working. Any clue why this is so?</p>","42340","","","","","2011-08-03 08:30:52","Setting any value for Gallery spacing will disable onKeyEvent","<android><android-widget>","1","0","","",""
"5027239","1","","","2011-02-17 09:42:48","0","133","<pre><code>protected CharSequence[] _options = { ""English "", ""Thai"", ""German"", ""Italy"", ""Spain"", ""All languages"" };protected boolean[] _selections =  new boolean[ _options.length ];@Overrideprotected Dialog onCreateDialog( int id ) {    return     new AlertDialog.Builder( this )        .setTitle( ""Choose Language"" )        .setMultiChoiceItems( _options, _selections, new DialogSelectionClickHandler() )        .setPositiveButton( ""OK"", new DialogButtonClickHandler() )        .create();}public class DialogSelectionClickHandler implements DialogInterface.OnMultiChoiceClickListener{    @Override    public void onClick( DialogInterface dialog, int clicked, boolean selected )    {        Log.i( ""ME"", _options[ clicked ] + "" selected: "" + selected );    }}public class DialogButtonClickHandler implements DialogInterface.OnClickListener{    @Override    public void onClick( DialogInterface dialog, int clicked )    {        switch( clicked )        {            case DialogInterface.BUTTON_POSITIVE:                printSelectedLanguage();                break;        }    }}protected void printSelectedLanguage(){    for( int i = 0; i &lt; _options.length; i++ ){        Log.i( ""ME"", _options[ i ] + "" selected: "" + _selections[i] );    }}</code></pre><p>How can I check that which checkbox is checked </p>","605358","","","","","2011-02-17 11:08:22","About check box","<android><checkbox>","2","0","","",""
"5027259","1","","","2011-02-17 09:45:49","0","743","<p>I want use webservices (using Soap and not rest) on android and I want use dpws (not ksoap2).Is there any dpws library available for android?Thanks</p>","422688","","422688","","2011-02-25 11:32:31","2011-04-05 14:08:43","Does android support the Device Profile for Web Services (dpws)?","<android><web-services>","1","0","","",""
"5027283","1","","","2011-02-17 09:48:26","0","943","<p>I need to do LDAP authentication of my users in Android application , for the same I am using JNDI lookup method and need to include JNDI.jar in my build path , but android is not letting me do so and throwing the following error </p><p>trouble processing ""javax/naming/AuthenticationException.class"":</p><p>Ill-advised or mistaken usage of a core class (java.* or javax.*)when not building a core library.</p><p>This is often due to inadvertently including a core library filein your application's project, when using an IDE (such asEclipse). If you are sure you're not intentionally defining acore class, then this is the most likely explanation of what'sgoing on.</p><p>However, you might actually be trying to define a class in a corenamespace, the source of which you may have taken, for example,from a non-Android virtual machine project. This will mostassuredly not work. At a minimum, it jeopardizes thecompatibility of your app with future versions of the platform.It is also often of questionable legality.</p><p>If you really intend to build a core library -- which is onlyappropriate as part of creating a full virtual machinedistribution, as opposed to compiling an application -- then usethe ""--core-library"" option to suppress this error message.</p><p>If you go ahead and use ""--core-library"" but are in factbuilding an application, then be forewarned that your applicationwill still fail to build or run, at some point. Please beprepared for angry customers who find, for example, that yourapplication ceases to function once they upgrade their operatingsystem. You will be to blame for this problem.</p><p>If you are legitimately using some code that happens to be in acore package, then the easiest safe alternative you have is torepackage that code. That is, move the classes in question intoyour own package namespace. This means that they will never be inconflict with core system classes. JarJar is a tool that may helpyou in this endeavor. If you find that you cannot do this, thenthat is an indication that the path you are on will ultimatelylead to pain, suffering, grief, and lamentation.</p><p>2011-02-17 15:08:33 - DHCAndroid: Dx1 error; aborting2011-02-17 15:08:33 - DHCAndroid Conversion to Dalvik format failed with error 1</p><p>As soon as i remove the jar the error disappears, removing the jar is not an option , please help with the way to do it </p><p>Regards,Smriti Garg</p>","621104","","","","","2012-10-26 04:48:21","Not able to include jndi.jar file in android project build path","<android>","2","0","","",""
"5027332","1","5027359","","2011-02-17 09:52:03","0","967","<p>In my application am having lot bitmaps around 1000. I have to  merge them as a single image. In order to do this , loading currently needed bitmaps from sdcard .In this process i have to recyle Least recently used bitmaps other wise dvm throws out of memory error  . so can any one tell me how to accomplish this task (Least recently used ) in java.?? </p><p>Thank you,Srinivas</p>","414777","","","","","2011-02-17 09:54:59","Android : Least recently used (LRU) algorithm implementation in java?","<java><android><lru>","1","1","1","",""
"5027340","1","","","2011-02-17 09:52:49","5","2996","<p>I am trying to develop an android application. I've put a scroll view as main container using graphical layout in eclipse. After that, I had put some UI elements, like buttons. When the total height of elements become more than viewable area, it can be seen using scroll view as expected. There is no problem until this point. The problem is the elements that are not fit viewable are of the screen can not be seen using graphical container of the eclipse interface. There is no problem with the source code, as it runs expectedly. Is there any option in the Eclipse gui to see the UI elements that are not fit the viewport?</p>","334828","","334828","","2011-02-17 10:44:25","2012-03-15 04:00:25","Graphical Layout Scroll Problem in Eclipse Android Development","<android><eclipse>","4","2","1","",""
"5027346","1","5027943","","2011-02-17 09:53:59","1","1236","<p>Im using this Layout to put two ImageViews one next to the other, but the two images seems to be separated by 1 transparent pixel space.<br>The blue background is there to make easier to observe the problem...<br><br></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;    &lt;LinearLayout        android:orientation=""horizontal""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:gravity=""center""        android:layout_marginTop=""5dip""&gt;        &lt;ImageView            android:src=""@drawable/i_position_icon""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""/&gt;        &lt;ImageView            android:src=""@drawable/i_position_seekbar""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""/&gt;    &lt;/LinearLayout&gt;&lt;/LinearLayout&gt;</code></pre><p>The .java is:</p><pre><code>public class MainActivity extends Activity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle icicle) {        super.onCreate(icicle);        requestWindowFeature(Window.FEATURE_NO_TITLE);        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);        setContentView(R.layout.main);    }}</code></pre><p><br>Im using a device with android 2.2.<br>I wasnt able to reproduce the glitch on a 2.1-update1 emulator neither on a 1.6 emulator... <br>Ive checked the images and they have no extra pixels arround them.<br>Also i tried adding a red 1px width border on the images separately and the glitch is still there, so the images dont seem to be the problem.<br><br>These are the problematic images (correctly shown here):<br><img src=""http://i.stack.imgur.com/wRUX7.png"" alt=""Image A""><img src=""http://i.stack.imgur.com/KFRGQ.png"" alt=""Image B""><a href=""http://dl.dropbox.com/u/7024937/i_position_icon.png"" rel=""nofollow"">http://dl.dropbox.com/u/7024937/i_position_icon.png</a><br><a href=""http://dl.dropbox.com/u/7024937/i_position_seekbar.png"" rel=""nofollow"">http://dl.dropbox.com/u/7024937/i_position_seekbar.png</a><br><br><br>And this is what i see in my device:<br><img src=""http://i.stack.imgur.com/JpIIc.png"" alt=""Transparent pixel between ImageViews""><br><br>Thanks. </p>","13116","","13116","","2011-02-17 10:18:55","2011-02-17 10:50:25","Unwanted space between two ImageView on android","<android><imageview><padding><margin><android-linearlayout>","2","2","","",""
"5027358","1","","","2011-02-17 09:54:54","0","492","<p>I am working on a OpenGL ES project, newbie stadium, so I got a question regarding a GLSurfaceView and Renderer implementation.I have a layout that contains GLSurfaceView in FrameLayout which I use to show the rendered animation (the animation is rendered in Renderer implementation of my own).</p><p>All this happens in one Activity.</p><p>Then I need to start another activity, but to use the same View and the same Renderer, I tried to create new GLSurfaceView in the new activity (also in FrameLayoyt, the same as the first Activity), but it crashes right away. So I think that I have to reuse the GLSurfaceView and the Renderer that I use in the first activity.</p><p>What is the right way to achive this?</p>","584513","","44729","","2011-02-17 15:18:19","2011-02-17 15:18:19","Reuse of GLsurfaceView in 2 activities","<java><android><opengl-es>","1","0","","",""
"5027395","1","","","2011-02-17 09:58:43","1","10059","<p>Is it possible to download a file with JSON data inside it from a URL? Also, the files I need to get have no file extension, is this a problem or can i force it to have a .txt extension upon download?  </p><p>UPDATE:I forgot to mention, that the website requires a username and password entered in order to access the site which i know. There a way to input these values in as I retrieve the file?</p>","601327","","601327","","2011-02-17 10:23:20","2013-02-27 04:01:28","Android - download JSON file from url","<java><android><json><file><url>","5","1","1","",""
"5027509","1","5027609","","2011-02-17 10:07:31","0","5767","<p>I have got an application where I need to show counter from 3 to 1 then quickly switch to another activity. Will TimerTask will be suitable for doing this? Can anybody show me an example of exactly how to do it?</p><p>CountDownTimer Worked. Code for showing timer for 3 seconds is.</p><pre><code>new CountDownTimer(4000, 1000) {             public void onTick(long millisUntilFinished) {                 Animation myFadeOutAnimation = AnimationUtils.loadAnimation(countdown.this, R.anim.fadeout);                        counter.startAnimation(myFadeOutAnimation);                 counter.setText(Long.toString(millisUntilFinished / 1000));             }             public void onFinish() {                 counter.setText(""done!"");             }        }.start();</code></pre>","340002","","340002","","2011-02-17 10:38:51","2014-03-31 08:52:39","Implementing counter in Android","<android>","2","3","1","",""
"5027624","1","5027727","","2011-02-17 10:20:12","8","5725","<p>Hope I am able to explain this correctly... I am able to connect to my web server and download a single file.What I am now attempting to do is connect to my server and download all the flies from a particular folder.In this case i want to download images.This is the code i use to download a single file...</p><pre><code>URL url  = new URL(""http://127.0.0.1/Folder/file.csv"");            URLConnection conexion = url.openConnection();            conexion.connect();            int lenghtOfFile = conexion.getContentLength();            InputStream is = url.openStream();            File testDirectory =             new File(Environment.getExternalStorageDirectory()+""/Folder"");            if(!testDirectory.exists()){                testDirectory.mkdir();            }            FileOutputStream fos = new FileOutputStream(testDirectory+""/file.csv"");            byte data[] = new byte[1024];            int count = 0;            long total = 0;            int progress = 0;            while ((count=is.read(data)) != -1){                total += count;                int progress_temp = (int)total*100/lenghtOfFile;                if(progress_temp%10 == 0 &amp;&amp; progress != progress_temp){                    progress = progress_temp;                }                fos.write(data, 0, count);            }            is.close();            fos.close();</code></pre><p>How can I add to this code to make it download all the files from that folder?</p>","569654","","1316372","","2012-06-19 20:48:27","2014-01-10 04:30:29","Android - Download all files from a folder on server","<android>","2","2","6","",""
"5027718","1","5027755","","2011-02-17 10:29:36","2","978","<p>Is a ""Service"" in android same as a separate thread ?</p>","448005","","180538","","2011-02-17 10:39:41","2012-03-27 15:33:32","Android Service and thread","<android><multithreading><service>","2","0","","",""
"5027809","1","5027837","","2011-02-17 10:39:00","0","59","<p>In my Alert in Adroid, I would be able to have a checkbox, which will expand after tick the same alert and new objects (buttons) will appear. I haven't found anything yet, if it is possible or not. Is there anyone who tried it already?</p><p>Thanks</p>","513956","","","","","2011-02-17 10:41:19","Android - alert expand","<android><alert>","1","0","","",""
"5027821","1","","","2011-02-17 10:40:14","1","1063","<p>I have asked this before, but perhaps in a too inconcise way. </p><p>I have a SQLite database where a base64 string i stored in a BLOB column. I need to retreive this and show the image. </p><p>THis is how I try to fetch it:</p><pre><code> String[] blob = new String[4];    startManagingCursor(c);       if (c.moveToFirst()){             int i = 0;         do {blob[i] = c.getString(1);         i++;}         while (c.moveToNext());         c.close();        String bild = blob[0];        byte[] decodedString = Base64.decode(bild, Base64.DEFAULT);        Bitmap decodedByte = BitmapFactory.decodeByteArray(decodedString, 0, decodedString.length);        mImage.setImageBitmap(decodedByte);</code></pre><p>I have tried as well with:</p><pre><code>             byte[] blob = new byte[4];     startManagingCursor(c);       if (c.moveToFirst()){             int i = 0;         do {            blob = c.getBlob(1);         i++;}         while (c.moveToNext());         c.close();        String bild = blob.toString();        byte[] decodedString = Base64.decode(bild, Base64.DEFAULT);        Bitmap decodedByte = BitmapFactory.decodeByteArray(decodedString, 0, decodedString.length);        mImage.setImageBitmap(decodedByte);</code></pre><p>I have also tried to run one of the base64 strings in one of those decoder sites, and from there I can see it is a png-file. </p><p>BUt still, in the Android project I only get NULL reults. What am I missing? I had some recent problems with a misinterpretaion of utf-8 as macroman. Can there be a misinterpretation of my base64 code string as well?</p><p>Many thanks if someone could point me the right direction!</p>","455479","","","","","2011-02-17 10:40:14","Decode png-image stored as base64 in Android project","<android><sqlite><base64>","0","2","","",""
"5027834","1","","","2011-02-17 10:41:13","2","2105","<p>I am new to android ,how can I know if the call button is pressed or i can replace default dialer activity using my dialer I have used following code</p><pre><code>&lt;receiver  android:name=""CallService""&gt;        &lt;intent-filter&gt;          &lt;action android:name=""android.intent.action.CALL_BUTTON"" /&gt;        &lt;/intent-filter&gt;    &lt;/receiver&gt;</code></pre><p>and here is my broadcast</p><pre><code>public void onReceive(Context context, Intent intent){    String mAction = intent.getAction();    Log.e(""Intent"", mAction);}</code></pre><p>But its not receiving any intent</p>","621168","","","","","2011-11-06 01:26:47","Android Capture Call button","<android><call>","1","4","","",""
"5027890","1","","","2011-02-17 10:46:07","1","2982","<p>I want to check whether the gprs connection is active or not in android through code to show how can i check that.i have the following code.Will it work?</p><pre><code>public static boolean isOnline(Context context) {try {ConnectivityManager cm = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);if (cm.getActiveNetworkInfo().isConnectedOrConnecting()) {URL url = new URL(""https://telemeter4tools.services.telenet.be/TelemeterService"");HttpURLConnection urlc = (HttpURLConnection) url.openConnection();urlc.setRequestProperty(""User-Agent"", ""My Android Demo"");urlc.setRequestProperty(""Connection"", ""close"");urlc.setConnectTimeout(1000); // mTimeout is in secondsurlc.connect();if (urlc.getResponseCode() == 200) {return true;} else {return false;}}} catch (IOException e) {// TODO Auto-generated catch blocke.printStackTrace();}return false;}</code></pre><p>can i replace that site with the googleand check the response.</p>","601054","","491978","","2011-02-17 11:30:35","2012-01-06 20:24:01","Check Gprs Connection","<java><android><networking><gprs>","4","0","","",""
"5027974","1","","","2011-02-17 10:52:49","2","6189","<p>An issue has appeared a few days ago.I have an application that listen for GPS location. The listener is a background service that works all the time, this service saves data in application level and each activity reads this data. So, when i press back button i am able to catch this event and i can stop the service, but when i press HOME button the service is still working although the application is in background mode and this consumes battery, because the GPS always works. How can i handle this event? I do want to stop all services when the user presses HOME button and start them again when user gets back.10x</p>","621220","","","","","2014-03-20 16:56:57","Android: How to handle that the application is minimized by HOME button","<android><button><gps><home>","6","0","1","",""
"5028032","1","","","2011-02-17 10:58:07","1","221","<p>Hello I'm programming an Web-Application with asp.net and jQuery (parts of it in jQueryMobile).I can't use the loading-animations of jQueryMobile as they don't work with my aspx sites. So i implemented my own loading animation on several pages. Which looks like so:</p><pre><code>&lt;script type=""text/javascript""&gt;    $(document).ready(function () {        $(""#loading"").addClass(""hidden"");        $(""a.ui-btn"").removeClass(""hidden"");        $(""a"").click(function () {            $(""#loading"").removeClass(""hidden"");            $(""a.ui-btn"").addClass(""hidden"");        });    });&lt;/script&gt;</code></pre><p>Now the problem:on any Desktop Browser, on Mobile Opera and on any Safari-Based Browser (like on iPhone and iPad) everything works as one would expect it, except of the integrated Android-Browser (which is as far as i know a Chrome-derviate).On these devices the loading animation doesn't show when i click a button. But(!) after the following page loaded and one uses the back-button of the Browser the animation shows up and one can't acces the normal page...I don't understand what exactly happens here. Seems like a racing condition or something similar to me?! And how can i solve this?</p>","611048","","","","","2011-02-17 10:58:07","Android and jQuery Problem (might also be an asp.net issue?)","<jquery><asp.net><android>","0","0","","",""
"5028034","1","","","2011-02-17 10:58:20","0","651","<p>i structed with one serious issue. I have developed one app which basically receives push notifications.</p><p>I implemented Tokudu push notifications. Here is the link<strong><a href=""http://tokudu.com/2010/how-to-implement-push-notifications-for-android/comment-page-2/#comment-758"" rel=""nofollow"">Tokudu</a></strong></p><p>I downloaded the android source and from this <strong><a href=""http://tokudu.com/demo/android-push/"" rel=""nofollow"">url</a></strong> i was sending the notification to the device with the help of device ID.</p><p>But from the last two days i m not able to receive the notifications. i dont understand the problem. can anybody help in this case.</p>","383597","","","","","2011-02-17 10:58:20","Android real time push notifications","<android>","0","2","","",""
"5028134","1","","","2011-02-17 11:08:49","2","498","<p>I have a SurfaceView which has a fixed height within the game (let's say it is always 400 pixels high). However, the content that I display within that SurfaceView is tile-based, so at any point within the game, the content can have a ""virtual"" height of any value, 400 or more pixels. When the content height is larger than the SurfaceView height, the user can scroll that content up and down. When that happens, I would like to add a standard scrollbar to indicate where the user is scrolling currently within that content.</p><p>How is it possible to add the standard scrollbar and change its length (height in this case) depending on the height of my ""virtual"" content? Thank you!</p>","58038","","","","","2011-02-17 11:08:49","How to add a scrollbar to a custom SurfaceView of a virtual height","<android><scrolling><scrollbar><surfaceview>","0","0","","",""
"5028152","1","5028207","","2011-02-17 11:11:01","0","583","<p>is it possible to save images from the MediaStore, based on a certain user action, in a key/value pair using Hashmap. what i mean is, if the app gets restarted, does the Hashmap retain the contents or would i have to perform the action again. </p><p>what other solutions can i use to save the images for fast retrieval?.. shared Preferences or sqlite database, but i am assuming the latter might just be a waste. </p><p>Hope i am clear on this. Thank you.</p>","447570","","","","","2011-02-17 11:16:15","Saving images in a HashMap Android","<android>","1","0","","",""
"5028177","1","5029222","","2011-02-17 11:13:29","0","1681","<p>I have a multi Activity application with a quit/logout button on most of the screens. </p><p>On pressing the button it shows a confirmation dialog and then sends out a 'quit' broadcast. </p><p>I have a broadcast receiver on each of the activity that simply calls the finish() activity and in the OnDestroy I unregister the receiver. The code works well in normal usage.</p><p>The issue that I am facing is if an uncaught exception pops up and a  Force close happens. </p><p>After I press OK the last activity shows up. When I press the Quit/LogOut buttonthe broadcast does not seem to be picked up by other activities. </p><p>I usually have to exit each of the activity or in some cases the 2nd time I press the Quit button the broadcast propagates through. </p><p>I am aware that I can setup the Thread.setDefaultUncaughtExceptionHandler() but,</p><p>Is there any thing that I am missing out over here? </p><p>The logcat does not show up anything.</p>","541919","","424413","","2011-02-17 11:16:43","2011-02-17 12:58:35","Android Broadcast Receiver and Force Close (Uncaught exceptions)","<android><broadcastreceiver>","1","6","","",""
"5028186","1","5028803","","2011-02-17 11:13:59","1","616","<p>I want to display dotted margin in table layout in my application. Is it possible or not ?If yes then how..</p>","610940","","638471","","2013-12-22 13:34:14","2013-12-22 13:34:14","Margins in Android","<android><android-layout>","3","0","","",""
"5028211","1","","","2011-02-17 11:16:51","1","2973","<p>when i connect to the servlet from my andoid mobile browser I need to get UAprof url for my samsung mobile in x-wap-profile headers but im not getting the header ...</p><p>but when i tried to connect the servlet from htc i could to get uaprof url in X-Wap-Profile header..how should i get uaprof url for my samsung mobile please help me..</p><p>thanks in advance..</p>","621270","","55693","","2011-03-22 01:40:29","2011-03-22 23:12:41","how to get UAprof url for samsung mobile","<android><mobile-devices><capability><device-detection><uaprof>","1","4","","",""
"5028218","1","5028810","","2011-02-17 11:17:11","0","863","<p>I have got an application where I need to draw random number of points at random locations in the activity. Then I need to move those points at any direction too like steroids. How can I do that? Please see image below.</p><p><img src=""http://i.stack.imgur.com/JBGQv.png"" alt=""enter image description here""></p>","340002","","","","","2011-02-17 12:15:45","Drawing circles at random points","<android>","2","0","","",""
"5028257","1","11903191","","2011-02-17 11:21:34","1","1040","<p>Have an android app that prints with a toast pop up, and reads out a received message with tts.  I use ""String origin = smsMessage[0].getOriginatingAddress();"" to get the phone number of the sender.<br>I want to query the contacts list on the phone, so if the received number matches any contacts, it will print &amp; read out the name of the sender instead.  Otherwise, if the number is not recognised, it will default back to just printing &amp; reading the OriginatingAddress number.Iv'e looked at <a href=""http://stackoverflow.com/questions/3206276/how-can-i-query-android-contact-based-on-a-phone-number"">How can I query Android contact based on a phone number?</a> - but not quite sure howto go about it.</p>","600423","","","","","2012-08-10 18:35:49","Match number to contact in android app","<java><android><contacts>","2","0","","",""
"5028285","1","","","2011-02-17 11:23:44","1","158","<p>The first time I log in using the Facebook SDK in my application, it remains logged in until I close out of Eclipse.</p><p>How do I force it to log me in each time so that I can debug the login process?</p>","","Jazz","19679","","2011-02-28 15:55:23","2011-05-14 15:10:12","How do I get Facebook to log me in each time so that I can debug the login process?","<android><facebook><android-emulator>","2","0","","",""
"5028416","1","","","2011-02-17 11:37:32","0","708","<p>i want to draw a rectangle using rect method form android graphics but i want to specify the values in dp so that it can fix to any screen size. i presume by default its in pixel or just x,y coordinates.how can i draw it to fit in any screen size using the rect method</p>","613071","","","","","2011-02-17 11:56:49","draw a rectangle using rect method from android graphics but i want the rectangle to fit any screen","<android>","1","0","","",""
"5028420","1","5028462","","2011-02-17 11:37:58","1","1560","<p>In  getView method of gallery ,i had download the bitmap and set to Imageview and return it back to framework. When and where should i recycle the bitmap ? I don't want to wake up the system garbage collector to clean up the bitmaps.</p><pre><code>public View getView(int position, View view, ViewGroup parent) {        ImageView i = new ImageView(mContext);         downloadFromWeb(""www.blahblah.com"", i);        i.setScaleType(ImageView.ScaleType.FIT_XY);        i.setLayoutParams(new Gallery.LayoutParams(mDisplayWidth, (mDisplayHeight-100)));        i.setBackgroundResource(mGalleryItemBackground);        return i;    }public downloadFromWeb(URL url, ImageView i){        Bitmap bitmap = getBitmapFromWeb(url);        i.setImageBitmap(bitmap);  }</code></pre>","608209","","424413","","2011-02-17 11:39:33","2011-02-17 11:42:03","How to recycle bitmap from android Gallery::GetView method","<android><garbage-collection><gallery>","1","1","0","",""
"5028421","1","5028521","","2011-02-17 11:38:04","10","12481","<p>I have a zip folder on my SD card, how do i unzip the folder (within my application code) ? </p>","569654","","","","","2013-10-27 13:15:50","Android - Unzip a folder?","<android><unzip>","4","1","8","",""
"5028450","1","","","2011-02-17 11:41:08","2","2370","<p>I am developing an restaurant locator for that i need to find the current location of mobile without using the GPS, is it possible?</p><p>kindly help me with the codes</p>","621307","","457982","","2011-02-17 11:49:08","2011-02-17 11:53:28","Find the current location of mobile without using the GPS","<android><gps><location>","1","2","","",""
"5028466","1","5028511","","2011-02-17 11:42:25","4","9236","<p>I am writing a simple android app which have a edittext and a button. Clicking on button should display an alert dialog with text entered in the edittext. For that I have the following code:</p><pre><code>String txt; /** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState){    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    Button b=(Button)findViewById(R.id.ok);    AlertDialog.Builder builder = new AlertDialog.Builder(this);    builder.setMessage(""Text in edit box: "" + txt)        .setCancelable(false)        .setTitle(""Info"")        .setPositiveButton(""Done"", new DialogInterface.OnClickListener() {    public void onClick(DialogInterface dialog, int id) {                                                        }                                                                            }                            );final AlertDialog alert = builder.create();// set click listener on the flag to show the dialog box b.setOnClickListener(new View.OnClickListener() {public void onClick(View v) {    EditText et=(EditText)findViewById(R.id.entry);    txt=et.getText().toString();    alert.show();                            }                                                });}</code></pre><p>The above code is running fine but the alert dialog shows <strong>Text in edit box: null</strong>.It should show the text of the editbox.</p>","461537","","","","","2013-03-25 06:19:38","Reading text of an EditText in android","<android>","4","0","","",""
"5028507","1","5028572","","2011-02-17 11:46:43","15","14970","<p>I'd like to be able to integrate Android api docs into Eclipse so that, for example, if hover over an <code>Activity</code> class you get the appropriate Javadoc in a popup.</p><p>So to add Javadoc to Android you open up any Android project in Eclipse. Location the ""Android x.x"" library. In this right click on the <em>android.jar</em> file and select Properties. Choose the Javadoc location entry. </p><p>In the JavadocURL section I entered <a href=""http://developer.android.com/reference/packages.html"">http://developer.android.com/reference/packages.html</a> and clicked <em>Validate</em> but it gives the usual error of</p><p><em>Location might be invalid. Files 'package-list' and 'index.html' that are typically available at the root of the documentation created by the Javadoc tool have not been found</em></p><p>I've tried lots of variations of that URL but to no avail.</p><p>I also don't want to have to resort to downloading the source for Android.</p>","516286","","516286","","2011-02-17 12:07:12","2011-12-24 16:03:43","How to get the Android API documentation in Eclipse","<eclipse><documentation><android>","2","1","2","",""
"5028541","1","5029143","","2011-02-17 11:49:55","0","151","<p>i am created an application in android.In that i have a doubt,for explaining that i have to show the graphical layout of main.xml. it is possible to copy my code and paste here so that everybody can see the code.Now i want to display my graphical layout along with my code.Is it possible?? if it is possible means how?</p>","607853","","379693","","2011-03-02 04:00:31","2011-03-02 04:00:31","how can i Take snapshots of my Android application/Layout","<android>","1","4","","",""
"5028588","1","","","2011-02-17 11:54:45","2","2761","<p>In my Android app I declare a custom view in a separate XML file.</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout android:id=""@+id/download_interval_setter"" android:layout_width=""wrap_content""android:layout_height=""wrap_content""xmlns:android=""http://schemas.android.com/apk/res/android""android:orientation=""vertical""&gt;&lt;Button     android:layout_height=""wrap_content""      android:layout_width=""wrap_content""     android:id=""@+id/Button_interval_up""    style=""?android:attr/buttonStyleSmall""&gt;&lt;/Button&gt;&lt;EditText     android:id=""@+id/Download_interval""     android:layout_width=""wrap_content""     android:layout_height=""wrap_content""    android:text=""1""    android:numeric=""integer""&gt;&lt;/EditText&gt;&lt;Button     android:id=""@+id/Button_interval_down""    style=""?android:attr/buttonStyleSmall""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    &gt;&lt;/Button&gt;&lt;/LinearLayout&gt;</code></pre><p>Then I have my main.xml file where I would like to include the view declared in above XML like 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""&gt;&lt;ToggleButton android:layout_height=""wrap_content""         android:id=""@+id/XMLStart""         android:textOn=""@string/auto_update_on""        android:textOff=""@string/auto_update_off""         android:layout_width=""wrap_content"" /&gt;&lt;include layout=""@layout/download_interval_setter""        android:layout_toRightOf=""@id/XMLStart""/&gt;&lt;Button android:layout_height=""wrap_content""         android:id=""@+id/ShowRadars""         android:text=""@string/show_radars""         android:layout_width=""wrap_content""         android:layout_below=""@id/XMLStart""/&gt;       &lt;Button android:layout_height=""wrap_content""         android:id=""@+id/ShowAccidents""         android:text=""@string/show_accidents""         android:layout_width=""wrap_content""         android:layout_toRightOf=""@id/ShowRadars""        android:layout_below=""@id/XMLStart""/&gt;&lt;Button android:layout_height=""wrap_content""         android:id=""@+id/ShowConstraints""         android:text=""@string/show_constraints""         android:layout_width=""wrap_content""         android:layout_below=""@id/ShowRadars""/&gt;     &lt;Button android:layout_height=""wrap_content""         android:id=""@+id/ShowPatrols""         android:text=""@string/show_patrols""         android:layout_width=""wrap_content""         android:layout_below=""@id/ShowRadars""        android:layout_toRightOf=""@id/ShowConstraints""/&gt;    &lt;/RelativeLayout&gt;</code></pre><p>As you can see I am trying to set the layout_toRightOf attribute of the included view but it is not set, as I can see also in hierarchyviewer</p><p>On the other hand if I simply copy-paste the content of the download_interval_setter.xml file to main.xml and declare the layout_toRightOf parameter there , the view will be positioned to right of as I want.</p><p>Where am I going wrong?Thanks</p>","621327","","","","","2011-02-17 13:41:23","setting layout attribute for include","<android><android-layout>","2","0","","",""
"5028697","1","","","2011-02-17 12:06:10","0","99","<p>Consider am having 2 applications named first and second. The first applications has activity A the second applications has activity B. Initially Activity A of first application is launched and later second application will be launched from the activity A of the first application. Activity A of the first application has a count down timer. Once the timer hits How can i bring the activity A, being the application second is in visible ? </p><p>Thanks in advance.</p>","617510","","","","","2011-02-17 12:57:35","How to bring my application activity if another application is in visible?","<android>","2","0","","",""
"5028829","1","5029145","","2011-02-17 12:18:44","2","2686","<p>I'm rendering 3 different polygons with the same smiley texture.The texture is a yellow circle put on a transparent background.</p><p>My issue is that if i put a smiley that is drawn earlier in front of another that is drawn later it will make the one drawn later transparent where the early ones background is transparent.</p><p>Well a picture is worth a thousand words!See Image of the problem and the smiley png <a href=""https://sites.google.com/site/chrsin/stackoverflow/android-opengl-transparency-issues"" rel=""nofollow"">here</a>.</p><p>The issue doesn't occur if i put the lastly drawn smiley in front of the other, so the issue seems to be related to the drawing order. Anyone have any input?</p><pre><code>public void onSurfaceCreated(GL10 gl, EGLConfig eglConfig) {    //Textures a loaded here See next section for the implementation of loadTextures method on the polygon class.    loadTextures(gl, context);    gl.glEnable(GL10.GL_TEXTURE_2D);    gl.glShadeModel(GL10.GL_SMOOTH);    gl.glClearColor(.5f, .5f, .5f, 1);    gl.glEnable(GL10.GL_DEPTH_TEST);    gl.glHint(GL10.GL_PERSPECTIVE_CORRECTION_HINT, GL10.GL_FASTEST);    gl.glEnable(GL10.GL_BLEND);    gl.glBlendFunc(GL10.GL_ONE, GL10.GL_ONE_MINUS_SRC_ALPHA);}public void onSurfaceChanged(GL10 gl, int w, int h) {    if(h == 0) {        h = 1;    }    gl.glViewport(0, 0, w, h);    gl.glMatrixMode(GL10.GL_PROJECTION);    gl.glLoadIdentity();    float ratio = (float) w / h;    gl.glFrustumf(-ratio, ratio, -1, 1, 1, 30);    GLU.gluLookAt(gl, lookEyeX, lookEyeY, lookEyeZ, lookCenterX, lookCenterY, lookCenterZ, lookUpX, lookUpY, lookUpZ);    gl.glMatrixMode(GL10.GL_MODELVIEW);    gl.glLoadIdentity();}public void onDrawFrame(GL10 gl) {          gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT);    gl.glLoadIdentity();    gl.glEnableClientState(GL10.GL_VERTEX_ARRAY);    gl.glEnableClientState(GL10.GL_TEXTURE_COORD_ARRAY);    draw(gl);}</code></pre><p>Implementation of the loadTexture method</p><pre><code>public void loadTextures(GL10 gl, Context context) {    if(bitmap == 0) {        return;    }    //Get the texture from the Android resource directory    InputStream is = context.getResources().openRawResource(bitmap);    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 one texture pointer...    gl.glGenTextures(1, textureIDs, 0);    //...and bind it to our array    gl.glBindTexture(GL10.GL_TEXTURE_2D, textureIDs[0]);    //Create Nearest Filtered Texture    gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MIN_FILTER, GL10.GL_NEAREST);    gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MAG_FILTER, GL10.GL_LINEAR);    //Different possible texture parameters, e.g. GL10.GL_CLAMP_TO_EDGE    gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_WRAP_S, GL10.GL_CLAMP_TO_EDGE);    gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_WRAP_T, GL10.GL_CLAMP_TO_EDGE);    //Use the Android GLUtils to specify a two-dimensional texture image from our bitmap    GLUtils.texImage2D(GL10.GL_TEXTURE_2D, 0, bitmap, 0);    //Clean up    bitmap.recycle();}</code></pre>","473140","","190309","","2014-03-11 03:20:32","2014-03-11 03:20:32","Android opengl transparency issues","<android><opengl-es><background><transparent>","2","1","4","",""
"5028830","1","5029065","","2011-02-17 12:18:50","11","25386","<p>I do not need to display a map.  However, I need to use the gps/3g network to locate my current positions ADDRESS (not long and lat) this will then be added to a automated sms response to inform a person that I currently cant reply, &amp; the include the string address of my current location.I have the sms stuff working, just need to figure out a method of accessing the gps and pulling an address. I have seen sample code for lat/long.  Perhaps I need to convert lat/long into an address within the google maps API? I am unsure howto go about it.Any advice/code snippets/similar tutorials welcome! Thanks. :)</p>","600423","","1048862","","2013-04-29 05:12:07","2013-11-04 13:16:53","Get current location address for android app","<android><gps><location><reverse-geocoding>","3","0","12","",""
"5028966","1","5029007","","2011-02-17 12:34:05","1","13339","<p>How do I center a button and make it so it is 10px off of each side. Basicly 100% wide minus 10px on the left and right.</p>","614460","","","","","2011-02-17 12:57:47","Android Center Buttons","<android>","3","0","1","",""
"5028972","1","5039480","","2011-02-17 12:34:33","0","112","<p>I wonder, is it possible to create a <code>Service</code>, set some data, and then start it? I haven't come across a thread specific to this problem, so I would like to know if it is possible (if it is known of course).</p><p>My problem is that I have a <code>Service</code> which listens to a <code>DatagramSocket</code>, but the socket in question needs to be set after creation, but before the start of the <code>Service</code>. The setting of the socket happens through the use of a <code>Broadcast</code> (I broadcast 2 <code>Strings</code> which hold the IP-Address &amp; Port and the <code>BroadcastReceiver</code> then constructs a socket for me).</p><p>When the <code>Service</code> is started, a <code>Thread</code> will start to run and listen to the supposedly created socket. This, sadly, doesn't happen. The socket will remain <code>null</code> and I can't set it when the <code>Thread</code> is running (This is another issue I hope to tackle in the future, if anybody got any ideas about this, please notify me).</p><p>So, is what I want possible, or should I come up with another construct for achieving this goal?</p>","603059","","","","","2011-02-18 15:21:54","Is it possible to creating a Service without starting it?","<android>","3","0","","",""
"5028981","1","5030476","","2011-02-17 12:35:09","3","4244","<p>like the subject implies, I would like to programmatically change/set a <a href=""http://en.wikipedia.org/wiki/Font#Weight"" rel=""nofollow"">font weight</a> for an arbitrary font.</p><p>Edit: I mean on a font for drawing strings in general.</p><p>Thanks for any info.</p>","116622","","116622","","2011-02-17 13:27:21","2011-02-17 17:03:03","How to set a custom font weight?","<android><fonts>","1","1","","",""
"5029097","1","5045103","","2011-02-17 12:47:07","3","888","<p>I have json with field that contains two different types. </p><pre><code>""fields"":[{""value"":""ZIELONE OKO""},{""value"":{""@nil"":""true""}}]</code></pre><p>I have problem with deserializing these. My class with model contains:</p><pre><code>private String value;</code></pre><p>And I simply need to translate {""@nil"":""true""} into null. Right now I get error:</p><pre><code>The JsonDeserializer StringTypeAdapter failed to deserialized json object {""@nil"":""true""} given the type class java.lang.String</code></pre><p>Any ideas how to resolve that?</p>","611319","","611319","","2011-02-18 15:16:52","2011-02-18 18:25:42","Parsing json where field can have two diffrent types with gson or jackson","<android><json><gson><jackson><deserialization>","1","0","","",""
"5029183","1","5029367","","2011-02-17 12:56:20","10","23011","<p>I am figuring out a way to replace the default dialer application from my custom dialer application, but I am not getting how to achieve this.</p><p>Here is what I want</p><ul><li>Create a custom dialer UI</li><li>My application is called whenever call button hardware or that one in Android is pressed</li><li>The application can also be called from the contact screen</li></ul><p>I am referring to *<a href=""http://developer.android.com/reference/android/content/Intent.html#ACTION_DIAL"" rel=""nofollow"">public static final String ACTION_DIAL</a>*.</p>","517247","","63550","","2012-09-11 20:12:25","2013-01-24 21:05:14","Android dialer application","<android><call>","3","0","13","",""
"5029209","1","5029296","","2011-02-17 12:57:50","0","1617","<p>In my application I must update a seek bar. As I understand, if I'm using the handler I don't need to use another thread. The problem is that the handleMessage method gets called only once. Here is my sample code.</p><pre><code>private Handler mHandler = new Handler() {    @Override    public void handleMessage(Message msg) {        int pos;        pos = setProgress();        if (mVideoView.isPlaying()) {            System.out.println(""__handleMessage__isPlaying"");            Message msg1 = obtainMessage(REPORT_MSG);            sendMessageDelayed(msg1, 1000 - (pos % 1000));        }    }};private int setProgress() {    SeekBar mProgress = (SeekBar) findViewById(R.id.progress);    if (mVideoView == null) {        return 0;    }    int position = mVideoView.getCurrentPosition();    int duration = mVideoView.getDuration();    if (mProgress != null) {        if (duration &gt; 0) {            // use long to avoid overflow            long pos = 1000L * position / duration;            mProgress.setProgress( (int) pos);        }        int percent = mVideoView.getBufferPercentage();        mProgress.setSecondaryProgress(percent * 10);    }    return position;}</code></pre><p>Thanks a lot,</p><p>Gratzi</p>","460611","","","","","2011-02-17 13:04:25","Updating a seekbar using a handler","<android>","1","0","","",""
"5029211","1","5029359","","2011-02-17 12:57:58","3","1274","<p>I am using the following function to check network connectivity but application crashes when wifi status is swapped</p><pre><code>    public static boolean isNetworkAvailable(Context context) {    ConnectivityManager connec = (ConnectivityManager) context    .getSystemService(Context.CONNECTIVITY_SERVICE);    NetworkInfo netInfo = connec.getActiveNetworkInfo();    if (netInfo != null &amp;&amp; netInfo.isConnected() == true) {        return true;    }    return false;}</code></pre>","450487","","","","","2011-02-17 15:20:31","Android app crash when first network is switched off and then switched on","<android><connectivity>","2","5","1","",""
"5029320","1","","","2011-02-17 13:06:55","4","1144","<p>Can I load preferences.xml without extending PreferenceActivity? I need this because:</p><ol><li>I want custom title bar</li><li>I want all of my Activities to extend my AbstractActivity</li></ol>","243225","","243225","","2011-02-17 17:15:04","2011-02-17 17:15:04","Load preferences.xml without extending PreferenceActivity","<android>","2","3","1","",""
"5029346","1","5029397","","2011-02-17 13:09:24","0","1739","<p>I try to send the data from my application to server in xml format in android , any one could suggest some method and example to post the data to server.</p><p>Thanks.</p>","555806","","","","","2011-02-17 13:14:18","Posting XML data to server from android?","<android><xml><android-xml>","1","0","1","",""
"5029354","1","15582509","","2011-02-17 13:09:50","11","6315","<p>I've searched everywhere, but can't find anything in the SDK or on Google on how to do this. I know it's possible because all the custom launchers are able to do it via a button press (LauncherPro, ADW, etc).</p><p>Thanks.</p>","496854","","194894","","2014-02-06 11:26:19","2014-02-06 11:26:44","How can I programmatically open/close notifications in Android?","<android><android-notification-bar>","4","2","8","",""
"5029387","1","","","2011-02-17 13:13:03","0","825","<p>I have several text views that take up the majority of the screen in landscape view in a relativelayout and the font size i have set is quite big (150dp). The text views are all timers and the furthest to the right is the ""seconds"" textview. </p><p>My problem is that when testing on a phone with a small screen res the seconds are way outside the limit of the screen and can't be seen. They are in perfect place on normal to large screen resolutions just not on a small screen.</p><p>Is there any way i can force the ""seconds"" text view to stay on screen, without adjusting the font size or margins between each text view? Even if it means looking cramped on a small screen i can live with that.</p><p>Any help is greatly appreciated.</p><p>Thanks</p><p>This is the corresponding code for the relative layout and linear layout containing the hour and minute text views</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""       android:keepScreenOn=""true"" android:background=""@drawable/background2""&gt;&lt;RelativeLayout android:id=""@+id/RelativeLayout08""android:paddingLeft=""20dip"" android:paddingRight=""30dip""android:background=""@drawable/trans_img"" android:layout_centerHorizontal=""true"" android:paddingBottom=""20dip"" android:layout_centerVertical=""true"" android:layout_height=""wrap_content"" android:layout_width=""wrap_content""&gt;&lt;LinearLayout android:id=""@+id/LinearLayout01""android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:layout_centerVertical=""true""&gt;&lt;TextView android:id=""@+id/TextViewHr1"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:layout_marginRight=""5dip"" android:gravity=""right"" android:textColor=""@color/white"" android:textSize=""150dp"" android:layout_marginLeft=""5dip""&gt;&lt;/TextView&gt;&lt;TextView android:id=""@+id/TextViewHr2"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:layout_marginLeft=""5dip"" android:layout_marginRight=""5dip"" android:gravity=""right"" android:textColor=""@color/white"" android:textSize=""150dp""&gt;&lt;/TextView&gt;&lt;TextView android:id=""@+id/TextViewSeperate"" android:layout_width=""wrap_content"" android:layout_marginLeft=""5dip"" android:layout_marginRight=""5dip"" android:layout_gravity=""center_vertical"" android:background=""@drawable/colon"" android:layout_height=""55dip""&gt;&lt;/TextView&gt;&lt;TextView android:id=""@+id/TextViewMin1"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:layout_marginLeft=""5dip"" android:layout_marginRight=""5dip"" android:gravity=""right"" android:textColor=""@color/white"" android:textSize=""150dp""&gt;&lt;/TextView&gt;&lt;TextView android:id=""@+id/TextViewMin2"" android:layout_height=""wrap_content"" android:layout_marginLeft=""5dip""android:gravity=""right"" android:layout_width=""wrap_content"" android:textColor=""@color/white"" android:textSize=""150dp"" android:layout_marginRight=""5dip""&gt;&lt;/TextView&lt;/LinearLayout&gt;</code></pre><p>This is the code for the 2nd linear layout, within this relative layout 8:</p><pre><code>&lt;LinearLayout android:id=""@+id/LinearLayout02""android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:orientation=""vertical"" android:layout_centerVertical=""true""android:layout_toRightOf=""@+id/LinearLayout01"" android:layout_marginLeft=""20dip""&gt;&lt;TextView android:id=""@+id/TextViewSeconds"" android:layout_height=""wrap_content"" android:text=""20"" android:layout_marginTop=""5dip"" android:textColor=""@color/white"" android:textSize=""55dip"" android:layout_width=""wrap_content""&gt;&lt;/TextView&gt;</code></pre>","581949","","581949","","2011-02-21 16:19:35","2011-02-21 16:19:35","Android font out of view on small screen","<android><textview><font-size><fit><screen-size>","1","0","","",""
"5029398","1","","","2011-02-17 13:14:21","0","1565","<p>I'm trying to add MapView to one of my application.View with correct mapView is added.Permissions in Manifest are also following rules.Project compiles with out a problem.Library with maps is added.</p><p>But I'm still receiving this error.</p><p>Anyone had same problem and found a solution?</p><p>If you need more data, just let me know.</p><pre><code>02-17 14:16:22.196: WARN/dalvikvm(20884): Unable to resolve superclass of Lnet/gynsoft/citydusseldorf/MapViewController; (27)02-17 14:16:22.196: WARN/dalvikvm(20884): Link of class 'Lnet/gynsoft/citydusseldorf/MapViewController;' failed02-17 14:16:22.204: ERROR/dalvikvm(20884): Could not find class 'net.gynsoft.citydusseldorf.MapViewController', referenced from method net.gynsoft.citydusseldorf.startActivity$5.onClick02-17 14:16:22.204: WARN/dalvikvm(20884): VFY: unable to resolve const-class 121 (Lnet/gynsoft/citydusseldorf/MapViewController;) in Lnet/gynsoft/citydusseldorf/startActivity$5;</code></pre>","186268","","","","","2012-01-06 00:04:32","Problem with resolving superclass of a MapView (""Could not find class"" problem)","<android><eclipse><android-manifest>","3","5","","",""
"5029497","1","5029553","","2011-02-17 13:22:59","3","571","<p>i am newer to android. i want to develop 2D game in android.</p><p>1) i want sample program or some idea for get boundry position of bitmap......</p><p>2)  i want to some link about game development in android for preparly.</p><p>3) Mostly i want to draw some thing by using canvas method. so try to provide some material related to canvas method in android.</p>","561208","","","","","2011-02-17 13:28:47","android program for get all boundry position of bitmap","<android><graphics><canvas>","1","0","2","",""
"5029645","1","5029768","","2011-02-17 13:36:41","0","501","<p>I want to show all the data from the database in a View. <code>addview</code> to the layout is a good idea. But as I don't know the no. of data, I cann't create required no. of textview, and i cann't add a single textview multiple number of time. How can I solve this problem?</p>","525004","","","","","2011-02-17 13:49:45","Android tabluar data from database","<android><database><tabular>","2","0","","",""
"5029729","1","5029762","","2011-02-17 13:45:25","4","9553","<p>This is a very simple example where I have a single ScrollView defined in R.layout.main.  Then I try to dynamically add a TextView to it.</p><p>Unfortunately this crashes.</p><pre><code>ScrollView scroll = (ScrollView) this.findViewById(R.id.scrollView1);TextView tv1 = new TextView(this);tv1.setText(""This is tv1"");scroll.addView(tv1);setContentView(R.layout.main);</code></pre><p>Now I <em>can</em> do something like this:</p><pre><code>ScrollView scroll = new ScrollView(this);TextView tv1 = new TextView(this);tv1.setText(""This is tv1"");scroll.addView(tv1);setContentView(scroll);</code></pre><p>But I'd really like to be able to define some base UI elements in XML, then dynamically add others.</p><p>What's the best way to do that?</p>","305","","","","","2013-06-14 17:04:16","Trying to dynamically add a TextView to a ScrollView crashes when using an XML layout","<android>","6","13","2","",""
"5029775","1","5030039","","2011-02-17 13:50:08","0","5589","<p>Hey guysI am trying to build a signature task application .In which the user will create the signature on touch and that bitmap should be saved in the phone.I have created 2 class files one having the custom view the same as the one in fingerpaint application and calling the view in main.xml file.</p><p>In my main application class file i have menu button which on click saves the bitmap in sdcard . The following is the code :-</p><pre><code>package org.testCircle;import android.app.Activity;import android.graphics.Bitmap;import android.graphics.Canvas;import android.os.Bundle;import android.provider.MediaStore.Images;import android.view.Menu;import android.view.MenuItem;import android.widget.TextView;import android.widget.Toast;public class testCircle extends Activity {    TextView tv;    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        //setContentView(new customView(this));        setContentView(R.layout.main);    }    public boolean onCreateOptionsMenu(Menu menu) {        super.onCreateOptionsMenu(menu);        menu.add(0, 1, 0, ""save"").setShortcut('3', 'c');        return true;    }    public boolean onPrepareOptionsMenu(Menu menu) {        super.onPrepareOptionsMenu(menu);        return true;    }    @Override    public boolean onOptionsItemSelected(MenuItem item) {        switch (item.getItemId()) {        case 1:            //new ColorPickerDialog(this, this, mPaint.getColor()).show();            fingerPaint cv = new fingerPaint(this);            Bitmap viewBitmap = Bitmap.createBitmap(480, 800,Bitmap.Config.ARGB_8888);            Canvas canvas = new Canvas(viewBitmap);            cv.draw(canvas);            String url = Images.Media.insertImage(getContentResolver(), viewBitmap, ""title"", null);            Toast.makeText(testCircle.this, url, Toast.LENGTH_LONG).show();            return true;    }        return super.onOptionsItemSelected(item);}}</code></pre><p><strong>Custom  View  :-</strong></p><pre><code>package org.testCircle;import android.content.Context;import android.graphics.Bitmap;import android.graphics.Canvas;import android.graphics.Paint;import android.graphics.Path;import android.os.Bundle;import android.util.AttributeSet;import android.view.MotionEvent;import android.view.View;public class fingerPaint extends View {    Paint mPaint;    private static final float MINP = 0.25f;    private static final float MAXP = 0.75f;    private static Bitmap  mBitmap;    private Canvas  mCanvas;    private Path    mPath;    private Paint   mBitmapPaint;    public fingerPaint(Context c) {        super(c);        mPaint = new Paint();        mPaint.setAntiAlias(true);        mPaint.setDither(true);        mPaint.setColor(0xFFFF0000);        mPaint.setStyle(Paint.Style.STROKE);        mPaint.setStrokeJoin(Paint.Join.ROUND);        mPaint.setStrokeCap(Paint.Cap.ROUND);        mPaint.setStrokeWidth(12);        mBitmap = Bitmap.createBitmap(320, 480, Bitmap.Config.ARGB_8888);        mCanvas = new Canvas(mBitmap);        mPath = new Path();        mBitmapPaint = new Paint(Paint.DITHER_FLAG);    }    public fingerPaint(Context c , AttributeSet attrs){        super(c , attrs);         mPaint = new Paint();         mPaint.setAntiAlias(true);         mPaint.setDither(true);         mPaint.setColor(0xFFFF0000);         mPaint.setStyle(Paint.Style.STROKE);         mPaint.setStrokeJoin(Paint.Join.ROUND);         mPaint.setStrokeCap(Paint.Cap.ROUND);         mPaint.setStrokeWidth(12);         mBitmap = Bitmap.createBitmap(320, 480, Bitmap.Config.ARGB_8888);         mCanvas = new Canvas(mBitmap);         mPath = new Path();         mBitmapPaint = new Paint(Paint.DITHER_FLAG);    }    public void onerase(){        mCanvas=null;    }    @Override    protected void onSizeChanged(int w, int h, int oldw, int oldh) {        super.onSizeChanged(w, h, oldw, oldh);    }    @Override    protected void onDraw(Canvas canvas) {        canvas.drawColor(0xFFAAAAAA);        canvas.drawBitmap(mBitmap, 0, 0, mBitmapPaint);        canvas.drawPath(mPath, mPaint);    }    private float mX, mY;    private static final float TOUCH_TOLERANCE = 4;    private void touch_start(float x, float y) {        mPath.reset();        mPath.moveTo(x, y);        mX = x;        mY = y;    }    private void touch_move(float x, float y) {        float dx = Math.abs(x - mX);        float dy = Math.abs(y - mY);        if (dx &gt;= TOUCH_TOLERANCE || dy &gt;= TOUCH_TOLERANCE) {            mPath.quadTo(mX, mY, (x + mX)/2, (y + mY)/2);            mX = x;            mY = y;        }        mCanvas.drawBitmap(mBitmap, mX, mY, mPaint);    }    private void touch_up() {        mPath.lineTo(mX, mY);        // commit the path to our offscreen        mCanvas.drawPath(mPath, mPaint);        // kill this so we don't double draw        mPath.reset();    }    @Override    public boolean onTouchEvent(MotionEvent event) {        float x = event.getX();        float y = event.getY();        switch (event.getAction()) {            case MotionEvent.ACTION_DOWN:                touch_start(x, y);                invalidate();                break;            case MotionEvent.ACTION_MOVE:                touch_move(x, y);                invalidate();                break;            case MotionEvent.ACTION_UP:                touch_up();                invalidate();                Bundle b = new Bundle();                break;        }        return true;    }}</code></pre>","520141","","491044","","2011-03-11 08:39:34","2013-03-18 13:56:09","Save the image made by user in fingerPaint api demos in android","<android><canvas><bitmap>","3","2","2","",""
"5030001","1","","","2011-02-17 14:09:29","0","964","<p>Hello allI have a Desire Z Android 2.2 English with psysical keyboard.I need to have three local characters on the physical keyboard.I can certainly access them via longpress and choose on touch screen but it kills the flow when texting and writing email.1. Can I change Android OS from English to another language in the next update?2. If not, can I modify the file data in the system, so that I remap three unused keys to what I want to have?3. Do you have any other way to go about it?Kind rgds</p>","621527","","387076","","2012-05-12 20:31:39","2012-05-12 20:31:39","How to remap physical keyboard, or to change Android OS to another language","<keyboard><android>","1","1","","",""
"5030066","1","","","2011-02-17 14:14:27","0","406","<p>I have a problem when I try to update my persistences objects.</p><p>I retrive my objects using.</p><pre><code>objectContainer.query(myObject);</code></pre><p>modified and save again using:</p><pre><code>objectContainer.store(myObject);</code></pre><p>But this object don't update, just save another object.</p><p>I tried get object using:</p><p>long idObject = objectContainer.ext().getID(myObject);</p><pre><code>objectContainer.ext().getById(idObject);</code></pre><p>But ocurred same problem.Somebody know whats happens?</p><p>Thanks, sorry my english.</p>","621501","","","","","2011-02-17 15:58:19","Problems with DB4O on Android - Update objects","<java><android><db4o>","1","1","","",""
"5030068","1","","","2011-02-17 14:14:33","0","809","<pre><code>private void listData() {    SimpleCursorAdapter list = new SimpleCursorAdapter(            this,            R.layout.wordsee_row,            cursor,            new String[] {DBAdapter.KEY_LANG,DBAdapter.KEY_WORD_TH, DBAdapter.KEY_WORD, DBAdapter.KEY_WORD_READING},            new int[] {R.id.lang, R.id.th_word, R.id.word, R.id.reading});    setListAdapter(list);    db.close();}</code></pre><p>from above each list contain 4 items (id.lang, id.th_word, id.word, id.reading)</p><p>and I want to remove it by use primary key (KEY_WORD_SEE_ID ) like this</p><pre><code>case DELETE_ID:{            db.open();            db.deleteRecord(DBAdapter.WORDS_SEE_TABLE,DBAdapter.KEY_WORD_SEE_ID,cursor.getLong(cursor.getColumnIndexOrThrow(DBAdapter.KEY_WORD_SEE_ID)));            Toast.makeText(getBaseContext(), getString(R.string.save_data), Toast.LENGTH_LONG).show() ;            setBinding();            listData();            return true;        }</code></pre><p>and this is my delete function</p><pre><code>public boolean deleteRecord(String tableName, String indicatorName,        long rowId) {    return db.delete(tableName, indicatorName + ""="" + rowId, null) &gt; 0;}</code></pre><p>but it doesn't work and no force close</p><p>what should I do?</p>","605358","","","","","2011-02-17 14:24:01","How to remove item from list item?","<android><listview>","1","1","","",""
"5030087","1","5031717","","2011-02-17 14:16:40","1","271","<p>I am using <a href=""http://code.google.com/a/eclipselabs.org/p/m2eclipse-android-integration/"" rel=""nofollow"">m2eclipse-android-integration</a> version 0.2.5 (and all the required plugins) on eclipse helios. I like to use this plugin because it puts all maven dependencies in the generated apk file.</p><p>But, on each code change (save) eclipse runs in a ""Building Workspace..."" operation which takes really a long time. I am runnig my eclipse with <code>-Xmx1024m</code> and also generated a fresh workspace for my android project. It does not help :-(</p><p>After uninstalling the plugin a save operation also results in ""Building Workspace..."" but that takes just a second.</p><p>It must be possible to work with the plugin without this performance issue (and still having ""Build automatically..."" enabled). Does anybody know how?</p><p>Thanks Klaus</p>","367285","","","","","2011-02-27 12:50:46","bad m2eclipse-android-integration plugin performance","<android><eclipse><maven>","2","0","","",""
"5030094","1","15015687","","2011-02-17 14:17:11","7","3238","<p>In an answer to a previous question of mine someone indicated that there is some flakiness (for lack of a better word) inherent in the Android class UriMatcher. Can anyone pinpoint the known issues with UriMatcher? I'm designing a Content Provider that relies on UriMatcher to match my Uris correctly (as opposed to incorrectly I suppose). Are there workarounds to the known issues? Or is there a better strategy for matching Uris? </p><p>Example:</p><p>Here is the code setting my UriMatcher</p><pre><code>private static final int MEMBER_COLLECTION_URI = 1;private static final int MEMBER_SINGLE_URI = 2;private static final int SUBMATERIAL_COLLECTION_URI = 3;private static final int SUBMATERIAL_SINGLE_URI = 4;private static final int JOBNAME_COLLECTION_URI = 5;private static final int JOBNAME_SINGLE_URI = 6;private static final int ALL_MEMBERS_URI = 7;private static final int ALL_SUBMATERIAL_URI = 8;static{        //return the job and fab for anything matching the provided jobName        // JobNames/jobName        uriMatcher.addURI(JobMetaData.AUTHORITY, ""JobNames/*/"",                          JOBNAME_SINGLE_URI);        //return a collection of members        // jobName/member/attribute/value        uriMatcher.addURI(JobMetaData.AUTHORITY, ""*/member/*/*/"",                          MEMBER_COLLECTION_URI);        //return a single member        // jobName/member/memberNumber        uriMatcher.addURI(JobMetaData.AUTHORITY, ""*/member/*/"",                          MEMBER_SINGLE_URI);        //return a collection of submaterial        // jobName/submaterial/attribute/value        uriMatcher.addURI(JobMetaData.AUTHORITY, ""*/submaterial/*/*"",                          SUBMATERIAL_COLLECTION_URI);        //return a single piece of submaterial        // jobName/submaterial/GUID        //GUID is the only way to uniquely identify a piece of submaterial            uriMatcher.addURI(JobMetaData.AUTHORITY, ""*/submaterial/*"",                          SUBMATERIAL_SINGLE_URI);        //Return everything in the member and submaterial tables        //that has the provided attribute that matches the provided value        // jobName/attribute/value        //not currently used        uriMatcher.addURI(JobMetaData.AUTHORITY, ""JobNames/"",                          JOBNAME_COLLECTION_URI);        //return all members in a job        uriMatcher.addURI(JobMetaData.AUTHORITY, ""*/members/"",                          ALL_MEMBERS_URI);}</code></pre><p>Add another Uri:</p><pre><code>private static final int MEMBER_COLLECTION_URI = 1;private static final int MEMBER_SINGLE_URI = 2;private static final int SUBMATERIAL_COLLECTION_URI = 3;private static final int SUBMATERIAL_SINGLE_URI = 4;private static final int JOBNAME_COLLECTION_URI = 5;private static final int JOBNAME_SINGLE_URI = 6;private static final int ALL_MEMBERS_URI = 7;private static final int ALL_SUBMATERIAL_URI = 8;//ADDITIONAL URIprivate static final int REVERSE_URI = 9;static{        //return the job and fab for anything matching the provided jobName        // JobNames/jobName        uriMatcher.addURI(JobMetaData.AUTHORITY, ""JobNames/*/"",                          JOBNAME_SINGLE_URI);        //return a collection of members        // jobName/member/attribute/value        uriMatcher.addURI(JobMetaData.AUTHORITY, ""*/member/*/*/"",                          MEMBER_COLLECTION_URI);        //return a single member        // jobName/member/memberNumber        uriMatcher.addURI(JobMetaData.AUTHORITY, ""*/member/*/"",                          MEMBER_SINGLE_URI);        //return a collection of submaterial        // jobName/submaterial/attribute/value        uriMatcher.addURI(JobMetaData.AUTHORITY, ""*/submaterial/*/*"",                          SUBMATERIAL_COLLECTION_URI);        //return a single piece of submaterial        // jobName/submaterial/GUID        //GUID is the only way to uniquely identify a piece of submaterial            uriMatcher.addURI(JobMetaData.AUTHORITY, ""*/submaterial/*"",                          SUBMATERIAL_SINGLE_URI);        //Return everything in the member and submaterial tables        //that has the provided attribute that matches the provided value        // jobName/attribute/value        //not currently used        uriMatcher.addURI(JobMetaData.AUTHORITY, ""JobNames/"",                          JOBNAME_COLLECTION_URI);        //return all members in a job        uriMatcher.addURI(JobMetaData.AUTHORITY, ""*/members/"",                          ALL_MEMBERS_URI);        //ADDITIONAL URI        uriMatcher.addURI(JobMetaData.AUTHORITY, ""*/reverse/*"",                          REVERSE_URI);}</code></pre><p>And the last Uri is not recognized using:    uriMatcher.match(uri)</p><p>On the previous question (mentioned earlier) it was recommended that I move the offending Uri to the top of the calls to UriMatcher.put(String, int). That solved the previous problem (and left me with a bad taste in my mouth). Trying the same solution with this code results in the current first Uri (JOBNAME_SINGLE_URI) going unrecognized. I'm fairly sure that the issue isn't in my code (I've managed to create a working ContentProvider utilizing Uris and debug all of the problems with them prior to this issue), but rather is an issue with Uri matching in Android.</p><p>UPDATE: </p><pre><code>public final static String AUTHORITY = ""dsndata.sds2mobile.jobprovider"";</code></pre><p>Sample Uri:<br>    content://dsndata.sds2mobile.jobprovider/SDS2MobileDemo/reverse/C_1</p>","543677","","543677","","2011-03-24 20:23:46","2013-02-22 02:06:39","Problems with Android's UriMatcher ","<android><uri><android-contentprovider>","4","6","2","",""
"5030150","1","5030395","","2011-02-17 14:21:38","0","540","<p>I have an application that contains a main Activity, which has a very simple screen with all application setup options and a few user selections.  The main screen buttons start other Activities.</p><p>(1) I'm now implementing a bluetooth scanner into the application and i would like to be able to edit settings and establish a bluetooth connection on the main Activity and pass that connection (via Bundle or Parcelable perhaps?) to the other Activities.</p><p>I looked up Bundle as a way to pass the connection, but it appears to only accept primitive and basic types as values.  I noticed Intent.putExtra(String, Parcelable) was available, but Parcel sort of confused me.  What would be the best way to implement this, or is it even possible?</p><p>some relevant code:</p><pre><code>//subclass definitions for the Runnables which start the applications in their own threadsprivate final Handler smsHandler = new Handler();private final Handler smsOutHandler = new Handler();private final Runnable smsIntentRunnable = new Runnable() {    public void run() {        Intent smsIntent = new Intent(smsMobile.this, smsActivity.class);        startActivity(smsIntent);    }};private final Runnable smsOutIntentRunnable = new Runnable() {    public void run() {        Intent smsOutIntent = new Intent(smsMobile.this, smsOutActivity.class);        startActivity(smsOutIntent);    }};//button listeners located in onCreate(), which start the ActivitiesnewTicket.setOnClickListener(new View.OnClickListener() {    public void onClick(View v) {        smsHandler.post(smsIntentRunnable);    }});updateTicket.setOnClickListener(new View.OnClickListener() {    public void onClick(View v) {        smsOutHandler.post(smsOutIntentRunnable);    }});</code></pre><p>(2) Could I also pass a database connection?  I understand that SQLiteOpenHelper must be subclassed, which could complicate IPC, but thought it might still be possible somehow?</p>","329993","","1280410","","2012-05-03 16:32:11","2013-07-16 07:12:15","passing a Bluetooth connection to a new Activity","<java><android><multithreading><sqlite><interprocess>","2","0","","",""
"5030404","1","5030484","","2011-02-17 14:44:12","4","1496","<p>I am having a problem with the following bit of code.  I am trying to match a string.  When I have a match everything works perfectly.  When it does not find a match it throws an exception and causes a force close.</p><hr><p>Code Snippet</p><pre><code>private void validatePhoneNumberFormat(String t){    Pattern p = Pattern.compile(""^Match this exactly!$"");    Matcher m = p.matcher(t);        m.find();    if (m.group(0) != """"){        this.myString = m.group(0);        this.setIsValid(true);        this.setStatus(0);    } else {        this.myString = ""Invalid Input String"";        this.setIsValid(false);        this.setStatus(99); //  String parsing error    }}</code></pre><hr><p>LogCat</p><pre><code>02-17 14:12:10.562: WARN/dalvikvm(3854): threadid=1: thread exiting with uncaught exception (group=0x40015560)02-17 14:12:11.322: ERROR/AndroidRuntime(3854): FATAL EXCEPTION: main02-17 14:12:11.322: ERROR/AndroidRuntime(3854): java.lang.IllegalStateException: No successful match so far02-17 14:12:11.322: ERROR/AndroidRuntime(3854):     at java.util.regex.Matcher.ensureMatch(Matcher.java:607)02-17 14:12:11.322: ERROR/AndroidRuntime(3854):     at java.util.regex.Matcher.group(Matcher.java:358)02-17 14:12:11.322: ERROR/AndroidRuntime(3854):     at com.android.example.RegExTest.MyList.validateMyStringFormat(MyList.java:47)02-17 14:12:11.322: ERROR/AndroidRuntime(3854):     at com.android.example.RegExTest.MyList.&lt;init&gt;(MyList.java:15)02-17 14:12:11.322: ERROR/AndroidRuntime(3854):     at com.android.example.RegExTest.DataManagerActivity.readInputFile(DataManagerActivity.java:128)02-17 14:12:11.322: ERROR/AndroidRuntime(3854):     at com.android.example.RegExTest.DataManagerActivity$2.onClick(DataManagerActivity.java:77)02-17 14:12:11.322: ERROR/AndroidRuntime(3854):     at android.view.View.performClick(View.java:2485)02-17 14:12:11.322: ERROR/AndroidRuntime(3854):     at android.view.View$PerformClick.run(View.java:9080)02-17 14:12:11.322: ERROR/AndroidRuntime(3854):     at android.os.Handler.handleCallback(Handler.java:587)02-17 14:12:11.322: ERROR/AndroidRuntime(3854):     at android.os.Handler.dispatchMessage(Handler.java:92)02-17 14:12:11.322: ERROR/AndroidRuntime(3854):     at android.os.Looper.loop(Looper.java:123)02-17 14:12:11.322: ERROR/AndroidRuntime(3854):     at android.app.ActivityThread.main(ActivityThread.java:3647)02-17 14:12:11.322: ERROR/AndroidRuntime(3854):     at java.lang.reflect.Method.invokeNative(Native Method)02-17 14:12:11.322: ERROR/AndroidRuntime(3854):     at java.lang.reflect.Method.invoke(Method.java:507)02-17 14:12:11.322: ERROR/AndroidRuntime(3854):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)02-17 14:12:11.322: ERROR/AndroidRuntime(3854):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)02-17 14:12:11.322: ERROR/AndroidRuntime(3854):     at dalvik.system.NativeStart.main(Native Method)02-17 14:12:11.402: WARN/ActivityManager(62):   Force finishing activity com.android.example.RegExTest/.DataManagerActivity</code></pre>","617044","","","","","2011-02-17 16:06:59","Force Close on Regular Expression !match","<android><regex><validation>","3","0","1","",""
"5030448","1","","","2011-02-17 14:47:42","11","15215","<p>I need to get the absolute path of the assets folder in my app as I want to serve the files within using a webserver and it needs the absolute path. Is this possible?</p><p>I would have thought there might be something like this:</p><pre><code>String rootDir = getAssets().getRootDirectory();</code></pre><p>but there's not.</p><p>Any help appreciated, cheers.</p>","621591","","71724","","2011-02-23 00:57:02","2011-12-29 23:19:00","Android: How to find the absolute path of the assets folder?","<android><path><folder><asset>","2","0","1","",""
"5030565","1","5030710","","2011-02-17 14:57:24","5","8016","<p>So I have a very simple app I am working on. It's purpose is to collect asset data from 1 pc, and 1 or 2 monitors.My form contains 3 edittext views, and 3 buttons (one for each asset I am collecting data for). The buttons invoke startActivityForResult for the barcode scanner, then I want to pass the result to the associated edittext view based on which button was pressed (example: press ""scan"" button to the right of ""Asset - PC"" edittext, scan and return data to it's associated edittext. Then if you press the button ""scan"" thats next to the ""Asset - Mon1"" edittext, return data to ""Asset - Mon1"" edittext.... and so on...)</p><p>With the code I have here, all the items work, just not as intended. Pressing any of the ""scan"" buttons always returns the result to the first edittext view ""Asset - PC"".</p><pre><code>public class TestShit extends Activity {/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);}    public void assetPcClick(View view) {        Intent intent1 = new Intent(""com.google.zxing.client.android.SCAN"");        intent1.setPackage(""com.google.zxing.client.android"");        intent1.putExtra(""SCAN_MODE"", ""ONE_D_MODE"");        startActivityForResult(intent1, 0);    }       public void onActivityResult(int requestCode, int resultCode, Intent intent) {        if (requestCode == 0) {            if (resultCode == RESULT_OK) {                String contents1 = intent.getStringExtra(""SCAN_RESULT"");                String format1 = intent.getStringExtra(""SCAN_RESULT_FORMAT"");                EditText assetPC = (EditText) findViewById(R.id.assetPC);                assetPC.setText(contents1);            } else if (resultCode == RESULT_CANCELED) {                // Handle cancel            }        }    }    public void assetMon1Click(View view) {        Intent intent2 = new Intent(""com.google.zxing.client.android.SCAN"");        intent2.setPackage(""com.google.zxing.client.android"");        intent2.putExtra(""SCAN_MODE"", ""ONE_D_MODE"");        startActivityForResult(intent2, 0);    }       public void onActivityResult2(int requestCode, int resultCode, Intent intent2) {        if (requestCode == 0) {            if (resultCode == RESULT_OK) {                String contents2 = intent2.getStringExtra(""SCAN_RESULT"");                String format2 = intent2.getStringExtra(""SCAN_RESULT_FORMAT"");                EditText assetMon1 = (EditText) findViewById(R.id.assetMon1);                assetMon1.setText(contents2);            } else if (resultCode == RESULT_CANCELED) {                // Handle cancel            }        }    }    public void assetMon2Click(View view) {        Intent intent3 = new Intent(""com.google.zxing.client.android.SCAN"");        intent3.setPackage(""com.google.zxing.client.android"");        intent3.putExtra(""SCAN_MODE"", ""ONE_D_MODE"");        startActivityForResult(intent3, 0);    }       public void onActivityResult3(int requestCode, int resultCode, Intent intent3) {        if (requestCode == 0) {            if (resultCode == RESULT_OK) {                String contents3 = intent3.getStringExtra(""SCAN_RESULT"");                String format3 = intent3.getStringExtra(""SCAN_RESULT_FORMAT"");                EditText assetMon2 = (EditText) findViewById(R.id.assetMon2);                assetMon2.setText(contents3);            } else if (resultCode == RESULT_CANCELED) {                // Handle cancel            }        }    }</code></pre><p>}    </p><p>Any suggestions on how I can better manage my multiple ""ActivityForResult"" and ""onActivityResult"" 's ?</p><hr><p>My fix, thank you for all your help!</p><pre><code>public void onActivityResult(int requestCode, int resultCode, Intent intent) {        if (requestCode == 0) {            if (resultCode == RESULT_OK) {                String contents1 = intent.getStringExtra(""SCAN_RESULT"");                String format1 = intent.getStringExtra(""SCAN_RESULT_FORMAT"");                EditText assetPC = (EditText) findViewById(R.id.assetPC);                assetPC.setText(contents1);            } else if (resultCode == RESULT_CANCELED) {                // Handle cancel            }        }        if (requestCode == 1) {            if (resultCode == RESULT_OK) {                String contents1 = intent.getStringExtra(""SCAN_RESULT"");                String format1 = intent.getStringExtra(""SCAN_RESULT_FORMAT"");                EditText assetMon1 = (EditText) findViewById(R.id.assetMon1);                assetMon1.setText(contents1);            } else if (resultCode == RESULT_CANCELED) {                // Handle cancel            }        }        if (requestCode == 2) {            if (resultCode == RESULT_OK) {                String contents1 = intent.getStringExtra(""SCAN_RESULT"");                String format1 = intent.getStringExtra(""SCAN_RESULT_FORMAT"");                EditText assetMon2 = (EditText) findViewById(R.id.assetMon2);                assetMon2.setText(contents1);            } else if (resultCode == RESULT_CANCELED) {                // Handle cancel            }        }    }    </code></pre>","621597","","621597","","2011-02-17 15:47:27","2011-10-28 07:06:04","Multiple onActivityResult for 1 Activity","<android>","3","1","4","",""
"5030635","1","","","2011-02-17 15:03:11","0","93","<p>I'm modifying the Android framework so that certain functions provided by the framework behave differently depending on the program calling it. So for example, if I want to alter the method getSimState() to always return SIM_STATE_ABSENT if the program requesting the sim state is from package com.example.app1</p><p>Is this possible and if so, is there an SDK API to identify the requesting app? Thanks.</p>","96170","","","","","2011-02-17 15:22:25","Identify calling program","<android>","1","0","","",""
"5030700","1","5045517","","2011-02-17 15:08:35","5","4461","<p>I am currently planning the honeycomb update for my app and i am wondering how to use the Action Bar correctly. My first question is if it is possible to hide the App-Icon and Title from the Action Bar.And is there any kind of Design guidline for the Honeycomb-UI yet?</p>","457378","","750987","","2011-05-29 06:44:35","2011-05-29 06:44:35","Can i hide the App Icon from the Action Bar in Honeycomb?","<android><android-3.0-honeycomb>","1","0","4","",""
"5030718","1","5031978","","2011-02-17 15:10:16","1","145","<p>This is probably two questions in one....</p><p>Firstly i wonder how does android run the code, is it step by step. The reason i ask this is because at the moment what i am trying to do is decrypt an image and them display it. However, the problem i think is that the code is adding the bitmap image too fast before it is decrypted. Should it run the code line by line?</p><p>Secondly Eclipse gives stack error etc but i dont know how to read the stack, is there a way to set it to just say this is the line in the code which is causing the problem?</p><p>thanks</p><p>EDIT</p><pre><code>      DesEncrypter encrypter = new DesEncrypter();      File Directory = new File(Environment.getExternalStorageDirectory()+""/Temp"");      FileInputStream iFile = new FileInputStream(new File(""/sdcard/Images/""+Id+"".jpg""));      FileOutputStream fos = new FileOutputStream(Directory+""/""+Id+"".jpg"");      encrypter.frontDecrypt(iFile, fos);             File file = new File(Environment.getExternalStorageDirectory()+""/Temp/""+Id+"".jpg"");      if(file.exists()){         bm = BitmapFactory.decodeFile(Environment.getExternalStorageDirectory()+""/Temp/""+Id+"".jpg"");      }      else{         bm = BitmapFactory.decodeResource(getResources(), R.drawable.avatar);      }    }    catch(Exception e){}    iv.setImageBitmap(bm);</code></pre><p>This code seems to work now and then, i think sometimes the bm isnt added correctly. Even if there is no image it should add one from the resource but does not do so. </p>","569654","","569654","","2011-02-17 15:27:35","2011-02-17 16:55:47","Android - How does it run and how to use eclipse?","<android><eclipse>","3","2","","",""
"5031023","1","5031082","","2011-02-17 15:33:44","0","502","<p>I have an app that users can get messages but there is no way they no they have a message unless the app is currently open. They dont even no if they have a message if the app is in recent activity. What i want to do is when the user logs in it starts like a service or timer or something of that nature so it goes through a loop and keep checking the database for a message. Any suggestions please post code example, i am lost when it comes to stuff like this. Thanks!</p>","516883","","","","","2011-02-17 15:37:53","android service check for new messages while app is running","<android><service>","1","0","","",""
"5031073","1","","","2011-02-17 15:37:24","0","709","<p>The following causes the preview button to show up with the email attachment, and it does in fact launch the app.  The problem is now my app shows up as a viewer for items in my Contacts.  When you select a contact, you get a ""Complete action using"" popup with my app listed along with ""View contact"".  Obviously, the mimeType is causing this, but I can't get it to work any other way.  The attachment is basically custom data, not intended to opened by any other app.</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;data android:mimeType=""*/*"" /&gt;    &lt;data android:path=""custom.extension"" /&gt;&lt;/intent-filter&gt;            </code></pre>","464024","","","","","2011-07-17 19:24:29","how do i launch my app via an email attachment","<android><mime-types><attachment>","2","0","0","",""
"5031075","1","5032754","","2011-02-17 15:37:25","2","479","<p>I need to develop an App witch detects voice when it´s running (not what are they saying, just if someone speaks) and if so, I need to launch an especific mp3 from my sd.</p><p>I never developed for android/iphone but I need to especify my boss in how many hours it could be done.</p><p>Is there any easy way for voice recognition? and... I think that the answear could be yes but, is ther a way to listen a specified mp3 from my code?</p><p>(no plataform specified yet, it could be android or iphone)</p><p>Thanks very much in advance</p>","501893","","","","","2011-02-17 18:04:54","Create voice recognition app","<iphone><android>","1","0","","",""
"5031097","1","5031397","","2011-02-17 15:39:16","0","1440","<p>I have a large Png image file that I would like to display and scroll around it as I can do in a WebView. When I load my activity with the image file into an ImageView the image is displayed in the screen but is too small to read. I guess the Zoom controls will help once the image it is at it's normal size. I have tried using the image in a WebView but I don't want the Url displayed.</p>","616076","","","","","2011-02-17 22:48:30","How do I display a large png file and scroll around it?","<android><android-emulator>","4","0","","",""
"5031114","1","5031187","","2011-02-17 15:40:31","0","58","<p>I want to do perform an internet search (think google images) on user input and display the first pic that comes back (in an imageview).</p><p>Do I use Webkit to do the search query? </p><p>I found ways to open the android google search application through an Intent, but that's not what I want to do.  I just want to do the query, and bring the results back in an array or something.  </p><p>Thanks</p>","566145","","","","","2011-02-17 15:47:23","What do I use to run a user-transparent query on a search engine?","<android><search><transparent>","1","0","","",""
"5031261","1","","","2011-02-17 15:52:35","0","775","<p>In my application there is an search option .If user type a .I have to get the value from webservice .I am getting large webservice value .In my webservice string value are coming  I am getting like &lt;&gt; like xml character entity reference like  .I want to replace all character and parse xml can anybody tell how to do give example?</p><p>I tried with <code>StringBuffer</code> for unescapexml character I am getting out of memory error</p><pre><code>public  String unescapeXML(String str) {        if (str == null || str.length() == 0)          return """";        StringBuffer buf = new StringBuffer();        int len = str.length();        for (int i = 0; i &lt; len; ++i) {          char c = str.charAt(i);          if (c == '&amp;') {            int pos = str.indexOf("";"", i);            if (pos == -1) { // Really evil              buf.append('&amp;');            } else if (str.charAt(i + 1) == '#') {              int val = Integer.parseInt(str.substring(i + 2, pos), 16);              buf.append((char) val);              i = pos;            } else {              String substr = str.substring(i, pos + 1);              if (substr.equals(""&amp;amp;""))                buf.append('&amp;');              else if (substr.equals(""&amp;lt;""))                buf.append('&lt;');              else if (substr.equals(""&amp;gt;""))                buf.append('&gt;');              else if (substr.equals(""&amp;quot;""))                buf.append('""');              else if (substr.equals(""&amp;apos;""))                buf.append('\'');              else if (substr.equals(""&amp;nbsp;""))                  buf.append("" "");              else                // ????                buf.append(substr);              i = pos;            }          } else {            buf.append(c);          }        }        return buf.toString();      }</code></pre><p>I tried with stream I am not able to do can anybody give example how to do?</p>","426344","","512958","","2011-02-17 16:22:43","2011-02-17 16:50:19","parse big xml file in android","<android>","2","0","0","",""
"5031479","1","","","2011-02-17 16:09:41","1","480","<p>I have a textview in my main app that I do some formatting on (breaks, resizing subset of the text, etc) using fromHtml() to create the string I use to populate the textview's text and I use the same code to populate the textview of my widget.  Unfortunately that code doesn't seem to work on the widget.  I can't get the font color, size, or style to change using fromHtml.  Is there a way to affect the style of a widget's textview in pieces (showing some text as a smaller part of the whole, or changing the font color, etc) or can I only affect the style of the whole textview by using the layout declaration of the textview?</p><p>Thanks</p>","621713","","","","","2011-05-20 08:51:39","Formatting text in widget textview","<android><widget>","1","0","1","",""
"5031631","1","5031657","","2011-02-17 16:23:55","0","1326","<p>I know there are many topics about this, and I understand (or at least I think I do) the Activity lifecycle. I know the Activity itself should handle its lifecycle, including the process of stopping the Activity.</p><p>But, in some cases, this is just not practical, for example, if you have a controller, to manage your interface, and maybe receiving I/O results.</p><p>So, wouldn't be nice just to send some Intent with an action like a <code>ACTION_STOP_REQUEST</code>, and let the Activity handle it?</p>","467900","","427763","","2013-03-21 17:27:34","2013-03-21 17:27:34","Why there isn't a simpler way to stop an activity from another?","<android><activity><activity-lifecycle>","2","2","","",""
"5031707","1","","","2011-02-17 16:30:58","8","15355","<p>I'm working on a javascript framework that generates webkit browser pages which emulate a native app for Android &amp; iPhone.</p><p>I'm using an iPhone emulator (iBBPhone -- very nice) to see how my pages would look on the iPhone and iPad.  I was curious if there was something besides the Android SDK phone emulator that would simulate the Android browsing experience. I'm using desktop Google Chrome right now as a ""pretend Android"" browser but I'm not sure how alike they really are.</p><p>The Android emulator that ships with the SDK is a bit too slow to fire up on my box to be of great use in what I'm doing (even when starting up a saved image), and I was curious if there was anything else out there that simulates Android browsing.  Thanks!</p>","172617","","","","","2012-12-19 14:44:17","Testing Android browser without the emulator?","<android><android-emulator>","3","0","1","",""
"5031724","1","","","2011-02-17 16:32:49","3","4540","<p>I have a textview which should render its content with HTML formatting. From code, this can be achieved like this, </p><pre><code>textView.setText(Html.fromHtml(someText));</code></pre><p>Is there a way to do this through the XML? </p><p>I ask because i do not want to set the text through the code, In my case, the text comes from a DB call and displayed through an adapter.</p>","579705","","244296","","2011-02-17 16:47:56","2011-02-17 16:47:56","TextView Html formatting","<android><android-layout><android-textview>","1","2","","",""
"5031789","1","5031944","","2011-02-17 16:39:27","0","819","<p>As topic I'm currently in sweden but when launching my map it shows that I'm in England.</p><p>My code looks like this:</p><pre><code>private MapListener myMapViewListener;private MapController mapController;private GeoPoint test;@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.mapview);    setupListener();    MapView mapView = (MapView) findViewById(R.id.mapview);    mapController = mapView.getController();    mapView.setBuiltInZoomControls(true);    mapView.setClickable(true);     mapController.setZoom(7); // defualt zoom    }private void setupListener() {    LocationManager locationManager = (LocationManager) this.getSystemService(Context.LOCATION_SERVICE);    MapListener listener = new MapListener();    MapView mapView = (MapView) findViewById(R.id.mapview);    LocationListener locationListener = new LocationListener() {        public void onLocationChanged(Location location) {            test = new GeoPoint((int)location.getLatitude()*1000000, (int)location.getAltitude()*1000000);            mapController.animateTo(test);        }        @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        }    };    locationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 0, 0, locationListener);}</code></pre><p>}</p><p>I've added........</p><pre><code>    &lt;uses-library android:name=""com.google.android.maps"" /&gt;&lt;/application&gt; &lt;uses-permission android:name=""android.permission.INTERNET"" /&gt;    &lt;uses-permission android:name=""android.permission.ACCESS_COARSE_LOCATION""&gt;&lt;/uses-   permission&gt;  &lt;uses-permission android:name=""android.permission.ACCESS_FINE_LOCATION""&gt;&lt;/uses-permission&gt;   &lt;uses-permission android:name=""android.permission.ACCESS_NETWORK_STATE""&gt;&lt;/uses-permission&gt;     &lt;/manifest&gt;</code></pre><p>..... in my manifest.</p><p>I'm using <a href=""http://developer.android.com/guide/topics/location/obtaining-user-location.html"" rel=""nofollow"">http://developer.android.com/guide/topics/location/obtaining-user-location.html</a> as a guide.</p><p>Very thankful for help!</p><p>/Ben</p>","497458","","","","","2011-02-18 13:24:38","android: mapView doesnt give me correct user position","<android><android-mapview>","2","0","","",""
"5031846","1","5031884","","2011-02-17 16:44:20","3","604","<p>I have tried to display a PDF file by using a WebView using the following code -</p><pre><code>webview.loadUrl(""http://www.mywebsite.co.uk/floorplan.pdf"");  </code></pre><p>or</p><pre><code>Uri uri = Uri.parse(""http://www.mywebsite.co.uk/floorplan.pdf"");    Intent intent = new Intent(Intent.ACTION_VIEW, uri);  startActivity(intent);  </code></pre><p>Using either I cannot get the PDF to display unless I run it through Adobe (so my app is downloading it), which then looks fine. How can I get the PDF to display using Adobe through my app or am I better off displaying the PDF as an image instead?</p>","616076","","446746","","2011-02-17 17:51:08","2011-04-21 10:29:56","How do I display a PDF?","<android><pdf>","1","0","","",""
"5031847","1","","","2011-02-17 16:44:21","0","708","<p>I am developing some kind of digital membership cards system that needs to replace current plastic one. I would need to provide the user with the possibility to buy membership card directly within the application and therefore need some mobile payment option. I am developing this for both Android and iOS platforms so some web service or API would be the best solution. I have looked a bit around and the things I have found are:</p><p>Paypal Mobile: <a href=""https://personal.paypal.com/us/cgi-bin/?cmd=_render-content&amp;content_ID=marketing_us/mobile_payments"" rel=""nofollow"">https://personal.paypal.com/us/cgi-bin/?cmd=_render-content&amp;content_ID=marketing_us/mobile_payments</a></p><p>DIBS Mobile: <a href=""http://www.dibspayment.com/products/internet/add-on_packages/mobile/"" rel=""nofollow"">http://www.dibspayment.com/products/internet/add-on_packages/mobile/</a></p><p>Just push me in the right direction or give me some idea :)</p><p>Regardz,Mladjo</p>","115873","","","","","2011-02-18 08:51:45","Android/iPhone mobile payments","<iphone><android><mobile><payment>","2","0","","",""
"5031895","1","5032004","","2011-02-17 16:48:48","4","4740","<p>I'm writing a method that will return true if there's a GPS sensor present and enabled, but returns false if it's absent or switched off. It's proving hard because...</p><pre><code>hasSystemFeature(""FEATURE_LOCATION_GPS"")  // on PackageManager</code></pre><p>Returns false, whether the device has a GPS or not. So even on a device that has one, and it's switched on, it still returns false. Seems completely wrong to me, but I can't see why.</p><pre><code>isProviderEnabled(""gps"")   // on LocationManager</code></pre><p>Returns true, even on a device I have here that has no GPS hardware at all. That also seems completely counter-intuitive.</p><p>I accept these results could be because I'm missing something, the SDK isn't intuitive, or perhaps even that the devices I'm testing with are behaving strangely.</p><p>What am I missing?</p>","477415","","","","","2013-04-07 16:46:20","How to check for the presence of a GPS sensor?","<android><gps>","3","0","","",""
"5031915","1","","","2011-02-17 16:50:14","1","2600","<p>I'm trying to add individual listeners to items in a <code>ListPreference</code> but I just can't find the right code to do it.</p><p>For example, assume I have an app where needs the <em>region</em>  to be set. So I have a <code>ListPreference</code> with three options; Americas, Asia, Europe.</p><p>When I use the trackpad to scroll through the items I would like them to speak the text of the preference when they get focus. </p><p>I'm sure somewhere in the API I can add a listener to the individual items but I just can not find it.There is a <code>setOnPreferenceClickListener(..)</code> method in <code>ListPreference</code> (inherited from <code>DialogPreference</code>) but that is for when you select the actual parent preference item.</p><p>Do I need to write a special subclass?</p><p><strong>EDIT</strong></p><p>After looking into this more I think I need to further clarify my question.When using preferences you can override the <code>onPreferenceTreeClick (PreferenceScreen prefScreen, Preference pref)</code> method in the <code>PreferenceActivity</code>. This allows you to intercept any clicks on preferences. However I want to add a listener to the actual dialog that pops up. The ""Americas, Asia, Europe"" options from the above example. So if I select or click on Asia I can intercept it. </p><p>So my (refined) question is how can add a listener to those individual options.</p><p>cheers</p>","516286","","516286","","2011-02-18 14:38:40","2012-08-07 11:56:40","Adding listeners to individual ListPreference items","<android><listener><android-preferences><event-listeners>","2","0","","",""
"5032021","1","5032970","","2011-02-17 16:59:47","0","120","<p>I would like to provide the user the option to choose an email from the email app so I could  handle the message body and the attachments, is it possible?</p><p>It would be great if we could do that in the same way we do to get an image:</p><pre><code>Intent intent = new Intent();intent.setType(""image/*"");intent.setAction(Intent.ACTION_GET_CONTENT);startActivityForResult(Intent.createChooser(intent, ""Choose a picture""), 1);</code></pre><p>Thanks in advance.</p>","621767","","","","","2011-02-17 18:27:22","Is there a way to get an email from the email app via intent?","<android><email><android-intent>","1","0","","",""
"5032078","1","5041232","","2011-02-17 17:04:00","12","5744","<p>What I want is a way to have settings that are dependent on build configuration.  To give a specific example, my android application connects to a web service.  In development, I want the service url to be pulled in from a configurable value.  In Test, I want a different value pulled in.  In production, yet another value.</p><p>So, in code I have something like this:</p><pre><code>public class HttpRequestHelper {    private static String GetServiceUrl(ServiceAction action)    {        return serviceUrl + action.toString();    }}</code></pre><p>By default (when debugging/running through eclipse), I want that url to be <a href=""http://localhost:1234"">http://localhost:1234</a></p><p>In Test I want <a href=""https://test.mydomain.com"">https://test.mydomain.com</a></p><p>In Production I want <a href=""https://mydomain.com"">https://mydomain.com</a></p><p>I am new to eclipse and ant and it has been a long time since I used java.  How do I go about setting this up?  What should the build.xml look like?  I understand that when I want to build the test/prod versions I will need to use the command line.  That's okay.  But I don't know how to get this serviceUrl auto-set dependent on the build.  I'm not even sure the best place to put this information (a resource, a properties file?).  I really want to avoid setting it, building, setting it, building, etc.</p>","107455","","","","","2012-06-14 07:01:14","Android - use ant to create build configurations that change configuration values","<java><android><ant><build-automation><buildconfiguration>","4","0","11","",""
"5032098","1","","","2011-02-17 17:05:53","8","1727","<p>I have a media application which starts playback when the intent is sent to the player activity with the following intent extras; data ""path to the music"" and type ""mime/audio format"".</p><p>I pick up the intent data at the player activity execute to start playback and I remove the passed extras from the intent to avoid having the same request going again after flipping the screen or the activity being brought back to the foreground.</p><p>This is how I process an intent:</p><pre><code>final String data = getIntent().getDataString();final String type = getIntent().getType();// start playback    requestPlay( data, type );    // remove intents because they are needed only once per call!    this.getIntent().setDataAndType(Uri.parse(""""), """");    this.getIntent().removeExtra(""data"");    this.getIntent().removeExtra(""type"");</code></pre><p>The issue I'm having is that randomly and rarely, I will open the application and when it resumes at the player activity, the intent will contain the previous extra data and start playing...  This is annoying to me and well my users...</p><p>Anyone have any ideas what's the best way to clear the intents data? Some reason the ActivityManager might be keeping this data stored...?</p><p>Thanks!</p><p>-Jona</p>","398248","","","","","2013-10-05 06:27:08","Clearning Activity's intent data randomly comes back, why?","<android>","4","0","2","",""
"5032141","1","5424844","","2011-02-17 17:08:43","2","1259","<p>I have a menu that comes up for my PreferenceActivity. In my child preference screens, I lose that menu (doesn't pop up). How can I make my menu pop up for children too?</p><p>Thanks.</p><p>Example: </p><pre><code>&lt;PreferenceScreen  xmlns:android=""http://schemas.android.com/apk/res/android""  android:persistent=""true""&gt;  &lt;PreferenceCategory    android:title=""some category""    android:persistent=""true""    android:orderingFromXml=""true""&gt;    &lt;PreferenceScreen      android:title=""some child screen""      android:summary=""some child summary""&gt;      &lt;PreferenceCategory         ...</code></pre><p>The first preference screen has the menu, but when you click on the child one, no menu. How can you add the menu?</p>","354607","","354607","","2011-02-20 15:24:40","2011-08-29 15:09:11","Adding menus to child preference screens","<android>","3","0","2","",""
"5032153","1","5051849","","2011-02-17 17:09:42","0","2977","<p>Im trying to read in image file from a server , with the code below . It keeps going into the exception. I know the correct number of bytes are being sent as I print them out when received. Im sending the image file from python like so</p><pre><code>#open the image file and read it into an object        imgfile = open (marked_image, 'rb')          obj = imgfile.read()       #get the no of bytes in the image and convert it to a string        bytes = str(len(obj))        #send the number of bytes        self.conn.send( bytes + '\n')        if self.conn.sendall(obj) == None:            imgfile.flush()            imgfile.close()            print 'Image Sent'        else:            print 'Error'</code></pre><p>Here is the android part , this is where I'm having the problem. Any suggestions on the best way to go about receiving the image and writing it to a file ?</p><pre><code>//read the number of bytes in the image       String noOfBytes =  in.readLine();       Toast.makeText(this, noOfBytes, 5).show();       byte bytes [] = new byte [Integer.parseInt(noOfBytes)];       //create a file to store the retrieved image       File photo = new File(Environment.getExternalStorageDirectory(),  ""PostKey.jpg"");       DataInputStream dis = new DataInputStream(link.getInputStream());       try{        os =new FileOutputStream(photo);        byte buf[]=new byte[1024];        int len;        while((len=dis.read(buf))&gt;0)        os.write(buf,0,len);        Toast.makeText(this, ""File recieved"", 5).show();        os.close();        dis.close();       }catch(IOException e){           Toast.makeText(this, ""An IO  Error Occured"", 5).show();       }</code></pre><p>EDIT: I still cant seem to get it working. I have been at it since and the result of all my efforts have either resulted in a file that is not the full size or else the app crashing. I know the file is not corrupt before sending server side. As far as I can tell its definitely sending too as the send all method in python sends all or throws an exception in the event of an error and so far it has never thrown an exception. So the client side is messed up . I have to send the file from the server so I cant use the suggestion suggested by Brian . </p>","506892","","506892","","2011-02-19 15:22:10","2011-02-19 16:09:07","Android , Read in binary data and write it to file","<python><android><sockets><file-io>","3","2","","",""
"5032355","1","5032433","","2011-02-17 17:28:08","13","10857","<p>This is in an extension of TextView. getTextSize and setTextSize are not overridden, I do not extend those methods. Programming in 1.6, API level 4.</p><p>The loop in this code causes size to be multiplied by 1.5 every time it iterates, e.g. if size initially reads 200 from getTextSize, then setTextSize(size) is called, getTextSize called again reads back 300.</p><pre><code>    public void shrinkTest() {    float size = this.getTextSize();     while (size &gt; 8) {        this.setTextSize(size);        size = this.getTextSize();    }}</code></pre><p>Por que?</p>","150020","","150020","","2011-02-17 17:44:44","2011-02-17 17:44:44","Android TextView setTextSize incorrectly increases text size","<android><textview><pixels><pixelformat>","2","0","1","",""
"5032528","1","","","2011-02-17 17:42:38","0","294","<p>In an android email app the db emailprovider.db gets populated after fetching the values from the server when it is configured by using any of the protocols...in my case it is exchange server ..i wanted to know which class files are responsible for populating the data in the tables of emailprovider.db after fetching the data from the server.The source code used is Android 2.2.</p>","621845","","","","","2011-02-17 18:18:27","How an emailprovider.db gets populated?","<android>","1","0","","",""
"5032532","1","","","2011-02-17 17:43:12","1","406","<p>Trying to use the FilterQueryProvider function to update the contents of a ListView, as characters are entered into the filter, my runQuery function does get called, and a new cursor with filtered content is returned, but the ListView does not update to show the new contents. The docs state that after runQuery returns, changeCursor is called. Isn't this enough to update the ListView display? My code to set up the filter is:</p><pre><code>    mAdapter = new ItemAdapter(curs);    mAdapter.setFilterQueryProvider(new ItemFilter());    setListAdapter(mAdapter);</code></pre><p>And my filter class is simply:</p><pre><code>class ItemFilter implements FilterQueryProvider {    public Cursor runQuery(CharSequence filter) {        return getNewCursor(filter);    }}</code></pre><p>The cursor from getNewCursor does correctly fetch a subset of the rows. Have I missed something in getting the ListView to update?</p>","446874","","","","","2011-02-17 17:43:12","FilterQueryProvider not updating ListView","<android>","0","1","","",""
"5032588","1","5055484","","2011-02-17 17:48:23","10","8265","<p>I'm using the following to set the system auto brightness mode and level:</p><pre><code>    android.provider.Settings.System.putInt(y.getContentResolver(),Settings.System.SCREEN_BRIGHTNESS_MODE, 0);    android.provider.Settings.System.putInt(y.getContentResolver(),Settings.System.SCREEN_BRIGHTNESS, y.brightness1);</code></pre><p>I can change auto-brighess on and off, and set different levels. The settings seem to be applied properly -- I can go to into Settings --> Display --> Brightness, and whanever setting I set is actually shown correctly. However, the actual screen isn't changing its brightness. If i just tap on the slider in Display Settings, then everything gets applied.</p><p>I shoudl mention that I'm running an app withat a main activity, and these settings are getting applied in the BroadcastReceiver. I did try to create a dummy activity and tested the stuff there, but got the same results.</p>","496854","","540990","","2012-09-20 05:10:15","2013-07-11 17:23:48","Can't apply system screen brightness programmatically in Android","<android><settings><system><brightness>","4","0","4","",""
"5032601","1","","","2011-02-17 17:49:35","1","998","<p>hey people,I am trying to get the id of the item, in this case a table row, that was long pressed to bring up the context menu.  This is my code so far.</p><pre><code>@Overridepublic void onCreateContextMenu(ContextMenu menu, View v,                                ContextMenuInfo menuInfo) {  super.onCreateContextMenu(menu, v, menuInfo);  MenuInflater inflater = getMenuInflater();  inflater.inflate(R.menu.context_menu, menu);}@Overridepublic boolean onContextItemSelected(MenuItem item) {  AdapterContextMenuInfo info = (AdapterContextMenuInfo) item.getMenuInfo();  switch (item.getItemId()) {      case R.id.delete:          deleteitem(id); //ID of item should be passed to method deleteitem          Toast.makeText(this, ""delete"",                    Toast.LENGTH_LONG).show();        return true;      default:        return super.onContextItemSelected(item);  }}</code></pre><p>As you can see I need the id of the table row to pass to another method.  I have tried using info however it is always null.  Obviously I am missing something here so hopefully you'll be able to point me in the right direction.  Thanks.</p>","621854","","","","","2011-02-17 17:56:12","Get Item ID From Context Menu","<java><android>","2","0","","",""
"5032722","1","","","2011-02-17 18:01:59","0","76","<pre><code>try {    Cursor c = db.rawQuery(""select time from updateTimes where type = 'root'"", null);    long time = c.getLong(c.getColumnIndex(""time""));} catch (CursorIndexOutOfBoundsException e) {}</code></pre><p>This exception gets thrown, even though the column ""time"" definitely exists, the the same query returns data as expected when using the sqlite3 client. Any ideas?</p>","583293","","","","","2011-02-17 18:12:37","Column Index not finding a column that definitely exists","<java><android><sqlite>","1","0","","",""
"5032816","1","5032886","","2011-02-17 18:10:35","0","1215","<p>My Android app displays text in a few different ways, and there are some annoying differences between them I was hoping folks could help with.</p><p>When I use display methods that might be termed ""automatic,"" the text is displayed very nicely.  By automatic methods, I'm referring tools, like Toasts and Button widgets where I just have supply the text, and the OS (or ""environment"" or whatever) displays it for me.  The letters are nicely curved, pleasant to look at, and easily legible.</p><p>However, in my code where I handle the text display (using Canvas.drawtext() in a Surface Runner View), the text quality is poor.  The text is still legible, but it looks pixelated.  The letters just don't look their best.</p><p>I've tried experimenting with Paint.settypeface(), using Typeface.SANS_SERIF for example, but the quality of the display when it's my code is always poor.  Doable, but poor.</p><p>Has anybody else experienced this?  By any chance does anybody have a solution??</p><p>Thanks,R.</p>","453989","","507810","","2011-02-17 18:19:35","2011-03-15 03:08:52","Android Text Display","<android><text><canvas>","1","0","2","",""
"5032957","1","5039084","","2011-02-17 18:26:17","1","1938","<p>The question is very simple but I can't manage to find a good solution to it. I have a LinearLayout in my activity. Depending on what the user does I need to make the background of my Layout blink 3 times. This means it will change the Background Color from transparent to Red and backwards for 3 times. Let me give you an example:</p><ol><li>the user receives a question and 2 buttons with answers</li><li>the user presses the wrong answer. The layout containing the button will change it's background (Transparent - Red, Transparent - Red, Transparent - Red - Transparen) three times.</li></ol><p>How can I make this in Android ? Thank you.</p>","379865","","","","","2012-10-27 07:18:33","Animating LinearLayout background to blink in Android","<android><animation><android-linearlayout>","4","0","0","",""
"5033001","1","5033086","","2011-02-17 18:30:39","1","217","<p>A snippet of the <a href=""http://wiki.mikrotik.com/wiki/API_in_C_Sharp"" rel=""nofollow"">code</a> that I want to translate is here:</p><pre><code>class MK    {           Stream connection;        TcpClient con;        public MK(string ip)        {            con = new TcpClient();            con.Connect(ip, 8728);            connection = (Stream)con.GetStream();        }        public void Close()        {            connection.Close();            con.Close();        }        public bool Login(string username, string password)        {            Send(""/login"", true);            string hash = Read()[0].Split(new string[] { ""ret="" }, StringSplitOptions.None)[1];            Send(""/login"");            Send(""=name="" + username);            Send(""=response=00"" + EncodePassword(password, hash), true);            if (Read()[0] == ""!done"")            {                return true;            }            else            {                return false;            }        }        public void Send(string co)        {            byte[] bajty = Encoding.ASCII.GetBytes(co.ToCharArray());            byte[] velikost = EncodeLength(bajty.Length);            connection.Write(velikost, 0, velikost.Length);            connection.Write(bajty, 0, bajty.Length);        }        public void Send(string co, bool endsentence)        {            byte[] bajty = Encoding.ASCII.GetBytes(co.ToCharArray());            byte[] velikost = EncodeLength(bajty.Length);            connection.Write(velikost, 0, velikost.Length);            connection.Write(bajty, 0, bajty.Length);            connection.WriteByte(0);        }</code></pre>","150398","","150398","","2011-02-17 18:38:29","2011-02-17 18:38:46","What is the Android/Java corresponding method to the C# Stream object method Write()?","<c#><java><android><sockets><stream>","1","0","","",""
"5033008","1","","","2011-02-17 18:31:27","0","224","<p>I try to develop/debug on galaxy tab.I have created an ImageView and I want it to show just an image.I have created on photoshop an image 1024*600.Since this is the tab's resolution i expected everything presented on the image to fit just fine on the tab's screen.Instead a large portion of the image is not presented...Sorry I am noob but have I misunderstood something?</p><p>this is my code...</p><h1>main.xml</h1><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;ImageView    android:src=""@drawable/test2""    android:layout_width=""fill_parent""     android:layout_height=""fill_parent""     android:scaleType=""center""   /&gt;&lt;/LinearLayout&gt;</code></pre><h1>Manifest.xml</h1><pre><code>&lt;activity android:name=""...xxx""                  android:label=""@string/app_name""                  android:screenOrientation=""landscape""&gt;&lt;/activity&gt;</code></pre>","420390","","420390","","2011-02-17 18:34:59","2011-02-17 18:34:59","Galaxy tab maximum image dimentions for imageview?","<android><imageview><galaxy>","0","6","","",""
"5033012","1","5535672","","2011-02-17 18:31:38","274","93877","<p>I'm looking for an optimal way to resize wrapping text in a TextView so that it will fit within its getHeight and getWidth bounds. I'm not simply looking for a way to wrap the text- I want to make sure it both wraps and is small enough to fit entirely on the screen. </p><p>I've seen a few cases on StackOverflow where auto resizing was needed, but they are either very special cases with hack solutions, have no solution, or involve re-drawing the TextView recursively until it is small enough (which is memory intense and forces the user to watch the text shrink step-by-step with every recursion). </p><p>But I'm sure somebody out there has found a good solution that doesn't involve what I'm doing: writing several heavy routines that parse and measure the text, resize the text, and repeat until a suitably small size has been found. </p><p>What routines does TextView use to wrap the text? Couldn't those be somehow used to predict whether text will be small enough?</p><p><strong>tl;dr</strong>: is there a best-practice way to auto-resize a textview to fit, wrapped, in its getHeight and getWidth bounds?</p><p><strong>Thanks to everyone who shared what they had! I recommend Chase's solution for most cases, and I've listed some alternatives in my answer.</strong></p>","150020","","56285","","2014-02-13 11:47:31","2014-04-08 14:54:32","Auto Scale TextView Text to Fit within Bounds","<android><textview><scale><android-textview><textwrapping>","23","7","248","",""
"5033025","1","5033923","","2011-02-17 18:32:46","1","813","<p>I tried to google in hope to find any Google Goggles alike tools/libraries that would somewhat allow the developer to recognize objects in a video.</p><p>I understand this is a complex topic. </p><p>Are there any libraries that would recognize shapes in a video? For instance detect if there are any squares in a given frame/video? I'm pretty sure Goggles can do that, but from what I researched it doesn't have an SDK to use.</p><p><strong>UPDATE</strong>: <a href=""http://www.readwriteweb.com/archives/recognizr_facial_recognition_coming_to_android_phones.php"" rel=""nofollow"">Recognizr</a> seems be a good example of a part of what I am trying to accomplish. But it's an application that was not released yet.</p>","32188","","321731","","2013-10-22 17:52:27","2013-10-22 17:52:27","Android video recognition","<java><android><video-processing><pattern-recognition>","1","0","1","",""
"5033230","1","","","2011-02-17 18:51:25","0","1604","<p>Used Android Project:<a href=""http://android.git.kernel.org/?p=platform/packages/apps/Tag.git;a=summary"" rel=""nofollow"">Tag</a></p><p>After copying the Tag project into your workbench you should import the guava lib, to solve most of the errors. The Nullable errors can be fixed by importing the jsr305-1.3.9.jar regarding <a href=""http://stackoverflow.com/questions/3800033/guava-r07-gwt-and-javax-annotation-nullable"">this solution</a></p><p>After fixing all Error Messages I am trying to install the Tag App on my Nexus S, but I get the error message: </p><blockquote>  <p>Installation error: INSTALL_FAILED_CONFLICTING_PROVIDER</p></blockquote><p>Logcat Message:</p><blockquote>  <p>Can't install because provider name com.android.apps.tag (in package   com.android.apps.tag) is already used by com.google.android.tag</p>    <p>Package couldn't be installed in /data/app/com.android.apps.tag-1.apk</p></blockquote><p>I think I get this message, because another version of Tags is already installed which couldn´t be removed via ""Manage apps"".</p><p>I hope that we can bring the android Tags App to work, so everyone has a foundation for building nfc Apps. I have already tried the sample NFC Demo ""FakeTagsActivity"", but this is another story.</p><p>Has anyone a idea how I can install this app?</p><p>Best regards </p><p>Alexander</p>","621865","","","","","2011-06-11 03:30:59","Bringing the Android (NFC) TAG project to work","<android><tags><guava><nfc>","2","0","1","",""
"5033239","1","","","2011-02-17 18:52:33","0","334","<p>I'm a newbie with Eclipse and Android. I have a legacy project from anSVN repository which I could import and use under Eclipse Helios. Alsochanges inside and outside Eclipse are synchronized fine with the SVN.</p><p>Now the problem: The project structure consists of a root directory,referring to a src path, which exists outside the root (i.e. on thesame level as the root of the project is). I guess this has beenarranged by the designer, because the src part has been referencedfrom different java projects for different platforms. I think this isnot such a bad idea.</p><p>However: Whatever I do I can't make Eclipse and SVN synchronizechanges on files located in this ""outer"" directory. What do I have todo in order to make both aware of the outer parts, w/o being forced tochange the file/dir structure completely?</p><p>Kind regards</p>","621943","","","","","2011-02-17 20:47:25","Android and Eclipse - a problem","<android><eclipse><svn>","1","1","","",""
"5033246","1","5033834","","2011-02-17 18:53:45","7","3708","<p>Is there a way to force the entry in an autocompletetextview to be one of the elements in the entrylist?</p><p>I've found a method called ""performValidation"" but im not sure what it actually does, and i havent been able to find much documentation or any examples.</p>","587650","","","","","2011-02-19 07:58:13","Android, Autocomplettextview, force text to be from the entry list","<android><validation><autocompletetextview>","1","0","4","",""
"5033304","1","5033561","","2011-02-17 18:58:43","1","1034","<p>Im currently writing some software for android that takes gps data in the form of an ArrayList of GeoPoints and writes it to a KML file. The rest of file is created fine, but when the gps data is written to the file in the following way:</p><pre><code>for(int i=0; i &lt; geoPoints.size(); i++){        writer.write(geoPoints.get(i).getLatitudeE6());    writer.write("", "");    writer.write(geoPoints.get(i).getLongitudeE6());    writer.write(""\n"");}</code></pre><p>The output of file is random characters:</p><pre><code>?, ??, ??, ?</code></pre><p>If I change the loop to convert it to a String:</p><pre><code>for(int i=0; i &lt; geoPoints.size(); i++){        writer.write(Integer.toString(geoPoints.get(i).getLatitudeE6()));    writer.write("", "");    writer.write(Integer.toString(geoPoints.get(i).getLongitudeE6()));    writer.write(""\n"");}</code></pre><p>Then the output is almost correct, but there isn't a decimal place?</p><pre><code>-45570790, 167608003-45571713, 167608345-45572973, 167606660</code></pre><p>Can anyone help me find that pesky decimal?</p>","621949","","","","","2011-02-17 19:25:03","Can't get android to write GeoPoint GPS coordinate data to a file correctly","<android><kml>","1","0","2","",""
"5033379","1","","","2011-02-17 19:06:03","0","132","<p>I found this class:</p><pre><code>import android.content.Context;import android.graphics.Bitmap;import android.graphics.Canvas;import android.graphics.Paint;import android.util.AttributeSet;import android.view.Display;import android.view.MotionEvent;import android.view.View;import android.view.WindowManager;// borrowed from https://sites.google.com/site/androidhowto/how-to-1/custom-scrollable-image-viewpublic class ScrollImageView extends View {    private final int DEFAULT_PADDING = 10;    private Display mDisplay;    private Bitmap mImage;    /* Current x and y of the touch */    private float mCurrentX = 0;    private float mCurrentY = 0;    private float mTotalX = 0;    private float mTotalY = 0;    /* The touch distance change from the current touch */    private float mDeltaX = 0;    private float mDeltaY = 0;    int mDisplayWidth;    int mDisplayHeight;    int mPadding;    public ScrollImageView(Context context) {        super(context);        initScrollImageView(context);    }    public ScrollImageView(Context context, AttributeSet attributeSet) {        super(context);        initScrollImageView(context);    }    private void initScrollImageView(Context context) {        mDisplay = ((WindowManager)context.getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay();        mPadding = DEFAULT_PADDING;    }    @Override    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {        int width = measureDim(widthMeasureSpec, mDisplay.getWidth());        int height = measureDim(heightMeasureSpec, mDisplay.getHeight());        setMeasuredDimension(width, height);    }    private int measureDim(int measureSpec, int size) {        int result = 0;        int specMode = MeasureSpec.getMode(measureSpec);        int specSize = MeasureSpec.getSize(measureSpec);        if (specMode == MeasureSpec.EXACTLY) {            result = specSize;        } else {            result = size;            if (specMode == MeasureSpec.AT_MOST) {               result = Math.min(result, specSize);            }        }        return result;    }    public Bitmap getImage() {        return mImage;    }    public void setImage(Bitmap image) {        mImage = image;    }    public int getPadding() {        return mPadding;    }    public void setPadding(int padding) {        this.mPadding = padding;    }    @Override    public boolean onTouchEvent(MotionEvent event) {        if (event.getAction() == MotionEvent.ACTION_DOWN) {            mCurrentX = event.getRawX();            mCurrentY = event.getRawY();        }         else if (event.getAction() == MotionEvent.ACTION_MOVE) {            float x = event.getRawX();            float y = event.getRawY();            // Update how much the touch moved            mDeltaX = x - mCurrentX;            mDeltaY = y - mCurrentY;            mCurrentX = x;            mCurrentY = y;            invalidate();        }        // Consume event        return true;    }    @Override    protected void onDraw(Canvas canvas) {        if (mImage == null) {            return;        }        float newTotalX = mTotalX + mDeltaX;        // Don't scroll off the left or right edges of the bitmap.        if (mPadding > newTotalX && newTotalX > getMeasuredWidth() - mImage.getWidth() - mPadding)            mTotalX += mDeltaX;        float newTotalY = mTotalY + mDeltaY;        // Don't scroll off the top or bottom edges of the bitmap.        if (mPadding > newTotalY && newTotalY > getMeasuredHeight() - mImage.getHeight() - mPadding)            mTotalY += mDeltaY;        Paint paint = new Paint();        canvas.drawBitmap(mImage, mTotalX, mTotalY, paint);    }}</code></pre><p>and am stumped how to use it with my application.  </p><p>I want my application when in landscape orientation to display a bitmap image that is scrollable vertically and horizontally.  I pull my image from a URL and programatically make it a bitmap.  I call a method that returns my bitmap image.  </p><p>Any ideas?</p>","2186261","","","","","2011-02-17 19:21:14","How to implement the ScrollImageView class in my Android application","<android><view>","1","0","","",""
"5033392","1","","","2011-02-17 19:07:09","3","4846","<p>I have a file open on the SD card.  When someone mounts the SD card, it winds up crashing my application.  I am trying to register for the ACTION_MEDIA_EJECT broadcast event, and i receive that, but it seems like i'm getting that too late.  By the time I get that, it's already crashed my application.  Is there any way to get notified before crashing my application?</p><p>Added some very simple sample code.  When I do this, it winds up crashing the service when I turn on USB (MSC mode).</p><p>Test.java</p><pre><code>/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    try {        startService(new Intent(this, TestService.class));        bindService(new Intent(this, TestService.class), serviceConnection, Context.BIND_AUTO_CREATE);    } catch (Exception e) {    }}protected TestService testService;private ServiceConnection serviceConnection = new ServiceConnection() {    @Override    public void onServiceConnected(ComponentName name, IBinder service) {        TestService.LocalBinder binder = (TestService.LocalBinder) service;        testService = binder.getService();    }    @Override    public void onServiceDisconnected(ComponentName name) {        testService = null;    }};</code></pre><p>TestService.java</p><pre><code>@Overridepublic void onCreate() {    super.onCreate();    try {        mFileOutputStream = new FileOutputStream(""/sdcard/test2"", true);    } catch (Exception e) {    }}@Overridepublic IBinder onBind(Intent intent) { return binder; }public static class LocalBinder extends Binder {    public static TestService getService() {        return _this;    }}</code></pre>","306517","","306517","","2011-02-17 23:44:33","2012-03-20 09:39:33","preventing a crash when someone mounts an Android SD card","<android><broadcastreceiver><sd-card><mount>","3","7","1","",""
"5033593","1","5033661","","2011-02-17 19:28:19","0","2679","<p>I've written some code to test if a user has changed the values in any of 6 edittext boxes, but the code looks bulky and redundant. I'm wondering if there is a more elegant way to do this.</p><p>The user inputs numbers into all of 6 edittext boxes, and after each entry, a calculation routine checks to be sure all boxes have valid numbers before doing the calculation. The kistener has to fire on a lost foucus so that the number is in the box before the calculations are done. and outputing a result. If the user want to go back and change a value in any one of the 6 edittext boxes, the calulation routine runs again.beenI've set up 6 listeners in the onCreate section for each edittext box.Then I have 6 separate routines to test for each hasFocus==false. </p><p>Within the onCreate section i set a listener for each of the 6 user input edottext boxes: </p><pre><code>et1.setOnFocusChangeListener(this);.   .  ..et6.setOnFocusChangeListener(this);</code></pre><p>Then I have a method to check if any edittext box has lost focus, suggesting theat the user changed some data, and therfore re-run the calulations.<br>I do a check for each of the 6 user input edittext boxes as follows:</p><pre><code>@Overridepublic void onFocusChange(View v, boolean hasFocus){   if ((v == findViewById(R.id.et1)) &amp;&amp; (hasFocus==false))        {do calculations }     .    .    .    .    if ((v == findViewById(R.id.et6)) &amp;&amp; (hasFocus==false))        {do calculations } }</code></pre><p>Forgive me if I've made any typos in the code above. It runs on my platform, but I would like to learn a better way to do this.</p>","493998","","","","","2011-02-17 19:45:48","changing focus on multiple edittext boxes","<android>","2","0","","",""
"5033624","1","","","2011-02-17 19:31:05","0","172","<p>i want to make a list view in android 1.5 that contains phone contacts (name and number ) and also supports multiselect with out check boxes. i am using a custom listview for this app.</p><p>Kindly help me with some reference code.</p>","605158","","","","","2011-02-17 19:31:05","multiple listview","<android>","0","2","","",""
"5033645","1","5034417","","2011-02-17 19:33:46","1","712","<p>i followed the following tutroial for tts  </p><p><a href=""http://android-developers.blogspot.com/2009/09/introduction-to-text-to-speech-in.html"" rel=""nofollow"">http://android-developers.blogspot.com/2009/09/introduction-to-text-to-speech-in.html</a></p><p>but now how do i make it work for documents<br>i want to extract the text in documents and convert it to speechand want the functionality to stop,pause play functions in it as in a media player</p><p>By documents,i mean word,pdf etc.please tell how to extract text from these documents in android.i am newbie to android</p>","575805","","575805","","2011-02-19 08:01:34","2011-02-19 08:01:34","conversion of document text to speech","<android>","1","0","1","",""
"5033671","1","5083503","","2011-02-17 19:36:07","8","8606","<p>I am trying to work my way in UI. I am trying to set stateListDrawable for list entries. All I am trying to do is change the color of the list item's layout when the item is pressed, and while the list item is pressed I want to change the color of the text as well.</p><p>I am getting the following error stack:</p><pre><code>E/AndroidRuntime(  360): FATAL EXCEPTION: mainE/AndroidRuntime(  360): android.view.InflateException: Binary XML file line #8: Error inflating class &lt;unknown&gt;E/AndroidRuntime(  360):    at android.view.LayoutInflater.createView(LayoutInflater.java:513)E/AndroidRuntime(  360):    at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)E/AndroidRuntime(  360):    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:563)E/AndroidRuntime(  360):    at android.view.LayoutInflater.rInflate(LayoutInflater.java:618)E/AndroidRuntime(  360):    at android.view.LayoutInflater.inflate(LayoutInflater.java:407)E/AndroidRuntime(  360):    at android.view.LayoutInflater.inflate(LayoutInflater.java:320)E/AndroidRuntime(  360):    at android.view.LayoutInflater.inflate(LayoutInflater.java:276)</code></pre><p>The XML that is inflated is the following:</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/help_list_container""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:padding=""5dip""    android:background=""@drawable/default_list_selection""&gt;    &lt;TextView android:id=""@+id/help_list_text""         android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:textSize=""16sp""        android:textColor=""@drawable/help_text_color""&gt;    &lt;/TextView&gt;&lt;/LinearLayout&gt;</code></pre><p>I can get the program to work if I remove the <code>android:textColor</code> property from the xml. Is there a way I can use a stateListDrawable to control the texColor of a listitem from the xml?</p><p>The stateListDrawable works for <code>android:background</code> in LinearLayout, but it won't for the textColor property of TextView. The state list xml is the following:</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=""@color/white""              android:state_pressed=""true"" /&gt;    &lt;item android:drawable=""@color/black"" /&gt;&lt;/selector&gt;</code></pre><p>Any response would be appreciated.</p>","620661","","469983","","2012-10-02 09:58:07","2012-10-02 09:58:07","Error inflating class <unknown>","<android><textview><android-inflate><xml-drawable>","1","0","","",""
"5033723","1","5035943","","2011-02-17 19:40:39","1","5185","<p>I have a Bitmap that is larger than the ImageView that I'm putting it in. I have the ScaleType set to center_inside. How do I get the dimensions of the scaled down image?</p>","604591","","","","","2011-02-17 23:18:04","ImageView bitmap scale dimensions","<android><bitmap><imageview>","3","0","","",""
"5033728","1","5076753","","2011-02-17 19:41:02","0","1140","<p>I am trying to add emailing capabilities to my Android application. What I am trying to do actually is send a file that contains a json string representing some application data by using the ACTION_SEND intent. The problem is that on my device, an HTC Desire with Froyo, Gmail sends the actual email, but not the attachment, even though I see the attachment when the Gmail app starts as attached. However, on the emulator, using the default email application, this works just fine. This also works if I am using an application such as ASTRO file manager to send the attachment directly from the SD card with it's default suggested mime type. Anyone encountered something similar?My code looks something like this:</p><pre><code>Intent sendIntent = new Intent(Intent.ACTION_SEND);sendIntent.setType(""application/sal"");sendIntent.putExtra(Intent.EXTRA_SUBJECT, ""shopping list"");Log.d(TAG, ""attachment file: "" + Uri.parse(""file:/"" + fileWithPath));sendIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse(""file:/"" + fileWithPath));</code></pre><p>I have tried a variety of mime types also, such as application/json or text/plain with same result.    </p>","151690","","","","","2013-01-16 08:15:36","Gmail won't send attachment from my application on Android","<android>","1","2","1","",""
"5033793","1","5034228","","2011-02-17 19:47:18","0","1473","<p>I have some confusion regarding where you put regular java code in an android application.  </p><p>I'm using the Eclipse SDK and by default when you create an application it makes a .java file with an OnCreate() method.  Is this where I would put my code, inside this method?  </p><p>Right now in my layout I have an imageButton, once this button is clicked I want to open a new WebView page that gets it's HTML code from the index.html file found in the assets folder. This is what I have so far...</p><pre><code>    Button button = (Button)findViewById(R.id.imagebutton1);    if(button.isPressed())    {        WebView webview = new WebView(null);        setContentView(webview);        try {            InputStream fin = getAssets().open(""index.html"");                byte[] buffer = new byte[fin.available()];                fin.read(buffer);                fin.close();                webview.loadData(new String(buffer), ""text/html"", ""UTF-8"");        } catch (IOException e) {            e.printStackTrace();        }    }</code></pre><p>I have this block of code at the end of the onCreate() method right under the line:</p><pre><code>setContentView(R.layout.main);</code></pre><p>However, once I run the program it crashes and tells me that it failed to start.  I'm assuming that it has to do with the fact that the code is in the onCreate.  I know that its not where I'm supposed to put it, but I can't think of anywhere else the code should go.  Am I supposed to make a new .java file and have a main method there?  I'm currently taking classes for C++ and C# so this android thing is still new to me.</p>","611884","","750987","","2011-05-29 06:28:18","2011-05-29 06:28:18","how to add simple code to an android application","<java><android><html><oncreate>","3","0","","",""
"5033824","1","","","2011-02-17 19:50:33","0","1176","<p>I have a problem with my code and i don't seem to find it ! The error is...Application has stopped unexpectedly! I don't have a clue about what's going on. (i'm also a DevAndroid begginer)My first tab works ok, but when i switch to the second one with the ArrayList Hashmap, it crashes.</p><p>Here is my BonuriActivity code:</p><pre><code>public class BonuriActivity extends ListActivity {public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.tab_bonuri);    final String url=""http://xxxzzz/throwdata.php?p=bonuri"";    ListView lv = (ListView) findViewById(android.R.id.list);    SimpleAdapter adapter = new SimpleAdapter(BonuriActivity.this,            getBonuri(url), R.layout.list_bon,             new String[] {""Produs"", ""Cantitate"", ""UM"", ""IdVinzare""},            new int[] { R.id.Produs, R.id.Cantitate, R.id.UM, R.id.IdVinzare });    lv.setAdapter(adapter);}private ArrayList&lt;HashMap&lt;String,String&gt;&gt; getBonuri(String KEY_121) {       InputStream is = null;       String result = """";         HashMap&lt;String,String&gt; entitiesHashMap = new HashMap&lt;String, String&gt;();       ArrayList&lt;HashMap&lt;String, String&gt;&gt; returnString = new ArrayList&lt;HashMap&lt;String,String&gt;&gt;();        //http post        try{                HttpClient httpclient = new DefaultHttpClient();                HttpPost httppost = new HttpPost(KEY_121);                HttpResponse response = httpclient.execute(httppost);                HttpEntity entity = response.getEntity();                is = entity.getContent();        }catch(Exception e){                Log.e(""log_tag"", ""Error in http connection ""+e.toString());        }        //convert response to string        try{                BufferedReader reader = new BufferedReader(new InputStreamReader(is,""iso-8859-1""),8);                StringBuilder sb = new StringBuilder();                String line = null;                while ((line = reader.readLine()) != null) {                        sb.append(line + ""\n"");                }                is.close();                result=sb.toString();        }catch(Exception e){                Log.e(""log_tag"", ""Error converting result ""+e.toString());        }        //parse json data        try{                JSONArray jArray = new JSONArray(result);                for(int i=0;i&lt;jArray.length();i++){                        JSONObject json_data = jArray.getJSONObject(i);                                            //Get an output to the screen                        entitiesHashMap.put(""Produs"", json_data.getString(""Produs""));                        entitiesHashMap.put(""Cantitate"", json_data.getString(""Cantitate""));                        entitiesHashMap.put(""UM"", json_data.getString(""UM""));                        entitiesHashMap.put(""IdVinzare"", json_data.getString(""IdVinzare""));                        returnString.add(entitiesHashMap);                }        }catch(JSONException e){                Log.e(""log_tag"", ""Error parsing data ""+e.toString());        }        return returnString;     }     }</code></pre><p>And here is my TabBonuri.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/tab2Layout""&gt;&lt;ListViewandroid:id=""@android:id/list""android:layout_width=""fill_parent""android:layout_height=""fill_parent""&gt;&lt;/ListView&gt;&lt;/LinearLayout&gt;</code></pre><p>And my list_bon.xml</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearView xmlns:android=""http://schemas.android.com/apk/res/android""&gt;&lt;TextViewandroid:id=""@+id/UM""android:layout_width=""wrap_content""android:layout_height=""wrap_content""android:padding=""10dp""android:text=""UM""android:textSize=""16sp""&gt;&lt;/TextView&gt;&lt;TextViewandroid:id=""@+id/Cantitate""android:layout_width=""wrap_content""android:layout_height=""21px""android:padding=""10dp""android:text=""Cantitate""android:textSize=""16sp""&gt;&lt;/TextView&gt;&lt;TextViewandroid:id=""@+id/Produs""android:layout_width=""121px""android:layout_height=""22px""android:padding=""10dp""android:text=""Produs""android:textSize=""16sp""&gt;&lt;/TextView&gt;&lt;TextViewandroid:id=""@+id/IdVinzare""android:layout_width=""wrap_content""android:layout_height=""wrap_content""android:visibility=""invisible""android:text=""TextView""/&gt;&lt;/LinearView&gt;</code></pre><p>I gradly thank you for your time spent helping me.Please comment if you see why is my program crashing, cause i'm already stressed out with this ('ve been on this for 2 days, it's frustrating).</p>","622020","","622020","","2011-02-17 20:26:27","2011-02-18 11:44:13","The application has stopped unexpectedly! Arraylist Hashmaps and TabHost","<android><arraylist><hashmap><android-tabhost>","2","4","","",""
"5033922","1","","","2011-02-17 20:01:07","0","146","<p>I have a class Ball which extents View.Inside there i give some characteristics and implements onTouchEvent() so i can handle the movement.Also i use onDraw so i can draw the bitmap of the ball. in my activity class i crate a new Layout and i add the view to it so it can be displayed. Everything works fine except when, i try to add more balls to my layout they don't appear!Always the first added in layout ball is displayed!Here's the onCreate code from activity class:</p><pre><code>public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    LinearLayout ll = new LinearLayout(this);    ll.setOrientation(LinearLayout.HORIZONTAL);    int lHeight = LinearLayout.LayoutParams.WRAP_CONTENT;    int lWidth = LinearLayout.LayoutParams.WRAP_CONTENT;    Point point1 = new Point();    point1.x = 50;    point1.y = 20;    Point point2 = new Point();    point2.x = 100;    point2.y = 20;    Point point3 = new Point();    point3.x = 150;    point3.y = 20;    ColorBall ball1 = new ColorBall(this,R.drawable.bol_groen, point1);    ll.addView(ball1, new LinearLayout.LayoutParams(lHeight, lWidth));    setContentView(ll);    ColorBall ball2 = new ColorBall(this,R.drawable.bol_rood, point2);    ll.addView(ball2, new LinearLayout.LayoutParams(lHeight, lWidth));    setContentView(ll);    ColorBall ball3 = new ColorBall(this,R.drawable.bol_blauw, point3);    ll.addView(ball3, new LinearLayout.LayoutParams(lHeight, lWidth));    setContentView(ll);        }</code></pre><p>What could possibly be the problem?I have try it also with only one setContentView() at the end.I am thinking that i can't use a Layout so i can draw bitmaps which are in a custom View!Am i right?Should i change my code and create a View and inside there make an array with all the balls i want to be displayed and then set this View to be displayed from my main class of activity?(like this setContentView(customview)).</p>","587377","","180538","","2011-02-17 21:02:35","2011-02-17 21:02:35","Android user interface with bitmaps problem","<android><user-interface><layout><custom-view>","1","0","","",""
"5033952","1","5034082","","2011-02-17 20:03:45","0","2323","<p>What should I look when my settings <code>Activity</code> is starting up really slow? Sometimes I get <code>ANR keyDispatch error</code> if it takes to long.</p><p>Should also say that I am using <code>PreferenceActivity</code>. The absolute first time I go into settings the delay time is really slow (about 5-10 seconds), but otherwise it goes super smooth. This does appear when I'm reinstalling the application and start the settings for another first time (so it's a first time thing).</p><p>Some code in my settings <code>PreferenceActivity</code>:</p><pre><code>@Overrideprotected void onCreate(Bundle icicle) {    super.onCreate(icicle);    pref = getPreferenceManager();        pref.setSharedPreferencesName(LiveWallpaper.PREFERENCES);    addPreferencesFromResource(R.xml.live);    pref.getSharedPreferences().registerOnSharedPreferenceChangeListener(this);    pref.findPreference(""Username"").setOnPreferenceClickListener(new OnPreferenceClickListener() {                  public boolean onPreferenceClick(Preference preference) {                                          // Stuff...                return true;                            }        }    );// And so on...</code></pre><p>Basically, I want to find out where this error is located, the question is how? Can I see in LogCat WHAT it is that's causing the delay?</p><p>Thanks for any answer!</p>","386562","","","","","2012-01-25 13:49:19","Slow startup of second activity","<android>","2","1","","",""
"5033957","1","5034421","","2011-02-17 20:04:06","0","367","<p>I am using PhoneGap to develop cross-device (simple) applications, and I am currently using eclipse with the Android Emulator.  The problem I am encountering is that it does not appear like my code changes recently are reflected by the application installed on the emulator.  I have tried uninstalling the application from the emulator, cleaning and re-building from within eclipse, but neither of those has worked.</p><p>Is there some manual script I need to run to re-install the .apk?  I am a newbie at mobile development, so please bear with me. :)</p>","537031","","537031","","2011-02-17 20:35:17","2012-04-09 02:45:09","Do I need to prevent caching on Android emulator?","<android><eclipse><caching><mobile><android-emulator>","2","1","","",""
"5034129","1","8720087","","2011-02-17 20:20:16","0","578","<p>So in my app Im trying to make it flash a .zip in clockwork recovery using this </p><pre><code> Runtime run = Runtime.getRuntime();                      Process p = null;                      DataOutputStream out = null;                      try{                          p = run.exec(""su"");                          out = new DataOutputStream(p.getOutputStream());                          out.writeBytes(""echo install_zip SDCARD:"" +clickedFile.toString() +"" &gt; /cache/recovery/extendedcommand\n"");                          out.writeBytes(""reboot recovery\n""); // testing                          out.flush();                      }catch(Exception e){                          Log.e(""FLASH"", ""Unable to reboot into recovery mode:"", e);                          e.printStackTrace();                      }</code></pre><p>It will boot into recovery but it will not flash the .zip.. Whats wrong.. oh, and if you need the whole .java file here it is:</p><p><a href=""http://pastebin.com/NpiSLz90"" rel=""nofollow"">http://pastebin.com/NpiSLz90</a></p>","614820","","","","","2012-03-22 19:55:29","Install .zip in clockwork from app?","<java><android><root>","2","1","","",""
"5034160","1","5034276","","2011-02-17 20:22:46","4","7634","<p>I need to be able to toggle the GPS receiver on and off, and WRITE_SECURE_SETTINGS is required to be able to access secure settings. I've searched around quite a bit, and every answer I saw pretty much said that no app outside of the system/firmware can get that permisssion.</p><p>However, that is simply untrue. There are several apps on the market that do exactly what I'm trying to (in regards to GPS), but there are a bunch more that have the WRITE_SECURE_SETTINGS permissions. For example:</p><p><a href=""https://market.android.com/details?id=com.extendedcontrols"" rel=""nofollow"">Extended Controls</a></p><p><a href=""https://market.android.com/details?id=alei.switchpro"" rel=""nofollow"">SwitchPro</a></p><p><a href=""https://play.google.com/store/apps/details?id=com.amithgc.taskflow"" rel=""nofollow"">Profile Flow</a></p><p>So, how can this be done?</p>","496854","","367016","","2013-10-03 10:09:18","2013-10-03 10:09:18","How can I get the dreaded WRITE_SECURE_SETTINGS permission for my android app?","<android><permissions><gps>","3","0","3","",""
"5034249","1","","","2011-02-17 20:29:59","5","3898","<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>i am working on android sms app and i just want to disable the sms notification for particular messages.I had tried shared preference to uncheck the sms notification  but it didn't work;after that i tried to update  the message status using broadcast receiver onreceive method but then also notification appers....can someone suggest me how to disable the sms notificatioin of native android sms app using shared preference or any other way</p><p>Thank you in advance</p>","622072","","","","","2011-11-12 12:42:02","disable the notification of sms in android","<android>","2","0","1","2012-07-10 23:55:54",""
"5034358","1","","","2011-02-17 20:39:26","0","137","<p>How do I style my android app such that the background is the same as for the built-in calculator and stopwatch?</p>","622093","","","","","2011-02-17 20:39:26","How can i use the same background as the built-in apps use in my android app?","<android><colors><coding-style><background>","0","4","","",""
"5034362","1","5042650","","2011-02-17 20:39:51","2","9492","<p>I have two questions:</p><ol><li><p>If I am using <code>CheckedTextView</code> in a <code>ListView</code> and my class only extends <code>Activity</code> (instead of <code>ListActivity</code>), since I have another button at the bottom below my <code>ListView</code>,what event should I listen on, when a checkbox is selected in the <code>CheckedTextView</code>?</p></li><li><p>If I extend my class to use <code>ListActivity</code>, I can use <code>onListItemClick</code> event, right? How can I add a new button to this type of layout? </p></li></ol><p>Here is my code..</p><pre><code>public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    m_versionText=(TextView)findViewById(R.id.versionText);    m_versionText.setText(""Android Version is:"" + Build.VERSION.RELEASE);    m_btnAllCalendars = (Button)findViewById(R.id.btn_allCalendars);    m_btnAllCalendars.setOnClickListener(mCalendarListener);    m_calendarList=(ListView)findViewById(R.id.calList);    //populateList uses simplecursoradapter to add items to the listview..(this part is working)    populateList();    m_calCheckText = (CheckedTextView)findViewById(R.id.calTextView);    m_calCheckText.setOnClickListener(new OnClickListener(){        @Override        public void onClick(View v){        if (((CheckedTextView)v).isChecked())        {            Log.d(TAG,""i am inside ...its checked"");        }    }    });     private void populateList(){        Log.d(TAG,""inside populateList"");        Cursor cursor = getAllCalendars();        startManagingCursor(cursor);        SimpleCursorAdapter adapter = new SimpleCursorAdapter(this,R.layout.cal_list,cursor,new String[]{""displayName""},new int []{R.id.calTextView});        //m_calendarList.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);        m_calendarList.setAdapter(adapter);      } }</code></pre><p>UPDATE:::</p><pre><code>        SimpleCursorAdapter adapter = new SimpleCursorAdapter(this,R.layout.cal_list,cursor,new String[]{""displayName""},new int []{R.id.calTextView});        m_calendarList=getListView();        m_calendarList.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);        m_calendarList.setAdapter(adapter);        m_calendarList.setOnItemClickListener(new OnItemClickListener(){            public void onItemClick(AdapterView&lt;?&gt; parent, View view,int position,long id)            {                Log.d(TAG,""I am inside onItemClick and position is:""+String.valueOf(position));            CheckedTextView ctv = (CheckedTextView)view;    the below code didnt work too                     //CheckedTextView ctv = (CheckedTextView)view.findViewById(R.layout.cal_list);                ctv.setChecked(!ctv.isChecked());            }        });</code></pre>","622095","","622095","","2011-02-18 17:07:06","2011-02-18 17:14:33","Listview with checkedtextview","<android><listview><checkedtextview>","2","0","1","",""
"5034536","1","5034589","","2011-02-17 20:55:24","0","930","<p>I've got a RelativeLayout with two nested RelativeLayouts. I want first RL to stay on top and second to be scrollable, but this does not work.</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;RelativeLayout    android:id=""@+id/relativeTop""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""&gt;    &lt;!--Buttons--&gt;  &lt;/RelativeLayout&gt;  &lt;ScrollView    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""&gt;    &lt;RelativeLayout      android:layout_width=""fill_parent""      android:layout_height=""wrap_content""&gt;      &lt;!--Lots of nested RelatiLayouts with Views--&gt;    &lt;/RelativeLayout&gt;   &lt;/ScrollView&gt;&lt;/RelativeLayout&gt;</code></pre>","468311","","180538","","2011-02-17 20:57:26","2011-02-17 21:00:09","Android RelativeLayout issue","<android><android-layout>","1","2","","",""
"5034549","1","","","2011-02-17 20:56:26","0","126","<p>I am using RelativeLayout to position views at precise locations on the screen.  This works as expected when using a view that say, draws a rectangle.  But when using Android views like EditText, they are drawn shorter than specified by about 8 units.  Clicking outside of the drawn EditText (but within the parameters specified by RelativeLayout) will, in fact, hit the EditText.  </p><p>Here is some code to illustrate what I mean:</p><pre><code>package com.DrawDemo;import android.app.Activity;import android.content.Context;import android.graphics.Canvas;import android.graphics.Color;import android.graphics.Paint;import android.os.Bundle;import android.view.View;import android.widget.EditText;import android.widget.RelativeLayout;public class DrawDemo extends Activity {    @Override    public void onCreate(Bundle savedInstanceState)     {        super.onCreate(savedInstanceState);        RelativeLayout l = new RelativeLayout(this);        RelativeLayout.LayoutParams lp = new RelativeLayout.LayoutParams(100,100);        lp.leftMargin = 50;        lp.topMargin = 50;        DemoView demoview = new DemoView(this);        l.addView(demoview, lp);        EditText editText = new EditText(this);        l.addView(editText, lp);        setContentView(l);    }    private class DemoView extends View    {        public DemoView(Context context)        {            super(context);        }        @Override protected void onDraw(Canvas canvas)         {            super.onDraw(canvas);            Paint paint = new Paint();            paint.setStyle(Paint.Style.FILL);            paint.setColor(Color.GREEN);            canvas.drawPaint(paint);        }    }}</code></pre><p>If you execute this, you will notice that the EditText is noticeably shorter than the rectangle.  I've tried mucking with onMeasure, setMinimumXXX, and just about everything else I can think of.  So far, the only thing that works with some level of success is to just add 8 or so pixels to the height (8 seems to work better than trying a percentage of the height).</p><p>Next task will be to step into the source but was wondering if somebody has already solved this.</p><p>Thanks.</p>","542697","","542697","","2011-02-17 21:43:00","2011-02-17 21:56:05","Android Views Are Not As Tall As Specified","<android><view><relativelayout>","1","4","","",""
"5034575","1","5045327","","2011-02-17 20:58:57","11","2732","<p>This is my noob question for the week. I'm looking more for general speculation than specific code and maybe hoping the Android folks are watching and could correct this:</p><p>the SDK documentation for Context.openFileOutput says:</p><blockquote>  <p>Open a private file associated with this Context's application package for writing. Creates the file if it doesn't already exist.</p></blockquote><p>Ok, that sounds good. I can create a file. Except this method also throws a FileNotFoundException, so apparently something is amiss. Why would a function that is <em>supposed</em> to create a file if it's not found throw an exception if the file is not found???</p><p>Kinda defeats that whole ""Creates the file..."" thing, doesn't it?</p>","571876","","","","","2011-11-15 00:40:07","openFileOutput FileNotFoundException","<android>","4","2","","",""
"5034584","1","","","2011-02-17 21:00:00","0","359","<p>My widget is deployed in an applications which also launches a main activity.  Most of the time I want this main activity in the background but when I click on the widget it comes to the FOREGROUND and rather than the user seeing the widget change the application main activity displays. I can't get rid of the main activity because I also want to allow users to launch the application that contains the widget. Was wondering how this situation can be managed.  Thanks.</p>","602260","","","","","2011-12-24 03:14:44","Keeping Widget Applications Main Activity in BACKGROUND","<android><activity><widget><launch>","3","0","","",""
"5034605","1","","","2011-02-17 21:01:37","1","491","<p>I am working on an app that will be an alternative to the default Android search app. I want my app to be the default app that runs when the user presses (not long press) the hardware search button. Is this possible?</p>","178533","","","","","2011-02-17 21:14:10","Android Global Search app replacement","<android><android-manifest>","1","0","","",""
"5034742","1","","","2011-02-17 21:14:09","1","749","<p>Well, I have 16 buttons. I want to find an easier way to add them to an onTouch listener, I'm new to Android/java so I'm not sure what would work. Here's my pathetic code for that right now.</p><p><code>public void onCreate(Bundle savedInstanceState)     {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);</p><pre><code>    Button btn_main1 = (Button) findViewById(R.id.cmd_main1);    Button btn_main2 = (Button) findViewById(R.id.cmd_main2);    Button btn_main3 = (Button) findViewById(R.id.cmd_main3);    Button btn_main4 = (Button) findViewById(R.id.cmd_main4);    Button btn_main5 = (Button) findViewById(R.id.cmd_main5);    Button btn_main6 = (Button) findViewById(R.id.cmd_main6);    Button btn_main7 = (Button) findViewById(R.id.cmd_main7);    Button btn_main8 = (Button) findViewById(R.id.cmd_main8);    Button btn_main9 = (Button) findViewById(R.id.cmd_main9);    Button btn_main10 = (Button) findViewById(R.id.cmd_main10);    Button btn_main11 = (Button) findViewById(R.id.cmd_main11);    Button btn_main12 = (Button) findViewById(R.id.cmd_main12);    Button btn_main13 = (Button) findViewById(R.id.cmd_main13);    Button btn_main14 = (Button) findViewById(R.id.cmd_main14);    Button btn_main15 = (Button) findViewById(R.id.cmd_main15);    Button btn_main16 = (Button) findViewById(R.id.cmd_main16);    btn_main1.setOnTouchListener(tListener1);    btn_main2.setOnTouchListener(tListener1);    btn_main3.setOnTouchListener(tListener1);    btn_main4.setOnTouchListener(tListener1);    btn_main5.setOnTouchListener(tListener1);    btn_main6.setOnTouchListener(tListener1);    btn_main7.setOnTouchListener(tListener1);    btn_main8.setOnTouchListener(tListener1);    btn_main9.setOnTouchListener(tListener1);    btn_main10.setOnTouchListener(tListener1);    btn_main11.setOnTouchListener(tListener1);    btn_main12.setOnTouchListener(tListener1);    btn_main13.setOnTouchListener(tListener1);    btn_main14.setOnTouchListener(tListener1);    btn_main15.setOnTouchListener(tListener1);    btn_main16.setOnTouchListener(tListener1);}</code></pre><p></code></p><p>Obviously, that's a terrible way to do it. I'm sure there's a way to do some sort of loop, or put the buttons in an array or something. Any help shortening this up is greatly appreciated!</p>","614502","","","","","2011-02-17 22:19:58","Android OnTouch listener easy question","<java><android>","1","1","","",""
"5034788","1","5035119","","2011-02-17 21:18:15","0","3825","<p>I am building an app for the android, i dont need my app to have a calendar be part of it(plus it would defeat the purpose), my app allows the user to listen to a radio station, and needs the option to set an event to(remember to listen to the radio at a specific time), if the app has its own calendar then the event alarms will only go off if the user has the app open... pointless. i have been looking and cannot find, is there a way to use an intent or something else to open a google calendar or some other calendar that Android might have?i need to put my intent(/ other code) in my listener which i already have and looks like this for now </p><pre><code>private View.OnClickListener reminder = new View.OnClickListener() {        @Override        public void onClick(View v) {                  // open calendar code goes here.            }};</code></pre><p>i dont need the app to pre-fill in any field in the calendar just open it, i will leave the rest up to the user.all help is welcome and thank you</p>","591359","","","","","2011-02-17 22:11:47","how can i open the calendar from my app?","<java><android><android-intent>","1","0","1","",""
"5034791","1","5034920","","2011-02-17 21:18:42","1","847","<p>I am trying to keep a count going on the number of unread notifications in a broadcast receiver and have the number of unread notifications display differently as they accumulate but every time the receiver is fired its going to re-initialize everything and clear out the count. How can i keep control of the count, am i going to have to create another class just to keep the variables? that seems like a lot of work for just something so simple</p>","599346","","","","","2011-02-17 21:31:27","Keeping count of notifications in a broadcast receiver","<android><count><notifications>","1","0","","",""
"5034807","1","5035483","","2011-02-17 21:19:35","0","1232","<p>Am I doing it right?I have a Splash screen (just an image), and onCreate() I start the main activity after running a heavy function:</p><pre><code>              SPLASH_DISPLAY_LENGHT=2500;              new Handler().postDelayed(new Runnable(){              public void run() {                  LONG_OPERATING_FUNCTION();                    Intent mainIntent = new Intent(this, MainActivity.class);                    Splash.this.startActivity(mainIntent);                    Splash.this.finish();              }          }, SPLASH_DISPLAY_LENGHT);           </code></pre><p>I think I have a memory leak, and I'm trying to find it.I don't think the Splash really is finishing.</p>","380490","","","","","2012-01-22 04:51:00","Splash screen: using handler","<android><handler>","2","2","","",""
"5034947","1","5035023","","2011-02-17 21:34:57","4","4129","<p>I'm creating a custom dialog with a background image which has rounded corners. I remove the white border using a custom style, but it's displayed as if a black rectangle of the same size was behind my image, as shown below (the background image of the dialog is the brown one):</p><p><img src=""http://i.stack.imgur.com/REqne.png"" alt=""enter image description here""></p><p>How can I keep the transparent background of my image with the round corners?</p><p><br/></p><p>Layout of my dialog:</p><pre><code>&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""android:id=""@+id/confirmation""android:orientation=""vertical""android:background=""@drawable/dialog_background""android:layout_width=""279dp""android:layout_height=""130dp""   &gt;...</code></pre><p>I remove the white border by applying the following style to my dialog:</p><pre><code>&lt;stylename=""Theme_Dialog_Translucent""parent=""android:Theme.Dialog""&gt;&lt;item name=""android:windowBackground""&gt;@null&lt;/item&gt;&lt;/style&gt;</code></pre><p>My CustomDialog class is:</p><pre><code>public class CustomDialog extends Dialog implements OnClickListener {Button okButton;public CustomDialog(Context context) {    // Custom style to remove dialog border - corners black though :(    super(context, R.style.Theme_Dialog_Translucent);    // 'Window.FEATURE_NO_TITLE' - Used to hide the title    requestWindowFeature(Window.FEATURE_NO_TITLE);          setContentView(R.layout.custom_dialog);    okButton = (Button) findViewById(R.id.button_ok);    okButton.setOnClickListener(this);}...}</code></pre>","326849","","","","","2011-02-17 21:41:48","Issue with image having transparent background in Android","<android><image><dialog><transparent>","1","0","3","",""
"5034952","1","5035110","","2011-02-17 21:35:32","2","1124","<p>I face the common case of having to extract some information in a remote server via an HttpPost request. Imagine we are in the case of a weather app retrieving some weather info.</p><p>The server send a <strong>long</strong> inputstream and we are interested in extracting some information from this stream. Keep in mind we are in a memory-cpu bound environment.</p><p>We have two options:</p><p>1) We use a JSON or XML parser to extract the informations.</p><p>This is the recommended method, but it has some disadvantages:  </p><ul><li><p>It is painfully verbose, especially if we want little information from a big stream.</p></li><li><p>It should be faster and more garbage collection-friendly, but I'm not sure this is the case for the aforementioned case (little information from a big stream).</p></li></ul><p>2) We use simple string manipulation (SSM):</p><p>We reduce the dimension of the inputstream by grossly trimming off useless infos, and then we extract the informations from a compact string. For this purpose, we can build filters using static methods, to reduce the work of the garbage collector.</p><p>Also this method has some disadvantages:</p><ul><li>I think this method is strongly discouraged</li><li>The more informations we extract, the slower this method is. I think there is a critical point in the performance curve where SSM becomes slower.</li><li>It might be less flexible than JSON or other stock parser.</li></ul><p>But also some important advantages:</p><ul><li>Concise, human-readable code.</li><li>It might be difficult to modify an existing filter, but it is much easier to create a new one.</li></ul><p>To sum up, the question is:</p><p>1) Is simple string manipulation a big no-no approach, or it is reasonable to consider its use?2) If you answered yes (big no-no approach) to the previous question, could you explain your reason?</p><p>cheers :)</p>","269931","","","","","2011-02-18 07:56:01","JSON VS simple string manipulation to parse HttpRequest in Android","<java><android><parsing><rest><string>","2","3","1","",""
"5035000","1","5035036","","2011-02-17 21:39:44","1","1978","<p>I read <a href=""http://developer.android.com/reference/android/app/Activity.html"" rel=""nofollow"">http://developer.android.com/reference/android/app/Activity.html</a>but I have a question about PreferenceActivity lifecycle:</p><p>Does a PreferenceActivity get onStop() or onDestory() call?</p><p>I understand it gets onStop() called when user clicks 'Back', but what about onDestory()?when does onDesgtory() for PreferenceActivity get called?</p><p>Thank you.</p>","286802","","","","","2012-09-25 14:44:35","PreferenceActivity lifecycle","<android>","3","0","0","",""
"5035147","1","","","2011-02-17 21:53:44","0","222","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/5035000/preferenceactivity-lifecycle"">PreferenceActivity lifecycle</a>  </p></blockquote><p>I read <a href=""http://developer.android.com/reference/android/app/Activity.html"" rel=""nofollow"">http://developer.android.com/reference/android/app/Activity.html</a>but I have a question about PreferenceActivity lifecycle:</p><p>Does a PreferenceActivity get onStop() or onDestroy() call?</p><p>I understand it gets onStop() called when user clicks 'Back', but what about onDestroy()?when does onDestory() for PreferenceActivity get called?</p><p>Thank you.</p>","286802","","345717","","2011-02-17 21:59:00","2011-02-17 21:59:00","PreferenceActivity lifecycle","<android>","0","0","0","2011-12-15 20:46:20",""
"5035176","1","5035272","","2011-02-17 21:55:50","7","2470","<p>I'm on a quest to learn how to layout components properly in Android.  I'm a seasoned CSS/MXML developer and am having the hardest time getting a full understanding of layout properties in Android components.</p><p>One thing is I'm not sure the differences between these:</p><ul><li>layout_margin vs. padding</li><li>layout_gravity vs. gravity vs. ignoreGravity</li></ul><p>Should you use one over the other with Linear, Table or Relative Layouts?  An example of something I'd like to learn is having an overall margin on a layout with separate components relating to the top/middle/bottom of the screen.  The sdk docs are a good start, but they don't show how things work in different situations.</p><p>Any tips on where to go to learn a more complex/comprehensive layout design?</p>","235708","","21234","","2011-02-17 23:04:42","2011-02-17 23:04:42","Advanced Explanation of Android Layout Properties?","<android><android-layout><android-styles>","2","0","3","",""
"5035276","1","5035292","","2011-02-17 22:07:11","0","4480","<p>what is this error ??</p><pre><code>02-17 22:00:54.199: ERROR/AndroidRuntime(338): FATAL EXCEPTION: main02-17 22:00:54.199: ERROR/AndroidRuntime(338): java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=1, result=-1, data=null} to activity {com.dattsmoon.andFBChat/com.dattsmoon.andFBChat.andFBChat}: java.lang.IllegalThreadStateException: Thread already started.02-17 22:00:54.199: ERROR/AndroidRuntime(338):     at android.app.ActivityThread.deliverResults(ActivityThread.java:2496)02-17 22:00:54.199: ERROR/AndroidRuntime(338):     at android.app.ActivityThread.handleSendResult(ActivityThread.java:2538)02-17 22:00:54.199: ERROR/AndroidRuntime(338):     at android.app.ActivityThread.access$2000(ActivityThread.java:117)02-17 22:00:54.199: ERROR/AndroidRuntime(338):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:958)02-17 22:00:54.199: ERROR/AndroidRuntime(338):     at android.os.Handler.dispatchMessage(Handler.java:99)02-17 22:00:54.199: ERROR/AndroidRuntime(338):     at android.os.Looper.loop(Looper.java:123)02-17 22:00:54.199: ERROR/AndroidRuntime(338):     at android.app.ActivityThread.main(ActivityThread.java:3647)02-17 22:00:54.199: ERROR/AndroidRuntime(338):     at java.lang.reflect.Method.invokeNative(Native Method)02-17 22:00:54.199: ERROR/AndroidRuntime(338):     at java.lang.reflect.Method.invoke(Method.java:507)02-17 22:00:54.199: ERROR/AndroidRuntime(338):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)02-17 22:00:54.199: ERROR/AndroidRuntime(338):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)02-17 22:00:54.199: ERROR/AndroidRuntime(338):     at dalvik.system.NativeStart.main(Native Method)02-17 22:00:54.199: ERROR/AndroidRuntime(338): Caused by: java.lang.IllegalThreadStateException: Thread already started.02-17 22:00:54.199: ERROR/AndroidRuntime(338):     at java.lang.Thread.start(Thread.java:1227)02-17 22:00:54.199: ERROR/AndroidRuntime(338):     at com.dattsmoon.andFBChat.andFBChat.onActivityResult(andFBChat.java:190)02-17 22:00:54.199: ERROR/AndroidRuntime(338):     at android.app.Activity.dispatchActivityResult(Activity.java:3907)02-17 22:00:54.199: ERROR/AndroidRuntime(338):     at android.app.ActivityThread.deliverResults(ActivityThread.java:2492)02-17 22:00:54.199: ERROR/AndroidRuntime(338):     ... 11 more02-17 22:03:14.428: ERROR/InputDispatcher(60): channel '40766410 com.dattsmoon.andFBChat/com.dattsmoon.andFBChat.andFBChat (server)' ~ Consumer closed input channel or an error occurred.  events=0x802-17 22:03:14.438: ERROR/InputDispatcher(60): channel '40766410 com.dattsmoon.andFBChat/com.dattsmoon.andFBChat.andFBChat (server)' ~ Channel is unrecoverably broken and will be disposed!02-17 22:03:15.298: ERROR/InputDispatcher(60): Received spurious receive callback for unknown input channel.  fd=172, events=0x802-17 22:03:15.298: ERROR/InputDispatcher(60): Received spurious receive callback for unknown input channel.  fd=163, events=0x8</code></pre>","508377","","","","","2011-02-17 22:10:03","what is this error in android?","<android>","1","0","","",""
"5035324","1","5035457","","2011-02-17 22:13:02","1","200","<p>This one should be pretty simple.  The use case is that I have a ListView generated by the results of a voice search.  Once the user selects the appropriate item from the list, I want the list to disappear.  This list (its contents) will not be needed again.  I know this can be done in a number of ways, but I am not experienced enough to know which is best (quickest, most efficient with mobile resources...etc.)  I have used clearChoices(), setVisibility(2) 'Gone'.  Anyway I thought I would go to the source for a proper answer.</p><p>Thanks as always for your help.  Here is the relevant code, if you like:</p><pre><code>    protected void onActivityResult(int requestCode, int resultCode, Intent data) {    if (requestCode == VOICE_RECOGNITION_REQUEST_CODE &amp;&amp; resultCode == RESULT_OK) {        mList = (ListView) findViewById(R.id.list);        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));        mList.setTextFilterEnabled(true);        mList.setOnItemClickListener(new OnItemClickListener() {            public void onItemClick(AdapterView&lt;?&gt; parent, View view, int position, long id) {                String description = ((TextView) view).getText().toString();                final EditText etDesc = (EditText) findViewById(R.id.EditDescription);                etDesc.setText(description);                mList.setVisibility(2);            }        });    }}   </code></pre>","593078","","","","","2011-02-17 22:24:11","Removing ListView after user selects item","<android><listview><visibility>","1","0","","",""
"5035329","1","","","2011-02-17 22:13:23","1","609","<p>I'm building an app that relies on a lot of online content. I'd like to monitor how much is being downloaded and attempt to minimize it as much as possible. These days, with more and more carriers implementing data caps, users deserve an application that has gone through data consumption testing.</p>","97120","","","","","2011-02-18 02:26:33","Monitor data consumption in Android app?","<android><data><usage>","1","2","","",""
"5035456","1","6633751","","2011-02-17 22:24:10","44","56191","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/4072706/the-connection-to-adb-is-down-and-a-severe-error-has-occured"">The connection to adb is down, and a severe error has occured</a>  </p></blockquote><p>I am currently trying to develop an application for Android in the latest release of Eclipse. When I try to build and run, the following comes up: </p><pre><code>[2011-02-17 17:08:03 - &lt;ProgramName&gt;] The connection to adb is down, and a severe error has occured.[2011-02-17 17:08:03 - &lt;ProgramName&gt;] You must restart adb and Eclipse.[2011-02-17 17:08:03 - &lt;ProgramName&gt;] Please ensure that adb is correctly located at 'C:\&lt;sdk-directory&gt;s\platform-tools\adb.exe' and can be executed.</code></pre><p>Now, I have updated the ADT plugin, I have the latest version of the Android SDK; adb.exe is, in fact, in the platform-tools directory and can be executed. I've tried everything I found on Google:</p><ul><li>I tried adb kill-server and adb start-server</li><li>I tried to run it with an without an emulator started</li><li>I have the given directory in my PATH (I tried with just the platform-tools in the path and I tried with having both platform-tools and tools in my PATH).</li></ul><p>Notes: I am running Windows 7. Also, I have previously tested apps in Eclipse. This error is new to me since upgrading the SDK. </p>","371018","","180538","","2011-02-26 15:04:19","2014-01-31 17:45:40","The connection to adb is down, and a severe error has occurred","<android><eclipse><adb><adt>","11","5","8","2012-07-25 18:36:24",""
"5035585","1","","","2011-02-17 22:37:36","1","502","<p>I have a HorizontalScrollView with a LinearLayout in it. The Linerlayout has images in it. When i use TranslateAnimation to move the image from one x-coordinate to another x coordinate. the animation is very flickring. The image size is around 2400 pix wide and 100 pix height.</p><p>I can't find a way to prevent the filckring with TranslateAnimation. Any ideas ?  </p>","260298","","338479","","2013-05-21 15:03:43","2013-05-21 15:03:43","flickering Translate animation in Android","<android><animation>","1","0","","",""
"5035669","1","","","2011-02-17 22:49:18","2","3040","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/4460508/android-move-bitmap-along-a-path"">Android, move bitmap along a path?</a>  </p></blockquote><p>Is there a way to animate an ImageView's position along a path on the Android as with a CGPath on the iPhone? I have scoured the web for a solution to this, but no one has even seemed to ask about it. I didn't see anything in the Android docs describing this functionality.</p>","535488","","","","","2012-07-11 02:02:18","Animate image along path on Android?","<android><animation><path><imageview>","2","1","","2012-07-11 02:27:44",""
"5035685","1","5035851","","2011-02-17 22:50:51","0","66","<p>suppose you have a location listener that might be listening for location updates from the network provider. I want whenever the user enables GPS my listener to stop using network and start listening from the GPS. </p><p>My understanding is that whenever a provider is enabled it sends a message to the onProviderEnabled() method passing in a string with its name.</p><p>What is the actual value that is passed in for GPS? Is it ""GPS"", ""gps"" or ""GPS_PROVIDER""?</p><p>Thanks</p><p>Mike</p>","582665","","","","","2011-02-17 23:08:36","What is the actual string that is passed in in the onProviderEnabled(String provider) method?","<android><geolocation><gps><locationlistener>","1","0","","",""
"5035692","1","5035823","","2011-02-17 22:51:29","0","4611","<p>I am trying to load an xml file located in the /assets folder of an android project by name using this method:</p><pre><code>getAssets().openXmlResourceParser(""thefilename.xml"");</code></pre><p>However, executing this code always throws a ""FileNotFound"" exception, even though the file is located in the /assets folder and is with the correct file name.Now, I have not put the file in the /res/xml folder because I really need to be able to 1. edit the file right on the device itself and most importantly 2. add new xml files to the application without issuing an update, to allow for easy user modifications.Thanks in advance.</p>","457899","","","","","2011-02-17 23:05:28","How to load an xml file from android's assets folder by name","<android><xml><file-io>","1","0","","",""
"5035752","1","","","2011-02-17 22:58:04","0","1107","<p>I create an HTTP streaming server, but the clients can not play all video formats, so my question is, if there is a way, using xuggle in the server to transcode the video in a specific format and streaming it directly, on the fly. </p><p>I mean, not have to wait to finish the transcoding and then start the http streaming. I mean that I have a loop for example and get everytime a number of transcoded bytes and writes them to the socket.</p>","594971","","2961","","2011-03-07 12:31:59","2011-03-07 12:34:16","Use Xuggle in Java to trancode and streaming video/audio","<java><android><video><stream><xuggle>","1","0","","",""
"5035961","1","5036074","","2011-02-17 23:20:12","1","851","<p>I have a need to check for the enter key to start a search routine. All works except some keyboards seem to have a SEND button instead of the ENTER button.  When this is pressed the code dumps.  I have a small sample below.  Any ideas?</p><pre><code>tx1.setOnEditorActionListener (new OnEditorActionListener() {    @Override    public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {        System.out.println(""Key: "" + event.getKeyCode()); //BLOWS UP HERE        if  (event.getAction() ==  KeyEvent.ACTION_DOWN) {            if (event.getKeyCode() == KeyEvent.KEYCODE_ENTER) {                // ...            }        }    }}</code></pre>","528130","","180538","","2011-02-17 23:24:49","2011-02-17 23:36:46","android SEND key crashes","<android><keyevent>","1","3","","",""
"5035993","1","","","2011-02-17 23:25:02","0","401","<p>I set up diffuse lighting:</p><pre><code>private float[] lightAmbient = { 0.5f, 0.5f, 0.5f, 1.0f };private float[] lightDiffuse = { 1.0f, 1.0f, 1.0f, 1.0f };private float[] lightPosition = { 0.0f, 0.0f, 2.0f, 1.0f };gl.glLightfv(GL10.GL_LIGHT0, GL10.GL_AMBIENT, lightAmbientBuffer);gl.glLightfv(GL10.GL_LIGHT0, GL10.GL_DIFFUSE, lightDiffuseBuffer);gl.glLightfv(GL10.GL_LIGHT0, GL10.GL_POSITION, lightPositionBuffer);gl.glEnable(GL10.GL_LIGHT0);gl.glShadeModel(GL10.GL_SMOOTH);</code></pre><p>But I get triangulated shading or flat color on the cube located at origin ( center) and rotated 45 deg around x and y. So the cube is directly in front of the light. Any reasons why I am getting such poor results? Attached is the cube image.</p><p><img src=""http://i.stack.imgur.com/rbbAJ.jpg"" alt=""enter image description here""></p>","574122","","574122","","2011-02-18 10:06:28","2011-06-01 17:49:15","Poor shading problem in Android OpenGL ES","<android><opengl-es>","1","2","","",""
"5036008","1","","","2011-02-17 23:26:20","1","527","<p>I have a simple webview that checks for a mp4 in shouldOverrideUrlLoading, and starts an intent like so:</p><pre><code>Intent intent = new Intent(Intent.ACTION_VIEW);intent.setDataAndType(uri, ""video/mp4"");startActivity(intent); </code></pre><p>A video will only work after I hit the MP4 in the browser directly...</p><p>Here is the LogCat for the error:</p><pre><code>WARN/MediaPlayer(4355): info/warning (1, 26)ERROR/PlayerDriver(1159): Command PLAYER_INIT completed with an error or info PVMFFailureERROR/MediaPlayer(4355): error (1, -1)WARN/PlayerDriver(1159): PVMFInfoErrorHandlingCompleteERROR/MediaPlayer(4355): Error (1,-1)</code></pre><p>Any Ideas?</p>","622312","","345717","","2011-02-17 23:30:48","2011-02-17 23:30:48","Launching ACTION_VIEW Intent for http MP4 fails unless I hit the MP4 directly in the browser first","<android><video><android-intent><mp4>","0","1","1","",""
"5036024","1","5036289","","2011-02-17 23:28:50","2","251","<p>I have a tab layout app that needs to download a few files right when it starts, so in the Main.java file in the onCreate method I call:</p><pre><code>  myProgressDialog = ProgressDialog.show(Controller.this,                ""Please wait..."", ""Doing Extreme Calculations..."", true);    downloadFile(NAME_LOCAL, NAME_SERVER, true);</code></pre><p>downloadFile is a separate thread it looks likes this:</p><pre><code> protected void downloadFile(final String localFilePath, final String remoteFileName, final boolean ASCII) {            // Fire off a thread to do some work that we shouldn't do directly in the UI thread            Thread a = new Thread() {                public void run() {                    Logger.setLevel(Level.DEBUG);                         try{                            //create client                            log.info(""Creating Client"");                            ftp = new FileTransferClient();                            log.info(""Setting Remote Host"");                            ftp.setRemoteHost(host);                            ftp.setUserName(username);                            ftp.setPassword(password);                            //connect. . .We hope                            log.info(""Connecting to server "" + host);                            ftp.connect();                            ftp.getAdvancedFTPSettings().setConnectMode(FTPConnectMode.PASV);                            if(ASCII){                            ftp.setContentType(FTPTransferType.ASCII);                            Log.d(""ASCII"", ""USING ASCII"");                            }else if(!ASCII){                                Log.d(""BINARY"", ""USING BINARY"");                                ftp.setContentType(FTPTransferType.BINARY);                            }                            ftp.downloadFile(cache + localFilePath , remoteFileName);                        }catch (Exception e){                            e.printStackTrace();                        }                    mHandler.post(mUpdateResults);                    Handler handler=new Handler();                    handler.post(new Runnable(){public void run(){myProgressDialog.dismiss();}});                }            };            a.start();        }</code></pre><p>In log cat it starts the download, and it finishes then all the sudden it gives me this:</p><pre><code>02-17 17:27:51.175: ERROR/WindowManager(2523): Activity org.IRE.toolbox.Controller has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView@46eba2f0 that was originally added here02-17 17:27:51.175: ERROR/WindowManager(2523): android.view.WindowLeaked: Activity org.IRE.toolbox.Controller has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView@46eba2f0 that was originally added here</code></pre><p>Whats going on?!Thanks in advance!</p>","614820","","","","","2011-02-18 00:08:49","WindowLeaked exception right when thread finishes and calls dialog.dissmiss();","<java><android><progressdialog>","1","1","","",""
"5036177","1","5036208","","2011-02-17 23:53:28","0","580","<p>I'm trying to use MySQL (phpmyadmin) in my android 2.1 update 1 version. I downloaded the driver of MySQL and included the jar file to my referenced library. From then, I'm having error  </p><p><code>Conversion to Dalvik format failed with error 1</code></p><p>I saw couple of solutions but everyone is saying to remove the .jar files which I can't. I need both <code>jama-1.0.2.jar</code> and <code>mysql-connector-java-5.1.15-bin.jar</code>.</p><p>Any solution please?</p>","400859","","","","","2011-02-17 23:58:42","Conversion to Dalvik format failed with error 1","<android><mysql><jar><phpmyadmin>","1","0","0","",""
"5036179","1","5066821","","2011-02-17 23:54:33","0","1228","<p>I am doing a project using PhoneGap + jQuery Mobile in Android. I am trying to make the header like this:</p><p>[BTN 1]--------APP NAME-------[BTN 2]</p><p>USER NAME---------------------[BTN 3]</p><p>I tried the following code but only can get this:</p><pre><code>    &lt;div data-role=""header"" data-position=""fixed""&gt;        &lt;a href=""#"" data-icon=""gear""&gt;Edit&lt;/a&gt;        &lt;h1&gt;APP NAME&lt;/h1&gt;        &lt;a href=""#"" data-icon=""plus""&gt;Children&lt;/a&gt;        &lt;div&gt;            USERNAME            &lt;a href=""add.html?"" data-rel=""dialog"" data-transition=""slidedown"" data-role=""button"" data-icon=""plus""&gt;Measurement&lt;/a&gt;        &lt;/div&gt;&lt;!-- /navbar --&gt;    &lt;/div&gt;</code></pre><p>[BTN 1]--------APP NAME-------[BTN 2]</p><p>USER NAME[BTN 3]</p><p>Then I tried following:</p><pre><code>&lt;div data-role=""header"" data-position=""fixed""&gt;    &lt;a href=""#"" data-icon=""gear""&gt;Edit&lt;/a&gt;    &lt;h1&gt;APP NAME&lt;/h1&gt;    &lt;a href=""#"" data-icon=""plus""&gt;Children&lt;/a&gt;    &lt;div&gt;        USERNAME        &lt;a href=""add.html?"" data-rel=""dialog"" data-transition=""slidedown"" data-role=""button"" data-icon=""plus"" class=""ui-btn-right""&gt;Measurement&lt;/a&gt;    &lt;/div&gt;&lt;!-- /navbar --&gt;&lt;/div&gt;</code></pre><p>Then it become:</p><p>[BTN 1]--------APP NAME-------[BTN 3]</p><p>USER NAME---------------------</p><p>I think it is because [BTN 3] is on the top of the [BTN 2]</p><p>So how can I get the first layout? Any suggestion will be appreciated.</p>","479927","","703019","","2012-03-07 10:54:28","2012-03-07 10:54:28","PhoneGap + jQuery Mobile in Android: how to adjust the header using HTML5","<jquery><android><html5><mobile><phonegap>","1","0","","",""
"5036273","1","","","2011-02-18 00:07:05","6","2123","<pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout  xmlns:android=""http://schemas.android.com/apk/res/android""  xmlns:app=""http://schemas.android.com/apk/res/com.org.BatteryManager""  android:layout_width=""match_parent""  android:layout_height=""wrap_content""  android:orientation=""vertical""  &gt;&lt;com.org.BatteryManager.BatteryViewandroid:layout_width=""match_parent""android:layout_height=""wrap_content""app:textColor=""#ffffffff""/&gt;&lt;/LinearLayout&gt;02-17 18:49:49.392: WARN/AppWidgetHostView(124): updateAppWidget couldn't find any view, using error view    02-17 18:49:49.392: WARN/AppWidgetHostView(124): android.view.InflateException: Binary XML file line #9: Error inflating class com.org.BatteryManager.BatteryView    02-17 18:49:49.392: WARN/AppWidgetHostView(124):     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:576)    02-17 18:49:49.392: WARN/AppWidgetHostView(124):     at android.view.LayoutInflater.rInflate(LayoutInflater.java:618)    02-17 18:49:49.392: WARN/AppWidgetHostView(124):     at android.view.LayoutInflater.inflate(LayoutInflater.java:407)    02-17 18:49:49.392: WARN/AppWidgetHostView(124):     at android.view.LayoutInflater.inflate(LayoutInflater.java:320)    02-17 18:49:49.392: WARN/AppWidgetHostView(124):     at android.widget.RemoteViews.apply(RemoteViews.java:930)    02-17 18:49:49.392: WARN/AppWidgetHostView(124):     at android.appwidget.AppWidgetHostView.updateAppWidget(AppWidgetHostView.java:219)    02-17 18:49:49.392: WARN/AppWidgetHostView(124):     at android.appwidget.AppWidgetHost.updateAppWidgetView(AppWidgetHost.java:250)    02-17 18:49:49.392: WARN/AppWidgetHostView(124):     at android.appwidget.AppWidgetHost$UpdateHandler.handleMessage(AppWidgetHost.java:73)    02-17 18:49:49.392: WARN/AppWidgetHostView(124):     at android.os.Handler.dispatchMessage(Handler.java:99)    02-17 18:49:49.392: WARN/AppWidgetHostView(124):     at android.os.Looper.loop(Looper.java:123)    02-17 18:49:49.392: WARN/AppWidgetHostView(124):     at android.app.ActivityThread.main(ActivityThread.java:4627)    02-17 18:49:49.392: WARN/AppWidgetHostView(124):     at java.lang.reflect.Method.invokeNative(Native Method)    02-17 18:49:49.392: WARN/AppWidgetHostView(124):     at java.lang.reflect.Method.invoke(Method.java:521)    02-17 18:49:49.392: WARN/AppWidgetHostView(124):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)    02-17 18:49:49.392: WARN/AppWidgetHostView(124):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)    02-17 18:49:49.392: WARN/AppWidgetHostView(124):     at dalvik.system.NativeStart.main(Native Method)    02-17 18:49:49.392: WARN/AppWidgetHostView(124): Caused by: java.lang.ClassNotFoundException: com.org.BatteryManager.BatteryView in loader dalvik.system.PathClassLoader[.]    02-17 18:49:49.392: WARN/AppWidgetHostView(124):     at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)    02-17 18:49:49.392: WARN/AppWidgetHostView(124):     at java.lang.ClassLoader.loadClass(ClassLoader.java:573)    02-17 18:49:49.392: WARN/AppWidgetHostView(124):     at java.lang.ClassLoader.loadClass(ClassLoader.java:532)    02-17 18:49:49.392: WARN/AppWidgetHostView(124):     at android.view.LayoutInflater.createView(LayoutInflater.java:466)    02-17 18:49:49.392: WARN/AppWidgetHostView(124):     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:565)    02-17 18:49:49.392: WARN/AppWidgetHostView(124):     ... 15 more</code></pre>","620335","","","","","2011-09-05 06:01:13","Android Custom Widget Inflate Exception","<android>","2","1","","",""
"5036299","1","5354597","","2011-02-18 00:09:54","2","200","<p>HiI am creating a contact based application.In that i have a text view in that I want load the contacts from phone at the time of editing the text view.</p><p>Please any one help me how to do thisThanks in Advance</p>","609050","","","","","2011-03-18 15:58:38","How to load contacts in text view at the time of editing?","<android><contacts>","1","2","","",""
"5036305","1","5036387","","2011-02-18 00:10:56","0","1317","<p>I am still not completely sure of this opening a new screen with a new intent. I have two problems. 1 is getting it to work and the second is more theory.</p><p>Firstly I have two packages com.quiz.max and com.reason.max both have activities names accordingly eg Quiz and Reason respectively. Here is the on click code I am trying to execute at the moment in quiz to go to reason.</p><pre><code>        Intent intent = new Intent();        intent.setClassName(""com.reason.max"", ""com.reason.max.Reason"");        this.startActivityForResult(intent, requestCode);</code></pre><p>Secondly I heard if I start this intent then everytime i click the button a new intent is created. Does this mean if the user goes to reason page and navigates back and clicks the button again they actually create a new intent instead of going back to the already active one. Thus dozens could be opened via this method. Therefore should I close each reason intent once navigated back or is this a redundant point?</p><p>Max</p>","614460","","","","","2011-02-18 00:27:15","Android New Intent New Screen","<android>","1","0","","",""
"5036370","1","5037315","","2011-02-18 00:20:17","2","3368","<p>Evening :)</p><p>I have a little problem...</p><p>As you can see in my code below, the Textview which i am trying to setText on, is getting me a Nullpointer :(</p><p>Is there anyone which can tell me what i am doing wrong ? :)</p><p>And the string s isnt null or, it is the view itself. It is working when setting the text in the oncreate().</p><p>Thanks..</p><pre><code>public class smsShower extends Activity{    private TextView status;    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        requestWindowFeature(Window.FEATURE_NO_TITLE);        setContentView(R.layout.show);        //status = (TextView)findViewById(R.id.status);        status = (TextView)findViewById(R.id.status);    }    public void displayText(String s){        status.setText(s);    }}</code></pre><p>smsReceiverclass:</p><pre><code>public class smsreceiver extends BroadcastReceiver {    private String str;    private boolean received = false;    private smsShower smsshow;    @Override    public void onReceive(Context context, Intent intent) {           //---get the SMS message passed in---        Bundle bundle = intent.getExtras();               smsshow = new smsShower();        SmsMessage[] msgs = null;        str = """";                    if (bundle != null)        {            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]);                 if(msgs[i].getDisplayOriginatingAddress().equals(""1990""))                {                    received = true;                    str += msgs[i].getMessageBody().toString();                    smsshow.displayText(str);                }</code></pre><p>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;TextView android:id=""@+id/status"" android:layout_alignParentTop=""true"" android:text=""Status:"" android:layout_height=""match_parent"" android:layout_width=""match_parent""&gt;&lt;/TextView&gt;&lt;/RelativeLayout&gt;</code></pre><p>Error Log:</p><pre><code>02-18 01:14:20.064: ERROR/AndroidRuntime(18964): Caused by: java.lang.NullPointerException02-18 01:14:20.064: ERROR/AndroidRuntime(18964):     at com.sms1990.smsShower.displayText(smsShower.java:36)02-18 01:14:20.064: ERROR/AndroidRuntime(18964):     at com.sms1990.smsreceiver.onReceive(smsreceiver.java:47)02-18 01:14:20.064: ERROR/AndroidRuntime(18964):     at android.app.ActivityThread.handleReceiver(ActivityThread.java:2941)</code></pre>","453562","","453562","","2011-02-18 08:59:50","2011-02-19 10:23:23","How to change text on a Textview","<android><textview>","4","1","","",""
"5036385","1","5036481","","2011-02-18 00:22:24","7","3157","<p>What is the best practice for updating the DB schema?  I could send a text file with the SQL commands.  The app could check the text file and execute the commands needed.  I am guessing then I will have a flag to indicate that the update has been done.  I havent found a way to delete a file in the asset folder from the app, which would be the best thing to do after the DB was updated.  </p><p>Any thoughts on this?</p>","528130","","210916","","2011-04-26 15:37:39","2011-04-26 15:37:39","Android update SQLite DB schema?","<android><sqlite>","3","0","2","",""
"5036438","1","","","2011-02-18 00:30:12","0","736","<p>I have a WidgetProvider which is around for milliseconds. It takes in an intent, and it kicks off a service which takes maybe noticeable time. I wanted to display something to the user during this delay like a progress bar that will block user, but the BroadcastReceiver/WidgetProvider seems like the wrong place to start up a progress bar. Where should I issue the Progress Bar in this case?  Service maybe?  but service might not be part of UI at all? </p>","602260","","","","","2011-02-18 06:10:14","Android Progress Dialog","<android><dialog><widget>","3","3","","",""
"5036451","1","5036565","","2011-02-18 00:32:45","1","9076","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/6165070/receiver-not-registered-exception-error"">Receiver not registered exception error?</a>  </p></blockquote><p>I have a TabActivity and the 'content' of each TabSpec is my own GuideListActivity class.</p><p>There are seven tabs (one for each day of the week) and each GuideListActivity shows TV Guide info for one TV channel / one day of the week.</p><p>The TabActivity maintains which channel number the user is viewing guide details for and when the user changes to view another channel's info, the TabActivity uses sendStickyBroadcast() with an Intent identifying which channel's info to display (having first removed any previous sticky broadcast that may exist).</p><p>This works but I'm getting seemingly random issues with the GuideListActivity's BroadcastReceiver which are too frequent to ignore (even in 'Beta' level code). The error I see is...</p><pre><code>java.lang.RuntimeException: Unable to pause activity {com.mycompany.mypackage/com.mycompany.mypackage.GuideListActivity}: java.lang.IllegalArgumentException: Receiver not registered: com.mycompany.mypackage.GuideListActivity$ChannelChangeListener@462ebe20</code></pre><p>Each GuideListActivity maintains its own BroadcastReceiver (obviously) example...</p><pre><code>public class GuideListActivity extends ListActivity {    private ChannelChangeListener listener = null;    private Intent ChannelChangeListenerIntent = null;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        listener = new ChannelChangeListener();    }    @Override    protected void onResume(){        super.onResume();        if (ChannelChangeListenerIntent == null)            ChannelChangeListenerIntent = registerReceiver(listener, new IntentFilter(packageName + "".GUIDE_UPDATE""));    }    @Override    protected void onPause() {        super.onPause();        if (ChannelChangeListenerIntent != null)            unregisterReceiver(listener); // &lt;== EXCEPTION THROWN HERE    }    // Nested 'listener' class    public class ChannelChangeListener extends BroadcastReceiver {        @Override        public void onReceive(Context context, Intent intent) {            // Handle intent        }    }}</code></pre><p>As I said this seems to be random - I can stick to one channel and click 1, 2 maybe 3 or even all 7 tabs then next click , the exception is thrown. Other times it happens on the second click.</p><p>Any help to explain this and how I could fix it would be really appreciated.</p>","488241","","488241","","2011-02-18 00:54:56","2011-12-02 11:13:32","Problem with BroadcastReceiver (Receiver not registered error)","<android><broadcastreceiver>","2","1","","2012-07-27 14:02:26",""
"5036587","1","5773373","","2011-02-18 00:54:51","1","287","<p>I have a test that is using an ActivityMonitor to wait for an activity to start, e.g.</p><pre><code>// ins is an instance of the Instrumentation class.Instrumentation.ActivityMonitor mon = new Instrumentation.ActivityMonitor((String)null, null, false);ins.addMonitor(mon);// do something that will start an activityActivity a = ins.waitForMonitorWithTimeout(mon, msWaitTime);</code></pre><p>At the point when waitForMonitorWithTimeout returns, what point in the activity lifecycle is the activity at, has it already been through create/start/resume etc, or is that still going on ? The docs just say that it returns the started activity, but with no indication of what state the activity is in.</p>","41455","","","","","2011-04-24 21:32:49","At what point in the Activity Lifecycle does an ActivityMonitor fire?","<android><unit-testing>","1","0","1","",""
"5036703","1","5046772","","2011-02-18 01:15:00","26","8612","<p>I am using PhoneGap + jQuery Mobile in Android, I am confused about the Phonegap's  ""onBodyLoad()/onDeviceReady()"" functions and Jquery's ""$(document).ready()"".</p><p>In PhoneGap documents:</p><blockquote>  <p>PhoneGap consists of two code bases:  native and JavaScript. While the  native code is loading, a custom  loading image is displayed. However,  JavaScript is only loaded once the DOM  loads. This means your web application  could, potentially, call a PhoneGap  JavaScript function before it is  loaded.</p>    <p>The PhoneGap deviceready event fires  once PhoneGap has fully loaded. After  the device has fired, you can safely  make calls to PhoneGap function.</p>    <p>Typically, you will want to attach an  event listener with  document.addEventListener once the  HTML document's DOM has loaded.</p></blockquote><p>In jQuery doc:</p><blockquote>  <p>While JavaScript provides the load  event for executing code when a page  is rendered, this event does not get  triggered until all assets such as  images have been completely received.  In most cases, the script can be run  as soon as the DOM hierarchy has been  fully constructed. The handler passed  to .ready() is guaranteed to be  executed after the DOM is ready, so  this is usually the best place to  attach all other event handlers and  run other jQuery code. When using  scripts that rely on the value of CSS  style properties, it's important to  reference external stylesheets or  embed style elements before  referencing the scripts.</p>    <p>In cases where code relies on loaded  assets (for example, if the dimensions  of an image are required), the code  should be placed in a handler for the  load event instead.</p></blockquote><p>My experiments shows that ready() is always earlier that onDeviceReady(), how to explain this? How should I use them? Should I put ready() in onDeviceReady() to make every call safe?</p><p>Thank you in advance.</p><p>Regards,Chris</p>","479927","","","","","2012-03-10 06:32:07","The relationship between Phonegap's ""onBodyLoad()/onDeviceReady()"" functions and Jquery's ""$(document).ready()""","<jquery><android><mobile><phonegap>","1","0","10","",""
"5036729","1","","","2011-02-18 01:19:30","1","840","<p>I don not know what I am doing I get this error on Main.1 local1 = new Main.1(this);Multiple markers at this line</p><pre><code>- local1 cannot be resolved or is not a field- Syntax error on token "".1"", . expected- Syntax error on token "".1"", delete this token- The constructor Main(Main) is undefined</code></pre><p>and then on localGridView.setOnItemClickListener(local1); I get this errorlocal1 cannot be resolved to a variable</p><p>any suggestions?</p><pre><code>import android.app.Activity;import android.os.Bundle;import android.view.Window;import android.widget.GridView;public class Main extends Activity{  public void onCreate(Bundle paramBundle)  {    super.onCreate(paramBundle);    getWindow().setFlags(1024, 1024);    setContentView(2130903042);    setRequestedOrientation(1);    GridView localGridView = (GridView)findViewById(2131034124);    ImageAdapter localImageAdapter = new ImageAdapter(this);    localGridView.setAdapter(localImageAdapter);    Main.1 local1 = new Main.1(this);    localGridView.setOnItemClickListener(local1);  }}</code></pre>","622416","","345717","","2011-02-18 01:20:27","2011-02-18 01:20:27","local1 cannot be resolved or is not a field","<android>","0","5","1","",""
"5036810","1","","","2011-02-18 01:37:42","0","376","<p>I get a blank screen when I try to fill it with a web view on the android. The program runs with out errors, but i get a blank screen. I'm ussin g sdk 1.6 and running it in  the simulator</p><p>The codepackage mikenorman.org;</p><pre><code>import android.app.Activity;import android.view.*;import android.os.Bundle;import android.view.View;import android.webkit.WebView;public class cBlog extends Activity { @Overrideprotected void onCreate(Bundle savedInstanceState){    super.onCreate(savedInstanceState);    setContentView(R.layout.blog);WebView  mWebView;mWebView=(WebView) findViewById(R.id.bwebpage);mWebView.loadUrl(""http://www.besttechsolutions.biz"");}</code></pre><p>the layout file</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=""wrap_content""&gt;&lt;WebViewandroid:id=""@+id/bwebpage""android:layout_width=""fill_parent""android:layout_height=""fill_parent""android:layout_weight=""1.0""/&gt;</code></pre><p>}}-Ted</p>","564653","","2256325","","2013-09-08 19:05:43","2013-09-08 19:05:43","Cannot get web view to work on Android sdk 1.6","<android><webview>","2","1","","",""
"5036912","1","5037102","","2011-02-18 01:59:00","0","158","<p>Helllo</p><p>I am trying to upload some images to the server. If i placed the code in the subclass of activity, will the sending be interrupted by the onPause function when the user leaving the activity while the user want to use other application. If this is the problem would it be better to use service to upload the file instead?</p>","186820","","","","","2011-02-18 02:34:10","Question about android: I Want to upload images to server","<android><service><upload><activity>","1","0","","",""
"5036939","1","5977124","","2011-02-18 02:04:18","3","877","<p>In my android application I am using an async task to write some data to a database in a transaction. This database is also accessed from the UI thread. While looking through the available database methods I came across yieldIfContendedSafely(). It seems like this method should be used for any case where a transaction is being made from a seperate thread. But there is hardly any documentation on this method other than the following:</p><blockquote>  <p>Temporarily end the transaction to let other threads run. The transaction is assumed to be successful so far. Do not call setTransactionSuccessful before calling this. When this returns a new transaction will have been created but not marked as successful. This assumes that there are no nested transactions (beginTransaction has only been called once) and will throw an exception if that is not the case.</p></blockquote><p>Here is how I would assume that you would use this method from a thread:</p><pre><code>        try {        db.beginTransaction();        //insert some stuff into the database here         ...        // is this how you use this method?        boolean yielded = db.yieldIfContendedSafely();        if (yielded) {            try {                Thread.sleep(500);            } catch (InterruptedException e) {                e.printStackTrace();            }        }        db.setTransactionSuccessful();    } catch (SQLException e) {        return false;    } finally {        db.endTransaction();        db.close();    }</code></pre><p>Is this the correct way to use this method?</p><p>Is it ok to use db.yieldIfContendedSafely() more than once on the same transaction? (for example in between multiple writes to different tables in the database)</p><p>Any help with this method would be much appreciated since the documentation is somewhat vague.</p>","590017","","","","","2011-05-12 11:14:39","how to properly use yieldIfContendedSafely() in an android multithreaded application","<java><android><database><multithreading>","1","0","","",""
"5036997","1","","","2011-02-18 02:14:37","0","1421","<p>I am relatively new to android and I really need help with this one. I am trying to write some code that will display the pictures on the sd card using a GridView, but so far when I run the application only the textview at the top is shown. I would like to know if there is a serious flaw in the logic of my code in the Main Activity code, Image Adapter class code or both. This is my code:</p><pre><code>package com.newtestforsdcarddisplay;import android.app.Activity;import android.os.Bundle;import android.database.Cursor;import android.graphics.Bitmap;import android.graphics.BitmapFactory;import android.view.View;import android.widget.GridView;import android.widget.AdapterView;import android.widget.Toast;import android.provider.MediaStore;import android.provider.MediaStore.Images.Thumbnails;import android.net.Uri;import android.widget.AdapterView.OnItemClickListener;public class MainActivity extends Activity {public Cursor myImageCursor;public int columnNumber;/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);String[] imageIDs = new String[]{Thumbnails._ID};Uri myImagesSource = MediaStore.Images.Media.EXTERNAL_CONTENT_URI;myImageCursor = managedQuery(myImagesSource,                 imageIDs, null, null, MediaStore.Images.Thumbnails._ID);         columnNumber = myImageCursor.getColumnIndexOrThrow(MediaStore.Images.Media._ID);    GridView PhoneImageView = (GridView)findViewById(R.id.sdcard);    PhoneImageView.setAdapter(new ImageAdapter(this));    PhoneImageView.setOnItemClickListener(new OnItemClickListener() {         public void onItemClick(AdapterView&lt;?&gt; parent, View v,int position, long id) {              String[] data = { MediaStore.Images.Media.DATA };             Cursor  viewImageCursor = managedQuery(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, data,null, null, MediaStore.Images.Thumbnails._ID );           int imageColumnIndex = viewImageCursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA);       viewImageCursor.moveToPosition(position);       viewImageCursor.moveToFirst();       String filepath = viewImageCursor.getString(imageColumnIndex);       Toast.makeText(MainActivity.this, filepath, Toast.LENGTH_LONG).show();      Bitmap yourSelectedImage = BitmapFactory.decodeFile(filepath);      }   });}       }</code></pre><hr><pre><code>package com.newtestforsdcarddisplay;import android.content.Context;import android.view.View;import android.view.ViewGroup;import android.widget.BaseAdapter;import android.widget.GridView;import android.widget.ImageView;import android.net.Uri;import android.provider.MediaStore;public class ImageAdapter extends BaseAdapter{    final   MainActivity pca = new MainActivity();    private Context context;    public ImageAdapter(Context localContext) {      //  context = localContext;    }    public int getCount() {       // return pca.myImageCursor.getCount();        return 0;    }    public Object getItem(int position) {        return position;    }    public long getItemId(int position) {        return position;    }    public View getView(int position, View convertView, ViewGroup parent) {        ImageView picturesView;        if (convertView == null) {            picturesView = new ImageView(context);            // Move cursor to current position            pca.myImageCursor.moveToPosition(position);            // Get the current value for the requested column            int imageID = pca.myImageCursor.getInt(pca.columnNumber);            // Set the content of the image based on the provided URI            picturesView.setImageURI(Uri.withAppendedPath(                    MediaStore.Images.Media.EXTERNAL_CONTENT_URI, """" + imageID));            picturesView.setScaleType(ImageView.ScaleType.FIT_CENTER);            picturesView.setPadding(8, 8, 8, 8);            picturesView.setLayoutParams(new GridView.LayoutParams(100, 100));        }        else {            picturesView = (ImageView)convertView;        }        return picturesView;    }   }package com.newtestforsdcarddisplay;import android.content.Context;import android.view.View;import android.view.ViewGroup;import android.widget.BaseAdapter;import android.widget.GridView;import android.widget.ImageView;import android.net.Uri;import android.provider.MediaStore;public class ImageAdapter extends BaseAdapter{    final   MainActivity pca = new MainActivity();    private Context context;    public ImageAdapter(Context localContext) {      //  context = localContext;    }    public int getCount() {       // return pca.myImageCursor.getCount();        return 0;    }    public Object getItem(int position) {        return position;    }    public long getItemId(int position) {        return position;    }    public View getView(int position, View convertView, ViewGroup parent) {        ImageView picturesView;        if (convertView == null) {            picturesView = new ImageView(context);            // Move cursor to current position            pca.myImageCursor.moveToPosition(position);            // Get the current value for the requested column            int imageID = pca.myImageCursor.getInt(pca.columnNumber);            // Set the content of the image based on the provided URI            picturesView.setImageURI(Uri.withAppendedPath(                    MediaStore.Images.Media.EXTERNAL_CONTENT_URI, """" + imageID));            picturesView.setScaleType(ImageView.ScaleType.FIT_CENTER);            picturesView.setPadding(8, 8, 8, 8);            picturesView.setLayoutParams(new GridView.LayoutParams(100, 100));        }        else {            picturesView = (ImageView)convertView;        }        return picturesView;    }   }</code></pre><hr><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;GridView      android:id=""@+id/sdcard""    android:layout_width=""fill_parent""     android:layout_height=""fill_parent""    android:padding=""10dp""    android:verticalSpacing=""10dp""    android:horizontalSpacing=""10dp""    android:numColumns=""auto_fit""    android:columnWidth=""90dp""    android:stretchMode=""columnWidth""    android:gravity=""center""/&gt;&lt;/LinearLayout&gt;</code></pre><p>Could somebody help me please???? As I said before, I am fairly new to android and I have been struggling with this for a really long time. Any help would VERY MUCH appreciated.</p>","610642","","71724","","2011-02-18 03:19:40","2012-09-06 08:15:05","Displaying pictures stored on the SD Card using a Gridview","<android>","2","1","","",""
"5037170","1","5037180","","2011-02-18 02:49:27","1","673","<p>How to make a clickable item in a listview and get the data directly from the DB when clicking it? Should I use a cursor and get the column names in the cursor??</p>","399459","","135152","","2011-07-05 17:46:40","2011-07-05 17:46:40","Create clickable item on listview","<android><android-listview>","2","0","2","",""
"5037176","1","","","2011-02-18 02:50:56","2","765","<p>Is there something specific I have to do to import a non-built-in type in an AIDL interface? Specifically MediaPlayer. When I try to import it i get the compile error ""couldn't find import for class android.media.MediaPlayer"".</p>","275552","","","","","2011-02-19 15:02:31","Android import non-built-in type in AIDL","<android><aidl>","1","0","","",""
"5037216","1","5332010","","2011-02-18 02:59:31","0","134","<p>I have this website i need to parse for an android app.</p><p><a href=""http://www.wow-coupons.com/rss_online_coupons.xml"" rel=""nofollow"">http://www.wow-coupons.com/rss_online_coupons.xml</a></p><p>I am using the code AndroidXml from the below site to parse</p><p><a href=""http://www.ibm.com/developerworks/opensource/library/x-android/index.html?ca=dgr-lnxw82Android-XML&amp;S_TACT=105AGX59&amp;S_CMP=grlnxw82"" rel=""nofollow"">http://www.ibm.com/developerworks/opensource/library/x-android/index.html?ca=dgr-lnxw82Android-XML&amp;S_TACT=105AGX59&amp;S_CMP=grlnxw82</a></p><p>There are no syntax errors in the xml file. Other websites work for the same code.</p><p>If there is a connection problem, how do I resolve it?Please help.</p><p>Thanks,Siri</p>","588132","","129195","","2011-02-18 03:02:08","2011-03-16 21:27:40","Problem with parsing xml file","<android><xml-parsing>","1","2","","",""
"5037231","1","","","2011-02-18 03:02:26","0","285","<p>I have created a button and need to increment mp3 tunes on click. </p><p>So far I have the mp3 playing like: </p><pre><code> final MediaPlayer sentence = MediaPlayer.create(Options.this, R.raw.indra);</code></pre><p>and then calling sentence.start(); in onclick. </p><p>Is it possible to increment more tunes in onclick?</p><p>Thanks. </p>","608658","","","","","2011-02-18 03:02:26","MediaPlayer Android Increment on button click","<android>","0","2","","",""
"5037260","1","5037791","","2011-02-18 03:11:59","0","1470","<p>How do I get the position of the android togglebutton that was clicked in a gridview?</p><p>If I use the following example code I dont get a Toast message of the position.</p><pre><code>public class HelloGridView 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 ToggleButtonAdapter(this));    gridview.setOnItemClickListener(new OnItemClickListener() {        @Override        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>}</p><p>And the toggle adapter:</p><pre><code>public class ToggleButtonAdapter extends BaseAdapter {private Context mContext;public ToggleButtonAdapter(Context c) {    mContext = c;}@Overridepublic int getCount() {    return 5;}@Overridepublic Object getItem(int position) {    return null;}@Overridepublic long getItemId(int position) {    return 0;}@Overridepublic View getView(int position, View convertView, ViewGroup parent) {    View view;    LayoutInflater inflater = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);    if (convertView == null) {  // reuse it if it already exists        view = (View) inflater.inflate(R.layout.items, null);    } else {        view = (View) convertView;    }    ToggleButton toggleButton = (ToggleButton) view.findViewById(R.id.toggleButton1);    TextView textView = (TextView) view.findViewById(R.id.textView1);    textView.setText(""Toggle Button "" + position);    /*toggleButton.setOnClickListener(new OnClickListener() {        @Override        public void onClick(View v) {            ToggleButton t = (ToggleButton) v.findViewById(R.id.toggleButton1);            Toast.makeText(mContext, Boolean.toString(t.isChecked()), Toast.LENGTH_SHORT).show();        }    });*/    return view;}</code></pre><p>}</p><p>Uncomment the toggle listener to play with that part and show me how to get the position. Is there a way to inject some data into the toggle button as the grid view is being constructed that I could later reference? I couldn't find a way reading the ToggleButton javadoc.</p><p>Thanks much!</p><p>EDIT:</p><p>Oops! here are the layouts:</p><p>main.xml</p><pre><code>&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;/GridView&gt;</code></pre><p>items.xml:</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=""horizontal""&gt;    &lt;LinearLayout         android:layout_width=""fill_parent""         android:layout_height=""fill_parent""        android:orientation=""vertical""&gt;        &lt;TextView             android:text=""Some label""             android:id=""@+id/textView1""             android:layout_width=""wrap_content""             android:layout_height=""wrap_content""            android:layout_margin=""10dp""/&gt;        &lt;ToggleButton             android:id=""@+id/toggleButton1""             android:layout_width=""wrap_content""             android:layout_height=""wrap_content""            android:layout_margin=""10dp""/&gt;    &lt;/LinearLayout&gt;&lt;/LinearLayout&gt;</code></pre>","100892","","","","","2011-02-18 05:20:10","How do I get the position of a togglebutton that is clicked in a gridview?","<android><gridview><togglebutton>","2","0","2","",""
"5037389","1","5037398","","2011-02-18 03:42:55","3","4550","<p>I am an android application developer for 6 months, i got a requirement to develop android based web application. So, i wanted to know some information on how to start the web application particularly for android. I've checked the android developers site, but it only says about viewport and webview.. </p><p>Please, would someone show me a way to start this? is there any IDE to develop android web apps? currently i am using Eclipse for android apps. Any tutorials regarding the android web apps? I know HTML, CSS, java script to some extent. But i don't think the general web application and android web application are same in developing.. so please give me some initial information to start..</p><p>Thank you..</p>","365184","","1104926","","2011-12-19 13:42:58","2013-10-09 13:49:45","Android web application development, how to start..","<android><website>","3","0","2","",""
"5037402","1","","","2011-02-18 03:46:47","2","393","<p>First of all I have to mention that I'm a developer from Sri Lanka, therefore I can't list paid apps on Android Market. But I found many good alternatives such as <code>AndAppStore</code>, <code>AndroidPIT</code>, <code>AppsLib &amp; SlideME</code> where I can list my paid apps &amp; get a revenue.</p><p>But my issue is about piracy. Since my app is not listed in <strong>Android Market</strong>, I can't use their licensing system (<code>LVL</code>). When I search for alternative licensing systems I found that there are licensing systems unique to each alternative market. (eg. <code>SlideME -&gt; SlideLock, AndAppStore</code> -> their system) If it is the case, I will have to implement each of those systems in separate versions of my app in order to publish my app in their markets.</p><p>Instead of that, I wonder weather there exists an universal licensing system for Android apps where I can implement it to my app &amp; distribute it via any alternative market.</p><p>I need to have 2 features in the licensing system:</p><ol><li><p>App must have a trial period &amp; it should stop working after a pre-defined period from the day the user install the app.</p></li><li><p>After the trial period it should obtain a paid license which is unique to the device (IMEI or Phone No. can be used.) &amp; should resume working if &amp; only if it has a valid license.</p></li></ol><p>Please share your ideas on this. Appreciate if you can provide coding, sources or links.</p>","471349","","321731","","2013-11-03 22:48:47","2013-11-03 22:48:47","Is there any universal licensing system for non-market paid Android apps?","<android><licensing><google-play>","0","0","1","",""
"5037409","1","","","2011-02-18 03:48:12","3","948","<p>Consider am having an application containing activity A,B,C. A is launched from the launcher and B is launched from A. B has a button. My requirement is on clicking button on B the present history of the activity Stack A->B should clear and the history stack must contain only C. Is it possible to do ? If so plz advise me... </p><p>Thanks in advance !</p>","617510","","","","","2011-12-01 10:11:46","How to clear stack history?","<android>","2","0","","",""
"5037425","1","5037499","","2011-02-18 03:51:06","5","698","<p>I assume someone's built an APK decompiler.....  What's the best practice to secure sensitive info (like auth parameters for a backend database)?  I suppose some kind of middleware would work but that can't do good things for speed.  What's the ""right way""?</p>","514880","","514880","","2011-02-18 04:01:46","2011-03-07 01:58:47","How can you protect info contained in an APK?","<java><android><apk>","2","2","4","",""
"5037462","1","5037536","","2011-02-18 04:00:34","1","121","<p>I need to browse a file tree in order to pick up the audio files.How can i achieve this?</p>","443075","","","","","2011-02-18 04:16:43","How to browse files in tree order to pick up the audio files available on sdcard and mobile memory in Android?","<android><media-player>","1","0","","",""
"5037519","1","","","2011-02-18 04:12:31","0","464","<p>This is my code,i cant able to get the value of cellid and Lac value.This is my code,</p><pre><code>public class lac extends Activity {    private int mCid ;    private int mLac ;    GsmCellLocation location;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);    TelephonyManager tel=(TelephonyManager)getSystemService(Context.TELEPHONY_SERVICE);    location = (GsmCellLocation) tel.getCellLocation();        mLac=location.getLac();        mCid=location.getCid();        Toast.makeText(getApplicationContext(),""LAC=""+mLac+""CellId=""+mCid+type,Toast.LENGTH_LONG).show();    }    }</code></pre><p>When i run the emulator it says that the application stops running unexpectedly.I used the permission <code>(ACCESS_COARSE_LOCATION),(ACCESS_FINE_LOCATION)</code>.</p>","622547","","457982","","2011-02-18 06:45:40","2011-02-18 06:57:15","The application stops running when executing getLac(),getCellId()","<android>","1","1","","",""
"5037718","1","","","2011-02-18 04:45:04","0","3696","<p>I have requirement in my project that is finding nearby movie theaters upto certain radius from the user present location then i want to show these finding location in the google map. I have seen some posts here but i did not get the clarity on this. Is there any direct API calls to get the nearest specific places or any other way to find.</p>","416143","","135152","","2011-05-31 00:23:44","2011-06-02 12:55:25","How to Find Specific Nearby Locations in android","<android><google-maps><location>","1","1","0","",""
"5037724","1","5149797","","2011-02-18 04:45:40","1","899","<p>I have a drawing activity that creates a custom 'canvas' View that occupies the entire screen, allowing the user to draw on it. I have a requirement to lock the Activity to the portrait orientation, as the drawing app is a sketchpad replacement, and the user would have the need to rotate the 'pad' to draw without the pad flipping around on them.  This of course means that the Options Menu is locked to that orientation as well and depending on the user, the menu could be popping out of the top, bottom or sides.  I'd like to have the Options Menu always be located at the bottom relative to the user... some options I am considering and would appreciate any suggestions or info:</p><ol><li>Allow orientation changes, so the menu moves as needed, then use the SensorManager to listen for the orientation, and manually rotate the canvas View back to the 'correct' orientation (portrait).  This would be ugly, as there could be a delay in the rotation of the canvas, and it introduces some potentially complex calculations, etc due to the X/Y being swapped.</li><li>Restrict orientation changes, then use the SensorManager to listen for the orientation, and manually rotate the Options Menu back to the bottom.  No idea if this is possible.</li><li>Lock orientation, and create a custom View that intercepts the menu button and displays a 'fake' Options Menu that I need to manage, etc.  Really really don't want to have to replace built-in OS functionality, could be a nightmare to maitain for different versions of OS in future, etc.</li></ol><p>Anyone have any ideas on how to handle this?  I'd love if #2 was possible, but can't find anything related to that.</p><p>Thanks,</p><p>Paul</p><p>EDIT:</p><p>Have confirmed that #2 is not possible, so I guess my options are #1, #3, unless anyone else has any ideas?</p>","357801","","357801","","2011-02-22 02:58:07","2011-03-01 02:08:06","Android: Dynamically change location of Options Menu","<android><orientation><sensor><options-menu>","1","0","","",""
"5037799","1","5037894","","2011-02-18 04:56:52","4","6901","<p>I want to make a drag and drop button. Drag it where you want it to do and it stays there. Below code only scales the button, doesn't change its position.</p><pre><code>package com.dynamic;import android.app.Activity;import android.os.Bundle;import android.view.MotionEvent;import android.view.View;import android.view.ViewGroup.LayoutParams;import android.widget.Button;import android.widget.FrameLayout;import android.widget.ImageView;import android.widget.TextView;import com.dynamic.R;import com.dynamic.R.layout;public class dy extends Activity {     int status;     private FrameLayout layout;     ImageView image;     Button b;     LayoutParams params;     public void onCreate(Bundle savedInstanceState) {            super.onCreate(savedInstanceState);            setContentView(R.layout.frm);            final Button tv=(Button)findViewById(R.id.txt_birth);            tv.setDrawingCacheEnabled(true);            layout = (FrameLayout) findViewById(R.id.frm);            params = new LayoutParams(100,100);            params = new LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT);            tv.setOnTouchListener(new View.OnTouchListener(){        @Override        public boolean onTouch(View v, MotionEvent me) {            // TODO Auto-generated method stub            if (me.getAction() == MotionEvent.ACTION_DOWN) {                System.out.println(""up"");                status = 0;            }            if (me.getAction() == MotionEvent.ACTION_UP) {                status = 1;                //Log.i(""Drag"", ""Stopped Dragging"");            } else if (me.getAction() == MotionEvent.ACTION_MOVE) {                if (status == 0) {                    System.out.println(""Dragging"");                    tv.setPadding((int) me.getRawX(), (int) me.getRawY(), 0, 0);                //  b.setPadding(0,50,0,0);                    tv.invalidate();                }            }            return false;        }    });}}</code></pre>","","user622578","881229","","2014-02-22 00:04:36","2014-02-22 00:04:36","How to make Drag & Drop Button in Android","<android><drag-and-drop>","3","0","3","",""
"5037801","1","5037831","","2011-02-18 04:57:04","0","47","<p>I am developing an Android application named AutoSms.I wan that when i open the application it should automatically open the 6th sms in the inbox.Can anybody tell me.How should i pursue</p><p>Thanks in advanceTushar</p>","475349","","","","","2011-02-18 05:05:50","Phone open 6th sms on installing application","<android>","1","0","1","",""
"5037833","1","5037990","","2011-02-18 05:06:01","0","1143","<p>How to open Settings>About page programmaticlly in Android.</p>","579875","","","","","2011-02-18 05:35:56","Android About page","<android>","3","0","0","",""
"5037906","1","","","2011-02-18 05:18:59","1","1491","<p>What is use of Adapter and inflator in android?</p>","622601","","918472","","2012-02-13 10:56:52","2013-06-08 02:47:44","Adapter and inflater","<android>","3","1","","",""
"5037921","1","","","2011-02-18 05:22:17","0","320","<p>Am having an application contains activity A,B,C and A is launched from the browser and B is launched from A, a count timer running on A launches an activity C if the timer hits. Could any one plz tell the stack order for the activity of this application. either A->B->C or A->C->B. However now the visible activiy should be C if i press back key from C which should display either A or B ?</p><p>Thanks in advance.</p>","617510","","571433","","2011-05-13 04:57:59","2012-01-02 09:17:51","Activity from a background activity?","<android><activity>","2","1","","",""
"5037938","1","","","2011-02-18 05:25:30","1","342","<p>I want to send the SOAP xml request to php server from android device, as shown below are required parameter for posting request. Currently i am not getting any method or sample to do achieve.Any suggest some samples.</p><p>POST /sample/server.php HTTP/1.0</p><p>Host:  x.x.x.x</p><p>User-Agent: NuSOAP/0.7.3 (1.114)</p><p>Content-Type: text/xml; charset=ISO-8859-1</p><p>SOAPAction: """"</p><p>Content-Length: 551</p><p>Thanks</p>","483901","","","","","2011-02-18 05:25:30","Android soap request posting -sample?","<android><android-xml>","0","0","","",""
"5037950","1","","","2011-02-18 05:28:22","0","857","<p>hi am using a drawable for scrollbar track and thumb ,in the case of thumb , i need to see the thumb in original dimension of the image, currently the thumb is stretched.  </p>","487219","","487219","","2011-02-18 05:56:03","2011-02-18 09:43:32","android scrollbar thumb length","<android>","1","0","","",""
"5037963","1","","","2011-02-18 05:30:50","-2","209","<p>I do not need the <code>setcontentview()</code> method. Tell me another one.</p>","622615","","750711","","2012-02-15 14:14:36","2012-02-15 14:14:36","How to import canvas.draw object into a layout in Android?","<android><android-canvas>","1","0","","",""
"5038038","1","","","2011-02-18 05:42:39","11","14888","<p>I have a doubt .. Am having a hander in an activity in my application. Though my activity destroyed the handler still functioning. Is it running on different process other than the application process ? Could any one plz explain why its working like so ?Is it possible to stop the handler while onDestroy of the activity ?</p><p>Thanks in advance. </p>","617510","","","","","2013-12-16 22:44:21","How to stop the handler.?","<android>","3","1","4","",""
"5038067","1","","","2011-02-18 05:47:28","0","1975","<p>Is it possible set a hint for the button in android?</p>","622630","","869912","","2012-08-13 18:19:47","2012-08-13 18:19:47","Is it possible set a hint for android buttons?","<android>","3","4","","",""
"5038084","1","","","2011-02-18 05:49:59","3","1563","<p>I want a simple example of implementing Twitter in our application. I would prefer that it not be browsable; it should open on our application area only. After login the user can post tweets on his/her account.</p>","","Jazz","23897","","2011-02-18 05:52:08","2012-06-17 06:33:06","Integrating Twitter in an Android application","<android><twitter>","1","0","2","",""
"5038106","1","5038472","","2011-02-18 05:53:26","1","943","<p>My application is very straightforward,  Main Activity -> activity 1 -> activity 2, and there is another worker thread who is doing some downloading jobs.  And they are started within the same process.</p><p>I want the downloading thread is not terminated until all the activities are destroyed, or at the end of the process. In Java, it is very simple: it will be OK by adding some clean code in the main method. But I don't know what is the right way in Android. Because every activity is possible to be recycled by the system, I don't know where to put the clean code of the worker thread, and I also dont't know what is the end point of the total application. </p><p>Could anyone give me some ideas? thanks.</p>","622477","","","","","2011-02-18 06:54:11","Life cycle of the application: How to do some clean jobs when the process is terminated?","<android><process><lifecycle>","1","2","","",""
"5038108","1","","","2011-02-18 05:53:46","0","3206","<p>i have a scrollview that contain a linearlayout ,my problem i need to give little margin on the right of the scrollbar of my scrollview ,ie scroll should  visible inside the linearlayout not at the border.</p><pre><code>&lt;ScrollView    android:fillViewport=""true""    android:orientation=""vertical""    android:layout_width=""match_parent""    android:scrollbarStyle=""outsideOverlay""    android:scrollbarAlwaysDrawVerticalTrack=""true""    android:scrollbarTrackVertical=""@drawable/scrollbattrack""    android:scrollbarThumbVertical=""@drawable/scrollbarthumb""    android:fadeScrollbars=""false""    android:layout_height=""match_parent""&gt;         &lt;LinearLayout            android:id=""@+id/ListView""            android:orientation=""vertical""            android:layout_width=""match_parent""            android:layout_height=""match_parent""            android:background=""@android:color/transparent""&gt;          &lt;/LinearLayout&gt;&lt;/ScrollView&gt;</code></pre>","487219","","477754","","2011-02-18 06:27:27","2011-08-04 07:20:46","android scrollview and scrollbar position","<android>","2","0","1","",""
"5038130","1","5038619","","2011-02-18 05:57:43","0","5001","<p>i have a relative layout on which i am displaying a page and some content. when i zoom my page...the layout size is not increasing. i want my layout to increase its size dynamically. how do i set it??i tried doing it in java code.contentLayout.getLayoutParams().height = x (some value which is equal to the page size)contentLayout.requestLayout()</p><p>but this is nt working. i have also set the layout params -width and height to wrap-content in xml.</p><p>Kindly, help me out. thank you</p>","562237","","","","","2014-03-15 03:24:31","dynamically increase the relative layout size in android","<android>","1","0","2","",""
"5038158","1","","","2011-02-18 06:02:37","12","1981","<p>I followed ""Avoiding Memory Leaks"" article from  <a href=""http://developer.android.com/resources/articles/avoiding-memory-leaks.html"">http://developer.android.com/resources/articles/avoiding-memory-leaks.html</a> </p><p>However the proposed solution does not solve the leak problem. I tested this with android emulator on Windows XP (SDK 2.3.1). I dumped the heap and checked the main activity is still in the heap (I used MAT)</p><p>Here's what I did:</p><ol><li>create HelloWorld app with HelloWorldActivity (it has no child views)</li><li>run Emulator and launch HelloWorld app.</li><li>close it by clicking back-key.</li><li>Cause gc in DDMS and dump heap &lt;-- Here I found HelloWorldActivity instance. </li><li>'Path to GC Roots' from it shows the following path.</li></ol><p>HelloWorldActivity &lt;- PhoneWindow$DecorView &lt;- InputMethodManager </p><p>InputMethodManager is a singleton and three references to DecorView which references HelloWorldActivity. </p><p>I can't understand why InputMethodManager still references DecorView instance even after the activity is destroyed. </p><p>Is there any way to make sure that the main activity is destroyed and GC-able after closing it?</p>","558899","","558899","","2011-02-18 09:47:28","2012-04-12 15:23:59","Main Activity is not garbage collected after destruction because it is referenced by InputMethodManager indirectly","<android><garbage-collection><activity>","2","0","3","",""
"5038191","1","","","2011-02-18 06:08:11","1","130","<p>simple app that can be downloaded and installed to the android phone and once clicked on the app will open a URL in the default browser of the phone. pls tell me how to start this application?</p>","555910","","","","","2011-02-18 06:42:33","simple app that can be downloaded and installed to the android phone and once clicked on the app will open a URL in the default browser of the phone","<android>","1","0","2","",""
"5038223","1","","","2011-02-18 06:12:28","0","659","<p>Can i give functionality of a forward button in my android app. In case of web app, the URLS and session id is stored in the stack so we can provide this functionality. But can we provide a similar kind of functionality in our mobile app using activities.If yes then how and what would be the implications of the same.</p><p>if i don't kill my activities, then wouldn't it create memory issues?? </p><p>Thanks..</p>","610921","","610921","","2011-02-18 07:33:20","2011-02-18 07:33:20","Forward button functionality","<android>","2","5","","",""
"5038253","1","5038269","","2011-02-18 06:18:28","0","5167","<p>[2011-02-18 23:41:16 - ddms]null</p><p>java.lang.NullPointerException</p><pre><code>at com.android.ddmlib.Client.sendAndConsume(Client.java:571)at com.android.ddmlib.HandleHello.sendHELO(HandleHello.java:142)at com.android.ddmlib.HandleHello.sendHelloCommands(HandleHello.java:65)at com.android.ddmlib.Client.getJdwpPacket(Client.java:670)at com.android.ddmlib.MonitorThread.processClientActivity(MonitorThread.java:317)at com.android.ddmlib.MonitorThread.run(MonitorThread.java:263)</code></pre><p>What kind of error is this..All xml files are having error suddenly like below..</p><pre><code>Multiple annotations found at this line:- Premature end of file.- error: Error parsing XML: no  element found</code></pre><p>thank you,</p>","565106","","","","","2011-03-11 22:23:53","Error:java.lang.NullPointerException in android","<android>","2","1","","",""
"5038292","1","5038404","","2011-02-18 06:25:15","0","255","<p>I am using SaxParser for parsing a XML which contains some image url which are long enough.Using sax parser i am storing them in my variable. the code i wrote is simple and very accurate to parse as it is parsing the same xml accurately but with smaller length strings. </p><p>Which Ensure My Code Correctness. Its like SAXParser is failing in extracting larger strings. </p><p>help me out plz </p>","609289","","","","","2011-02-18 06:40:53","SaxParser Not Working to Extract Larger Strings Android","<android>","2","0","","",""
"5038301","1","5038375","","2011-02-18 06:26:39","-2","91","<pre><code>    ss.setSpan(new URLSpan(""tel:1234556""), 13, 17,            Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);    tv.setText(ss);    tv.setMovementMethod(LinkMovementMethod.getInstance());</code></pre><p>what does the linkMovementMethod do?what is the URLSpan class and what is the use of it? what does the string tel:123456 mean?Is tel a keyword? </p><p>Need answer asapthank you in advance.</p>","590849","","","","","2011-02-18 06:36:34","cannot understand the following code in android","<android>","1","1","","",""
"5038309","1","5180532","","2011-02-18 06:27:46","0","836","<pre><code>package com.test.TestTweet;import android.app.Activity;import android.content.Intent;import android.net.http.RequestQueue;import android.os.Bundle;import android.util.Log;import android.view.View;import android.webkit.WebView;import android.widget.Button;import android.widget.EditText;import org.apache.commons.codec.binary.Base64;import java.io.ByteArrayInputStream;import java.io.UnsupportedEncodingException;import java.net.URLEncoder;import java.util.HashMap;import java.util.Map;/** * Initial screen with edit box for tweets and * a web view to display the tweets from friends */public class TestTweet extends Activity {    static final int GET_LOGIN_INFORMATION = 1;    WebView webView;    RequestQueue requestQueue;    String authInfo;    /**     * Called with the activity is first created.     */    @Override    public void onCreate(Bundle icicle) {        super.onCreate(icicle);        setContentView(R.layout.main);        // Set the initial text        webView = (WebView) findViewById(R.id.webView);        webView.loadData(                ""Please click on setup and enter your twitter credentials"",                ""text/html"", ""utf-8"");        // When they click on the set up button show the login screen        Button button = (Button) findViewById(R.id.setup);        button.setOnClickListener(new View.OnClickListener() {            public void onClick(View v) {                Intent intent = new Intent(TwitterClient.this, TwitterLogin.class);                startSubActivity(intent, GET_LOGIN_INFORMATION);            }        });        // When they click on the Tweet! button, then get the        // text in the edit box and send it to twitter        final Activity activity = this;        Button button2 = (Button) findViewById(R.id.update);        button2.setOnClickListener(new View.OnClickListener() {            public void onClick(View v) {                Log.i(""http"", ""Update clicked"");                Map headers = new HashMap();                if (authInfo == null) {                    return;                }                headers.put(""Authorization"", ""Basic "" + new String(Base64.encodeBase64(authInfo.getBytes())));                EditText user = (EditText) findViewById(R.id.updateText);                String text = null;                try {                    text = ""status="" + URLEncoder.encode(user.getText().toString(), ""UTF-8"");                    Log.i(""http"", ""with "" + text);                } catch (UnsupportedEncodingException e) {                    Log.e(""http"", e.getMessage());                }                byte[] bytes = text.getBytes();                ByteArrayInputStream baos = new ByteArrayInputStream(bytes);                // See Twitter API documentation for more information                // http://groups.google.com/group/twitter-development-talk/web/api-documentation                requestQueue.queueRequest(                        ""https://twitter.com/statuses/update.xml"",                        ""POST"", headers, new MyEventHandler2(activity), baos, bytes.length, false);            }        });        // Start a thread to update the tweets from friends every minute        requestQueue = new RequestQueue(this);        Thread t = new Thread(new MyRunnable(this));        t.start();    }    protected void onActivityResult(int requestCode, int resultCode,                                    String data, Bundle extras) {        if (requestCode == GET_LOGIN_INFORMATION &amp;&amp; resultCode == RESULT_OK) {            // Save the user login information            authInfo = data;        }    }}</code></pre><p>Here 2 import file is not supported. these are</p><ol><li>import android.net.http.RequestQueue;</li><li>import org.apache.commons.codec.binary.Base64;</li></ol><p>Plz suggest.</p><p>Thankx</p>","584040","","23033","","2011-02-18 06:52:24","2011-03-03 12:10:22","How to use requestqueue in android","<android><twitter>","1","0","","",""
"5038366","1","5038401","","2011-02-18 06:35:45","2","357","<p>I have three activities in my activity stack, A (main) -> B -> C.</p><p>A starts B starts C.</p><p>My C is a dialog box with one button that will take me to A and one button that will take me to B. The Activity B must therefore have history, so if C calls <code>finish()</code> I will always end up in B.</p><p>Given this, how do I (efficiently) set this up? i.e. how do I (efficiently) go from C to A?</p>","283311","","","","","2011-02-18 06:42:57","Android and popping from Activity C to Activity A or B","<android><activity>","2","0","","",""
"5038382","1","","","2011-02-18 06:37:33","0","292","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/5038130/dynamically-increase-the-relative-layout-size-in-android"">dynamically increase the relative layout size in android</a>  </p></blockquote><p>can i increase the relative layout size when in zoom mode in android</p>","562237","","","","","2011-02-18 06:39:35","can i increase the relative layout size when in zoom mode in android","<android>","1","0","","2011-02-18 12:16:07",""
"5038478","1","5890539","","2011-02-18 06:55:52","1","651","<p>i' trying to find how to integrate janrain to my android app.....</p><p>i found that janrain for iphone is given in the janrain engage section but i couldnt find for android applicaion.</p><p>if anyone knows wer to find it , please leave a link ......</p><p>and also some documentation would help...</p><p>Thank you,,</p>","438864","","","","","2011-05-19 21:01:12","How to integrate Janrain on android phone?","<android><login><openid><integration><janrain>","2","1","","",""
"5038479","1","5038817","","2011-02-18 06:55:57","1","664","<p>Currently here is what I am following,As soon as my app is launched, I have to send a request for REST service,It will take little time , so I thought of showing loading screen,</p><p>In <code>onCreate()</code> of my Activity , first thing will be to show loading screen(progress dialog) ,And I kick off the background Activity using AsyncTask , i.e. requesting for REST service and <code>onPostexecute()</code> I close the dialog and then I do <code>setContentView(myxml);</code> and update the UI .</p><p>Can this approach be improved ?</p><p>Problem which I faced was ,</p><p>Sometimes , Garbage collector may start(due to various reasons) and my app hangs at loading screen forever , because of Garbage collector , even request for REST service is not sent and because of it some wake up call comes and rest is disaster and Force close. </p><p>But sometimes even ForceClose doesnot come fast , may be because of GC. so I cannot even go back and stuck in loading screen. Only thing which I can do at that point is to come back HOME. After that If I come back to my app its still loading , so definitely this approach seems to be a bad design. Whats the right approach ?</p>","207646","","545691","","2011-02-18 07:21:27","2011-02-18 07:47:41","Showing Loading screen during REST service request in android app?","<android><android-widget><android-layout><android-lazyloading>","3","1","1","",""
"5038503","1","5038537","","2011-02-18 07:00:01","0","721","<p>I have to pass intent values to service class but every time intent take the same value as it took at very first time but i need every time <strong>different</strong> <em>intent</em> values.</p><pre><code>Intent alarmIntent = new Intent(AppointmentActivity.this,                AlarmService.class);        alarmIntent.putExtra(""appDate"", appDateString);        alarmIntent.putExtra(""appTime"", appoint_time);        alarmIntent.putExtra(""appDesc"", appoint_desc);        alarmIntent.putExtra(""appRemind"", appoint_remind);                sender = PendingIntent.getService(AppointmentActivity.this, 0,                alarmIntent, 0);        AlarmManager am = (AlarmManager) getSystemService(ALARM_SERVICE);        am.set(AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis(), sender);</code></pre>","525175","","674530","","2011-07-30 10:39:26","2011-07-30 10:39:26","intent pass the same values to service class","<android>","1","0","","",""
"5038515","1","","","2011-02-18 07:02:03","0","163","<p>I m working on one app in which i want if the app receive the message in background from particular number it will not show in the inbox and will auto delete from the app and would not play any message sound as well.</p><p>i want user will not b able to see that. It should get done in background.</p>","383597","","","","","2011-02-18 07:59:29","Android message problem","<android>","1","5","","",""
"5038545","1","5038562","","2011-02-18 07:05:52","3","19695","<p>i m developing an application.. </p><p>i want to create a popup message that will be stable while we don't close... </p><p>I want some tutorial that help me to do a alertDialog boxes.</p><p>Thanks in advance.</p>","785775","","785775","","2012-02-13 13:23:14","2012-10-21 16:44:07","popup message in android","<android>","3","3","0","",""
"5038591","1","5163767","","2011-02-18 07:14:40","0","1615","<p>My chronometer is always starting from 0:10 or like some other times... it s not starting from 0:01 itself..any one can help me</p><p>Thank you,</p>","565106","","","","","2011-09-07 12:50:52","Problem starting with chronometer","<android><chronometer>","2","0","2","",""
"5038622","1","","","2011-02-18 07:18:57","1","224","<p>is there any direct method to access a single row using cursor in android??</p>","620787","","","","","2011-02-18 08:19:20","accessing a single row using cursor in android","<android>","1","1","1","",""
"5038693","1","","","2011-02-18 07:29:50","0","1618","<p>i have to create a layouts dynamically depending on the some action for example depending on action i have created 5 layouts which is horizontal scroll and i want the control of each layout  how to go about it please give me some suggestion </p>","571423","","","","","2011-02-18 10:04:55","creating layouts dynamically and getting control on each layout","<android>","2","0","","",""
"5038790","1","5050497","","2011-02-18 07:43:13","5","1377","<p>I'm writing testcases for an android app extending <code>ActivityInstrumentationTestCase2</code>. The test class looks like this:</p><pre><code>public class SolutionEntryActivityTest extends ActivityInstrumentationTestCase2&lt;SolutionEntryActivity&gt; {    public SolutionEntryActivityTest() {        super(SolutionEntryActivity.class);    }}</code></pre><p>In eclipse, this code fails to compile with the error: <code>Bound mismatch: The type SolutionEntryActivity is not a valid substitute for the bounded parameter &lt;T extends Activity&gt; of the type ActivityInstrumentationTestCase2&lt;T&gt;</code></p><p>But SolutionEntryActivity really is an <code>android.app.Activity</code>, the type hierarchy is like this:</p><pre><code>Activity    OrmLiteBaseActivity&lt;H&gt; (abstract)        KabowieActivity            PracticeActivity (abstract)                SolutionEntryActivity</code></pre><p>I found two eclipse bugs from <a href=""https://bugs.eclipse.org/bugs/show_bug.cgi?id=62822"">2004</a> and <a href=""https://bugs.eclipse.org/bugs/show_bug.cgi?id=85262"">2005</a> which seem to deal with a similar problem but these should be long fixed.</p><p>I'm using Eclipse Helios with Android 2.2 and Sun Java 1.6.</p><p>Any idea what's going on?</p>","236405","","","","","2011-02-20 10:10:12","Android test class fails to compile in eclipse with ""bound mismatch"" error","<java><android><eclipse><unit-testing><generics>","1","0","1","",""
"5038912","1","","","2011-02-18 08:03:30","0","321","<p>I have a table defined in XML and a row defining a view as another XML. Let's say I need to populate the table with 5 rows. Running the following code:</p><pre><code>  final ViewGroup table = (TableLayout)findViewById(R.id.table);  View row = null;  TextView title = null;  for(int i=0; i&lt;5; i++)  {       row = LayoutInflater.from(this).inflate(R.layout.row, null, false);       title = (TextView)row.findViewById(R.id.text_title);       title.setText(""val"");       ImageView x= (ImageView)itemView.findViewById(R.id.remove);       x.setOnClickListener(delimg);       table.addView(row);  }  private OnClickListener delimg = new OnClickListener() {     @Override    public void onClick(View arg0) {        // TODO Auto-generated method stub        TextView tv = (TextView) findViewById(R.id.pname);                       tv.setText(""Deleted item!"");      } }; </code></pre><p>It works fine but when i try to add onclicklistener to a image, it changes only the first row and not the corressponding row. please help.</p>","622768","","535871","","2011-02-18 08:22:14","2011-02-19 04:16:07","android--unable to add listener to inflated table-","<android><android-widget>","1","1","","",""
"5038951","1","5038999","","2011-02-18 08:10:50","1","3114","<p>I am having a problem calling string values from the <code>strings.xml</code> resource in Android. The <code>strings.xml</code> file is below:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;resources&gt;    &lt;string name=""name1""&gt;contact_name1&lt;/string&gt;    &lt;string name=""phone1""&gt;contact_phone1&lt;/string&gt;&lt;/resources&gt;</code></pre><p>And the code calling for the string values is:</p><pre><code>private final String NAME1  = getString(R.string.name1);private final String PHONE1 = getString(R.string.phone1);</code></pre><p>I am calling for the strings from my <code>main.java</code> where I <code>extend Activity</code>, so I have the context. The problem is that when I run the app (physical device (EVO) or an emulator (API Levels 5 - 8) I get a <code>NullPointerException</code> at the line where the first <code>getString()</code> call is located. I have been over Google's documentation, a number of posts here and at AndDev.org with no change to the end result. Will some one please tell me whats wrong before I pull all of my hair out!? The <code>strings.xml</code> file is in the standard location (<code>&lt;project_folder&gt;&lt;res&gt;&lt;values&gt;</code> directory) in the same package as the rest of the app.</p>","549510","","","","","2011-02-18 08:21:41","Problems with calling from strings.xml","<android><string>","2","4","","",""
"5038973","1","5039580","","2011-02-18 08:13:34","1","1358","<p>I have writen a video player that plays videos from a website. My videoplayer is actualy the VideoView gadget from android.</p><p>The videos are playing ok when I am on the wifi network, the things are not the same if I switch to 3G as expected :D. What I want is to increase the streaming buffer, it seems that VideoView is streaming the video up to 8% of the clip size.</p><p>When I press the play button, the streaming its still coming but it keeps that percentage distance... and if I press pause, the streaming is stopping.. </p><p>Can I increase the streaming length and make the video streaming while in pause?</p><p>Thank you!</p>","449310","","","","","2011-02-18 09:26:40","android VideoView increase buffering","<android><streaming><video-streaming><videoview>","1","0","","",""
"5039044","1","5039133","","2011-02-18 08:23:13","0","2420","<p>Friend's,     I implemented tabhost in my application,i have three tabs defined in my activity tab1,tab2,tab3...here i have a problem to navigate from tab3 to tab1 at onkey back pressed event ,how can i reach the tab1 from tab3 and tab2,i tried up using overided keyback pressed,but it some times it's not responding to navigate.without overriding onkey back pressed it simply exits from application.</p><p>Here my code </p><pre><code>tabHost= getTabHost();        tabHost.addTab(tabHost.newTabSpec(""tab1"").setContent(                new Intent(this, DealCities.class)).setIndicator(prepareTabView(""Deals"",R.drawable.test)));        tabHost.addTab(tabHost.newTabSpec(""tab2"").setContent(new Intent(this, DbServerActivity.class))                        .setIndicator(prepareTabView(""My QuadDeals"",R.drawable.mydeal)));        tabHost.addTab(tabHost.newTabSpec(""tab3"").setContent(new Intent(this, Account.class))                .setIndicator(prepareTabView(""My Account"",R.drawable.img_myaccount)));</code></pre><p>here the tabhost defined in one class and the tabhost object being static one,</p><p>here the code from my tab2 back pressed event  has follows,</p><pre><code> @Override    public boolean onKeyDown(int keyCode, KeyEvent event) {        if (keyCode == KeyEvent.KEYCODE_BACK &amp;&amp; event.getRepeatCount() == 0) {            try {               //              userdealList.setVisibility(View.GONE);              //              logalertTable.setVisibility(View.GONE);//              dealType.setVisibility(View.GONE);//              mydealBack=1;//              QuadMain.tabHost.setCurrentTab(0);                  Intent i = new Intent();                i.setClass(DbServerActivity.this, QuadMain.class);                i.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);                i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);                startActivity(i);            } catch (Exception e) {            }            return true;        }        return super.onKeyDown(keyCode, event);    }</code></pre><p>it works fine sometimes only and sometimes it's not working..</p><p>Thanks in advance.</p>","393953","","393953","","2011-02-18 08:33:42","2011-02-18 09:42:23","Need Android tabhost back press navigation","<android>","2","2","1","",""
"5039141","1","","","2011-02-18 08:37:21","0","564","<p>I am trying to find out if there is a way to make existing app windows transparent in a smartphone. The platform could be any of iphone/android/WP7. In my own apps, I can make use of the alpha blending features and control transparency, but is there a way to make already existing windows transparent? Thanks!</p>","498937","","","","","2011-02-18 14:39:45","How to make existing app windows transparent in smartphones?","<iphone><android><windows-phone-7><alphablending>","2","2","","",""
"5039201","1","","","2011-02-18 08:44:22","0","169","<p>How can i fetch an html document from sqlite table using webview in android</p>","609497","","","","","2013-04-25 17:07:21","By using Sqlite database How can i retrieve an html document using webview in android","<android>","2","0","","",""
"5039210","1","","","2011-02-18 08:45:15","0","584","<p>i want to send link from my app. I use the following code: </p><pre><code>intent.setType(""text/plain"");intent.putExtra(Intent.EXTRA_SUBJECT, subject);intent.putExtra(Intent.EXTRA_TEXT, text);startActivity(Intent.createChooser(intent, ""Share""));</code></pre><p>This brings up a dialog with some Apps. But now I would like to filter this list, i.e. I would like to remove the Blutooth app.</p><p>How can i remove apps from this dialog?</p>","622816","","","","","2011-02-18 13:24:34","Only specific apps for action.send","<android><android-intent><send>","1","0","","",""
"5039274","1","5040498","","2011-02-18 08:53:35","0","1061","<p>hello i want to know whether the multilayer concept is work in android. if yes means tell me how?</p>","607853","","","","","2011-02-18 11:03:24","multilayer concept","<android>","2","1","1","2012-08-17 18:03:30",""
"5039278","1","","","2011-02-18 08:54:02","0","80","<p>I know the webview class has onpagestarted() and onpagefinished() methods, which can be used for calculating the load time for a page. Are there any other methods for doing this?I'm using an Intent object to launch a browser, I'm looking for a method that works under this setup:</p><pre><code>Uri Url = Uri.parse(""www.google.com"");Intent Browser = new Intent(Intent.ACTION_VIEW, Url );startActivity(Browser);</code></pre>","622547","","173773","","2011-02-18 09:04:14","2011-02-18 10:17:30","Are there any alternative methods for calculating the loading time of a web page on the Android?","<android>","1","0","","",""
"5039360","1","6773530","","2011-02-18 09:04:08","1","2109","<p>I have an app consisting of several activities. I'd like a background music to play continuously while user is navigating between them and stop is user goes to home screen/some other app/locks the screen.</p><p>What is the best way to do this?</p>","6533","","","","","2011-07-21 08:55:35","How to make MediaPlayer play music only while my app is in foreground?","<android><activity><media-player>","3","0","","",""
"5039427","1","5041575","","2011-02-18 09:10:15","0","546","<p>I think, e.g. Curved buttons, or a circle button. If I can how? </p>","590898","","","","","2011-02-18 13:25:57","Can I make ""not original looking"" buttons for Android in Eclipse?","<android>","3","0","","",""
"5039463","1","5044526","","2011-02-18 09:14:24","1","280","<p>I have a section on my Android app called 'More Information' which is basically a few pages of Html scripts which I display using WebView with the following code - </p><pre><code>InputStream fin = getAssets().open(htmlFl + "".html"");                 byte[] buffer = new byte[fin.available()];                 fin.read(buffer);                 fin.close();                 webview.loadData(new String(buffer), ""text/html"", ""UTF-8"");</code></pre><p>It all works fine except that the images are not appearing on any of the pages. I declare them using Html like the following -</p><pre><code>&lt;P&gt;&lt;IMG SRC=""http://www.OurWeb.co.uk/images/Icon.jpg""&gt;&amp;  nbsp;&lt;span style=""font-family: Arial, Helvetica, sans-serif; font-size: large;""&gt;&lt;B&gt;Opening Times During Exhibition&lt;/B&gt;&lt;/SPAN&gt;&lt;/P&gt;</code></pre><p>Am I doing anything wrong using the WebView and if not is there a way around this?</p>","616076","","","","","2011-02-18 18:01:27","Image not appearing in my Html script","<android><html><android-layout>","3","2","","",""
"5039465","1","5039490","","2011-02-18 09:14:31","7","7533","<p>Is it possible to bind a TableLayout with a ArrayAdapter?</p>","366053","","869912","","2012-08-15 19:27:26","2012-08-15 19:27:26","Is it possible to bind a TableLayout with a ArrayAdapter?","<android><android-adapter><android-tablelayout>","1","0","2","",""
"5039500","1","5040120","","2011-02-18 09:17:52","1","7921","<p>As the question suggest I know we can't override Home key event but if you look into emulator of <strong>android 2.2</strong> you will see an application <strong>Car Home</strong> it has overridden the most of the keys like Home, end cal.</p><p>Now the point is how had they done it. I tried to peep in the source code of the app but to my surprise its not available or I am unable to find it, but I dont think later is the case.</p>","517247","","","","","2012-10-06 07:13:32","Android Overriding home key","<android><key><home>","3","0","2","",""
"5039567","1","","","2011-02-18 09:24:45","0","504","<p>if i click the  button in second activity.it should move to first activity by clearing the listview data in the second activity</p>","581239","","","","","2012-04-07 15:42:16","Clearing listview","<android><listview>","5","0","1","2012-11-17 13:45:44",""
"5039639","1","","","2011-02-18 09:34:59","2","2919","<p>Is there any SDK of Twitter available through which we can implement Twitter in our application? I want that my application would load on his/her Twitter account and then the tweet should be sent to his/her account, but I cannot find any simple examples.</p><p>Something like the Facebook Android SDK is what I'm look for.</p>","","Jazz","238978","","2012-11-23 06:55:21","2012-11-23 06:55:21","twitter in android","<android><twitter-api>","4","5","1","",""
"5039685","1","5039794","","2011-02-18 09:40:48","1","1191","<p>I'm trying to send a JPG out of my app to a PHP listener and it seems like a ByteArray is the right way to handle this.However, when the request I currently have gets to the server, it has the fileName parameter (which is separate) but not the ByteArray param.  In the case of the ByteArray it's missing both the key and value of the field.</p><p>In the debugger, I can see the data is in the request... perhaps I'm not collecting it correctly on the PHP side?</p><p>here are the relevant parts of my code... all help greatly appreciated (as well as advice to do this in some alternate, more effective, way).</p><p>ANDROID:</p><pre><code>try {                   Part[] parts = new Part[2];        ByteArrayPartSource ps = new ByteArrayPartSource( printFileName, bitmapdata);        parts[0] = new FilePart(""fileData"", ps);        parts[1] = new StringPart(""fileName"" ,printFileName);        filePost.setRequestEntity(new MultipartRequestEntity(parts,                filePost.getParams()));    } catch (Exception e) {        Log.d(""MY_DEBUG"", e.toString());    }    try {        int statusCode1 = client.executeMethod(filePost);</code></pre><p>PHP:</p><pre><code>$targetPath = ""./"" . $_REQUEST['fileName'] ; $newFilePath = $targetPath;$fh = fopen($newFilePath, 'wb');        //tried both of these, neither seems to work...     fwrite($fh, $GLOBALS[""HTTP_RAW_POST_DATA""]) or die(""unable to write data"");            //and    fwrite($fh, file_get_contents('php://input'));    fclose($fh);    echo ""success!"";</code></pre>","59947","","","","","2011-02-18 09:51:44","How do I send a ByteArray from Android to PHP?","<java><php><android>","1","1","1","",""
"5039779","1","","","2011-02-18 09:50:15","7","15593","<p>I'm attempting to create a gridview that is loaded with images from a specific folder that resides on an SDCard. The path to the folder is known, (""/sdcard/pictures"") , but in the examples I've seen online I am unsure how or where to specify the path to the pictures folder I want to load images from. I have read through dozens of tutorials, even the HelloGridView tutorial at developer.android.com but those tutorials do not teach me what i am seeking. </p><p>Every tutorial I have read so far has either:</p><p>A) called the images as a Drawable from the /res folder and put them into an array to be loaded, not using the SDCard at all.</p><p>B) Accessed <strong>all</strong> pictures on the SDCard using the MediaStore but not specifying how to set the path to the folder I want to display images form</p><p>or </p><p>C) Suggested using BitmapFactory, which I haven't the slightest clue how to use. </p><p>If I'm going about this in the wrong way, please let me know and direct me toward the proper method to do what I'm trying to do. </p>","622898","","168175","","2011-08-23 19:08:14","2012-05-19 09:55:15","Displaying images from a specific folder on the SDCard using a gridview","<android><gridview><uri><android-sdcard><bitmapfactory>","4","0","5","",""
"5039850","1","5039979","","2011-02-18 09:56:55","0","2729","<p>I am new to Android. I need to store arraylist or vector in a database(SQLite) as a value for one of the column. I have searched regarding storing arraylist or vector. In thant they suggested to convert arraylist into JSON. Is there any other solution for this problem other than converting arraylist into JSON. Please give a me a solution or article regarding this issue.</p><p>Its very urgent. please help me.</p>","541539","","","","","2011-02-18 10:26:19","How to insert arraylist or vector into SQLite Database in android?","<android><sqlite>","4","0","1","",""
"5039895","1","5042848","","2011-02-18 10:00:27","5","1057","<p>Is there anyway to append a String to an EditText value, so that the string appended is not editable?</p><p>i.e. Say I have an EditText for Email Addresses, I want to treat an email address as a single entity rather than single characters. Therefore if a users deletes the last character of the email address, I want the whole email address to be removed rather than the last character.</p><p>I've been looking at Spannable but can't see anything obvious. This is similar to how Gmail and other apps do it.</p>","474997","","","","","2011-02-18 15:01:30","Append Non-Editable String to EditText","<android><edittext><editable>","1","3","2","",""
"5039902","1","5349167","","2011-02-18 10:00:41","0","500","<p>I am trying to debug the android phone with adb tool. When I run the adb command on the command prompt, the connected phone get disconnected from the system. I want to use adb logcat on the phone. I am using following command:</p><pre><code>adb -s &lt;device_id&gt; logcat</code></pre><p>After entering the command on command line, it says: <code>adb server out of date. Killing...</code> and after that phone gets disconnected and command line shows <code>waiting for device...</code></p><p>Any idea how to solve the problem? I just want to run logcat on the android device. I am using HTC Wildfire phone.</p><p>Thanks</p>","461537","","","","","2011-03-18 07:27:16","Android phone is disconnected when adb is started","<android><adb>","1","0","","",""
"5040031","1","5040087","","2011-02-18 10:14:09","0","640","<pre><code>AlertDialog.Builder alt_bld = new AlertDialog.Builder(this);</code></pre><p>when i wrote this error is shawn that</p><pre><code>The constructor AlertDialog.Builder(new Runnable(){}) is undefined</code></pre><p>.. so just tell me what i m do... </p>","785775","","512958","","2011-02-18 10:21:09","2011-02-18 10:21:09","alertbox in android","<android>","2","1","","",""
"5040054","1","5040102","","2011-02-18 10:17:22","0","340","<p>I have an android application which contains four modules(I mean four apk's).Each module has separate apk.But dependency is more among all the apk's. If all apk's available then my application works fine.But the problem is user can un-install any apk at any time.At that time application will crash. How to solve this problem. Is there anyway to find the availability of checking the apk's availability through programmatically ?.Or suggest me regarding this issue.</p><p>Please suggest me.Thanks in advance.</p><p>RegardsMurthy</p>","622910","","","","","2011-02-18 10:35:47","How to find the apk's is available or not from another apk in android","<android><apk>","2","2","","",""
"5040075","1","","","2011-02-18 10:19:55","0","346","<p>I have an <code>EditText</code> field restricted to numbers and <code>.,-</code> with <code>android:digits</code> and set <code>android:inputType</code> to <code>numberSigned|numberDecimal</code></p><p>My problem is when I switch to landscape mode, the IME goes to extracted mode and it lost any comma I put (I'm testing French locale).</p><p>If I delete <code>androud:inputType</code>, everything works well but the keyboard is not set to numeric keypad.</p><p>What am I missing?</p>","600351","","512958","","2011-02-18 10:23:32","2011-02-18 10:39:57","android extracted mode keyboard and android:digits","<android><user-interface><keyboard>","1","0","","",""
"5040182","1","","","2011-02-18 10:30:04","0","907","<p>How to insert files into database in Android. example: insert 2-3 .txt files into the database.Need the sample code to do this</p>","622953","","","","","2011-02-18 11:00:45","How insert files into database in android?","<android><sqlite>","2","1","","",""
"5040198","1","5041643","","2011-02-18 10:31:12","0","684","<p>control allow input both image and text in EditText android language</p>","577501","","","","","2011-02-18 13:09:07","How to input image and text in EditText","<android>","1","1","1","",""
"5040252","1","","","2011-02-18 10:37:26","1","3197","<p>I have developed an Android game application and I want to upload it to the Android Market.What is the procedure for this?</p>","475349","","300797","","2014-03-31 10:49:02","2014-03-31 10:49:02","upload android application to android market","<android><google-play>","3","0","1","",""
"5040255","1","","","2011-02-18 10:37:48","0","733","<p>I am developing one application through which i am calling webservice.      The web Service is hosted on the local machine,but while callingweb service i got      java.net.SocketException: Permission denied this bug.                    Mentioned internet permission in the manifest filealthough, i am getting this.      I am looking forward for positive response.</p><p>Thanks in Advance.     Regards </p>","622955","","","","","2011-06-12 10:29:01","Exception while calling web service----java.net.SocketException: Permission denied","<android>","1","1","","",""
"5040303","1","5041276","","2011-02-18 10:41:44","8","1056","<p>I have noticed that some Buttons don't seem as responsive as they could be. This applies equally to my app and to most other apps I've tried.</p><p>When I press a Button there is a tiny bit of lag (EDIT: I would estimate about 20-50 ms) before the Button lights up in the pressed state. Some apps have managed to remove this bit of lag, for instance RealCalc (available in the Market) whose Buttons switch to the pressed state immediately after you press your finger on them.</p><p>Most of the time this lag is not noticeable, but in my case where the Buttons are used in a custom number pad, this tiny bit of lag is disruptive to the user. RealCalc feels so much more responsive and polished because this lag has been removed.</p><p>My question is - how do I remove this lag? I am aware that I could just subclass, override onTouchEvent and proceed from there, but I would really prefer a solution using just the standard controls and options. I suspect the solution may also interfere with scrolling, but I can live with that.</p><p>EDIT: Specifically, the lag mentioned is the time from you put your finger on a button and hold it there until the button switches to the pressed state. The onClick handler is called when you remove your finger again.</p><p>Some answers suggested moving the bulk of my onClick handler to a thread. This is not the issue. To make doubly sure, I have removed all click handlers, and the tiny lag is still there.</p>","619821","","619821","","2011-02-18 11:15:03","2011-11-09 14:41:46","How can I make a Button more responsive?","<android><gui>","5","4","5","",""
"5040329","1","","","2011-02-18 10:44:13","2","393","<p>Hi Android automation test engineers....</p><p>My app has 2 android activities for Sign In and Home page and I want to automate these activities using android instrumentation.</p><p>My application must be signed and then it can get the home page. I have successfully written the code for login activity and now i want to test Homepage activity so that i need to pass user name and passwords arguments sign-In activity.</p><p>But android supports only for one activity level testing. i can pass only one activity name in ActivityInstrumentationTestcase2</p><p>Now how can i automate my home page activity? before i must need to set up the environment for this login activity instrumentation in Home page activity Instrumentation [ActivityInstrumentationTestcase2","396643","","1471203","","2013-01-09 11:55:51","2013-01-09 11:55:51","Android instrumentation with multiple activities","<android><android-manifest><android-intent>","0","0","","",""
"5040333","1","","","2011-02-18 10:45:22","1","416","<p>I am able to draw a path between two locations, but if the distance is too long - more than 300 Kilometers - the path is not drawn completely.</p><p>I am using the code below in order to draw the path:</p><pre><code>class MapOverlay extends com.google.android.maps.Overlay {    Road mRoad;    ArrayList&lt;GeoPoint&gt; mPoints;    public MapOverlay(Road road, MapView mv) {            mRoad = road;            if (road.mRoute.length &gt; 0) {                    mPoints = new ArrayList&lt;GeoPoint&gt;();                    for (int i = 0; i &lt; road.mRoute.length; i++) {                            mPoints.add(new GeoPoint((int) (road.mRoute[i][1] * 1000000),                                            (int) (road.mRoute[i][0] * 1000000)));                    }                    int moveToLat = (mPoints.get(0).getLatitudeE6() + (mPoints.get(                                    mPoints.size() - 1).getLatitudeE6() - mPoints.get(0)                                    .getLatitudeE6()) / 2);                    int moveToLong = (mPoints.get(0).getLongitudeE6() + (mPoints.get(                                    mPoints.size() - 1).getLongitudeE6() - mPoints.get(0)                                    .getLongitudeE6()) / 2);                    GeoPoint moveTo = new GeoPoint(moveToLat, moveToLong);                    MapController mapController = mv.getController();                    mapController.animateTo(moveTo);                    mapController.setZoom(8);            }    }    @Override    public boolean draw(Canvas canvas, MapView mv, boolean shadow, long when) {            super.draw(canvas, mv, shadow);            drawPath(mv, canvas);            return true;    }    public void drawPath(MapView mv, Canvas canvas) {            int x1 = -1, y1 = -1, x2 = -1, y2 = -1;            Paint paint = new Paint();            paint.setColor(Color.GREEN);            paint.setStyle(Paint.Style.STROKE);            paint.setStrokeWidth(3);            for (int i = 0; i &lt; mPoints.size(); i++) {                    Point point = new Point();                    mv.getProjection().toPixels(mPoints.get(i), point);                    x2 = point.x;                    y2 = point.y;                    if (i &gt; 0) {                            canvas.drawLine(x1, y1, x2, y2, paint);                    }                    x1 = x2;                    y1 = y2;            }    }</code></pre><p>}</p>","569938","","540776","","2011-11-10 17:32:15","2011-11-10 17:32:15","Is there any limit to drawing path using Geocoder (Android)?","<android><google-maps><overlay><shape><android-maps>","0","0","2","",""
"5040349","1","","","2011-02-18 10:47:32","1","700","<p>Assume I have 3 cubes in random location/rotation that are visible in the viewport. I want to be able to detect if which of the cube has been touched if I touch ( or click on emulator) a specific cube. If I just touch empty space instead of a cube, this should also be properly detected. I know there is onTouchEvent callback that you over-ride on a View but this only gives me x,y coordinate of where the touch occurred. I am looking for OpenGL-ES based solution and more specifically for Java based Android application.</p>","574122","","","","","2011-02-18 10:57:26","How to detect which 3d object has been touched?","<android><opengl-es>","2","0","","",""
"5040392","1","","","2011-02-18 10:51:43","2","552","<p>Please any body know about speech recognition in android,Please help me.</p>","487253","","","","","2011-02-18 10:57:27","How to run speech recognitaion (speech to text) in android device?","<android><speech-recognition>","1","0","","2011-02-18 12:31:08",""
"5040417","1","","","2011-02-18 10:54:55","1","381","<p>hello i have to set one alarm for every appointment(which i insert appointment details)and also show list of appointments on which date it to be alarm.but if i cancel particular appointment from list then it must not alarm but for all appointments it is being alarm .</p><p>how i cancel any specific alarm for appointment.</p><p>calendar = Calendar.getInstance();</p><pre><code>        calendar.set(Calendar.YEAR, _year);        calendar.set(Calendar.MONTH, _month - 1);        calendar.set(Calendar.DATE, _date);        calendar.set(Calendar.HOUR_OF_DAY, _hour1);        calendar.set(Calendar.MINUTE, _min1);        calendar.set(Calendar.SECOND, 0);</code></pre><p>Date specifiedTime = calendar.getTime();</p><pre><code>    Timer timer = new Timer();    timer.schedule(new TimerTask() {        public void run() {            showNotification();        }    }, specifiedTime);</code></pre><p>i have already use timer.cancel(); but it won't work properly.Please help...Thanks in advance</p>","525175","","","","","2011-09-26 21:57:12","how to cancel scheduled task","<android>","2","1","","",""
"5040533","1","","","2011-02-18 11:07:48","2","1155","<p>I have to check whether a database exists or not in android?? how can i check? It should return a boolean value after checking?plz provide me with the code.</p>","620787","","","","","2011-02-18 11:17:57","checking database in android","<android>","1","0","2","",""
"5040538","1","5040623","","2011-02-18 11:08:11","0","4238","<p>I have a ListActivity class, and when any item on the list is clicked, a new activity is displayed. The new activity takes time to load, so i would like the users to know that there is something happening (in the form of a progress dialog)</p><p>So, in order to do this, i implemented Runnable in my class like this - </p><pre><code>public class ProtocolListActivity extends ListActivity implements Runnable {private ProgressDialog progDialog;....protected void onListItemClick(ListView l, View v, int position, long id) {                    progDialog.show(this, ""Showing Data.."", ""please wait"", true, false);    Thread thread = new Thread(this);    thread.start();}....public void run() {     // some code to start new activity based on which item the user has clicked.}</code></pre><p>Initially, when i click, and the new activity is being loaded, the progress dialog works nicely, but when i close the previous activity (to get back to this list) the progress dialog is still running. I want the progress dialog to show up only for the time the new activity is being started.</p><p>Can someone please guide me on how to do this correctly. </p>","579705","","1886484","","2013-01-01 14:52:31","2013-01-01 14:52:31","Android - progress dialog does not close","<android><progressdialog><android-ui><runnable>","1","0","","",""
"5040547","1","5041869","","2011-02-18 11:08:53","2","1095","<p>I'm having some trouble with my <code>litView</code> inside my <code>viewFlipper</code>.</p><pre><code>    // GestureDetectorclass 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) {                IconManager.INSTANCE.leftSwipe();                vf.setInAnimation(slideLeftIn);                vf.setOutAnimation(slideLeftOut);                vf.showNext();                System.out.println(""SWIIINGG!!"");                // Left to right swipe            }  else if (e2.getX() - e1.getX() &gt; SWIPE_MIN_DISTANCE &amp;&amp; Math.abs(velocityX) &gt; SWIPE_THRESHOLD_VELOCITY) {                IconManager.INSTANCE.rightSwipe();                vf.setInAnimation(slideRightIn);                vf.setOutAnimation(slideRightOut);                vf.showPrevious();            }        } catch (Exception e) {            // nothing        }        return false;    }    @Override    public boolean onSingleTapConfirmed(MotionEvent e) {        Log.e(""Item Click"",""Item Click"");        Intent intentAgenda = new Intent (Activity_Main.this, AgendaSelected.class);        //intentAgenda.putExtra(""LECTURE_NAME"", homeAgendaListAdapter.getItemId(3));        startActivity(intentAgenda);        return super.onSingleTapConfirmed(e);    }}</code></pre><p>This code enables me to flip among the views in the flipper and scroll in the lists within the different flips. However, this makes my <strong>entire app</strong> clickable. Even if I <code>singleTap</code> on a blank surface, it registers a click, and sends me to where the <code>Intent intentAgenda = new Intent</code> wants to send me. This should only happen when I tap on an item within the <code>listView</code>!</p><p>What can I do to get the listener on the specific lists to only listen ""on the lists"" and not the entire app? I believe that the problem lies within the <code>public boolean onSingleTapConfirmed</code>, but I can't see it.</p>","591995","","1128737","","2012-01-26 15:32:32","2012-01-26 15:32:32","listView inside a ViewFlipper - scrolling problems","<android><listview><android-intent><scroll><viewflipper>","2","0","1","",""
"5040558","1","","","2011-02-18 11:10:05","2","2014","<p>I am trying to compile networking code on android and seeing compilation errors. the struct I am using is is ip_mreq_source which should be defined in header like so:</p><pre><code>struct ip_mreq_source {  struct in_addr imr_multiaddr;  struct in_addr imr_sourceaddr;  struct in_addr imr_interface;};</code></pre><p>Where in_addr should be defined as:</p><pre><code>typedef uint32_t in_addr_t;struct in_addr  {    in_addr_t s_addr;  };</code></pre><p>My detailed error coming out of g++ (GCC 4.4.3) from the Android based compiler:</p><pre><code>    arm-linux-androideabi-g++ -MMD -MP -MF groupsock/GroupsockHelper.o.d.org -fpic -ffunction-sections -funwind-tables -fstack-protector -D__ARM_ARCH_5__ -D__ARM_ARCH_5T__ -D__ARM_ARCH_5E__ -D__ARM_ARCH_5TE__  -Wno-psabi -march=armv5te -mtune=xscale -msoft-float -fno-exceptions -fno-rtti -mthumb -Os -fomit-frame-pointer -fno-strict-aliasing -finline-limit=64 -Igroupsock/include -Igroupsock/../UsageEnvironment/include -Iandroid-ndk-r5b/sources/cxx-stl/system/include -Igroupsock -DANDROID  -Wa,--noexecstack -DANDROID_NDK -Wall -fexceptions  -O2 -DNDEBUG -g   -Iandroid-8/arch-arm/usr/include -c  groupsock/GroupsockHelper.cpp -o groupsock/GroupsockHelper.o &amp;&amp; rm -f groupsock/GroupsockHelper.o.d &amp;&amp; mv groupsock/GroupsockHelper.o.d.org groupsock/GroupsockHelper.o.dgroupsock/GroupsockHelper.cpp: In function 'Boolean socketJoinGroupSSM(UsageEnvironment&amp;, int, netAddressBits, netAddressBits)':groupsock/GroupsockHelper.cpp:427: error: request for member 's_addr' in 'imr.ip_mreq_source::imr_multiaddr', which is of non-class type '__u32'groupsock/GroupsockHelper.cpp:428: error: request for member 's_addr' in 'imr.ip_mreq_source::imr_sourceaddr', which is of non-class type '__u32'groupsock/GroupsockHelper.cpp:429: error: request for member 's_addr' in 'imr.ip_mreq_source::imr_interface', which is of non-class type '__u32'</code></pre><p>I am not sure what is causing the error. Any pointers would be great - no pun intended.Thanks</p>","600590","","52917","","2012-03-25 11:42:05","2012-03-25 11:42:05","IN_ADDR struct strangely defined in android","<c++><android><c><struct><android-ndk>","3","8","","",""
"5040559","1","","","2011-02-18 11:10:08","0","747","<p>I face prob in add &amp; read cookie from default browser.I want to save some value in user default browser and next time i want dat valueI m setting cookie</p><pre><code>BasicClientCookie c = new BasicClientCookie(""AppN"", ""CookN"");    c.setValue(""Value"");    c.setDomain(""New Domain"");    c.setPath(""/newPath"");    c.setComment(""new Comment"");    c.setExpiryDate(new Date(""11/02/2012""));    String s = c.toString();    CookieSyncManager.createInstance(this);     CookieManager cookieManager = CookieManager.getInstance();     cookieManager.setCookie(""http://www.myssec.com"",s);</code></pre><p>is it okif yes den can u write code to read cookieelse how to add cookieplz i m new in android</p>","820710","","457982","","2011-02-19 04:41:17","2011-02-19 04:56:57","How to read cookie in Android 1.6?","<android><cookies>","1","6","","",""
"5040574","1","5040786","","2011-02-18 11:11:41","0","6589","<p>i want to write a paragraph as part of my mobile application. How do i go about it?</p><p>thanks in advance.</p>","590849","","","","","2011-02-18 11:34:47","write a paragraph using textview in android","<android><textview>","1","1","","",""
"5040629","1","5040742","","2011-02-18 11:17:41","1","2724","<p>My situation:I have a method that accepts a byte array. The array in question is encoded using UTF-8 and was originally an XML message. I would like to be able to re-construct this message using a DOM parser. I know I can create a Document from a byte array through the use of a <code>ByteBuffer</code>. The only problem is that if I put this directly into action on the passed byte array, it will create a corrupted Document (if possible at all). That is because the array is an encoded XML message, encoded in UTF-8. However, when I decode the array by the use of  the decode() method, I get a CharBuffer returned:</p><pre><code>ByteBuffer encodedData = ByteBuffer.wrap(data);CharBuffer decodedData = Charset.forName(""UTF-8"").decode(encodedData);</code></pre><p>I don't know how to construct a Document from this, as there are no parse() methods defined in the DocumentBuilder that will accept a CharBuffer....</p><p>Could anyone help me with this?</p>","603059","","","","","2011-02-18 11:29:32","Can I create a DOM Document from an encoded UTF-8 byte array?","<java><android><xml><dom>","1","0","","",""
"5040690","1","","","2011-02-18 11:24:22","1","202","<p>I have created some playlists in the Music application on a Galaxy Tab, but they did not appear in MediaStore.Audio.Playlists. I've noticed that the music app on Galaxy Tab is different than the default one. Maybe, it stores playlists in some other way?</p><p>Any ideas on how to access playlists created in that Galaxy Tab-specific Music app?</p>","6533","","","","","2011-02-18 11:24:22","How to access playlists on Galaxy Tab?","<android>","0","1","","",""
"5040703","1","","","2011-02-18 11:25:48","0","115","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/4448772/safely-wipe-file-content"">Safely wipe file content</a>  </p></blockquote><p>hi group,please tell me which algorithm use for file shredding.</p>","603066","","","","","2011-02-18 11:25:48","file shredder in android","<android>","0","2","","2011-02-18 13:43:30",""
"5040720","1","","","2011-02-18 11:27:23","6","9661","<p>I have a list view structure, with Relative layout that usesalternating background images for odd/even elements. I'm trying to setthe background drawable dynamically by calculating the position. Itworked fine with the normal bitmap. But when I tried to use theninepatch image it breaks the UI, all the elements get distorted. Whatam I doing wrong? Could it be how the ninepatch image is created or isthere a different way to use a ninepatch image compared to a normalbitmap.</p><p>My List View XML goes like 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=""wrap_content"" android:id=""@+id/id01""       android:background=""@drawable/my_9patch_bg_image""&gt;       &lt;ImageView  /&gt;       &lt;RelativeLayout&gt;         &lt;ImageView  /&gt;          &lt;TextView  /&gt;          &lt;TextView  /&gt;       &lt;/RelativeLayout&gt;&lt;/RelativeLayout&gt;</code></pre><hr><p>May be the solution <a href=""http://stackoverflow.com/questions/3904852/android-layout-broken-with-9-patch-background"">here</a> might work for my problem. It's exact though I have to try it. </p>","264989","","1288","","2011-09-13 11:20:54","2013-07-26 10:06:50","Problem with 9 patch image as background","<android><listview><nine-patch>","4","3","2","",""
"5040730","1","","","2011-02-18 11:28:37","1","538","<p>Assume I have 3 cubes at random location/orientation and I want to detect if any of the cube is overlapping (or colliding) with another cube. This overlap or collision could also happen as the cubes location/rotation are changed in each frame. Please note that I am looking for Android based and OpenGL ES (1.0 or 1.1) based solution for this.</p>","574122","","494747","","2011-02-19 18:57:32","2011-02-19 18:57:32","How to detect if part or all of object overlaps with another object in Android OpenGL-ES application?","<android><opengl-es><geometry>","1","2","","",""
"5040782","1","","","2011-02-18 11:34:40","-1","376","<p>hi i m new in androidI want to create session in androidplz any one ? </p>","820710","","54680","","2011-06-07 19:19:54","2011-06-07 19:20:32","How to create cookie session in 1.6","<android><session><cookies>","1","0","","2011-06-07 19:27:32",""
"5040807","1","","","2011-02-18 11:37:07","3","595","<p>Am having an applications which contains activity A,B,C and activity A has been launched from the launcher and B from A and C from B. Now am having a button in C on clicking the button i should tell the position of the activity c in activity stack . Ex A-B->C means C is at the 3 position of the activity stack.. How could i find this ?</p><p>Thanks in advance.</p>","617510","","526217","","2011-02-18 16:30:34","2014-01-08 14:19:42","Position of the activity in the activity stack","<android><activity>","3","1","","",""
"5040852","1","5041689","","2011-02-18 11:42:12","0","1295","<p>I am trying to create a service for a chat widget using XMPP, which picks up chat messages when they are sent to the user.</p><p>I have created a service, and in the onStart I use a AsyncTask to connect to the chat server, and then sets up a packetlistener.</p><p>Here's the code for the packer listener:</p><pre><code>public void setConnection(XMPPConnection connection) {    if (connection != null) {        // Add a packet listener to get messages sent to us        PacketFilter filter = new MessageTypeFilter(Message.Type.chat);        connection.addPacketListener(new PacketListener() {            public void processPacket(Packet packet) {                Message message = (Message) packet;                if (message.getBody() != null) {                    String fromName = StringUtils.parseBareAddress(message                            .getFrom());                    Log.v(TAG, ""Got:"" + message.getBody());                    // messages.add(fromName + "":"");                    // messages.add(message.getBody());                }            }        }, filter);    }}</code></pre><p>The problem is it seems to stop listening after being idle for a while. If I send chat messages straight away they get output.</p><p>Is the service getting stopped somehow? Is that the right place to put the packerlistener?</p><p>Thanks</p>","446963","","","","","2011-02-18 13:12:55","Packet Listener in Android Service","<android><service><widget><xmpp>","1","3","","",""
"5041021","1","5041072","","2011-02-18 11:59:45","2","4531","<p>I have created a custom class which extends ToggleButton and I override the toggle method and do not do anything in that. This has helped me in having control of switching togglebutton from on to off. Is this proper way of doing?</p><p>I wanted to have the control of togglebutton switching. I mean it should go from on to off based on certain conditions otherwise it should remain in the state it was. </p><p>This way its working but want to know whether its the correct way of doing or not.</p>","261566","","","","","2011-12-28 23:22:44","ToggleButton state change programmatically rather than automatically in Android?","<android><togglebutton>","2","0","","",""
"5041024","1","","","2011-02-18 12:00:05","-3","773","<p>I am creating android application which involves menu.Can anyone provide me the sample code code of creating menu.Thanks in advance</p><p>Tushar</p>","475349","","","","","2011-06-03 05:58:10","creating menu in Android","<android>","2","0","1","2011-09-19 08:37:05",""
"5041075","1","","","2011-02-18 12:06:21","0","362","<p>I am creating an Android application which involves imageview.Animation part.I want to rotate the image after every 3 sec. Can anybody tell how should i pursue</p><p>Thanks in advanceTushara</p>","475349","","","","","2011-02-18 12:14:59","rotate an image after every 3 second in android","<android>","2","0","1","",""
"5041079","1","","","2011-02-18 12:07:14","0","2479","<p>Hi guys I want to make a simple application.It will have one button which when clicked will play the song who's URI is hard coded.So i basically want the user to click a button and some song will play in the default media player so that i don't have to code for media player buttons.</p><p>Is this possible ? do u have a better approach?</p><p>this whole situation arises from the problem of fetching album art basically :) </p>","520141","","","","","2013-02-10 22:33:20","Play song in android in default media player.... i dont want to create my own","<android><controller><media><player>","2","1","","",""
"5041191","1","","","2011-02-18 12:20:32","0","4308","<p>Is it possible to convert my Android app to Bada Os?</p><p>Do you know any converter or anything else or should be written Bada Sdk again?</p><p>Thanks in advance</p>","2148828","","","","","2011-05-20 09:25:38","Android to Bada","<android><bada>","3","0","","",""
"5041202","1","5043043","","2011-02-18 12:21:25","3","2609","<p>Good day.In my app I have three tab (one Activity extend TabActivity and others activitys provides access to content). In first tab I have ImageView, a few TextView and it is works. But when I add ListView and in activity that contain ListView I add a few rows it was not show in may tab.</p><p>Can someone tell me where I was wrong? Here my code: </p><p>In StartActivity:</p><pre><code>    intent = new Intent().setClass(this, GoodsAndShopsActivity.class);    spec = tabHost.newTabSpec(""shops"").setIndicator(""Shops"",                      res.getDrawable(R.drawable.ic_tab_shops))                  .setContent(intent);    tabHost.addTab(spec);</code></pre><p>In GoodsAndShopsActivity:</p><pre><code>protected void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.descriptions);    m_shopsLayout = (ListView) findViewById(R.id.shops);    m_shopList = new ArrayList&lt;Shop&gt;();    m_shopAdapter = new ShopAdapter(m_shopList, this);    m_shopsLayout.setChoiceMode(ListView.CHOICE_MODE_SINGLE);    m_shopsLayout.setAdapter(m_shopAdapter);    for (int i = 0; i&lt;3; i++) {        m_shopList.add(new Shop(""new description""));        m_shopAdapter.notifyDataSetChanged();    }}</code></pre><p>In class that extends BaseAdapter:</p><pre><code>@Overridepublic View getView(int position, View convertView, ViewGroup parent) {    ViewHolder holder;    if (convertView == null) {        convertView = m_inflater.inflate(R.layout.shop, null);        holder = new ViewHolder();        holder.descriptions = (TextView) convertView.findViewById(R.id.shop);        convertView.setTag(holder);    } else {        holder = (ViewHolder) convertView.getTag();    }    String textOnView = m_shops.get(position).getDescription();    holder.descriptions.setText(textOnView);    return convertView;}static class ViewHolder{    TextView descriptions;}</code></pre><p>And my xml where define ListView (Sorry that so much):</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;LinearLayout    android:id=""@+id/full_info""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""&gt;    &lt;ImageView        android:id=""@+id/icon""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:layout_margin=""10px""        android:src=""@drawable/icon""&gt;    &lt;/ImageView&gt;    &lt;LinearLayout        android:id=""@+id/short_info""        android:orientation=""vertical""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:layout_toRightOf=""@id/icon""        android:layout_alignParentRight=""true""&gt;        &lt;TextView            android:id=""@+id/name_for_good""            android:layout_width=""fill_parent""            android:layout_height=""0dip""            android:layout_weight=""1""            android:gravity=""center_vertical""            android:text=""???????????? ??????""&gt;        &lt;/TextView&gt;        &lt;TextView            android:id=""@+id/best_price""            android:layout_width=""fill_parent""            android:layout_height=""0dip""            android:layout_weight=""1""             android:singleLine=""true""            android:ellipsize=""marquee""            android:text=""?????? ????: ""&gt;        &lt;/TextView&gt;        &lt;TextView            android:id=""@+id/worst_price""            android:layout_width=""fill_parent""            android:layout_height=""0dip""            android:layout_weight=""1""            android:text=""?????? ????: ""&gt;        &lt;/TextView&gt;    &lt;/LinearLayout&gt;&lt;/LinearLayout&gt;&lt;LinearLayout    android:id=""@+id/description_and_shop""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:layout_below=""@id/full_info""&gt;    &lt;TextView        android:id=""@+id/description""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:text=""??????? ????????? ???????? ?????? ? ??????? ????????, ???????? ? ?.?.""&gt;    &lt;/TextView&gt;        &lt;ScrollView        android:id=""@+id/ScrollView""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""&gt;        &lt;ListView            android:id=""@+id/shops""            android:layout_width=""fill_parent""            android:layout_height=""fill_parent""&gt;        &lt;/ListView&gt;    &lt;/ScrollView&gt;&lt;/LinearLayout&gt;</code></pre><p></p><p><strong>UPDATE:</strong> After coffe brake I was find mistake: in my xml I add in last LinearLayout ""orientaion=vertical"" and my rows appeared. <strong>SOLVED</strong></p>","559730","","559730","","2011-02-18 13:21:43","2011-02-18 15:21:46","How use ListView in android Tab?","<android><listview><adapter><tabactivity>","1","0","","",""
"5041224","1","5041359","","2011-02-18 12:24:01","1","5277","<p>How to get the total incoming call duration and total outgoing call duration in Android.</p><p>Anyone's help will be much appreciated.</p><p>Thanks to all,Madan.</p>","249634","","","","","2011-02-18 12:37:33","How to get the total incoming call duration and total outgoing call duration in Android","<android>","1","0","1","",""
"5041365","1","","","2011-02-18 12:38:09","-4","578","<pre><code>CREATE TABLE IF NOT EXISTS employee (_id INTEGER PRIMARY KEY AUTOINCREMENT,    firstName VARCHAR(50),    lastName VARCHAR(50),    title VARCHAR(50),    department VARCHAR(50),    managerId INTEGER,    city VARCHAR(50),    officePhone VARCHAR(30),    cellPhone VARCHAR(30),    email VARCHAR(30),    picture VARCHAR(200))INSERT INTO employee VALUES(1,'Ryan','Howard','Vice President, North East',    'Management', NULL, 'Scranton','570-999-8888',    '570-999-8887','ryan@dundermifflin.com','howard.jpg')</code></pre>","528057","","512958","","2011-02-18 12:50:02","2011-02-18 12:50:02","How do I Insert Latitude/Longtitude in my database & use it to open Google maps with Intent?","<android><sql><latitude-longitude>","1","1","","2011-02-18 14:42:05",""
"5041426","1","5159286","","2011-02-18 12:44:37","10","14294","<p>can anybody confirm what are the currently allowed methods for peer-to-peer communications within the Android framework? I need to transfer json strings and I'm currently using SMS which works ok but the problem is that the data also ends up as lots of text messages. I've read Reto Meier's first edition of Professional Android Application Development where he says that the data transfer options were not implemented due to security concerns.</p><p>Has this changed at all and how would you do peer-to-peer transfer of data?</p>","367698","","","","","2014-03-10 15:32:07","Peer-to-Peer communication options","<android><json><communication><p2p>","5","3","9","",""
"5041441","1","5044564","","2011-02-18 12:46:43","0","170","<p>Is there a way to get all the geopoints of a storechain's stores?If you f.e search for Ikea, walmart etc I would like to gather all the geopoints from the locations that google map or any other tool plot.</p>","497458","","","","","2011-02-18 17:32:38","Get Geopoints of <insert storechain> stores?","<android><map><gps><plot><android-mapview>","1","0","","",""
"5041499","1","5042123","","2011-02-18 12:53:47","11","11018","<p>I know, this question was asked before, but I haven't seen a working answer for it.</p><p>Is there any way to hide some items in a <code>ListView</code> without changing source data?</p><p>I tried to set visibility of the item view to gone, it won't be displayed anymore, but the place reserved for this item is still there.</p><p>I also set:</p><pre><code>android:dividerHeight=""0dp""android:divider=""#FFFFFF""</code></pre><p>Without success.</p>","408780","","1706309","","2013-10-30 17:24:09","2013-10-30 17:24:09","How to hide an item in a listview in Android","<android><listview><android-listview>","5","3","3","",""
"5041552","1","","","2011-02-18 12:58:49","0","248","<p>I want to us an Android-powered Pad as an information terminal for my customers.</p><p>The only thing it has to to is to show a HTML5 Webpage.</p><p>Therefore, 1. it should not be posiible to show another website (only the local one), should be no problem</p><ol><li><p>it should be only possible to leave the app with a password (how?)</p></li><li><p>and all buttons should be disabled (that´s hard).</p></li></ol><p>I found out how to set the target for the home button, but maybe there is an existing solution.</p><p>Thanks</p><p>Christian</p>","623129","","","","","2011-02-18 13:19:01","Android: How to use a Android Pad as a customer information Terminal","<android>","1","0","","",""
"5041567","1","5075506","","2011-02-18 13:00:08","0","766","<p>Hello i have a simple expandable list activity that was working fine until i changed this: <code>List&lt;Map&lt;String, String&gt;&gt; groupData = new ArrayList&lt;Map&lt;String, String&gt;&gt;();</code> for this: <code>List&lt;Map&lt;String, Image&gt;&gt; groupData = new ArrayList&lt;Map&lt;String, Image&gt;&gt;();</code> i guess that when you set the TextView items in the Simple expandable list adapter's constructor the textview is expecting to get Strings instead of objects. Is there some way to work this arround ? Or do i have to get stuck with strings? Here's some code:</p><pre><code> public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.expandable_list_layout);        List&lt;User&gt; header = new ArrayList&lt;User&gt;();        header.add(new User(""John""));        header.add(new User(""Smith""));        header.add(new User(""Anderson""));        header.add(new User(""Trinity""));        header.add(new User(""Morfeo""));        List&lt;String&gt; gretting = new ArrayList&lt;String&gt;();        gretting.add(""Hello"");        List&lt;Map&lt;String, User&gt;&gt; groupData = new ArrayList&lt;Map&lt;String, User&gt;&gt;();        final List&lt;List&lt;Map&lt;String, String&gt;&gt;&gt; childData = new ArrayList&lt;List&lt;Map&lt;String, String&gt;&gt;&gt;();        for (User user : header) {            Map&lt;String, User&gt; curGroupMap = new HashMap&lt;String, User&gt;();            groupData.add(curGroupMap);            curGroupMap.put(NAME, user);            List&lt;Map&lt;String, String&gt;&gt; children = new ArrayList&lt;Map&lt;String, String&gt;&gt;();            for (String word : gretting) {                Map&lt;String, String&gt; curChildMap = new HashMap&lt;String, String&gt;();                children.add(curChildMap);                curChildMap.put(NAME, word);            }            childData.add(children);        }        //our adapter        mAdapter = new SimpleExpandableListAdapter(                getApplicationContext(),                groupData,                R.layout.simple_expandable_list_item_1,                new String[] { NAME },                new int[] { R.id.header_text1 },                childData,                R.layout.simple_expandable_list_item_2,                new String[] { NAME },                new int[] { R.id.text1 }                );        ExpandableListView lv = (ExpandableListView)findViewById(R.id.list);        lv.setAdapter(mAdapter);    }}</code></pre><p>So the final question is: do i have to implement my own simple expandable list adapter to be able to set the text by myself?</p><p><strong>EDIT:</strong> Here is the trace of the error: </p><pre><code>02-21 08:56:54.128: ERROR/AndroidRuntime(277): java.lang.ClassCastException: se.madcoderz.categoryObject.User02-21 08:56:54.128: ERROR/AndroidRuntime(277):     at android.widget.SimpleExpandableListAdapter.bindView(SimpleExpandableListAdapter.java:249)02-21 08:56:54.128: ERROR/AndroidRuntime(277):     at android.widget.SimpleExpandableListAdapter.getChildView(SimpleExpandableListAdapter.java:229)02-21 08:56:54.128: ERROR/AndroidRuntime(277):     at android.widget.ExpandableListConnector.getView(ExpandableListConnector.java:450)02-21 08:56:54.128: ERROR/AndroidRuntime(277):     at android.widget.AbsListView.obtainView(AbsListView.java:1315)02-21 08:56:54.128: ERROR/AndroidRuntime(277):     at android.widget.ListView.makeAndAddView(ListView.java:1727)02-21 08:56:54.128: ERROR/AndroidRuntime(277):     at android.widget.ListView.fillDown(ListView.java:652)02-21 08:56:54.128: ERROR/AndroidRuntime(277):     at android.widget.ListView.fillSpecific(ListView.java:1284)02-21 08:56:54.128: ERROR/AndroidRuntime(277):     at android.widget.ListView.layoutChildren(ListView.java:1558)02-21 08:56:54.128: ERROR/AndroidRuntime(277):     at android.widget.AbsListView.onLayout(AbsListView.java:1147)02-21 08:56:54.128: ERROR/AndroidRuntime(277):     at android.view.View.layout(View.java:7035)02-21 08:56:54.128: ERROR/AndroidRuntime(277):     at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1249)02-21 08:56:54.128: ERROR/AndroidRuntime(277):     at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1125)02-21 08:56:54.128: ERROR/AndroidRuntime(277):     at android.widget.LinearLayout.onLayout(LinearLayout.java:1042)02-21 08:56:54.128: ERROR/AndroidRuntime(277):     at android.view.View.layout(View.java:7035)02-21 08:56:54.128: ERROR/AndroidRuntime(277):     at android.widget.FrameLayout.onLayout(FrameLayout.java:333)02-21 08:56:54.128: ERROR/AndroidRuntime(277):     at android.view.View.layout(View.java:7035)02-21 08:56:54.128: ERROR/AndroidRuntime(277):     at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1249)02-21 08:56:54.128: ERROR/AndroidRuntime(277):     at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1125)02-21 08:56:54.128: ERROR/AndroidRuntime(277):     at android.widget.LinearLayout.onLayout(LinearLayout.java:1042)02-21 08:56:54.128: ERROR/AndroidRuntime(277):     at android.view.View.layout(View.java:7035)02-21 08:56:54.128: ERROR/AndroidRuntime(277):     at android.widget.FrameLayout.onLayout(FrameLayout.java:333)02-21 08:56:54.128: ERROR/AndroidRuntime(277):     at android.view.View.layout(View.java:7035)02-21 08:56:54.128: ERROR/AndroidRuntime(277):     at android.view.ViewRoot.performTraversals(ViewRoot.java:1045)02-21 08:56:54.128: ERROR/AndroidRuntime(277):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1727)02-21 08:56:54.128: ERROR/AndroidRuntime(277):     at android.os.Handler.dispatchMessage(Handler.java:99)02-21 08:56:54.128: ERROR/AndroidRuntime(277):     at android.os.Looper.loop(Looper.java:123)02-21 08:56:54.128: ERROR/AndroidRuntime(277):     at android.app.ActivityThread.main(ActivityThread.java:4627)02-21 08:56:54.128: ERROR/AndroidRuntime(277):     at java.lang.reflect.Method.invokeNative(Native Method)02-21 08:56:54.128: ERROR/AndroidRuntime(277):     at java.lang.reflect.Method.invoke(Method.java:521)02-21 08:56:54.128: ERROR/AndroidRuntime(277):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)02-21 08:56:54.128: ERROR/AndroidRuntime(277):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)02-21 08:56:54.128: ERROR/AndroidRuntime(277):     at dalvik.system.NativeStart.main(Native Method)</code></pre><p><strong>2nd EDIT</strong> It's almost working but the listItems are not visible even if they're there:</p><pre><code>public class CategoriesAdapter2 extends SimpleExpandableListAdapter {    private List&lt;? extends List&lt;? extends Map&lt;String, User&gt;&gt;&gt; mChildData;    private String[] mChildFrom;    private int[] mChildTo;    public CategoriesAdapter2(Context context, List&lt;? extends Map&lt;String, ?&gt;&gt; groupData, int groupLayout,                              String[] groupFrom, int[] groupTo, List&lt;List&lt;Map&lt;String, User&gt;&gt;&gt; childData,                              int childLayout, String[] childFrom, int[] childTo) {        super(context, groupData, groupLayout, groupFrom, groupTo, childData, childLayout, childFrom, childTo);        mChildData = childData;        mChildFrom = childFrom;        mChildTo = childTo;    }    @Override    public View getChildView(int groupPosition, int childPosition, boolean isLastChild, View convertView, ViewGroup parent) {        View v;        if (convertView == null) {            v = newChildView(isLastChild, parent);        } else {            v = convertView;        }        bindView(v, mChildData.get(groupPosition).get(childPosition), mChildFrom, mChildTo, groupPosition, childPosition);        return v;    }    private void bindView(View view, Map&lt;String, User&gt; data, String[] from, int[] to, int groupPosition, int childPosition) {        int len = to.length - 1;        for (int i = 0; i &lt; len; i++) {            TextView v = (TextView)             view.findViewById(to[i]);            if (v != null) {                v.setText(data.get(from[i]).getName());            }        }    }}</code></pre>","526924","","526924","","2011-02-21 19:29:00","2011-02-22 07:57:29","problem showing object in SimpleExpandableActivity android","<android>","1","4","","",""
"5041587","1","5041650","","2011-02-18 13:03:02","1","125","<p>im trying to port an iphone app to android. i am completely new to java and android environment</p><p>i see different code samples on the internet, some use int and boolean where as some use Integer and Boolean</p><p>i wanted to know the pros and cons of both and which is the best way forward?</p><p>since primitive types are saved on the stack and no garbage collection happens on them, are they definitely a better choice as far as performance goes?</p><p>what is the real benefit of primitive v/s managed types? and what is the suggested approach?</p><p>in my app performance is crucial...</p><p>thanks in advance</p>","83027","","","","","2011-02-21 20:38:59","primitive vs managed types on android - which one should i use in my app","<java><android>","3","0","1","",""
"5041611","1","5042250","","2011-02-18 13:06:00","0","362","<p>I have to develop an Android application which should access a specific version of another application installed on the same machine. Is there a way we can handle this check programmatically? I am an Android newbie. Any help would be greatly appreciated.</p><p>Thanks in Advance,Navin</p>","623134","","","","","2011-02-18 14:06:33","How to make an Android application use specific version of another application","<android><version>","1","0","","",""
"5041665","1","5042260","","2011-02-18 13:11:08","2","4518","<p>Android documentation refers to <a href=""http://developer.android.com/reference/android/os/Build.html#FINGERPRINT"" rel=""nofollow"">Build.FINGERPRINT</a> as a way to uniquely identify the build. I'd like to know how this property is generated. I'm compiling whole framework on my board and it's set by default to <em>unknown</em>. Another question is if Market uses this identifier as some kind of validation?</p>","623112","","","","","2011-02-18 14:24:04","Creating Build.FINGERPRINT on Android","<android>","1","0","2","",""
"5041696","1","5043962","","2011-02-18 13:13:15","0","862","<p>I want to make a dynamic webpage that can display my sqlite database's element in tabular format. How can I create a dynamic webpage in android?I make a static HTML page and put in assest folder. It works but now I want a dynamic webpage. Please help:</p><pre><code>package com.Htmlview;import java.io.IOException;import java.io.InputStream;import android.app.Activity;import android.os.Bundle;import android.webkit.WebView;public class Htmlview extends Activity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        //setContentView(R.layout.main);        WebView webview = new WebView(this);        setContentView(webview);        try {            InputStream fin = getAssets().open(""index3.html"");                byte[] buffer = new byte[fin.available()];                fin.read(buffer);                fin.close();                webview.loadData(new String(buffer), ""text/html"", ""UTF-8"");        } catch (IOException e) {            e.printStackTrace();        }    }} </code></pre><p>This page works ...Help to make it dynamic through code.</p><p>gaurav gupta</p>","623176","","366898","","2012-08-13 06:56:36","2012-08-13 06:56:36","Retrieve data from sqlite database and display in assest folder's HTML page in android","<android><assets>","2","0","","",""
"5041733","1","5041989","","2011-02-18 13:16:18","3","480","<p>On an iphone context, when we add a view as a subview of another view, anything that happens to our subview will be handled correctly, because in the xib we say which class will be handling its actions. How can we achieve this on android? Since we don't have that kind of relation between an .xml layout and a class that uses it, how can we achieve something like that?</p><p>The main purpose is, for example: while having one common header and one common footer for the entire application, we just want to add different views to ""content View"" between the header and footer.</p>","491239","","491239","","2012-07-05 13:18:36","2012-07-05 13:18:36","Re-using Android layouts","<android><iphone><ios><layout><subviews>","1","0","1","",""
"5041745","1","5041880","","2011-02-18 13:17:43","8","339","<p>we are creating a location-enabled app where users use this app to record certain events in the field. </p><p>The important part of the event data is when an event happened. This is no issue when user is online, but we also support situations when user is offline (by remembering &amp; later syncing events). </p><p>There could be situations when users are offline and they change the time on the phone, so that event times are wrongly recorded.</p><p>So, what would be the best way to ensure we get a correct time, independent of user actions,  given that device could be offline. Some ideas:</p><ol><li>GPS time. Is it possible to acquire it?</li><li>Tracking system time changes made by user? </li><li>Any other idea?</li></ol><p>Note: time does need second accuracy, approximately minute accuracy would be ok.</p><p>Note2: we are creating mobile apps for Android and iPhone, so I'm interested for generic solutions and also solutions that are specific to any of those two platforms.</p>","248432","","248432","","2011-02-18 13:30:54","2011-05-12 15:17:59","Ensuring correct date/time","<iphone><android>","2","3","","",""
"5041927","1","5043795","","2011-02-18 13:36:43","0","375","<p>i want to display my data's in a html page,i make a static html page in assest folder .but dont know how to insert my data's in that html page programtically. please help its urgent.  </p>","623176","","623176","","2011-08-05 12:17:17","2011-08-05 12:17:17","how to disply my content on a html page in android","<android><html>","2","0","","",""
"5041978","1","","","2011-02-18 13:41:58","3","8919","<p>I am new to Android Development.</p><p>I've written the following code to download a video file from theinternet. It works fine. Now I want to attach a progress bar duringthe download process.I tried to subclass AsyncTask and write the download code inside doInBackground() method. But, somehow I can't figure it out.</p><p>Can somebody please help me modify this code to accomplish that?</p><hr><pre><code>package sample.android.download;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.content.Intent;import android.net.Uri;import android.os.Bundle;import android.os.Environment;import android.util.Log;import android.widget.TextView;public class DownloadDemo extends Activity {   private TextView tv;   private String videoURL = ""http://mysite-name.com/videos/videofile_name.mp4"";   private String fileName = ""my_video.mp4"";   /** Called when the activity is first created. */   @Override   public void onCreate(Bundle savedInstanceState) {       super.onCreate(savedInstanceState);       setContentView(R.layout.main);       tv = (TextView) findViewById(R.id.TextView01);       if(checkExternalMedia()==true) {               DownloadFromUrl(videoURL,fileName);               tv.append(""\n\nDownload Complete!"");       }       else {               tv.append(""\n\nExternal Media is NOT readable/writable"");       }   }   /** Method to check whether external media available and writable. */   private boolean checkExternalMedia(){       boolean mExternalStorageAvailable = false;       boolean mExternalStorageWriteable = false;       boolean stat;       String state = Environment.getExternalStorageState();       if (Environment.MEDIA_MOUNTED.equals(state)) {           // Can read and write the media           mExternalStorageAvailable = mExternalStorageWriteable = true;           stat = true;       }        else if (Environment.MEDIA_MOUNTED_READ_ONLY.equals(state)) {           // Can only read the media           mExternalStorageAvailable = true;           mExternalStorageWriteable = false;           stat = false;       } else {           // Can't read or write           mExternalStorageAvailable = mExternalStorageWriteable = false;           stat = false;       }       tv.append(""\n\nExternal Media: readable=""+mExternalStorageAvailable+ ""writable=""+mExternalStorageWriteable);       return stat;   }   /** Method to download an external file from the network to the SD card. */   public void DownloadFromUrl(String videoURL, String fileName) {       try {                   File root = android.os.Environment.getExternalStorageDirectory();                   tv.append(""\nExternal file system root: ""+root);                   File dir = new File (root.getAbsolutePath() + ""/video"");                   //dir.mkdirs();                   URL url = new URL(videoURL); //you can write here any link                   File file = new File(dir, fileName);                   long startTime = System.currentTimeMillis();                   Log.d(""ImageManager"", ""download begining"");                   Log.d(""ImageManager"", ""download url:"" + url);                   Log.d(""ImageManager"", ""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(5000);                   int current = 0;                   while ((current = bis.read()) != -1) {                      baf.append((byte) current);                   }                   /* Convert the Bytes read to a String. */                   FileOutputStream fos = new FileOutputStream(file);                   fos.write(baf.toByteArray());                   fos.flush();                   fos.close();                   Log.d(""ImageManager"", ""download ready in"" + ((System.currentTimeMillis() - startTime) / 1000) + "" sec"");       } catch (IOException e) {                       Log.d(""ImageManager"", ""Error: "" + e);       }       sendBroadcast(new Intent(Intent.ACTION_MEDIA_MOUNTED, Uri.parse(""file://""+ Environment.getExternalStorageDirectory())));   }}</code></pre>","622645","","622645","","2011-02-23 11:08:03","2011-02-23 11:08:03","Implement Progress Bar for File Download in Android","<android><android-asynctask>","1","6","1","",""
"5042065","1","","","2011-02-18 13:50:05","1","688","<p>i tried coding it, i tried solving it with google and stackoverflow, nothing found :=) so hopefully someone else has a better idea, im not sure if i get everything right:</p><p>i have 2 applications: ad (main app) / adfree-pro (just license starts ad app without ads ;P)</p><p>so <strong>the problem is, i want to have a pro version (with pro icon) in the launcher, which starts the normal-ad app, which is (the normal ad-app) not in the launcher.</strong></p><p>i tried removing the ad-app from the launcher (which due to my research should JUST remove it from the launcher)</p><blockquote>  <p>pkgMgr.setComponentEnabledSetting(new ComponentName(PACKAGE_NAME, PACKAGE_NAME + "".Main""),                              PackageManager.COMPONENT_ENABLED_STATE_DISABLED, PackageManager.DONT_KILL_APP);</p></blockquote><p>which results to: the icons in the launcher are correct ;) <strong>BUT</strong> the application can't be found on the phone, launched, started, even not with a launcher pro activity shortcut. it seems to be there (shortcuts can be created) but i crashes with an activity exception when i try to launch it.</p><blockquote>  <p>02-18 14:38:59.237: ERROR/AndroidRuntime(9941): Caused by: android.content.ActivityNotFoundException: Unable to find explicit activity class {PACKAGE_NAME/PACKAGE_NAME.Main}; have you declared this activity in your AndroidManifest.xml?</p></blockquote><p>which doesnt seem to belong (the error message)it looks like there has happened more to the application than just simply removed the entry in the launcher.</p><p>thanks a lot guys,every workaround for this situation appreciated :)best regards :)</p>","371749","","","","","2013-01-26 16:23:16","Remove from launcher BUT keep enabled / startable","<android><activity><launcher>","2","0","2","",""
"5042147","1","","","2011-02-18 13:57:31","0","3358","<pre><code>public class ClientJabberActivity extends Activity {private final static String SERVER_HOST = ""chat.facebook.com"";private final static int SERVER_PORT = 5222;private final static String SERVICE_NAME = ""chat.facebook.com""; private final static String LOGIN = ""xxxxx@chat.facebook.com"";private final static String PASSWORD = ""xxxxxx"";private List&lt;String&gt; m_discussionThread;private ArrayAdapter&lt;String&gt; m_discussionThreadAdapter;private XMPPConnection m_connection;private Handler m_handler;/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    m_handler = new Handler();    try {        initConnection();    } catch (XMPPException e) {        e.printStackTrace();    }    final EditText recipient = (EditText) this.findViewById(R.id.recipient);    final EditText message = (EditText) this.findViewById(R.id.message);            ListView list = (ListView) this.findViewById(R.id.thread);    m_discussionThread = new ArrayList&lt;String&gt;();    m_discussionThreadAdapter = new ArrayAdapter&lt;String&gt;(this,            R.layout.multi_line_list_item, m_discussionThread);    list.setAdapter(m_discussionThreadAdapter);    Button send = (Button) this.findViewById(R.id.send);    send.setOnClickListener(new View.OnClickListener() {        public void onClick(View view) {            String to = recipient.getText().toString();            String text = message.getText().toString();            Message msg = new Message(to, Message.Type.chat);            msg.setBody(text);            m_connection.sendPacket(msg);            m_discussionThread.add(""moi :"");            m_discussionThread.add(text);            m_discussionThreadAdapter.notifyDataSetChanged();        }    });}private void initConnection() throws XMPPException {    //Initialisation de la connexion    ConnectionConfiguration config =            new ConnectionConfiguration(SERVER_HOST, SERVER_PORT, SERVICE_NAME);    m_connection = new XMPPConnection(config);    m_connection.connect();    m_connection.login(LOGIN, PASSWORD);    Presence presence = new Presence(Presence.Type.available);    m_connection.sendPacket(presence);    //enregistrement de l'écouteur de messages    PacketFilter filter = new MessageTypeFilter(Message.Type.chat);    m_connection.addPacketListener(new PacketListener() {            public void processPacket(Packet packet) {                Message message = (Message) packet;                if (message.getBody() != null) {                    String fromName = StringUtils.parseBareAddress(message                            .getFrom());                    m_discussionThread.add(fromName + "":"");                    m_discussionThread.add(message.getBody());                    m_handler.post(new Runnable() {                        public void run() {                            m_discussionThreadAdapter.notifyDataSetChanged();                        }                    });                }            }        }, filter);}}</code></pre><p>this code i used to make connection with facebook chat, but the connection can not be established i don't know why . it works well with gmail </p><pre><code>02-18 16:06:20.178: ERROR/AndroidRuntime(453): java.lang.IllegalStateException: Not connected to server.02-18 16:06:20.178: ERROR/AndroidRuntime(453):     at org.jivesoftware.smack.XMPPConnection.sendPacket(XMPPConnection.java:665)02-18 16:06:20.178: ERROR/AndroidRuntime(453):     at com.developpez.florentgarin.android.ClientJabberActivity$1.onClick(ClientJabberActivity.java:61)02-18 16:06:20.178: ERROR/AndroidRuntime(453):     at android.view.View.performClick(View.java:2485)02-18 16:06:20.178: ERROR/AndroidRuntime(453):     at android.view.View$PerformClick.run(View.java:9080)02-18 16:06:20.178: ERROR/AndroidRuntime(453):     at android.os.Handler.handleCallback(Handler.java:587)02-18 16:06:20.178: ERROR/AndroidRuntime(453):     at android.os.Handler.dispatchMessage(Handler.java:92)02-18 16:06:20.178: ERROR/AndroidRuntime(453):     at android.os.Looper.loop(Looper.java:123)02-18 16:06:20.178: ERROR/AndroidRuntime(453):     at android.app.ActivityThread.main(ActivityThread.java:3647)02-18 16:06:20.178: ERROR/AndroidRuntime(453):     at java.lang.reflect.Method.invokeNative(Native Method)02-18 16:06:20.178: ERROR/AndroidRuntime(453):     at java.lang.reflect.Method.invoke(Method.java:507)02-18 16:06:20.178: ERROR/AndroidRuntime(453):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)02-18 16:06:20.178: ERROR/AndroidRuntime(453):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)02-18 16:06:20.178: ERROR/AndroidRuntime(453):     at dalvik.system.NativeStart.main(Native Method)02-18 16:06:43.167: ERROR/installd(35): eof02-18 16:06:43.167: ERROR/installd(35): failed to read size02-18 16:07:11.857: ERROR/Zygote(470): setreuid() failed. errno: 1702-18 16:07:16.408: ERROR/BatteryService(477): usbOnlinePath not found02-18 16:07:16.408: ERROR/BatteryService(477): batteryVoltagePath not found02-18 16:07:16.408: ERROR/BatteryService(477): batteryTemperaturePath not found02-18 16:07:16.477: ERROR/SurfaceFlinger(477): Couldn't open /sys/power/wait_for_fb_sleep or /sys/power/wait_for_fb_wake02-18 16:07:16.758: ERROR/SensorService(477): couldn't open device for module sensors (Invalid argument)</code></pre>","622342","","512958","","2011-02-18 14:44:17","2012-06-27 19:44:20","XMPP/facebook chat connection for android","<android><facebook><xmpp><chat>","2","5","1","",""
"5042192","1","5042993","","2011-02-18 14:01:07","0","1502","<p>I've got a thread running in my <code>ListActivity</code>and sometimes it takes too long to get the data from the internet, so maybe the user wants to quit and go back.</p><p>However, when I press the BACK button, it shows the previous view, but thread still remains in execution.</p><p>I override <code>onBackPressed()</code> method and set a breakpointm but while debugging I see that it doesn't go through it, so I don't know what else to do...</p><p>Any idea?</p><p>Thank you</p><p>Here is my code. Basically, I don't know why it doesn't execute <code>onKeyPressed()</code> even if it goes back to the previous activity when y press BACK button...<strong>code edit</strong></p><pre> // package + importspublic class ListaVideosActivity extends ListActivity implements Runnable {    private ProgressDialog pd;    private Context mContext;    private View header;    private View footer;    private Vibrator vibrator;    private boolean firsTime = true;    private Thread thread;    private Long playlistId;    private String playlistTitle;    protected int headerDrawable;    private Playlist pList;    public static final String TAG_PL_ID = ""id_playlist"";    public static final String TAG_PL_TITLE = ""title_playlist"";    public static final String TAG_PL_HEADER = ""header_playlist"";    private SensorManager mSensorManager;    private ShakeListener mShakeListener;    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        // Context es el MainTabActivity        mContext = getParent();        MainTabActivity.tabHost.getTabWidget().setVisibility(View.GONE);        playlistId = getIntent().getLongExtra(TAG_PL_ID, 0L);        playlistTitle = getIntent().getStringExtra(TAG_PL_TITLE);        headerDrawable = getIntent().getIntExtra(TAG_PL_HEADER, 0);        setLoadingView();        thread = new Thread(this);        thread.start();        createListHeader();        mSensorManager = (SensorManager) getSystemService(SENSOR_SERVICE);        mShakeListener = new ShakeListener(mSensorManager);    }    @Override    protected void onPause() {        mSensorManager.unregisterListener(mShakeListener);        super.onPause();    }    @Override    protected void onResume() {        super.onResume();        mSensorManager.registerListener(mShakeListener, mSensorManager                .getDefaultSensor(Sensor.TYPE_ACCELEROMETER),                SensorManager.SENSOR_DELAY_GAME);    }    private void setLoadingView() {        LayoutInflater inflater = (LayoutInflater) mContext                .getSystemService(LAYOUT_INFLATER_SERVICE);        View layout = inflater.inflate(R.layout.videos_loading_dialog, null);        MainTabActivity.tabHost.getTabWidget().setVisibility(View.GONE);        setContentView(layout);    }    private void createListHeader() {        LayoutInflater inflater = (LayoutInflater) mContext                .getSystemService(LAYOUT_INFLATER_SERVICE);        header = inflater.inflate(R.layout.videos_list_header, null);        footer = inflater.inflate(R.layout.screen_footer, null);        ((ImageView) header).setImageResource(headerDrawable);    }    @Override    protected void onListItemClick(ListView l, View v, int position, long id) {        Video video = (Video) l.getItemAtPosition(position);        Intent intent = new Intent(mContext, BCPlayerActivity.class);        BCPlayerActivity.video = video;        mContext.startActivity(intent);    }    public void run() {        pList = BCVideoGetter.getPlaylistById(playlistId);        if (pList != null) {            // hay lista            handler.sendEmptyMessage(1);        } else {            handler.sendEmptyMessage(0);        }    }    private Handler handler = new Handler() {        @Override        public void handleMessage(Message msg) {            switch (msg.what) {            case 0:                Toast.makeText(mContext, R.string.noHostError,                        Toast.LENGTH_LONG).show();            case 1:                if (firsTime) {                    // Shake                    mShakeListener.setForceThreshHold(1.9);                    mShakeListener                            .setOnShakeListener(new ShakeListener.OnShakeListener() {                                @Override                                public void onShake() {                                    if (pd == null || !pd.isShowing()) {                                        vibrator.vibrate(300);                                        updateVideosList();                                    }                                }                            });                    MainTabActivity.tabHost.getTabWidget().setVisibility(                            View.VISIBLE);                    setContentView(R.layout.videos_list);                    getListView().addHeaderView(header, null, false);                    getListView().addFooterView(footer, null, false);                    setListAdapter(new VideosListAdapter(mContext,                            R.layout.videos_list_item, (ArrayList) pList                            .getVideos()));                    vibrator = ((Vibrator) getSystemService(Context.VIBRATOR_SERVICE));                    firsTime = false;                } else {                    ((VideosListAdapter) getListAdapter()).setItems((ArrayList) pList.getVideos());                    ((VideosListAdapter) getListAdapter())                            .notifyDataSetChanged();                }                if (pd != null)                    pd.dismiss();                break;            }        }    };    @Override    public void onBackPressed() {        mSensorManager.unregisterListener(mShakeListener);        thread.interrupt();        PestanaProgramasTVActivity.group.back();    }    public boolean onCreateOptionsMenu(Menu menu) {        MenuInflater inflater = getMenuInflater();        inflater.inflate(R.menu.news_list_menu, menu);        return true;    }    @Override    public boolean onOptionsItemSelected(MenuItem item) {        switch (item.getItemId()) {        case R.id.update:            updateVideosList();            break;        case R.id.settings:            Intent settingsActivity = new Intent(mContext,                    SettingsActivity.class);            startActivity(settingsActivity);            break;        }        return true;    }    private void updateVideosList() {        if (pd == null || !pd.isShowing()) {            pd = ProgressDialog.show(mContext, """", getResources().getString(                    R.string.news_update), true);            thread = new Thread(this);            thread.start();        }    }}</pre>","453981","","453981","","2011-02-18 16:28:41","2011-02-18 16:28:41","onBackPressed and threads in android","<android><multithreading><back-button>","2","2","","",""
"5042197","1","5042326","","2011-02-18 14:01:25","29","49469","<p>I have created a custom view named <code>Graphview</code> . Here is the structure for the GraphView class.</p><pre><code>public class GraphView extends View {    public GraphView(Context context, float[] values, String title, String[] horlabels, String[] verlabels, boolean type) {        super(context);                ........   }   ..................   .................}</code></pre><p>I have added the view in a tablerow using <code>addview()</code>. It is working fine. Now I want to set height and width for the <code>GraphView</code>. How to do that?</p>","525004","","932225","","2013-02-28 07:21:51","2013-06-13 15:24:53","Android set height and width of Custom view programmatically","<android><view><height><width><params>","3","0","8","",""
"5042247","1","5044061","","2011-02-18 14:06:20","5","7508","<p>I have a text view with text"" This is a product developed by XYZ. For more queries, mail us at info@abc.com. And I have linkified ""info@abc.com"". But the problem is, whenever I touch any area below the textview, it gets linked to the email. How Do I make sure, the link has to happen only on clicking info@....I used patterns, Linkify.EMAIL_ADDRESS..nothing seem to work...kindly suggest some answers</p>","466590","","","","","2012-04-08 11:15:51","Linkify in android TextView","<android><hyperlink><patterns>","3","1","1","",""
"5042310","1","","","2011-02-18 14:13:37","0","2035","<p>Sorry Im new to android, and im doing a project where i want to edit some data from a item selected in a ListView.the prob is that i dont have any idea on how to pass the data.I select this item, this item is of the type ProjItems(a class to construct the item);it has the gets, string getname(), date getdata(),int getPrec();</p><p>and here is where i want to start the new Activity:</p><pre><code>public void onCreateContextMenu(ContextMenu menu,View v,ContextMenu.ContextMenuInfo menuInfo) {    super.onCreateContextMenu(menu, v, menuInfo);    menu.setHeaderTitle(""Selected Project"");    menu.add(0, DEL, Menu.NONE, R.string.remove);    menu.add(0, EDIT, Menu.NONE, R.string.edit).setIntent(new Intent(PM_List.this, PM_Edit.class));//here is where i want to pass the info    menu.add(0, TASK_LIST, Menu.NONE, R.string.task);    menu.add(0, CANCEL, Menu.NONE, R.string.cancel);    }</code></pre><p>this info i want to pass to the new activity i will later show it on a textview!Please help me, i will be very much happy, and grateful if you do!best regards to all João Azevedo</p>","600134","","","","","2011-02-18 14:20:08","Passing Values from a Context View item to a new intent!","<android>","1","0","","",""
"5042322","1","5042420","","2011-02-18 14:14:44","0","211","<p>I am an old school C programmer and I have the habbit of putting my change log in comments at the top of my main source file.</p><p>I would like to put my change log in a more convenient place so that I could pull it up at run time and display it to the user on request.</p><p>Any suggestions ?</p>","583683","","","","","2011-06-20 03:25:53","Convenient place to put a change log","<java><android>","6","0","2","",""
"5042325","1","","","2011-02-18 14:14:54","0","595","<p>I'm getting the error for the following lines:</p><pre><code>mTimeDisplay = (TextView) findViewById(R.id.timeDisplay);mPickTime = (Button) findViewById(R.id.pickTime);</code></pre><p>Although at this stage I'm merely copy-pasting stuff from the Tutorial, just to get a feel for it.. So where am I going wrong guys?</p><p>This is the .java file as a whole:</p><pre><code>package com.example.hellotimepicker;import java.util.Calendar;import android.app.Activity;import android.os.Bundle;import android.view.View;import android.widget.Button;import android.widget.TextView;public class HelloTimePicker extends Activity {    /** Called when the activity is first created. */    private TextView mTimeDisplay;    private Button mPickTime;    private int mHour;    private int mMinute;    static final int TIME_DIALOG_ID = 0;    @Override    protected void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        // capture our View elements        mTimeDisplay = (TextView) findViewById(R.id.timeDisplay);        mPickTime = (Button) findViewById(R.id.pickTime);        // add a click listener to the button        mPickTime.setOnClickListener(new View.OnClickListener() {            public void onClick(View v) {                showDialog(TIME_DIALOG_ID);            }        });        // get the current time        final Calendar c = Calendar.getInstance();        mHour = c.get(Calendar.HOUR_OF_DAY);        mMinute = c.get(Calendar.MINUTE);        // display the current date        updateDisplay();    } // updates the time we display in the TextView    private void updateDisplay() {        mTimeDisplay.setText(            new StringBuilder()                    .append(pad(mHour)).append("":"")                    .append(pad(mMinute)));    }    private static String pad(int c) {        if (c &gt;= 10)            return String.valueOf(c);        else            return ""0"" + String.valueOf(c);    }}</code></pre>","623214","","180538","","2011-02-18 14:16:31","2012-10-27 07:35:51","Time Picker widget - ""id cannot be resolved or is not a field""","<android><android-widget><datetimepicker>","2","0","","",""
"5042404","1","5193875","","2011-02-18 14:23:29","0","4413","<p>I was wondering if it's possible to create a generic push notification solution for mobile devices (or at least Android and iPhone) with Appcelerator. I found some examples on how to implement iPhone Push with Appcelerator but nothing generic.</p><p>Any ideas? Or are there maybe other cross-plattform development sdk to solve this?</p>","452681","","","","","2012-07-02 11:15:05","Appcelerator Push Notifications","<iphone><android><mobile><appcelerator>","3","0","","",""
"5042430","1","5042506","","2011-02-18 14:25:18","0","131","<p>I have to submit a base64 encoded string to my server. How to do this in android application.</p><p>Please help!!</p>","489762","","1471203","","2013-01-09 09:56:29","2013-01-09 09:56:29","Basce64 encoding in android","<android>","5","0","","",""
"5042487","1","5042572","","2011-02-18 14:30:06","0","6588","<p>i looking for code to send an email from my android application. I have googled and read that the code that are given will not run on emulators. i will have to put the code on actual devices to send an email. why is this so?</p><p>thank you in advance</p>","590849","","","","","2012-06-15 10:24:34","why cannot an emulator send email in android","<android><email><android-emulator>","4","2","","",""
"5042513","1","","","2011-02-18 14:32:34","0","240","<p>I have an issue with an Android Dev Phone 1 that does not want to start. The led is blinking when I press the ""Start"" button.</p><p>First, I thought it was the battery but I try it on another ADP and it starts! Battery is recharging at 100% (see it on the working phone) but the phone still refuses to start... Same issue when plugin the phone with the USB cable (the led is red).</p><p>Sometimes, I managed to start the phone but it says ""Charging 0%..."".</p><p>Does anyone know a solution for this issue ? How is the battery status managed by the Android system ?</p><p>Thanks !</p><hr><p>Some weeks ago, I updated the device from Android 1.5 to Android 1.6 and then I downgraded the phone to Android 1.5.</p><p>As the Radio image is the same for Android 1.5 and Android 1.6, I only flash the System image when downgrading.</p><p>I always use the official flash ROM that HTC provides for ADP1.</p><p>Any other idea ?</p><hr><p>When I manage to boot the phone, I navigate into the file system and find the binary file /data/system/batterystats.bin</p><p>Do you know an utility to examinate it ? Could I do something with it ? Thanks !</p>","590392","","1288","","2013-05-25 04:32:58","2013-05-25 04:32:58","Android Dev Phone 1 - Issue with battery status and phone boot","<android><phone><status><battery><adp>","0","2","","",""
"5042548","1","","","2011-02-18 14:35:40","4","10747","<p>i have a lan and i want to send  a upd message from my android (htc desire) to my PC. Theres a Wlan Router between them. The Problem is, that the UPD message never gets to the PC.</p><p>Code on the Android.:</p><pre><code>package org.example.androidapp;import java.net.DatagramPacket;import java.net.DatagramSocket;import java.net.InetAddress;public class UDPClientAnd {    public void sendUDPMessage(int port) throws java.io.IOException {        DatagramSocket socket = new DatagramSocket();        InetAddress serverIP = InetAddress.getByName(""192.168.1.110"");        byte[] outData = (""Ping"").getBytes();        DatagramPacket out = new DatagramPacket(outData,outData.length, serverIP,50005);        socket.send(out);        socket.close();    }}</code></pre><p>I choose a high port on booth sides. </p><p>The Permissions on the Android are:</p><pre><code>uses-permission android:name=""android.permission.INTERNET""uses-permission android:name=""android.permission.CHANGE_WIFI_MULTICAST_STATE"" </code></pre><p>The Server-Side is the PC just a simple programm for receiving:</p><pre><code>package org.example.androidapp;import java.io.IOException;import java.net.DatagramPacket;import java.net.DatagramSocket;import java.net.InetAddress;import java.net.SocketException;public class UPDServerAnd implements Runnable{public void run(){byte[] inData = new byte[48];byte[] outData = new byte[48];String message;DatagramSocket socket;try {    socket = new DatagramSocket(50005);    while (true) {        DatagramPacket in = new DatagramPacket(inData,inData.length);        socket.receive(in);        InetAddress senderIP = in.getAddress();        int senderPort = in.getPort();        message=new String(in.getData(),0,in.getLength());        System.out.println(""Got ""+message+"" from ""+senderIP+"",""+senderPort);        outData = ""Pong"".getBytes();        DatagramPacket out = new DatagramPacket(outData,outData.length, senderIP,senderPort);        socket.send(out);        }} catch (SocketException e) {    e.printStackTrace();}  catch (IOException e) {    e.printStackTrace();}}}</code></pre><p>So why is there no UDP Package visible coming from android?  Even Wireshark only shows some ARP packages.Plz help :)</p>","623273","","590840","","2011-02-18 14:43:06","2013-01-20 14:59:28","Sending UDP packages from ANDROID 2.2 (HTC desire)","<java><android><sockets><sdk><udp>","1","3","3","",""
"5042674","1","5042893","","2011-02-18 14:47:22","2","1151","<p>My second activity is not starting.Below is the code :-</p><p>First Activity :-</p><pre><code>package infy.route;import android.app.Activity;import android.content.Context;import android.content.Intent;import android.os.Bundle;import android.widget.Toast;public class main extends Activity {   /** Called when the activity is first created. */    Context mCtx;    final static int START =0;   @Override   public void onCreate(Bundle savedInstanceState) {      super.onCreate(savedInstanceState);      setContentView(R.layout.welcomescreen);      mCtx = this;      Thread splashThread = new Thread() {         @Override         public void run() {            try {               int waited = 0;               while (waited &lt; 2500) {                  sleep(100);                  waited += 100;               }            } catch (InterruptedException e) {               // do nothing            } finally {               finish();               Intent i = new Intent(mCtx,InfyRoutePlanner.class);               mCtx.startActivity(i);               ((Activity)mCtx).startActivityForResult(i, 2);            }         }      };      splashThread.start();   }   @Override    protected void onActivityResult(int requestCode, int resultCode, Intent data) {        // TODO Auto-generated method stub        super.onActivityResult(requestCode, resultCode, data);        if(requestCode == START)        {            Toast.makeText(mCtx, Integer.toString(resultCode), Toast.LENGTH_SHORT).show();        }    }    @Override    public void onDestroy(){        super.onDestroy();        finish();    }}</code></pre><p>Second Activity :- </p><pre><code>package infy.route;import android.app.Activity;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;public class InfyRoutePlanner extends Activity {    /** Called when the activity is first created. */    Context mCtx;public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        mCtx = this;        // Setting the buttons with their xml        Button btn1 = (Button)findViewById(R.id.btn1);        Button btn2 = (Button)findViewById(R.id.btn2);        // Button for Prepare Route By Address  ( Line 30 is this one)        btn1.setOnClickListener(new OnClickListener(){//          @Override        public void onClick(View v)        {            // This will start the From Address Activity            Intent intent = new Intent(mCtx, FromAddress.class);            /*Start Activity*/            mCtx.startActivity(intent);            /*Start ActivityForResult*/            ((Activity)mCtx).startActivityForResult(intent, 3);        }        });        // Action On Clicking Button 2        btn2.setOnClickListener(new OnClickListener(){        //  @Override        public void onClick(View v)        {            // This will start the activity RoutePlanning using Lat and Long Values            Intent intent = new Intent(mCtx, RoutePlanning.class);            /*Start Activity*/            mCtx.startActivity(intent);            /*Start ActivityForResult*/            ((Activity)mCtx).startActivityForResult(intent, 3);        }    });}}</code></pre><p>Here is the stack tracer :- </p><pre><code>02-18 20:10:02.253: DEBUG/AndroidRuntime(299): Shutting down VM02-18 20:10:02.263: WARN/dalvikvm(299): threadid=3: thread exiting with uncaught exception (group=0x4001aa28)02-18 20:10:02.263: ERROR/AndroidRuntime(299): Uncaught handler: thread main exiting due to uncaught exception02-18 20:10:02.283: ERROR/AndroidRuntime(299): java.lang.VerifyError: infy.route.InfyRoutePlanner$102-18 20:10:02.283: ERROR/AndroidRuntime(299):     at infy.route.InfyRoutePlanner.onCreate(InfyRoutePlanner.java:30)02-18 20:10:02.283: ERROR/AndroidRuntime(299):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1123)02-18 20:10:02.283: ERROR/AndroidRuntime(299):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2364)02-18 20:10:02.283: ERROR/AndroidRuntime(299):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2417)02-18 20:10:02.283: ERROR/AndroidRuntime(299):     at android.app.ActivityThread.access$2100(ActivityThread.java:116)02-18 20:10:02.283: ERROR/AndroidRuntime(299):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1794)02-18 20:10:02.283: ERROR/AndroidRuntime(299):     at android.os.Handler.dispatchMessage(Handler.java:99)02-18 20:10:02.283: ERROR/AndroidRuntime(299):     at android.os.Looper.loop(Looper.java:123)02-18 20:10:02.283: ERROR/AndroidRuntime(299):     at android.app.ActivityThread.main(ActivityThread.java:4203)02-18 20:10:02.283: ERROR/AndroidRuntime(299):     at java.lang.reflect.Method.invokeNative(Native Method)02-18 20:10:02.283: ERROR/AndroidRuntime(299):     at java.lang.reflect.Method.invoke(Method.java:521)02-18 20:10:02.283: ERROR/AndroidRuntime(299):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)02-18 20:10:02.283: ERROR/AndroidRuntime(299):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)02-18 20:10:02.283: ERROR/AndroidRuntime(299):     at dalvik.system.NativeStart.main(Native Method)</code></pre>","569938","","297762","","2011-02-18 14:48:56","2011-02-18 15:06:40","Android :- Second activity not getting started?","<android>","2","0","","",""
"5042832","1","","","2011-02-18 15:00:23","0","2472","<p>I've been looking into this for the last day or two and can not seem to find a solution to my issue. I am trying to post an image to a server using httppost.I have tried two ways of doing this and both complete the post but with no content i.e. the content length is 0.The first is as follows:</p><pre><code>String url = ""MYURL"";        HttpClient httpClient = new DefaultHttpClient();     try {             httpClient.getParams().setParameter(""http.socket.timeout"", new Integer(90000)); // 90 second             HttpPost post = new HttpPost(url);             File SDCardRoot = Environment.getExternalStorageDirectory();             File file = new File(SDCardRoot,""/DCIM/100MSDCF/DSC00004.jpg"");             FileEntity entity;             entity = new FileEntity(file,""binary/octet-stream"");             entity.setChunked(true);             post.setEntity(entity);             post.addHeader(""Header"", ""UniqueName"");             HttpResponse response = httpClient.execute(post);             if (response.getStatusLine().getStatusCode() != HttpStatus.SC_OK) {                     Log.e(""Here"",""--------Error--------Response Status line code:""+response.getStatusLine());             }else {                     // Here every thing is fine.             }             HttpEntity resEntity = response.getEntity();             if (resEntity == null) {                 Log.e(""Here"",""---------Error No Response!!-----"");             }     } catch (Exception ex) {             Log.e(""Here"",""---------Error-----""+ex.getMessage());             ex.printStackTrace();     } finally {               httpClient.getConnectionManager().shutdown();     }</code></pre><p>and the second is:</p><pre><code>String url = ""MYURL"";        //File SDCardRoot = Environment.getExternalStorageDirectory();        File file = new File(Environment.getExternalStorageDirectory(),""/DCIM/100MSDCF/DSC00004.jpg"");        try {            HttpClient httpclient = new DefaultHttpClient();            HttpPost httppost = new HttpPost(url);            InputStreamEntity reqEntity = new InputStreamEntity(new FileInputStream(file), -1);            reqEntity.setContentType(""binary/octet-stream"");            reqEntity.setChunked(true);            // Send in multiple parts if needed            httppost.setEntity(reqEntity);            HttpResponse response = httpclient.execute(httppost);            Log.d(""finishing"", ""The try catch function"");        } catch (Exception e) {            // show error        }*/</code></pre><p>As you can see I have hardcoded a path to a specific image, this is to be dynamic when I get it up and running. Can anyone see what i'm doing wrong? Am I leaving out something? I know I use setChunked and setContenttype - is there a setContent option?Any help would be grately appreciated.</p><p>Thanks,jr83.</p>","623335","","71724","","2011-02-18 15:16:55","2011-02-18 15:28:22","Android - image upload sending no content","<android><http-post>","1","0","1","",""
"5042841","1","5042898","","2011-02-18 15:01:01","2","4321","<p>I have looked for an answer for this but can't seem to find one.</p><p>I have a button that has been created programatically (rather than in the xml file) and I want something to happen when its clicked, show an alert or move to another screen etc.</p><p><strong>Button Code:</strong></p><pre><code>Button submitButton = new Button(this);submitButton.setId(99);submitButton.setText(""Submit"");</code></pre><p><strong>Listener code:</strong></p><pre><code>View submitButtonListener = findViewById(99);submitButtonListener.setOnClickListener(this);</code></pre><p>So I have set up the listner to find that button but I get this error</p><blockquote>  <p>The method setOnClickListener(View.OnClickListener) in the type View  is not applicable for the arguments  (RegisterScreen)  RegisterScreen.java /AccessibleApp/src/org/project/accessible   line  217   Java Problem</p></blockquote><p>I think it may be something to do with the fact that I dont have <code>setContentView();</code> at the start of the class because the whole page is written programatically (because I need to add checkboxes programatically). </p><p><strong>Here is the all the code below if it helps:</strong></p><pre><code>public class RegisterScreen extends Activity {    @Override    protected void onCreate(Bundle savedInstanceState) {         super.onCreate(savedInstanceState);         //initiate the database to be qureied        DatabaseData db = new DatabaseData(this);        db = new DatabaseData(this);        try {            db.createDataBase();        }         catch (IOException ioe) {            throw new Error(""Unable to create database"");        }        try {             db.openDataBase();        }        catch(SQLException sqle){            throw sqle;        }        SQLiteDatabase rdb = db.getReadableDatabase();        //main layout of the screen             LinearLayout layoutMain = new LinearLayout(this);        layoutMain.setOrientation(LinearLayout.VERTICAL);        layoutMain.setBackgroundColor(Color.WHITE);        //Linear Layout for the Banner        LinearLayout banner = new LinearLayout(this);        banner.setOrientation(LinearLayout.VERTICAL);        banner.setBackgroundColor(Color.rgb(17, 168, 191));        //layout params for height and width        LayoutParams bannerParams = new android.widget.LinearLayout.LayoutParams(                android.widget.LinearLayout.LayoutParams.FILL_PARENT, 40);        banner.setLayoutParams(bannerParams);        //Banner text        TextView bannerText = new TextView(this);        bannerText.setText(""Register"");        bannerText.setTextColor(Color.WHITE);        banner.addView(bannerText);        bannerText.setTextSize(24);        bannerText.setGravity(Gravity.CENTER);        //add banner layout to main layout        layoutMain.addView(banner);        //Scroll view for the rest of the screen        ScrollView sv = new ScrollView(this);        //Table layout to align the items register form items        TableLayout tl = new TableLayout(this);        //Table rows to put items on left and right sides of the page        TableRow usernameTR = new TableRow(this);        //Username label        TextView usernameL = new TextView(this);        usernameL.setText(""Username:"");        usernameL.setTextColor(Color.BLACK);        usernameTR.addView(usernameL);        //Username textbox        EditText usernameTB = new EditText(this);        usernameTB.setWidth(250);        usernameTR.addView(usernameTB);         tl.addView(usernameTR);        TableRow emailTR = new TableRow(this);        //email label        TextView emailL = new TextView(this);        emailL.setText(""Email:"");        emailL.setTextColor(Color.BLACK);        emailTR.addView(emailL);        //email textbox        EditText emailTB = new EditText(this);        emailTB.setWidth(250);        emailTR.addView(emailTB);           tl.addView(emailTR);        TableRow forenameTR = new TableRow(this);        //forename label        TextView forenameL = new TextView(this);        forenameL.setText(""Forename:"");        forenameL.setTextColor(Color.BLACK);        forenameTR.addView(forenameL);        //forename textbox        EditText forenameTB = new EditText(this);        forenameTB.setWidth(250);        forenameTR.addView(forenameTB);         tl.addView(forenameTR);        TableRow surnameTR = new TableRow(this);        //surname label        TextView surnameL = new TextView(this);        surnameL.setText(""Surname:"");        surnameL.setTextColor(Color.BLACK);        surnameTR.addView(surnameL);        //surname textbox        EditText surnameTB = new EditText(this);        surnameTB.setWidth(250);        surnameTR.addView(surnameTB);           tl.addView(surnameTR);        TableRow streetTR = new TableRow(this);        //street label        TextView streetL = new TextView(this);        streetL.setText(""Street:"");        streetL.setTextColor(Color.BLACK);        streetTR.addView(streetL);        //street textbox        EditText streetTB = new EditText(this);        streetTB.setWidth(250);        streetTR.addView(streetTB);         tl.addView(streetTR);        TableRow postcodeTR = new TableRow(this);        //postcode label        TextView postcodeL = new TextView(this);        postcodeL.setText(""Postcode:"");        postcodeL.setTextColor(Color.BLACK);        postcodeTR.addView(postcodeL);        //postcode textbox        EditText postcodeTB = new EditText(this);        postcodeTB.setWidth(250);        postcodeTR.addView(postcodeTB);         tl.addView(postcodeTR);        TableRow cityTR = new TableRow(this);               //city label        TextView cityL = new TextView(this);        cityL.setText(""City:"");        cityL.setTextColor(Color.BLACK);        cityTR.addView(cityL);        //city textbox        EditText cityTB = new EditText(this);        cityTB.setWidth(250);        cityTR.addView(cityTB);         tl.addView(cityTR);        TableRow countyTR = new TableRow(this);        //county label        TextView countyL = new TextView(this);        countyL.setText(""County:"");        countyL.setTextColor(Color.BLACK);        countyTR.addView(countyL);        //county textbox        EditText countyTB = new EditText(this);        countyTB.setWidth(250);        countyTR.addView(countyTB);         tl.addView(countyTR);        //Add table layout to the scroll view        //country dropdown          TextView catTitle = new TextView(this);        catTitle.setText(""\nPlease select the categories which affect you:\n"");        catTitle.setTextColor(Color.BLACK);        tl.addView(catTitle);        //categories        //categories title        String[] cols =  {""_id"", ""cat_name""}; //columns to be searched        Cursor cursor = rdb.query(""aa_category"", cols, null, null, null, null, null); //save teh querey to the db        while (cursor.moveToNext()) {             CheckBox catCB = new CheckBox(this);            String name = cursor.getString(1);            int id = cursor.getInt(0);            catCB.setId(id);            catCB.setText(""\n""+name+""\n"");            catCB.setTextColor(Color.BLACK);            tl.addView(catCB);        }        //add field for new category with a text field that will become active on clicking the checkbox        Button submitButton = new Button(this);        submitButton.setId(99);        submitButton.setText(""Submit"");        View submitButtonListener = findViewById(99);        submitButtonListener.setOnClickListener(this);        tl.addView(submitButton);        //Add table layout to the scroll view        sv.addView(tl);        //Add scroll view to the main layout        layoutMain.addView(sv);        this.setContentView(layoutMain);    }}</code></pre>","623336","","384985","","2012-09-25 16:05:51","2012-09-25 16:05:51","Onclicklistener for a programatically created button","<android><button>","2","0","","",""
"5043056","1","5814911","","2011-02-18 15:22:29","1","554","<p>I want to save(export) contents of MyView, which extends TextView, into a bitmap. </p><p>I followed the code: [this][1].</p><p>It works fine when the size of the text is small.</p><p>But when there are lots of texts, and some of the content is out of the screen, what I got is only what showed in the screen.</p><p>Then I add a ""layout"" in my code:</p><pre><code>private class MyView extends TextView{    public MyView(Context context) {        super(context);        // TODO Auto-generated constructor stub    }    public Bitmap export(){        Layout l = getLayout();        int width = l.getWidth() + getPaddingLeft() + getPaddingRight();        int height = l.getHeight() + getPaddingTop() + getPaddingBottom();        Bitmap viewBitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);        Canvas canvas = new Canvas(viewBitmap);        setCursorVisible(false);        layout(0, 0, width, height);        draw(canvas);        setCursorVisible(true);        return viewBitmap;    }}</code></pre><p>Now the strange thing happened:</p><p>The first time I invoke ""export""(I use an option key to do that), I got contents only on the screen.</p><p>When I invoke ""export"" again, I got complete contents, including those out of the screen.</p><p>Why?</p><p>How to ""export"" a view, including contents cannot be showed on the screen?</p><p>Thank you!</p><p>[1]: <a href=""http://www.techjini.com/blog/2010/02/10/quicktip-how-to-convert-a-view-to-an-image-android/"" rel=""nofollow"">http://www.techjini.com/blog/2010/02/10/quicktip-how-to-convert-a-view-to-an-image-android/</a> this</p>","623318","","","","","2011-04-28 07:05:24","convert a textview, including those contents off the screen, to bitmap","<android><view><bitmap><textview>","3","0","1","",""
"5043059","1","5043563","","2011-02-18 15:22:40","1","1393","<p>I have been doing a bit of research, but I cannot seem to find a way to determine small distances (centimeters and meters) using the sensors in Android or iOS devices.Bluetooth appears too inaccurate and require more than one device, GPS only works over larger variations in distance, and small variations in rotation seem to make using the accelerometer nearly impossible.</p><p>Is there a method that I am unaware of that would allow me to do such a thing? I am familiar with Calculus, so using Integrals to determine distance based on changes in time and velocity/ acceleration is not a problem for me, I just do not know how to determine those things.</p><p>Thank you.</p>","148824","","","","","2011-03-05 06:16:17","Android/ iOS how to determine small changes in distance using sensors?","<iphone><android><ios><gps><accelerometer>","3","0","1","",""
"5043116","1","5043415","","2011-02-18 15:27:15","0","223","<p>I want to implement layering of screens when transitioning from one screen to another.</p><p>Requirement:</p><p>i> There is a screen with a button.</p><p>ii> When the user clicks on the button , the next screen is displayed in the following manner.</p><p>It should move up from down &amp; place on top of the existing screen.On iPhone , technically its known as implementing the <strong>present model view controller</strong></p><p>I am aware of moving screens left &amp; right , but is there already available API for implementing what I have mentioned.</p><p>Any inputs/sample code for implementing the same will be useful.</p><p>Warm Regards,</p><p>CB</p>","443141","","","","","2011-02-18 15:56:45","Implement Layering of screens on Android","<android>","2","0","","",""
"5043167","1","","","2011-02-18 15:30:51","0","3264","<p>I have a Downloader Service that loads a list of downloads to run from my database.</p><p>It then creates an ASyncTask that will run the downloads in a background Thread.</p><p>This all works perfectly well, but the problem is I don't currently have a way to tell the service that the Downloader has completed.  I somehow have to send the service a message from the ASyncTask's <a href=""http://developer.android.com/intl/fr/reference/android/os/AsyncTask.html#onPostExecute%28Result%29"" rel=""nofollow"">onPostExecute</a> function (which runs on the UIThread).</p><p>I can't simply close the service remotely because the Service has some work to do when the ASyncTask completes.</p><p>I've considered registering a listener from the service and calling it in onPostExecute, but I think this would cause problems like closing the service before the Task was complete or some threadlocking issues.</p><p>How can I send a message (like a broadcast intent) to my Downloader service from my ASyncTask?</p><p><strong>EDIT</strong><br>Here's some code for those of you confused about what I am doing.</p><p>DownloadService.java (Important bits):</p><pre><code>public class DownloadService extends Service implements OnProgressListener {/** The Downloads. */private List&lt;Download&gt; mDownloads = new ArrayList&lt;Download&gt;(10);private DownloadTask mDownloadTask;/** The Intent receiver that handles broadcasts. */private BroadcastReceiver mIntentReceiver = new BroadcastReceiver(){    @Override    public void onReceive(Context context, Intent intent) {        DebugLog.i(TAG, ""onRecieve"" +intent.toString());        handleCommand(intent);    }};/* (non-Javadoc) * @see android.app.Service#onCreate() */@Overridepublic void onCreate() {    DebugLog.i(TAG, ""onCreate"");    mNM = (NotificationManager)getSystemService(NOTIFICATION_SERVICE);    IntentFilter commandFilter = new IntentFilter();    commandFilter.addAction(ACTION_PAUSE_DOWNLOADS);    commandFilter.addAction(ACTION_START_DOWNLOADS);    registerReceiver(mIntentReceiver, commandFilter);}/* (non-Javadoc) * @see android.app.Service#onDestroy() */@Overridepublic void onDestroy(){    DebugLog.i(TAG, ""onDestroy"");    //Make sure all downloads are saved and stopped    pauseAllDownloads();    //unregister command receiver    unregisterReceiver(mIntentReceiver);    //cancel notifications    closeNotification();}/* (non-Javadoc) * @see android.app.Service#onStartCommand(android.content.Intent, int, int) */a@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;}/** * Handle command sent via intent. * &lt;strong&gt;Warning, this function shouldn't do any heavy lifting.   * This will be run in UI thread and should spin off ASyncTasks to do work.&lt;/strong&gt; * * @param intent the intent */private void handleCommand(Intent intent) {    if(intent != null){        String action = intent.getAction();        Uri data = intent.getData();        if(action.equals(ACTION_START_DOWNLOADS))        {            updateDownloads();//Fetch list of downloads to do from database            startDownloads();//run downloads        }else if(action.equals(ACTION_PAUSE_DOWNLOADS)){            pauseAllDownloads();        }    }}/** * Start all downloads currently in list (in order). */private void startDownloads(){    pauseAllDownloads();//make sure we don't have a download task running    mDownloadTask = new DownloadTask();    mDownloadTask.setOnProgressListener(this);    Download[] downloads = new Download[mDownloads.size()];    for(int i = 0; i&lt;mDownloads.size(); i++)    {        Download d = mDownloads.get(i);        if(d.getStatus() != Download.COMPLETE)        {            downloads[i] = mDownloads.get(i);           }    }    //must be called on UI thread    mDownloadTask.execute(downloads);}/** * Pause downloads. */private void pauseAllDownloads(){    if(mDownloadTask == null)    {        //Done.  Nothing is downloading.        return;    }    //Cancel download task first so that it doesn't start downloading next    if(mDownloadTask.cancel(true))    {        //Task has been canceled.  Pause the active download.        Download activeDownload = mDownloadTask.getActiveDownload();        if(activeDownload != null)        {            activeDownload.pause();        }    }else    {        if(mDownloadTask.getStatus() == AsyncTask.Status.FINISHED)        {            DebugLog.w(TAG, ""Download Task Already Finished"");        }else{            //Task could not be stopped            DebugLog.w(TAG, ""Download Task Could Not Be Stopped"");        }    }}@Overridepublic void onProgress(Download download) {    //download progress is reported here from DownloadTask}}</code></pre><p>DownloadTask:</p><pre><code>/** * The Class DownloadTask. */public class DownloadTask extends AsyncTask&lt;Download, Download, Void&gt; {/** The On progress listener. */private OnProgressListener mOnProgressListener;/** * The listener interface for receiving onProgress events. * The class that is interested in processing a onProgress * event implements this interface and registers it with the component. * */public static interface OnProgressListener{    /**     * On progress update.     *     * @param download the download     */    public void onProgress(Download download);}private Download mCurrent;/** * Sets the on progress listener. * * @param listener the new on progress listener */public void setOnProgressListener(OnProgressListener listener){    mOnProgressListener = listener;}/** * Gets the active download. * * @return the active download */public Download getActiveDownload(){    return mCurrent;}/* (non-Javadoc) * @see android.os.AsyncTask#doInBackground(Params[]) */@Overrideprotected Void doInBackground(Download... params) {    int count = params.length;    for (int i = 0; i &lt; count; i++) {        mCurrent = params[i];        if(mCurrent == null)        {            continue;        }        mCurrent.setDownloadProgressListener(new Download.OnDownloadProgressListener() {            @Override            public void onDownloadProgress(Download download, int bytesDownloaded,                    int bytesTotal) {                publishProgress(download);            }        });        mCurrent.setOnStatusChangedListener(new Download.OnStatusChangedListener() {            @Override            public void onStatusChanged(Download download, int status) {                publishProgress(download);            }        });        mCurrent.download();        //publishProgress(mCurrent); redundant call        if(this.isCancelled())            break;    }    return null;}/* (non-Javadoc) * @see android.os.AsyncTask#onPostExecute(java.lang.Object) */public void onPostExecute(Void v){    //TODO notify completion.}/* (non-Javadoc) * @see android.os.AsyncTask#onProgressUpdate(Progress[]) */@Overrideprotected void onProgressUpdate(Download... progress) {    if(mOnProgressListener != null)    {        for(Download d:progress)        {            mOnProgressListener.onProgress(d);        }    }}}</code></pre>","131871","","131871","","2011-02-18 16:14:53","2011-02-18 16:33:50","How to end android service after ASyncTask it spun off completes?","<java><android><service><android-intent><android-asynctask>","1","6","3","",""
"5043281","1","","","2011-02-18 15:41:15","0","298","<p>Consider am having an APK, my requirement is to add some source code along with the APK and to create a new APK. Is it possible ? If so plz advise me !</p><p>Note: I have only APK not the source code.</p><p>Thanks in advance.</p>","617510","","","","","2011-02-18 15:58:20","Creating a new APK","<android>","1","2","","",""
"5043297","1","5044107","","2011-02-18 15:42:12","0","584","<p>i've now got the listview and it's touch actions and swipe actions working. But now i'm not sure how i can implement a swipe effect, like it's in the twitter app. </p><p>I've found in the internet that it's possible to animate 2 views with a viewflipper, but is it possible to animate two layouts in the same way?</p><p>Anyone out there, who knows how i can implement such a function?</p><p>The only thing i want is to switch the ListViewsItem layout with a swipe.</p>","325479","","1023783","","2012-08-08 03:08:59","2012-08-08 03:08:59","Change ListViewItems Layout with a Right Swipe. Android","<android><animation><swipe><viewflipper><listviewitem>","1","3","1","",""
"5043332","1","5043389","","2011-02-18 15:45:17","0","182","<p>I am trying to understand the OpenSudoku source code. I understand how the Board is drawn and how the onTouch event is processed. The only problem is there is a whole InputMethod package and about 8 classes in the package. Why do we need that package in the first place? Also the InputMethod class has a initialize() function. Why is that? Can I disable touch or keyboard input specifically for my app? </p><p>Thanks for any help. I am still learning Android dev and this will be of help.</p><ul><li>P</li></ul>","220201","","","","","2011-02-18 15:49:28","Can some explain this InputMethod classes in OpenSudoku source code?","<android>","1","0","","",""
"5043427","1","5044649","","2011-02-18 15:52:16","4","2980","<p>I need to get a <a href=""http://en.wikipedia.org/wiki/Ascender_%28typography%29"" rel=""nofollow"">ascender</a>/<a href=""http://en.wikipedia.org/wiki/Descender"" rel=""nofollow"">descender</a> and <a href=""http://en.wikipedia.org/wiki/X-height"" rel=""nofollow"">x</a> height..</p><p>By using following code I can find the descender and the total height:</p><pre><code>descender_height = paint.descent();total_height = descender_height - paint.ascent();//ascender = ?; is this always equal to descender height?//x_height = ?; total_height - 2*descender_height ?</code></pre><p>Thanks</p>","116622","","19750","","2011-02-18 15:59:53","2013-12-30 19:18:27","How to get ascender/descender and x height for a given font","<android><fonts><fontmetrics>","2","0","2","",""
"5043434","1","5044016","","2011-02-18 15:52:49","1","313","<p>I have two static tables with about 500 records each which provide lookup material for some ListViews in my app. When the app first starts and the tables are created I run a process to populate the tables which takes less than a minute but I've been looking to run the process in background using Async Task with a progress dialog letting the user know what is happening.My concern is that while the process is running and the data is being added and then the user tilts the phone the process will cancel. What would be the state of my database then? Is Async Task the best solution for this or should I use Threading? </p>","616076","","","","","2011-02-18 17:11:25","Best way to load my Sqlite Tables after creating tables on startup","<android><sqlite><sqlite3><android-asynctask>","2","0","1","",""
"5043490","1","5043585","","2011-02-18 15:57:20","0","759","<p>When I type android or android.bat in the Windows Command Prompt as Administrator, I return the java.exe options not the android.bat options.</p><p>For example:</p><p>C:>android.bat[INFO] Starting Android SDK and AVD ManagerUsage: java [-options] class [args...]           (to execute a class)   or  java [-options] -jar jarfile [args...]           (to execute a jar file)</p><p>where options include:    -client       to select the ""client"" VM    -server       to select the ""server"" VM</p><p>When I cd to anywhere in the path: C:\Program Files (x86)\Android\android-sdk-windows\tools - I do get the android options.</p><p>My system path is set to: <code>%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;%JAVA_HOME%\bin;%ANT_HOME%\bin;%ANDROID_SDK_PATH%\tools;C:\Program Files\ThinkPad\Bluetooth Software\;C:\Program Files\ThinkPad\Bluetooth Software\syswow64;C:\SWTOOLS\ReadyApps;C:\Program Files (x86)\Lenovo\Access Connections\;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Program Files (x86)\QuickTime\QTSystem\</code></p><ul><li>%ANDROID_SDK_PATH% is set to:C:\Program Files(x86)\Android\android-sdk-windows</li><li>%JAVA_HOME% is set to: C:\ProgramFiles (x86)\Java\jdk1.6.0_23</li></ul><p>How do I get the correction options returned for android.bat anywhere in my system?</p>","88757","","","","","2011-02-18 16:13:55","Windows 7 Command Prompt: Typing android.bat returns java.exe options","<java><android><windows-7><dos>","1","0","","",""
"5043671","1","","","2011-02-18 16:11:44","1","354","<p>I am here seeking some help. I am beginner of Android and there are so many things I confused. For now, I want to know how to control system resources and services like bluetooth, SMS, phone contacts etc. Honestly, i want to know how or what to do to control sms usage based on user behavior, block incoming call or change it to auto vibrate mode without user noticed like that. Actually, I want it for my assignment about context aware access control paper. I choose Android for implementation but i am afraid i couldn't submit my paper in time if i study android from the beginning and all by myself.Tutorials (especially with full sample code) would be fine for me.No offense but I want to avoid errors.I feel my head becomes swollen whenever ""force close error"" show as I need it urgent.Thanks in advance! Cheers!</p>","623439","","","","","2011-02-18 16:34:19","Seek for help about Android Programming","<android>","2","0","","",""
"5043681","1","5590378","","2011-02-18 16:12:55","5","3298","<p>I am writing my first Android application and I am liberally using asserts() from junit.framework.Assert</p><p>I would like to find a way to ensure that the asserts are only compiled into the debug build, not in the release build.</p><p>I know how to query the android:debuggable attribute from the manifest so I could create a variable and accomplish this in the following fashon:</p><p>static final boolean mDebug = ...</p><p>if (mDebug)    Assert.assertNotNull(view);</p><p>Is there a better way to do this?  i.e. I would prefer not to use an if() with each assert.</p><p>thanks</p>","623393","","","","","2011-09-15 07:07:50","better way to do Debug only assert code","<android>","3","0","3","",""
"5043767","1","","","2011-02-18 16:20:16","2","1465","<p>ok i've tried several different configurations. this keeps crashing and i can't see why?here is the 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""   &lt;WebView      android:id=""@+id/webview2""      android:layout_width=""fill_parent""      android:layout_height=""wrap_content"" /&gt; &lt;RelativeLayout&gt;        &lt;Button        android:id=""@+id/one""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:layout_alignParentBottom=""true""        android:layout_marginLeft=""10dip""        android:text=""Video 1"" /&gt;    &lt;Button        android:id=""@+id/two""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:layout_toLeftOf=""@id/one""        android:text=""Video 2"" /&gt;    &lt;Button        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:layout_toLeftOf=""@id/two""        android:text=""Video 3"" /&gt;&lt;/RelativeLayout&gt;&lt;/LinearLayout&gt;</code></pre>","616323","","469983","","2012-08-22 08:07:10","2012-08-22 08:07:10","working with nested views?","<android><android-layout>","2","3","","",""
"5043830","1","5048272","","2011-02-18 16:24:56","1","2754","<p>I am doing a research on NFC and its use, I've started with a simple proof of concept by creating an NFC application for Android. When tag is scanned, it sends REST request with tag's ID to see whether it is registered with the service, and if is, content is downloaded and played on the phone. </p><p>The problem is tags' ID are sequential, the requirement is to have some unique random information stored to avoid possible complications and security issues. The question is, what should the data be? Is there some standard on the subject?</p><p>The idea is to store <code>x,y</code> where <code>x</code> is trigger identifier and <code>y</code> is a random unique number. Would this work? Can custom activity be started based on <code>x</code> value?</p><p>Any help and references are appreciated. There will be cake.</p>","172609","","","","","2012-08-19 05:44:57","NFC listener trigger based on tag","<android><triggers><listener><nfc>","4","3","1","",""
"5043901","1","","","2011-02-18 16:31:25","1","1317","<p>When I try to run the Android 2.3.3 emulator, the phone desktop doesn't show.</p><p>Instead, this error message keeps popping up :</p><pre><code>The Application Launcher (process com.android.launcher) has stopped unexpectedly. Please try again.</code></pre><p>I keep force-closing it but it just keeps popping up.</p><p>However, any application that I try to run (I'm using Eclipse Helios for my IDE) runs fine in the background.</p><p>How do I get around this? </p>","623460","","92837","","2011-08-23 08:43:14","2011-08-23 08:43:14","Android 2.3.3 (Windows) emulator doesn't show the phone desktop on startup. Getting a repeated Launcher (com.android.launcher) error","<android><windows><emulator><launcher>","1","0","","",""
"5044041","1","","","2011-02-18 16:44:56","10","6709","<p>I am trying to use a BroadcastReceiver to detect when the phone has disconnected from a WiFi access point. To do this, I registered my BroadcastReceiver in the manifest:</p><pre><code>&lt;receiver android:name=""com.eshayne.android.WiFiBroadcastReceiver""&gt;    &lt;intent-filter&gt;        &lt;action android:name=""android.net.wifi.STATE_CHANGE"" /&gt;    &lt;/intent-filter&gt;&lt;/receiver&gt;</code></pre><p>In my WiFiBroadcastReceiver class, I am checking for a NETWORK_STATE_CHANGED_ACTION action and looking at the NetworkInfo's detailed state:</p><pre><code>if (action.equals(WifiManager.NETWORK_STATE_CHANGED_ACTION)) {    NetworkInfo info = (NetworkInfo)intent.getParcelableExtra(WifiManager.EXTRA_NETWORK_INFO);    android.util.Log.d(""com.eshayne.android.WiFiBroadcastReceiver"", ""network state change - detailedState="" + info.getDetailedState() + "": "" + info.toString());    if (info.getDetailedState() == DetailedState.DISCONNECTED) {        ...    }    else if (info.getDetailedState() == DetailedState.CONNECTED) {        ...    }</code></pre><p>The problem I'm seeing is that when the phone leaves the WiFi access point's range, my ""disconnected"" callback gets called 6 times - pretty regularly at about once every 15 seconds - before it stops. So far I haven't been able to find any distinguishing characteristics between each callback's NetworkInfo. Each NetworkInfo object being written to the log looks like this:</p><pre><code>02-18 10:16:51.918 D/com.eshayne.android.WiFiBroadcastReceiver( 1511): network state change - detailedState=DISCONNECTED: NetworkInfo: type: WIFI[], state: DISCONNECTED/DISCONNECTED, reason: (unspecified), extra: (none), roaming: false, failover: false, isAvailable: true</code></pre><p>It's also not an issue of the phone wandering in and out of WiFi range, as my ""connected"" callback is not called in between ""disconnected"" callbacks. Nor are any other states being triggered in between. Just a rapid series of 6 callbacks each with a detailedState of DISCONNECTED.</p><p>Is there a better way for me to detect when the phone has lost its WiFi connection, so that my callback only gets called once per disconnect? Or any way to detect which of the 6 callbacks I'm seeing is the ""final"" one?</p>","562080","","562080","","2011-02-18 22:03:56","2012-02-20 21:56:32","detecting disconnection from a WiFi access point","<android><wifi><broadcastreceiver><disconnect>","2","2","3","",""
"5044151","1","5044341","","2011-02-18 16:56:11","0","3458","<p>This maybe a continuation from 2 of my previous question, or maybe it's a completely unconnected problem.    </p><p>Previous questions were<br><a href=""http://stackoverflow.com/questions/5023133/questions-on-notepad-tutorial"">Questions on Notepad Tutorial:</a><br><a href=""http://stackoverflow.com/questions/5025152/cant-read-androidmanifest-xml-while-attempting-android-notepad-tutorial"">Can't read ... AndroidManifest.xml - while attempting Android Notepad Tutorial - Exercise 1</a>    </p><p>The tutorial asked you to select ""Create project from existing source"". My 1st original question was where to copy the template (original source) to and from the answers I received, It looks like I should copy the directory-structure/source under the C:/Development/Eclipse/ directory, so it would look like this<br>_ C:/Development/Eclipse/Notepadv1/... _    </p><p>I did that, and then tried to continue the tutorial, but when I got to the part that says to select ""Create project from existing source"", I received a pair of errors     </p><blockquote>  <p>C:\Andriod\Andriod-SDK-Windows\AndroidManifest.xml: java.io.FileNotFoundException: C:\Andriod\Andriod-SDK-<br>  (Same error prints twice in the Console &amp; WorkSpaceLog    </p></blockquote><p>So I posted a second question about the FileNotFoundException:, and received an answer saying to ignore the message, happens all the time... so I deiced to plow forward again. Now I have 2 problem. One of the problems may well be of my own doing, trying to run threw this tutorial dozens of times, and attempting to back out my changes over and over again.    </p><p><strong>Problem # 1:</strong><br>I once again start to create the Notepadv1 project using ""Create Project from Existing Source"" (The cant-read-androidmanifest-xml error still appears), but as suggested I just ignore it. I next select ""Android 1.5/Platform 1.5 as the Build Target, BUT the field where you enter the Min SDK Version is grayed out, and you can't enter the number 3 there.. The tutorial says to put the number there, but it seems to become grayed out at the same time I select  ""Create Project from Existing Source"" and get the ""cant-read-androidmanifest-xml"" error.    </p><p><strong>Problem # 2:</strong><br>If I click on [Next] twice, or [Finish] once, I get a pop up box with the message ""Invalid project description"" - - ""Reason: Invalid project description""    </p><blockquote>  <p>[Details>>] ""Invalid project description.   C:\Development\Eclipse\Notepadv1 overlaps the location of another project: 'Notepadv1'  "".    </p></blockquote><p>This did not originally happen. There is no mention of the ""Notepadv1"" in the Package Explorer or Navigator windows, so I can't find any way to remove it, and I have run Clean Projects, exited eclipse and rebooted the machine a few time... in a few different ways.<br>Any suggestions?  Joe</p><p><em>P.S. I have not yet accept any of the answers to my last question, because the juries still out. I'm not yet sure they were correct. I'll will make sure I go back and accept an answers, once I figure out what the correct answer is - Joe</em></p>","515453","","","","","2011-12-07 12:03:19","Attempting Android Notepad Tutorial - Exercise 1 - More problems","<android><eclipse>","4","1","","",""
"5044331","1","5044421","","2011-02-18 17:12:58","1","1097","<p>I don't have much experience with Android, but was asked by a hearing-impaired friend if there is a way to essentially ""stream"" voice to text on a mobile device.  I've used and looked into the android built in api, but it seems that only sends the speech off for processing after the speech input is completed.  I'm looking for something that works contiguously (similar to how Dragon works with microsoft word).</p><p>Perhaps there is already an app that does this.  If not, is there a way to implement this with the current Android OS/API?</p><p>Any suggestions appreciated.</p>","503644","","","","","2011-08-04 19:08:46","Android Instant Speech to Text voice recognition","<android><accessibility><voice-recognition>","2","0","1","",""
"5044342","1","","","2011-02-18 17:13:34","3","3075","<p>I have ploblem:get cursor position x,y in EditText android?You can help me?</p>","577501","","","","","2012-04-23 13:17:25","How to get cursor position (x,y) in EditText android","<android>","3","2","1","",""
"5044363","1","8144410","","2011-02-18 17:15:37","4","3650","<p>I'm trying to get a background in a live wallpaper to behave like a regular wallpaper with regard to scrolling when the user changes homescreens. I know the method required for this is onOffestsChanged, but I can't seem to get it working.</p><p>Does anyone have advice or a code snippet to get this working?</p>","2371514","","19750","","2011-04-01 14:42:06","2014-02-05 12:30:11","Parallax effect scrolling of live wallpaper background","<android><screen><home><live-wallpaper>","1","0","0","",""
"5044429","1","5044535","","2011-02-18 17:20:51","1","1039","<p>I have added a gadget in my iGoogle to display orders from our e-commerce shopping cart. I would like to have it as a Widget for our Android phones.  Anyone know where to start and what needs to be done?  <a href=""http://www.google.com/ig/directory?type=gadgets&amp;url=www.brandlabs.us/v/vspfiles/downloadables/widgets/igoogle/volusion_order_notifications.xml"" rel=""nofollow"">Link To iGoogle Gadget</a></p><p>I have found that I can EMBED the html to a webpage, could this be useful in creating something that would appear on my phone?</p>","525706","","525706","","2011-02-18 17:35:06","2011-04-21 21:23:54","iGoogle Gadget on Android Phone as APP or Widget","<android><android-widget><google-gadget><igoogle>","1","0","","",""
"5044483","1","5044815","","2011-02-18 17:25:57","9","1541","<p>I want to set a View background that is a regular grid of vertical stripes. The stripes alternate between two colors. (For example, across a single row, there might be 6 pixels of light gray followed by 2 pixels of dark gray, repeated to fill the width.)</p><p>It's easy enough to do this using a Bitmap (either as a resource or generated in code). For instance:</p><pre><code>ShapeDrawable bg = new ShapeDrawable(new RectShape());int[] pixels = new int[] { 0xFFCCCCCC, 0xFFCCCCCC, 0xFFCCCCCC,    0xFFCCCCCC, 0xFFCCCCCC, 0xFFCCCCCC, 0xFF999999, 0xFF999999};Bitmap bm = Bitmap.createBitmap(pixels, 8, 1, Bitmap.Config.ARGB_8888);Shader shader = new BitmapShader(bm,    Shader.TileMode.REPEAT, Shader.TileMode.REPEAT);bg.getPaint().setShader(shader);view.setBackgroundDrawable(bg);</code></pre><p>Is there a way to do this strictly as XML drawables, without using bitmap resources?</p>","535871","","","","","2011-02-18 17:57:01","Vertical-striped background in XML?","<android><background><drawable><xml-drawable>","1","1","3","",""
"5044501","1","5044863","","2011-02-18 17:27:53","1","1582","<p>I know that there is only a certain fill rate that admob can fill. However I want to show something anyway, or it will make my UI inconsistent. I tried to enable the ""house ad"", but still sometimes the ad bar is not filled.</p><p>Is there a way to force admob to show some ads? I believe getting more ads displayed can only be a good thing for them. Otherwise, can I manually check if there is no ad returned? Thus I can replace the ad bar with my own decorating bar.</p><p>Thanks,</p>","277368","","","","","2011-02-18 18:02:32","How to make admob always shows an ad on android?","<android><admob>","1","0","5","",""
"5044544","1","5044590","","2011-02-18 17:31:22","26","19960","<p>Can someone tell me how to lock my application to a portrait mode? Is it a simple configuration in the manifest file?</p>","250043","","","","","2011-02-18 19:48:03","Lock Android phone application to Portrait mode","<android><portrait><android-screen>","3","2","2","",""
"5044648","1","5044823","","2011-02-18 17:42:08","1","345","<p>I'm creating an application and it's has a button to switch perspective view of the itens (coverflow, grid and list). My question was, how do I keep an space in my activity to swap these views?</p><p>I have a header, and a footer, the middle I want to place an empty View in that to switch my perspectives on it.</p><p>Someone has a better idea?</p>","558433","","","","","2011-02-18 17:57:56","Empty View to add any Content on it","<android><layout><view>","2","0","","",""
"5044708","1","5047079","","2011-02-18 17:46:44","1","321","<p>I am planning to start writing some android test cases and I would like to know if there is a way of switching connectivity on and off programmatically in the emulator.  </p><pre><code>// High level puesdo codeTest: is Message Pushed to Local Storage if Phone is Not Connected to Network:    Connectivity = off    Create message    try push message to webapp    assert message in local storage    Connectivity = on</code></pre><p>New to test cases in android so apologies if answer is obvious.</p>","415600","","","","","2011-02-18 22:03:30","Is there a way of switching connectivity on and off in an AndroidTestCase?","<android><unit-testing><android-emulator><automated-tests>","1","0","1","",""
"5044755","1","","","2011-02-18 17:51:20","1","3970","<p>I'm building an Android app and I need to upload a photo taken with the camera. I need to upload it to a restful WCF service. I have looked at many tutorials but I just can't seem to get it working. I think my problem lies with the WCF service. I do not get any exceptions but I get a response 400 BAD REQUEST. Since the WCF service is currently running on my localhost, I am using 10.0.2.2 to access it from the android emulator. I am able to call other service methods on my local service but this one fails.</p><p>Java</p><pre><code>HttpPost httppost = new HttpPost(""http://10.0.2.2:53943/ImageService/UploadInspectionPhoto"");File photo = new File(Environment.getExternalStorageDirectory(), ""01.jpg"");MultipartEntity t = new MultipartEntity();t.addPart(""t"", new FileBody(photo));//t.addPart(new FormBodyPart(""t"", new FileBody(photo))); I tired this toohttppost.setEntity(t);HttpResponse response = httpclient.execute(httppost);</code></pre><p>WCF</p><pre><code>[ServiceContract][AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)][ServiceBehavior(InstanceContextMode = InstanceContextMode.PerCall)]public class ImageService{        [WebInvoke(Method = ""POST"")]        public void UploadInspectionPhoto(Stream t)        {            // I put a breakpoint here but it never gets here            // Do something with the stream        }}</code></pre><p>Config file</p><pre><code>&lt;?xml version=""1.0""?&gt;&lt;configuration&gt;  &lt;system.web&gt;    &lt;compilation debug=""true"" targetFramework=""4.0"" /&gt;      &lt;customErrors mode=""Off""&gt;&lt;/customErrors&gt;  &lt;/system.web&gt;  &lt;system.webServer&gt;    &lt;modules runAllManagedModulesForAllRequests=""true""&gt;      &lt;add name=""UrlRoutingModule"" type=""System.Web.Routing.UrlRoutingModule, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"" /&gt;    &lt;/modules&gt;  &lt;/system.webServer&gt;  &lt;system.serviceModel&gt;    &lt;serviceHostingEnvironment aspNetCompatibilityEnabled=""true""/&gt;      &lt;bindings&gt;          &lt;!--&lt;basicHttpBinding&gt;              &lt;binding name=""BasicHttpStreaming"" transferMode=""Streamed""&gt;              &lt;/binding&gt;          &lt;/basicHttpBinding&gt;--&gt;          &lt;webHttpBinding&gt;              &lt;binding name=""WebHttpDtreaming"" transferMode=""Streamed"" &gt;              &lt;/binding&gt;          &lt;/webHttpBinding&gt;      &lt;/bindings&gt;    &lt;standardEndpoints&gt;      &lt;webHttpEndpoint&gt;        &lt;!--             Configure the WCF REST service base address via the global.asax.cs file and the default endpoint             via the attributes on the &lt;standardEndpoint&gt; element below        --&gt;        &lt;standardEndpoint name="""" helpEnabled=""true"" automaticFormatSelectionEnabled=""true"" /&gt;      &lt;/webHttpEndpoint&gt;    &lt;/standardEndpoints&gt;      &lt;services&gt;          &lt;service behaviorConfiguration=""PublishMetadataBehavior"" name=""SystemDesign.Collaborate.Services.ImageService""&gt;              &lt;endpoint address=""soap"" binding=""basicHttpBinding"" name=""soap"" contract=""SystemDesign.Collaborate.Services.ImageService""/&gt;              &lt;endpoint address=""mex"" binding=""mexHttpBinding"" name=""mex"" contract=""IMetadataExchange"" /&gt;          &lt;/service&gt;      &lt;/services&gt;      &lt;behaviors&gt;          &lt;serviceBehaviors&gt;              &lt;behavior name=""PublishMetadataBehavior""&gt;                  &lt;serviceMetadata httpGetEnabled=""true"" policyVersion=""Policy15""/&gt;              &lt;/behavior&gt;          &lt;/serviceBehaviors&gt;      &lt;/behaviors&gt;  &lt;/system.serviceModel&gt;&lt;/configuration&gt;</code></pre><p>What am I doing wrong?</p>","358007","","566353","","2011-04-26 15:22:44","2013-09-22 02:55:52","How do I upload a file from an android device to a restful wcf service?","<android><wcf><file-upload>","3","4","2","",""
"5044986","1","5045016","","2011-02-18 18:14:50","0","88","<p>I'm creating a layout and have a header aligned on top, a footer aligned on bottom and want a View to take all the rest of the available space in the middle.</p><p>How do I do that without explicit passing the height attributes to each view?</p><p>My actual XML 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:layout_width=""match_parent"" android:layout_height=""match_parent""    orientation=""vertical""&gt;    &lt;ImageView android:id=""@+id/header"" android:layout_width=""match_parent""        android:layout_height=""wrap_content"" android:src=""@drawable/library_header""        android:scaleType=""fitXY"" /&gt;    &lt;ViewFlipper android:id=""@+id/content""        android:layout_height=""0dip"" android:layout_width=""match_parent""        layout_weight=""1.0"" /&gt;    &lt;LinearLayout android:layout_width=""match_parent""        android:layout_height=""44px"" android:layout_alignParentBottom=""true""        android:background=""@drawable/library_footer""&gt;        &lt;Button android:id=""@+id/l_coverflow"" android:layout_width=""44px""            android:layout_height=""34px"" android:background=""@drawable/library_coverflow_deselected""            android:layout_gravity=""center"" android:layout_marginLeft=""12px"" /&gt;        &lt;Button android:id=""@+id/l_grid"" android:layout_width=""36px""            android:layout_height=""32px"" android:background=""@drawable/library_grid_deselected""            android:layout_marginLeft=""12px"" android:layout_gravity=""center""            android:paddingLeft=""10px"" /&gt;        &lt;Button android:id=""@+id/l_list"" android:layout_width=""40px""            android:layout_height=""32px"" android:background=""@drawable/library_list_deselected""            android:layout_marginLeft=""12px"" android:layout_gravity=""center"" /&gt;    &lt;/LinearLayout&gt;&lt;/LinearLayout&gt;</code></pre>","558433","","558433","","2011-02-18 18:42:11","2011-02-18 18:42:11","View widthXheight equals to the available space of the screen","<android><layout>","1","2","","",""
"5045000","1","5045253","","2011-02-18 18:16:34","0","4465","<p>I want to implement a 2 part preference screen. If checkbox is clicked, first category should lock and 2nd one unlock. If it's not, reverse.  Now I see it only works if I go to previous activity and then to new (sharedPreferences). What listener should I override and how?</p>","607767","","","","","2011-02-18 18:50:38","CheckboxPreference onClick()","<android><checkbox><checkboxpreference>","2","0","","",""
"5045025","1","7188788","","2011-02-18 18:19:02","27","9027","<p>Ok so I am an avid user of Emacs and tend to stay away from using IDE's unless I absolutely have to and I see that it is recommended to use Eclipse with a plugin for developing android. I was just wondering if it is really necessary to use the Eclipse plugin (or some others out there)?</p>","392046","","217283","","2011-02-18 18:53:06","2013-01-25 21:43:49","Android development without using Eclipse","<android><emacs><ide>","6","0","15","",""
"5045202","1","","","2011-02-18 18:36:18","4","1087","<p>I've been receiving the same ANR reports recently.The ANR happens when app tries to draw some bitmaps (when rendering a GridView with ImageViews as elements).I've did a lot of debugging and can now surely say that hangs don't depend neither on bitmap, nor on position where it's being drawn.</p><p>The heap is 50% free, images are no bigger than 400px^2<br>Grid elements doesn't have any custom layout - just simple ImageView.<br>Tested on HTC Desire (1 GHz CPU), Hero, emulators, etc.<br>The ANR continues <strong>forever</strong> so it's like some infinite loop is running while drawing bitmap.  </p><p>What else can cause such a hang?</p><p>The report follows:</p><pre><code>DALVIK THREADS:""main"" prio=5 tid=1 NATIVE  | group=""main"" sCount=1 dsCount=0 s=N obj=0x40020ba0 self=0xddd0  | sysTid=32366 nice=0 sched=0/0 cgrp=unknown handle=-1345025972  at android.graphics.Canvas.native_drawBitmap(Native Method)  at android.graphics.Canvas.drawBitmap(Canvas.java:1045)  at android.graphics.drawable.BitmapDrawable.draw(BitmapDrawable.java:323)  at android.widget.ImageView.onDraw(ImageView.java:860)  at android.view.View.draw(View.java:6740)  at android.view.ViewGroup.drawChild(ViewGroup.java:1640)  at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1367)  at android.view.ViewGroup.drawChild(ViewGroup.java:1638)  at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1367)  at android.view.View.draw(View.java:6743)  at android.widget.FrameLayout.draw(FrameLayout.java:352)  at android.view.ViewGroup.drawChild(ViewGroup.java:1640)  at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1367)  at android.view.View.draw(View.java:6743)  at android.widget.FrameLayout.draw(FrameLayout.java:352)  at com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:1847)  at android.view.ViewRoot.draw(ViewRoot.java:1407)  at android.view.ViewRoot.performTraversals(ViewRoot.java:1163)  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:878)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:636)  at dalvik.system.NativeStart.main(Native Method)</code></pre>","223122","","881229","","2014-01-02 09:44:06","2014-01-02 09:44:06","ANR in Canvas.native_drawBitmap","<android><bitmap><native>","1","6","3","",""
"5045206","1","","","2011-02-18 18:36:44","3","508","<p>What are the best approaches to build a ""Craigslist Notifications"" software that shoots new postings directly to my email/sms/rss?</p><p>For example, I am constantly refreshing the ""Free"" category waiting for new postings. </p>","623528","","606805","","2011-02-25 20:15:38","2012-02-21 13:44:07","Android - Craigslist Notifications App that sends new postings to my email/sms/rss","<php><iphone><android><api>","3","2","","",""
"5045267","1","","","2011-02-18 18:43:36","0","1291","<p>I am making a game which will be using questions stored on a mp3, so for each question there will be a mp3 file. </p><p>The user will then press play to hear the mp3 and then add an answer for the mp3 in an edittext field. Which would then show correct or incorrect answer. </p><p>When the user clicks confirm answer the mp3 will move to the next question. So when the user presses play it will be question 2. Is it possible to do this and if so how would I go about implementing this. I would highly appreciate any advice on this. </p><p>Thanks. </p>","608658","","","","","2014-02-11 08:41:24","Soundpool game with mp3 questions","<android>","2","0","3","",""
"5045377","1","","","2011-02-18 18:56:38","1","910","<p>I'm on a Mac 10.6.3, running Android emulator 2.3.3.  I want to run some Selenium tests on the Android app, and as such, am instructed to install the ""Android WebDriver Application"" using this command ...</p><p>./adb -e install -r  android-server.apk</p><p>Does anyone know where I can download the ""Android WebDriver Application"", aka ""android-server.apk""?  Thanks, - Dave</p>","623658","","","","","2013-07-02 12:08:11","Where do I find android-server.apk?","<android>","2","0","","",""
"5045419","1","","","2011-02-18 19:00:22","0","115","<p>I'm writing an android app where I'd like to maintain the current location for the user while my app is open. I'm trying to figure out how to know when to stop listening for updates from my LocationManager, but can't seem to figure out a good way to know when the current task is paused.</p><p>Is there an easy way to say something like onTaskFinish() or onTaskPause()? </p>","612094","","","","","2011-02-18 23:30:30","receive notification when current task ends","<android>","1","1","","",""
"5045424","1","","","2011-02-18 19:00:43","0","761","<p>Can someone tell me whats wrong?? lost</p><p>Thanks,Mike</p><p>P.S.</p><p>I figured this might work instead of the splash for 1st page.</p><p>page1 or activity 1</p><pre><code>package com.test;import android.app.Activity;import android.content.Intent;import android.os.Bundle;import android.view.View;import android.widget.Button;public class test1 extends Activity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        Button next = (Button) findViewById(R.id.Button01);        next.setOnClickListener(new View.OnClickListener() {        public void onClick(View view) {        Intent myIntent = new Intent(view.getContext(),test2.class);        startActivityForResult(myIntent, 0);    }        });    }    }</code></pre><p>page2 or activity 2</p><pre><code>package com.test;    import android.app.Activity;    import android.content.Intent;    import android.os.Bundle;    import android.view.View;    import android.widget.Button;    public class test2 extends Activity {    /** Called when the activity is first created. */        public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main2);        Button next = (Button) findViewById(R.id.Button02);        next.setOnClickListener(new View.OnClickListener() {        public void onClick(View view) {        Intent intent = new Intent();        setResult(RESULT_OK, intent);        finish();                   }               }) ;        }}</code></pre><p>Manifiest</p><pre><code>&lt;manifest xmlns:android=""http://schemas.android.com/apk/res/android""      package=""com.test""      android:versionCode=""1""      android:versionName=""1.0""&gt;    &lt;uses-sdk android:minSdkVersion=""7"" /&gt;    &lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;        &lt;activity android:name="".test1""                  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="".Activity2""&gt;&lt;/activity&gt;    &lt;/application&gt;&lt;/manifest&gt;</code></pre>","607536","","297762","","2011-02-18 19:12:01","2011-02-19 06:41:00","Android basic activity call 2 pages with 1 button respectivly found no erros on validate still won't work in AVD","<java><android>","2","3","","",""
"5045521","1","","","2011-02-18 19:12:04","0","734","<p>In a research project I need to obtain the touch event when the user is typing with a soft keyboard. It is possible if I draw a soft keyboard on a imageView and set a touchListener for the imageView, but then I will have to figure out which key the user is typing on. Basically I am reimplementing the soft keyboard. So I was wondering if there is a way that I can set a touchListener for the view of the existing soft keyboard and get both the touch event and the text?</p>","623662","","","","","2011-10-07 07:14:24","How to get touch events when the user is typing with a soft keyboard on Android","<android>","4","0","","",""
"5045583","1","8749538","","2011-02-18 19:18:51","3","4436","<p>Using a widget.Gallery to display a horizontally scrolling list of items. I've implemented paging in the gallery with what seems to be the standard technique: subclass Gallery and implement:</p><pre><code>@Overridepublic boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) {        if (velocityX&gt;0) {            onKeyDown(KeyEvent.KEYCODE_DPAD_LEFT, null);        } else {            onKeyDown(KeyEvent.KEYCODE_DPAD_RIGHT, null);        }}</code></pre><p>When tapping the gallery, I fade up next and previous image buttons. When clicking these, I want the gallery to animated to the next/previous page, respectively. I've tried calling onKeyDown from my next-button handler, but strangely this has no effect.AbsSpinner has <code>setSelection(int position, boolean animate)</code> but animate is ignored in Gallery.</p>","619586","","","","","2013-03-22 09:10:03","Scroll gallery to next page","<android><gallery>","3","4","","",""
"5045604","1","","","2011-02-18 19:22:00","8","755","<p>In which file of the android repo do i have to change the default user-agent?I need to set this string as default user-agent for the media-player:<strong>HTC Streaming Player vodafone_uk / 1.0 / htc_bravo / 2.2</strong></p>","179235","","797495","","2014-01-19 12:19:08","2014-02-18 11:40:25","How to change default User-agent in mediaplayer of the android","<android><user-agent><media-player>","2","0","1","",""
"5045662","1","","","2011-02-18 19:29:03","2","397","<p>I have been reading quite a bit about intents and the like, and have been trying to avoid having to actually post a question. I believe what happens is you set the URI and that passes data to an intent (please correct me if I'm wrong), I am interested in using the calculator app on the phone, but I don't know HOW to determine what URI's are available of a given package (assuming URI is the correct terminology). (I'd be happy with only android native apps or any ""open"" apps).</p>","241852","","","","","2011-02-18 21:50:11","Discovering URI of intents","<android>","2","2","0","",""
"5045739","1","","","2011-02-18 19:36:18","1","730","<p>Is it possible in android to read out the GPS coordinates and velocity in ECEF.</p><p>I'd like to have a velocity vector (x, y, z), like in standard GPS modules available?</p><p>Cheers,Silvan</p>","623695","","","","","2011-02-23 08:49:18","Read GPS coordinates and velocity in ECEF","<android><gps><coordinates><velocity>","1","0","","",""
"5045912","1","","","2011-02-18 19:56:00","-2","386","<p>I recently noticed that I save non-ascii characters to file and read those characters from files. Could this cause crash on some phones?</p>","623715","","","","","2011-02-18 23:47:38","Is it safe to use non-ascii characters on Android app?","<android><non-ascii-chars>","2","1","","",""
"5045920","1","","","2011-02-18 19:56:32","5","1643","<p>I'm building a browser, and I have an address bar (as EditText) on top of the WebView. What I would like to do is to present the loading of the page graphically in the background of the EditText, much like in the iphone's browser. Is this possible?</p><p>Thanks</p><hr><p>UPDATE</p><p>So far I have tried the ClipDrawable approach. What I did was to take the stock drawable android.R.drawable.editbox_background and create 2 versions - a white background and a blue one (to show the progress). Then I would create a LayerDrawable like so:</p><pre><code> barDrawable = addressBar.getBackground();    Drawable progress = getResources().getDrawable(R.drawable.editbox_progress);    cbarDrawable = new ClipDrawable(progress, Gravity.LEFT, ClipDrawable.HORIZONTAL);    cbarDrawable.setLevel(0);    layerlist = new LayerDrawable(new Drawable[] { barDrawable, cbarDrawable });    addressBar.setBackgroundDrawable(layerlist);</code></pre><p>and then I would call setLevel as the loading progresses. The problem now is that there are weird issues such as: the white drawable is too big or it moves to the top.</p><p>What do you think?</p>","171911","","171911","","2011-02-28 16:47:37","2011-02-28 16:48:22","Android: EditText with Progress bar?","<android><progress-bar><edittext>","3","0","1","",""
"5045949","1","","","2011-02-18 20:00:33","0","964","<p>I am quite new to Android. I am doing a shopping cart app. In my cart page, I display the product image,name,id,quantity,price,total and delete button for each item. </p><p>I have used table layout for the above view in item.xml and inflated it in another tablelayout in cart.xml. </p><p>The problem is that when i add onclick listener to the remove button, it works only for the first row instead of the corresponding row.</p><p>Am i doing it the right way? Please help me. Thanks in advance.</p><pre><code>//item.xml&lt;TableLayoutandroid:id=""@+id/Item""android:layout_width=""fill_parent""android:layout_height=""fill_parent""android:orientation=""vertical""xmlns:android=""http://schemas.android.com/apk/res/android""android:background=""#ffffff""&gt;  &lt;TableRowandroid:id=""@+id/tr""android:layout_width=""fill_parent""android:layout_height=""97px""android:padding=""2dip""android:orientation=""horizontal""&gt;&lt;LinearLayoutandroid:id=""@+id/linear1""android:layout_width=""75px""android:layout_height=""95px""android:orientation=""vertical""&gt;&lt;ImageViewandroid:id=""@+id/product""android:layout_width=""60px""android:layout_height=""60px""&gt;&lt;/ImageView&gt;&lt;TextViewandroid:id=""@+id/pname""android:layout_width=""wrap_content""android:layout_height=""wrap_content""android:textSize=""12sp""android:layout_marginLeft=""5px""android:textColor=""#000000""&gt;&lt;/TextView&gt;&lt;TextViewandroid:id=""@+id/pid""android:layout_width=""wrap_content""android:layout_height=""16px""android:textSize=""12sp""android:layout_marginLeft=""5px""android:textColor=""#000000""&gt;&lt;/TextView&gt;&lt;/LinearLayout&gt;&lt;LinearLayoutandroid:id=""@+id/linear2""android:layout_width=""80px""android:layout_height=""74px""android:orientation=""vertical""&gt;&lt;TextViewandroid:id=""@+id/qty_t""android:layout_width=""wrap_content""android:layout_height=""wrap_content""android:layout_marginBottom=""11px""android:layout_marginLeft=""20px""android:text=""Qty: ""android:textSize=""12sp""android:layout_gravity=""right""android:textColor=""#000000""&gt;&lt;/TextView&gt;&lt;TextViewandroid:id=""@+id/price""android:layout_width=""wrap_content""android:layout_height=""wrap_content""android:text=""Price: ""android:textSize=""12sp""android:layout_gravity=""right""android:textColor=""#000000""&gt;&lt;/TextView&gt;&lt;TextViewandroid:id=""@+id/itemtot""android:layout_width=""wrap_content""android:layout_height=""wrap_content""android:text=""Item Total: ""android:textSize=""12sp""android:layout_gravity=""right""android:textColor=""#000000""&gt;&lt;/TextView&gt;&lt;/LinearLayout&gt;&lt;LinearLayoutandroid:id=""@+id/linear3""android:layout_width=""95px""android:layout_height=""110px""android:orientation=""vertical""&gt;&lt;EditTextandroid:id=""@+id/qty""android:numeric=""integer"" android:layout_width=""55px""android:layout_height=""29px"" android:textSize=""10sp""&gt;&lt;/EditText&gt;&lt;TextViewandroid:id=""@+id/price_amt""android:layout_width=""wrap_content""android:layout_height=""wrap_content""android:textSize=""12sp""android:textColor=""#000000""&gt;&lt;/TextView&gt;&lt;TextViewandroid:id=""@+id/item_amt""android:layout_width=""wrap_content""android:layout_height=""wrap_content""android:textSize=""12sp""android:textColor=""#000000""&gt;&lt;/TextView&gt;&lt;CheckBoxandroid:id=""@+id/gift_option""android:layout_width=""wrap_content""android:layout_height=""wrap_content""android:text=""Add Gift Options""android:textSize=""12sp""android:textColor=""#000000""&gt;&lt;/CheckBox&gt;&lt;/LinearLayout&gt;&lt;LinearLayoutandroid:id=""@+id/linear4""android:layout_width=""68px""android:layout_height=""69px""android:orientation=""vertical""android:layout_gravity=""right""&gt;&lt;ImageViewandroid:id=""@+id/remove""android:layout_width=""wrap_content""android:layout_height=""wrap_content""android:layout_gravity=""center_horizontal""android:layout_marginTop=""10px""android:src=""@drawable/x""&gt;&lt;/ImageView&gt;&lt;/LinearLayout&gt;&lt;/TableRow&gt;&lt;View        android:layout_height=""3dip""        android:background=""#FF909090"" /&gt;&lt;/TableLayout&gt;//cart.xml&lt;ScrollViewandroid:id=""@+id/widget129""android:layout_width=""fill_parent""android:layout_height=""wrap_content""xmlns:android=""http://schemas.android.com/apk/res/android""&gt;&lt;LinearLayoutandroid:id=""@+id/widget120""android:layout_width=""fill_parent""android:layout_height=""fill_parent""android:background=""#ffffff""android:orientation=""vertical""xmlns:android=""http://schemas.android.com/apk/res/android""&gt;&lt;TableLayoutandroid:id=""@+id/cart_item_table""android:layout_width=""fill_parent""android:layout_height=""wrap_content""android:orientation=""vertical""&gt;&lt;/TableLayout&gt;&lt;/LinearLayout&gt;&lt;/ScrollView&gt;</code></pre><p>my java code is :</p><pre><code>public class cart3 extends Activity  {    /** Called when the activity is first created. */    String[] product = new String[]{            ""Ipod 1"",            ""ipod 2"",            ""ipod 3"",            ""ipod 4"",            ""ipod 5""                    };    String[] pid = new String[]{            ""#1000"",            ""#1001"",            ""#1002"",            ""#1003"",            ""#1004""                    };   Integer[] pimg = {            R.drawable.sample_2, R.drawable.sample_1,            R.drawable.i2, R.drawable.i1,            R.drawable.i3, R.drawable.i4,    };   String[] Qty =  {           ""1"",""2"",           ""1"",""3"",           ""1"",""2"",    };   String[] price =  {           ""5000"",""7500"",           ""8000"",""5500"",           ""7200"",""5000"",    };    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.cart);        addCartContent();    }**//here is the problem**    private OnClickListener delimg = new OnClickListener() {         @Override        public void onClick(View arg0) {            // TODO Auto-generated method stub            TextView tv=(TextView) findViewById(R.id.pname);            tv.setText(""Deleted Item!"");            }     };     public void addCartContent()    {    int m_amt=0;    View itemView;    // ""cart_item_table"" is the id of the item table in cart.xml      TableLayout tl = (TableLayout)findViewById(R.id.cart_item_table);    // we will use service from inflater        LayoutInflater inflater = (LayoutInflater)getSystemService(LAYOUT_INFLATER_SERVICE);      //doing a loop to add many times the cart xml            for(int i = 0; i &lt; product.length; i++) {              // ""item"" is the name of the xml file ""item.xml"".               // Create the itemView who will be added.             // itemView = cart.xml             itemView = inflater.inflate(R.layout.item,null);           //get the image id and set it to image in array pimg           ImageView im = (ImageView) itemView.findViewById(R.id.product);           im.setImageDrawable(getResources().getDrawable(pimg[i]));          // get the product name, and set the text to element from array              TextView t1 = (TextView) itemView.findViewById(R.id.pname);               t1.setText(product[i]);           // get the product id, and set the text to element from array               TextView t2 = (TextView) itemView.findViewById(R.id.pid);                t2.setText(pid[i]);            // get the product qty, and set the text to element from array                EditText t3 = (EditText) itemView.findViewById(R.id.qty);                 t3.setText(Qty[i]);           // get the product price, and set the text to element from array                 TextView t4 = (TextView) itemView.findViewById(R.id.price_amt);                  t4.setText(""Rs.""+price[i]+"".00"");         // get the item total, and set the text to product of price and qty                 TextView t5 = (TextView) itemView.findViewById(R.id.item_amt);               int pr = Integer.parseInt(price[i].trim());               int quan=Integer.parseInt(Qty[i].trim());               int item_amt=pr*quan;                String i_amt = Integer.toString(item_amt);              //Calculate the merchandise total by adding all item_amt                m_amt=m_amt+item_amt;                t5.setText(""Rs.""+i_amt+"".00"");                 ImageView x= (ImageView)itemView.findViewById(R.id.remove);                x.setOnClickListener(delimg);                //add the itemView                  tl.addView(itemView);                   }//end of for loop    }//end of addCartContent()</code></pre>","623438","","23199","","2011-02-18 20:03:09","2011-02-19 05:22:06","unable to implement onclicklistener in inflated layout","<android><android-layout>","1","0","","",""
"5045965","1","5046384","","2011-02-18 20:02:43","0","6486","<p>I have an application that lists all videos in MediaStore. (I need both internal storage and external storage).</p><p>Basically I have two cursors which query MediaStore.Video.Media.EXTERNAL_CONTENT_URI and MediaStore.Video.Media.INTERNAL_CONTENT_URI.</p><p>Then I use a MergeCursor to merge these queries and display in a ListView with a CursorAdapter.</p><p>The thing is that sometimes I want to delete one of the videos, but I need the ""content Uri"" for this operation because I don't have a way to determine the storage of the selected video.</p><p>I have the full file path of the Video and the ID in MediaStore.</p><p>How can I get the ""content Uri"" from the file path/Uri?</p>","471016","","471016","","2011-02-18 20:45:25","2012-07-22 20:49:09","Get MediaStore content Uri from File path?","<android><uri><mediastore>","2","0","3","",""
"5046092","1","5276739","","2011-02-18 20:17:18","0","1400","<p>I have been following <a href=""http://dalelane.co.uk/blog/?p=1599"" rel=""nofollow"">Dale Lane's blog</a> to access Mosquitto through my Android project, but am stuck at the first step. Here is the relevant portion of the logs :</p><pre><code>02-24 20:43:17.324: WARN/System.err(316): com.ibm.mqtt.MqttException02-24 20:43:17.534: WARN/System.err(316):     at com.ibm.mqtt.MqttBaseClient.doConnect(Unknown Source)02-24 20:43:17.534: WARN/System.err(316):     at com.ibm.mqtt.MqttBaseClient.connect(Unknown Source)02-24 20:43:17.534: WARN/System.err(316):     at com.ibm.mqtt.MqttClient.connect(Unknown Source)02-24 20:43:17.534: WARN/System.err(316):     at com.ibm.mqtt.MqttClient.connect(Unknown Source)02-24 20:43:17.534: WARN/System.err(316):     at com.push.MQTTService.connectToBroker(MQTTService.java:665)02-24 20:43:17.584: WARN/System.err(316):     at com.push.MQTTService.handleStart(MQTTService.java:294)02-24 20:43:17.584: WARN/System.err(316):     at com.push.MQTTService.onStartCommand(MQTTService.java:210)02-24 20:43:17.594: WARN/System.err(316):     at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:3053)02-24 20:43:17.594: WARN/System.err(316):     at android.app.ActivityThread.access$3600(ActivityThread.java:125)02-24 20:43:17.594: WARN/System.err(316):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2096)02-24 20:43:17.594: WARN/System.err(316):     at android.os.Handler.dispatchMessage(Handler.java:99)02-24 20:43:20.107: WARN/System.err(316):     at com.ibm.mqtt.MqttBaseClient.doConnect(Unknown Source)02-24 20:43:20.107: WARN/System.err(316):     at com.ibm.mqtt.MqttBaseClient.connect(Unknown Source)02-24 20:43:20.114: WARN/System.err(316):     at com.ibm.mqtt.MqttClient.connect(Unknown Source)02-24 20:43:20.124: WARN/System.err(316):     at com.ibm.mqtt.MqttClient.connect(Unknown Source)02-24 20:43:20.124: WARN/System.err(316):     at com.push.MQTTService.connectToBroker(MQTTService.java:665)02-24 20:43:20.124: WARN/System.err(316):     at com.push.MQTTService.access$6(MQTTService.java:658)02-24 20:43:20.124: WARN/System.err(316):     at com.push.MQTTService$NetworkConnectionIntentReceiver.onReceive(MQTTService.java:883)02-24 20:43:20.274: WARN/System.err(316): Caused by: java.net.ConnectException: /127.0.0.5:1883 - Connection refused02-24 20:43:20.304: WARN/System.err(316):     at org.apache.harmony.luni.net.PlainSocketImpl.connect(PlainSocketImpl.java:254)02-24 20:43:20.344: WARN/System.err(316):     at org.apache.harmony.luni.net.PlainSocketImpl.connect(PlainSocketImpl.java:533)02-24 20:43:20.344: WARN/System.err(316):     at java.net.Socket.connect(Socket.java:1055)02-24 20:43:20.344: WARN/System.err(316):     at com.ibm.mqtt.j2se.MqttJava14NetSocket.&lt;init&gt;(Unknown Source)02-24 20:43:20.344: WARN/System.err(316):     at com.ibm.mqtt.j2se.MqttJavaNetSocket.setConnection(Unknown Source)02-24 20:43:20.376: WARN/System.err(316):     at com.ibm.mqtt.Mqtt.tcpipConnect(Unknown Source)02-24 20:47:17.677: DEBUG/SntpClient(65): request time failed: java.net.SocketException: Address family not supported by protocol</code></pre><p>The exception is thrown at the ""connectToBroker()"" method of Dale's code :</p><pre><code>mqttClient.connect(""_unique_client_id"", true, (short) 2000);     //tried many permutations</code></pre><p>I am running Mosquitto broker on the same machine as the client. I can publish/subscribe to the broker through the IA92 client provided in the samples.I am also able to connect through a simple java project with the same service parameters.</p><p>Thanks a lot !</p>","430720","","430720","","2011-02-24 15:30:12","2011-03-11 18:15:43","MqttException on Android","<android><push-notification><mq>","1","7","1","",""
"5046202","1","5046621","","2011-02-18 20:28:10","0","2415","<p>When I create a new Android project in Eclipse, the following default proguard.cfg file is created:</p><pre><code>-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 * extends android.app.backup.BackupAgentHelper-keep public class * extends android.preference.Preference-keep public class com.android.vending.licensing.ILicensingService-keepclasseswithmembernames class * {    native &lt;methods&gt;;}-keepclasseswithmembernames class * {    public &lt;init&gt;(android.content.Context, android.util.AttributeSet);}-keepclasseswithmembernames class * {    public &lt;init&gt;(android.content.Context, android.util.AttributeSet, int);}-keepclassmembers enum * {    public static **[] values();    public static ** valueOf(java.lang.String);}-keep class * implements android.os.Parcelable {  public static final android.os.Parcelable$Creator *;}</code></pre><p>Note that the <code>-optimizations</code> line comments out the rest of the file. I'm wondering if it is intentional or if it is a typo and that line should have its last two characters reversed:</p><pre><code>-optimizations !code/simplification/arithmetic,!field/*,!class/merging*/</code></pre><p>I'm using ADT plugin 9.0 and Eclipse 3.6.1.</p>","535871","","","","","2011-02-18 21:11:42","Error in default proguard.cfg?","<android><eclipse><proguard>","3","0","","",""
"5046314","1","5046385","","2011-02-18 20:39:34","1","467","<p>I just starting as an Android app developer and I already have a problem with my first app :(</p><p>It's a webapp created with jQTouch and packaged with PhoneGap that is on the market for a few weeks. One customer is running it on a Motorola Milestone (Canadian equivalent of the Droid) <strong>using Android 2.1 and she says it's crashing</strong>.</p><p>I tried to reproduce it with the AVD I defined from the following website and I do get a SIGSEGV exception.<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></p><p>I looked around and I learned that I have to run the log trace in a tool to view the reason behind the crash. I found two tools, stack.py and parse_stack.py, however they require a command to be installed: arm-eabi-addr2line and I don't have it.Searching again, I found it on GitHub: <a href=""https://github.com/jsnyder/arm-eabi-toolchain/"" rel=""nofollow"">https://github.com/jsnyder/arm-eabi-toolchain/</a></p><p>Now, trying to install this command, it says I don't have a recent enough version of GCC. I have the latest XCode installed and I think it comes with GCC. Or else it would just say that GCC is not found.</p><p><strong>Questions</strong></p><ol><li>How do I get this command, arm-eabi-addr2line, installed on my Mac?</li><li>Am I doing this for nothing? If stack.py tells me something is wrong in the Android SDK, what can I do to fix my app?</li><li>VERY BIG THANK YOU!</li></ol>","528096","","","","","2011-02-18 20:47:07","How to debug a SIGSEGV on a Mac?","<android><android-emulator><phonegap><sigsegv>","2","0","0","",""
"5046320","1","5046586","","2011-02-18 20:40:48","10","32926","<p>I am attempting to create a 3 x 3 grid of items.  Each Item consists of an <code>ImageView</code> on top of a <code>TextView</code>.  Unfortunately, I am having issues getting everything to play nicely.</p><p>Here is my attempt to get 2 such items side by side.  The text views don't even show, and the icons are squished together (instead of evenly spaced)</p><pre><code>&lt;TableLayout xmlns:android=""http://schemas.android.com/apk/res/android""android:layout_width=""fill_parent""android:layout_height=""fill_parent""android:stretchColumns=""1"" android:gravity=""center""    android:paddingLeft=""40px"" android:paddingRight=""40px"" &gt;&lt;TableRow&gt;    &lt;LinearLayout android:orientation=""vertical"" android:layout_width=""fill_parent""android:layout_height=""fill_parent""&gt;        &lt;ImageView            android:id=""@+id/usertoolsimage""           android:src=""@drawable/ftnicon""           android:layout_width=""wrap_content""           android:layout_height=""wrap_content""           /&gt;        &lt;TextView        android:text=""User Accounts""        android:gravity=""right""        android:padding=""3dip"" android:textColor=""#ffffff"" /&gt;    &lt;/LinearLayout&gt;   &lt;LinearLayout android:orientation=""vertical"" android:layout_width=""fill_parent""android:layout_height=""fill_parent""&gt;        &lt;ImageView            android:id=""@+id/queueimage""           android:src=""@drawable/ftnicon""           android:layout_width=""wrap_content""           android:layout_height=""wrap_content""           /&gt;        &lt;TextView        android:text=""Queue Management""        android:gravity=""right""        android:padding=""3dip"" android:textColor=""#ffffff"" /&gt;    &lt;/LinearLayout&gt;&lt;/TableRow&gt;&lt;TableRow&gt;    &lt;TextView        android:text=""test 3""        android:padding=""3dip"" android:textColor=""#ffffff"" /&gt;    &lt;TextView        android:text=""test 4""        android:gravity=""right""        android:padding=""3dip"" android:textColor=""#ffffff"" /&gt;&lt;/TableRow&gt;&lt;/TableLayout&gt;</code></pre><p>My goal in the end is to have a grid of clickable items where the item is an image and text for a main menu.  Can anyone guide me on what layouts I should use to achieve this?</p>","107455","","107455","","2011-02-18 20:48:13","2011-10-25 14:30:49","A grid layout of icon/text buttons","<android><grid><android-layout>","2","0","4","",""
"5046509","1","5046931","","2011-02-18 20:58:49","1","1833","<p>I want to create a playlist in android from which I can query and pull different mp3 tunes when I click next. But I'm not sure how and where to add the files and how to go about this, please can someone advise me how to go about this. </p><p>I have looked around on the net but cannot find something a little straightforward. I have found code of how to query this, but I'm not sure of where to start to actually create the playlist. I really need help with this, any help would be highly appreciated. </p><p>Thanks. </p>","608658","","","","","2011-02-18 21:44:40","MediaStore playlist on android","<android>","1","0","","",""
"5046748","1","5046817","","2011-02-18 21:26:23","4","4080","<p>Is there any intent/event that i can listen to when user slide out the keyboard on a phone with keyboard?</p><p>Thank you.</p>","286802","","","","","2011-06-16 10:59:35","Any android event when keyboard slide out","<android>","3","0","2","",""
"5046807","1","5046884","","2011-02-18 21:32:44","0","1955","<p>I need to show values on a horizontal bar like a bar graph. the values are coming from a database.  I have a XML layout now showing the value and max and percent.  Like this:</p><p>10 / 100   10%</p><p>But that is pretty boring and doesn't really jump out at the user if they are close to 100%.  I have it changing colors of each row now but it would be good to have a sliding ""thermometer"" showing a graphical representation of the data</p><p>the page is only updated when the user click on the button to show the page.</p><p>Is there any example on how to use the progress bar or the seek bar or what would you all do?  is there examples on how to make whatever you recommend?</p><p>thanks!</p>","528130","","","","","2011-07-01 05:51:52","Android - progressbar or seekbar or?","<android><progress-bar><seekbar>","1","1","1","",""
"5046864","1","","","2011-02-18 21:37:25","13","6078","<p>I'm developing an Android SDK library. In this library I've declared and used some Activities. Now I've tried to include the library in an application but I've noticed that I must declare all the library activities in the app. This is a very bad thing because in the library, I've included a lot of activities and the developer has to copy all the activities in his own app. Is there a solutions to this?</p>","623825","","319931","","2013-11-17 23:09:31","2013-11-17 23:09:31","android library project and Activities","<android><android-activity><android-manifest><android-library>","1","1","2","",""
"5047025","1","5047745","","2011-02-18 21:57:46","11","4111","<p>I'm working on adding support for tablet sized screens to my apps. I already have images in drawable-mdpi and drawable-hdpi for different density screens. My problem is with tablets like the Galaxy 7"" which is a ""large"" screen but is still medium density. Part of my layout has 5 buttons across the width of the screen which are evenly spaced. On the large screen with mdpi graphics though the images are very small with tons of whitespace between them.</p><p>I would like to use larger graphics for the large layout to make them look appropriate as well as take advantage of the screen real estate. I have some double sized graphics in my hdpi directory that would work perfectly. As a test, I've copied all of the images from /res/drawable-hdpi into /res/drawable-large-mdpi and everything looked exactly as I want.</p><p>However, I don't want to bloat the size of my app by coping all of those images. I would like to just create aliases for each of them so that when /res/drawable-large-mdpi/button_0 is requested, it will actually use /res/drawable-hdpi/button_0 instead.</p><p>I've tried creating an xml bitmap but I don't know how to reference a drawable from a specific directory. Any help?</p><p>Contents of /res/drawable-large-mdpi/button_0.xml:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;bitmap xmlns:android=""http://schemas.android.com/apk/res/android""    android:src=""@drawable-hdpi/button_0"" /&gt;</code></pre><p>The error I get with the above is:</p><pre><code>error: Error: No resource found that matches the given name (at 'src' with value '@drawable-hdpi/button_0_highlighted').</code></pre>","416631","","","","","2013-01-30 09:35:38","How can I alias an android bitmap to a drawable from another size (drawable-large-mdpi aliases to drawable-hdpi)","<android><bitmap><drawable><tablet><screen-size>","2","2","2","",""
"5047084","1","5047429","","2011-02-18 22:04:15","0","538","<p>I have a list that uses a database to display some data. There are several operations that the user can perform on each list item and instead of implementing a context menu where the user uses a long press to bring up a list of possible operations I would like to add buttons to each item so the user can just tap the button and perform the operation. The list can be potentially large and attaching a listener to each button for each list item is overkill so I would like to do what Javascript programmers do with event bubbling, i.e. attach a single handler to a top level element like the entire list and let the click events bubble up to it. How would I go about doing this?</p>","165198","","","","","2011-02-18 22:54:20","Android list tap event delegation","<android><listview><event-handling><event-delegation>","1","0","","",""
"5047159","1","5047187","","2011-02-18 22:14:28","0","316","<p>In my app I have a contact via mail function.However, I have a specific title that I don't want the user to be able to customize / change.</p><p>How can this be achieved?</p><p>Currrent code:</p><pre><code>Intent intent = new Intent(android.content.Intent.ACTION_SEND); String title = ""My subject"";intent.putExtra(android.content.Intent.EXTRA_SUBJECT, title);// Other stuff...</code></pre><p>As it is above, the user can change the title and I don't want this. I want it to be ""My subject"" in this case.</p><p>Thanks for any answer!</p>","386562","","","","","2011-02-18 22:19:49","Non change able Intent.EXTRA_SUBJECT in email Intent","<android>","1","0","","",""
"5047249","1","","","2011-02-18 22:27:55","1","903","<p>I need a set of basic Ajax controls that work well with ASP.NET. I need the basic controls, like lists, trees, masked edits, accordians etc. However, my twist is that many of the users of my web app will be using mobile browsers on Android and iPhone, so the controls need to work well in small screen touch oriented formats. (For example, the ASP.Net Ajax library resize control just doesn't work well in this environment.)</p><p>Does anyone have any experience and recommendations in this area?</p>","447567","","","","","2011-02-20 14:04:17","ASP.NET Ajax Control Library Best for Mobile Web","<iphone><asp.net><android><ajax><mobile>","1","0","","",""
"5047329","1","5047410","","2011-02-18 22:41:34","0","262","<p>I want to display a list of options in a modal popup just like some apps let you click a button and then present you with a list of possible options.  This list takes up the entire screen, such as when selecting a ringtone or notification sound.  How do I do this?</p>","107455","","","","","2011-02-18 22:51:33","Full Screen Selection List, such as when selecting a ringtone or notification sound","<android><android-widget><android-layout>","1","0","","",""
"5047378","1","5047439","","2011-02-18 22:47:31","9","1564","<p>My Android application includes an SQLite database with an <code>SQLiteOpenHelper</code> class to help manage it.  During application use, the user may perform some operations such as adding/deleting/updating etc on the database.  </p><p>At some points the size of the operation will be known, like this:</p><ol><li>user clicks button to save item</li><li>the <code>SQLiteDatabase</code> performs a single <code>insert</code> query</li><li>user continues using app</li></ol><p>At other areas of the app, the operation may be large, like inserting 10+ items into the database all at once.</p><p>Questions: </p><ul><li>should I thread simple operations like inserting/updating/deleting/viewing 1 item?</li><li>will it take longer to insert 1 item into a table which contains many items(like 30+) than it would take to insert into a table with no items?</li><li>if i don't need to thread such simple operations, at what point do you suggest i <strong>start</strong> threading them?</li></ul><p>when i say <strong>thread</strong> i mean using a thread that is not the main UI thread.</p><p>edit: I realize that small operations do not take much time and i could very well get away with doing them on the main thread. I am just concerned that it would be bad practice to be executing them on the main thread and would like clarification!</p>","416412","","","","","2011-02-18 23:03:04","When should I do certain SQLite operations on another thread(not the main thread)?","<android><sqlite>","3","0","2","",""
"5047463","1","5047645","","2011-02-18 22:59:53","6","988","<p>On my Samsung Galaxy, application icons displayed on my Home Screen often don't match those displayed on the Applications Menu.</p><p>Firstly, I want to know if this is peculiar to Samsung/Galaxy (or some subset of Android phones), or if this is across the platform? Secondly, I'd like to know how to set this up in my Android project.</p><p>To illustrate what I'm asking, please refer to the following image:</p><p><img src=""http://i.stack.imgur.com/H2Xm7.png"" alt=""image icons"">Icons 1 and 2 are typical of a lot of third-party apps: on the Home Screen the icon transparency is honoured, but on the Applications Menu the icon is over-layed onto a button graphic. On my phone the latter is more-often-than-not a dirty-green, radial pattern.</p><p>Some apps have over-ridden this behaviour, however: icons 3 and 4 show that MapQuest has been able to specify a different base colour for the button (same radial pattern, though); and icons 5 and 6 show what appears to be a complete replacement of the button image or Application Menu icon.</p><p>Can anyone explain what I need to do to specify both forms of the icon in my project?</p><p>Thanks, in advance.</p>","623877","","623877","","2011-02-18 23:06:48","2011-02-19 06:08:33","Android Icons: Home Screen vs Applications Menu","<android><icons><homescreen>","2","0","1","",""
"5047475","1","","","2011-02-18 23:01:34","1","1464","<p>I am struggling with a Layout Problem on Android. This is very simple to do on the iPhone, but with the various screen sizes and the Layout classes available. I am having a hard time doing this. </p><p>One thing that I have noticed is that setting backgrounds on objects in the xml really messes up the layout on the device. I generally have to put in a FrameLayout and an ImageView to get a background.</p><p>So Am trying to get to this. <a href=""http://www.calidadsystems.com/images/AndroidListItem.png"" rel=""nofollow"">http://www.calidadsystems.com/images/AndroidListItem.png</a> (Sorry I don't have enough pts to post the image)</p><p>his is a status view and is an item in a List View. There are 8 TextViews that need to be set. Each of the 222 fields will change. The current background has the colors in there at specific locations and I am trying to line up the Labels and TextViews to get the picture below. I built this one with AbsoluteLayout which is deprecated, but it also does not work very well on the device. </p><p>I have constantly struggled with the layouts on Android. Does someone have some good sample code that could do this?</p>","548762","","","","","2011-02-18 23:17:52","Android Layout On Top of an Image","<android><image><layout><background>","2","0","","",""
"5047578","1","5047618","","2011-02-18 23:16:15","1","1114","<p>I'm using CommonsGuy's drag n drop example and I am basically trying to integrate it with the Android notepad example.</p><p><a href=""https://github.com/commonsguy/cwac-touchlist"" rel=""nofollow"">Drag N Drop</a></p><p>Out of the 2 different drag n drop examples i've seen they have all used a static string array where as i'm getting a list from a database and using simple cursor adapter. </p><p>So my question is how to get the results from simple cursor adapter into a string array, but still have it return the row id when the list item is clicked so I can pass it to the new activity that edits the note.</p><p>Here is my code:</p><pre><code>Cursor notesCursor = mDbHelper.fetchAllNotes();    startManagingCursor(notesCursor);    // Create an array to specify the fields we want to display in the list (only NAME)    String[] from = new String[]{WeightsDatabase.KEY_NAME};    // and an array of the fields we want to bind those fields to (in this case just text1)    int[] to = new int[]{R.id.weightrows};    // Now create a simple cursor adapter and set it to display    SimpleCursorAdapter notes =             new SimpleCursorAdapter(this, R.layout.weights_row, notesCursor, from, to);    setListAdapter(notes);</code></pre><p>And here is the code i'm trying to work that into.</p><pre><code>public class TouchListViewDemo extends ListActivity {private static String[] items={""lorem"", ""ipsum"", ""dolor"", ""sit"", ""amet"",                                                                ""consectetuer"", ""adipiscing"", ""elit"", ""morbi"", ""vel"",                                                                ""ligula"", ""vitae"", ""arcu"", ""aliquet"", ""mollis"",                                                                ""etiam"", ""vel"", ""erat"", ""placerat"", ""ante"",                                                                ""porttitor"", ""sodales"", ""pellentesque"", ""augue"", ""purus""};private IconicAdapter adapter=null;private ArrayList&lt;String&gt; array=new ArrayList&lt;String&gt;(Arrays.asList(items));@Overridepublic void onCreate(Bundle icicle) {    super.onCreate(icicle);    setContentView(R.layout.main);    adapter=new IconicAdapter();    setListAdapter(adapter);    TouchListView tlv=(TouchListView)getListView();    tlv.setDropListener(onDrop);    tlv.setRemoveListener(onRemove);}private TouchListView.DropListener onDrop=new TouchListView.DropListener() {    @Override    public void drop(int from, int to) {            String item=adapter.getItem(from);            adapter.remove(item);            adapter.insert(item, to);    }};private TouchListView.RemoveListener onRemove=new TouchListView.RemoveListener() {    @Override    public void remove(int which) {            adapter.remove(adapter.getItem(which));    }};class IconicAdapter extends ArrayAdapter&lt;String&gt; {    IconicAdapter() {        super(TouchListViewDemo.this, R.layout.row2, array);    }    public View getView(int position, View convertView,                                            ViewGroup parent) {        View row=convertView;        if (row==null) {                                                                LayoutInflater inflater=getLayoutInflater();            row=inflater.inflate(R.layout.row2, parent, false);        }        TextView label=(TextView)row.findViewById(R.id.label);        label.setText(array.get(position));        return(row);    }}</code></pre><p>}</p><p>I know i'm asking for a lot, but a point in the right direction would help quite a bit!Thanks</p>","394093","","","","","2011-02-18 23:23:41","Drag N Drop utilizing simple cursor","<android><drag-and-drop><simplecursoradapter>","1","1","","",""
"5047612","1","5047662","","2011-02-18 23:22:50","0","9885","<p>I have an activity in Android which uses a ListView. When I click on an item in the ListView, I would like to be able to determine which item was clicked. I have the following code:</p><pre><code>@Overridepublic void onCreate(Bundle savedInstanceState){    super.onCreate(savedInstanceState);    setRequestedOrientation (ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);    setContentView(R.layout.listr);   //setupDB();     //populateList3();   ListView lv = (ListView) findViewById(R.id.ListView01);   lv.setClickable(true);   lv.setOnItemClickListener(new OnItemClickListener() {   public void onItemClick(AdapterView&lt;?&gt; parent, View view, int position, long id) {              Toast.makeText(ListRecords.this,""Clicked!"", Toast.LENGTH_LONG).show();       }   });</code></pre><p>}</p><p>My 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:id=""@+id/Linear03lr""     android:layout_width=""fill_parent""       android:orientation=""vertical""       android:gravity=""center""     android:layout_height=""fill_parent""&gt;   &lt;!--Put form controls here--&gt;      &lt;ListView android:id=""@+id/ListView01"" android:layout_width=""wrap_content"" android:layout_height=""400dp"" /&gt;     &lt;Button        android:id=""@+id/previousbutton""        android:gravity=""center_horizontal""        android:layout_width = ""fill_parent""        android:layout_height = ""fill_parent""        android:text=""Previous Menu""/&gt;&lt;/LinearLayout&gt;  </code></pre><p>What am I missing here to be able to intercept clicks on the Listview?</p>","490698","","163423","","2013-12-23 13:33:18","2013-12-23 13:33:18","ListView in Android, handler for clicking item","<android><listview>","3","2","1","",""
"5047774","1","","","2011-02-18 23:48:45","0","1061","<p>i am developing an android application that use map view.</p><p>i can add point to the map, zoom, get current location and animate to point.</p><p>but how to get direction between 2 points?</p><p>when user click on point to show direction between current location and clicked location.</p><p>Thanks</p>","548868","","569101","","2013-09-09 08:30:59","2013-09-09 08:30:59","android: show direction in google maps","<android><google-maps><navigation>","2","0","","",""
"5047780","1","5047950","","2011-02-18 23:49:43","1","721","<p>I was reading one of the articles on internet and he was saying that he'll make library so that all the apps can use it. How is this possible? Any ideas? </p>","574911","","","","","2011-02-19 00:23:23","How android apps use library made by user?","<android><shared-libraries><android-ndk>","1","1","","",""
"5047795","1","5047959","","2011-02-18 23:53:46","0","465","<p>Try this: </p><p>1) Set your manifest to use a full screen theme (thereby hiding the status bar)</p><p>2) Create a set of nested preference activities, and have the innermost activity open a ListPreference dialog. </p><p>You will find that opening this dialog causes the status bar to briefly re-appear, and it will then permanently re-appear if you change the device orientation. </p><p>Is this a legitimate Android bug? Is there a way to override the theme used by ListPreference itself? (<a href=""http://developer.android.com/reference/android/R.style.html#Theme_InputMethod"" rel=""nofollow"">Relevant?</a>)</p>","150020","","","","","2011-02-19 00:24:50","Status bar inappropriately appears when selecting for ListPreference dialog","<android><android-layout><statusbar><listpreference><android-theme>","1","0","","",""
"5047817","1","5047898","","2011-02-18 23:57:37","4","7867","<p>I'm using a GUI-less linux so I can't use Eclipse to generate one for me.</p>","390718","","","","","2013-10-16 08:06:45","How do I generate an android debug.keystore from the command-line?","<android><linux><command-line><android-emulator>","1","0","5","",""
"5047869","1","5048001","","2011-02-19 00:05:35","0","3051","<p>I'm writing an app for Android that spawns a service that periodically checks the wifi state and changes it based on some conditions. My problem is that whenever I try to create a WifiManager object to check the state of the wifi (and perhaps control it), it gives me an uninitialized object. Here is the code:</p><pre><code>public class WifiCheckerService extends Service {    // Service code and run() method    private void checkWifi() {        WifiManager wifi = (WifiManager) getSystemService(Context.WIFI_SERVICE);        System.out.println(wifi.getConnectionInfo());        // Rest of code    }}</code></pre><p>And here is the line in the log when it gets to this code.</p><pre><code>02-18 05:22:59.274: INFO/System.out(1170): SSID: &lt;none&gt;, BSSID: &lt;none&gt;, MAC: &lt;none&gt;, Supplicant state: UNINITIALIZED, RSSI: -200, Link speed: -1, Net ID: -1</code></pre><p>Obviously I'm not getting the system WifiManager object. I know it has something to do with the fact that I am in a service which is a thread, but I am still having trouble understanding the concept and a little explanation about why it's not working and how I can fix it would be greatly appreciated.</p><p>(On a sort of unrelated note, I think an explanation would also explain why I can't use the line <code>Toast.makeText(getBaseContext(), ""Checking Wifi..."", Toast.LENGTH_SHORT).show();</code> in the service)</p>","218013","","","","","2011-02-19 00:31:41","How can I get a WifiManager Object inside of a Service?","<android><android-service><android-wifi>","1","1","","",""
"5047903","1","","","2011-02-19 00:13:52","8","2914","<p>Is there a published size for xhdpi application icons? Or do we just use the hdpi ones at 72x72?</p>","623954","","","","","2012-02-28 07:10:25","Android xhdpi icons","<android>","1","0","4","",""
"5047920","1","5048222","","2011-02-19 00:17:01","0","1124","<p>I would like to show a tooltip, i.e. additional non-essential information about a <code>View</code> when the user long-clicks on it. </p><p>The two options I see in front of me are using an <a href=""http://developer.android.com/reference/android/view/View.html#setOnLongClickListener%28android.view.View.OnLongClickListener%29"" rel=""nofollow"">OnLongClickListener</a> to construct a custom tooltip in front of the clicked View; or abusing an <a href=""http://developer.android.com/reference/android/view/View.html#setOnCreateContextMenuListener%28android.view.View.OnCreateContextMenuListener%29"" rel=""nofollow"">OnCreateContextMenuListener</a> to create a context menu that isn't. </p><p>Neither seems like the best way to go about things, and I'm not sure whether either will work. I've scoured the web and haven't found any hints. Any alternatives, or should I be wet-fish-slapped for trying to do this? Thanks!</p>","118220","","","","","2011-02-19 01:22:25","Show affordance/hover/tooltip on a long-clicked View","<android><hover><tooltip><usability><long-click>","1","3","","",""
"5047969","1","5048075","","2011-02-19 00:26:20","1","747","<p>Well this is probably a stupid question with a simple answer but when using simple cursor adapter from the notepad example, I get a list of names from my database.</p><p>When I try to do it ""manually"" by moving the cursor over the rows and extracting the names the cursor says there is zero rows returned...</p><p>This works as per the example:</p><pre><code>Cursor notesCursor = mDbHelper.fetchAllNotes();    startManagingCursor(notesCursor);    // Create an array to specify the fields we want to display in the list (only NAME)    String[] from = new String[]{WeightsDatabase.KEY_NAME};    // and an array of the fields we want to bind those fields to (in this case just text1)    int[] to = new int[]{R.id.weightrows};    // Now create a simple cursor adapter and set it to display    SimpleCursorAdapter notes =             new SimpleCursorAdapter(this, R.layout.weights_row, notesCursor, from, to);    setListAdapter(notes);</code></pre><p>Now i'm trying to do this but it's not quite working. Is the simple cursor adapter doing something special i'm not?</p><pre><code>//check # of rows, returns 0    int mOne = notesCursor.getCount();    //initial random string array    String[] temp = new String[100];    int i = 0;    notesCursor.moveToFirst();    do{        temp[i]=notesCursor.getString(notesCursor.getColumnIndex(WeightsDatabase.KEY_ROWID)); //crashes here        //index out of bounds        i++;    }while(notesCursor.moveToNext());</code></pre><p>I have gotten this to work, but with returning a specific query like return all row with the name ""<em>_</em>"". What is different about returning all notes?</p>","394093","","","","","2011-02-19 00:46:59","Fetch all notes returns zero rows from Android notepad example","<android><simplecursoradapter>","1","0","","",""
"5047985","1","5048009","","2011-02-19 00:29:32","1","225","<p>Using the text to speech API I want to change the string array to increment from index 0 string and when it reaches the end it will go back to the beginning. </p><p>At the moment it uses a random generator and the method works as follows:</p><pre><code> public static void sayHello() {    // Select a random hello.    int helloLength = HELLOS.length;    String hello = HELLOS[RANDOM.nextInt(helloLength)];    mTts.speak(hello,        TextToSpeech.QUEUE_FLUSH,  // Drop all pending entries in the playback queue.        null);}</code></pre><p>HELLOS is the array and it holds the strings:</p><pre><code> String [] HELLOS = {""One"" ""Two"" ""Three"" ""Four""};</code></pre><p>Appreciate any helpThanks.</p>","608658","","","","","2011-02-19 00:32:39","String Array increment each string in TextToSpeech","<android>","1","0","","",""
"5048000","1","","","2011-02-19 00:31:26","2","11288","<p>I am trying to communicate with a Bluetooth programmable Microcontroller. The Bluetooth device on the microcontroller communicates (specifically) on Bluetooth Serial COM Port number 4. </p><p>QUESTION: How can I get the Android App to read data from this COM port (number 4)?</p><p>I know the UUID is a well known unique ID,that works for this device, but I don't think that it has anything to do with specifying the COM port. </p><pre><code>static final UUID myUUID = UUID.fromString(""00001101-0000-1000-8000-00805F9B34FB"");btSocket = btDevice.createRfcommSocketToServiceRecord( myUUID);btSocket.connect();valid.append( btDevice.getName() + ""\n"" + btDevice.getAddress());north.append(""Socket Connected"");InputStream mmInStream = btSocket.getInputStream();OutputStream mmOutStream = btSocket.getOutputStream();byte[] buffer = new byte[10];int bytes;StringBuffer str = new StringBuffer();while (true)                            {                                    try {    mmOutStream.write(""a"".getBytes());        //Reads a # of bytes until the end of stream is reached        bytes = mmInStream.read(buffer);        //Transform to string                str.append(buffer.toString()+""\t"");                         //Clear the buffer        Log.e(""DATA"", ""THE DATA: ""+ str.toString());        south.setText(str.toString());         str.delete(0,str.length());       } catch (IOException e) {        break;} }}</code></pre>","623965","","210916","","2013-09-27 02:20:27","2013-09-27 02:20:27","Android: Bluetooth Serial (Com Port) communication with Android Phone","<android><bluetooth><serial-port>","2","0","","",""
"5048004","1","","","2011-02-19 00:32:08","1","4614","<p>How can you change the progressbar color from within the app.  I already have it set in the XML but as the value gets within preset thresholds I need to change the color of the bar to alert the user. For the buttons I can set it like the example below.  Is there a way to do with with the progressbar?</p><pre><code>B.setBackgroundDrawable(c.getResources().getDrawable(R.drawable.button2));B.getBackground().setColorFilter( UserS.ColorBtnBack, PorterDuff.Mode.MULTIPLY);</code></pre>","528130","","","","","2012-01-09 07:43:58","android how to change the progressbar color programatically","<android><progress-bar>","2","0","","",""
"5048064","1","","","2011-02-19 00:43:22","7","2309","<p>I am attempting to continue developing applications for Smart Phones (I have a little experience with Android). I have done some deep research &amp; I have decided to start creating applications in Qt C++.</p><p><em>The reason I am doing this is because from my research it seems that I can write an application once in Qt then all I have to do is compile it on IPhone, Android, Symbian &amp; Windows Mobile and then I will have an application that will work on <strong>ALL</strong> these platforms.</em></p><p><strong><em>My question is:</em> Am I correct that if I write an app in Qt C++ then it will work on the following platforms: Android, IPhone, Symbian &amp; Windows Mobile?</strong></p><p>I know that this is kindof a naive question (""What API can I use to work on all platforms"") but I have researched alot &amp; they all seem to say Qt can work on all these platforms.</p><p><em>PS, Are there any cons to using Qt to write a cross platform Phone App? Is compiling Qt application code difficult to do on each platform?</em></p>","593747","","1565831","","2013-08-31 19:56:06","2014-02-16 12:41:40","Realities of using QT C++ to write a cross platform phone app","<iphone><c++><android><qt><cross-platform>","6","0","","",""
"5048071","1","5048116","","2011-02-19 00:45:51","0","389","<p>It is necessary for my application to keep the camera captured until released manually by an Activity (I realize this is bad practice, as no other applications will be able to use the camera).  I used to be able to do this by avoiding the camera.release() call in the surfaceDestroyed function from CameraPreview, but this no longer works after 2.1.</p><p>Is there any way to keep the camera in captivity, without it being automatically released after surfaceDestroyed?</p><p>As a workaround question to answer instead of the previous one, is there any way to take a picture from within a service, without the preview view inflated?</p>","342745","","","","","2011-02-19 00:53:42","Keep camera captured by an activity after picture taken","<android><camera><preview><surfaceview><android-camera>","1","0","","",""
"5048086","1","","","2011-02-19 00:48:06","1","385","<p>If I wish to debug some code for a UI event, e.g. </p><pre><code>public boolean onTouchEvent(MotionEvent me){    // code to be debugged}</code></pre><p>... and I hold onto this thread (UI):</p><p>After 5 seconds I will get this warning: Key dispatching timed out sending to com.hos/com.hos.MyActivity ... null to Window ...</p><p>After 20 seconds I will get: Key dispatching timed out sending to com.hos/com.hos.MyActivity ... null to Window ... Continuing to wait for key to be dispatched</p><p>After 35 seconds I will get: Key dispatching timed out sending to com.hos/com.hos.MyActivity ... null to Window ... timed out expired process next Key &amp; find new target</p><p>At this point, not only is my application frozen but so is the phone. Quite often I need to wait for the ANR and sometimes hard restart the phone.</p><p>Is there a way to debug this code for more than 35 seconds without freezing the app / phone?</p>","491066","","","","","2011-02-19 03:35:02","Debugging Event code","<android><debugging><event-handling>","1","3","","",""
"5048124","1","5048198","","2011-02-19 00:55:25","1","670","<p>So I've gone through the basic tutorial and I've read up on activities and UI listeners.</p><p>However I'm still unsure on how to open an HTML page when I select a button.  </p><p>What I think I have to do is, make an HTML file and store it in the res/layout folder, create an activity which is connected to the HTML file.  Then I'm not sure what to do.  Where do I call the <code>OnClickListener</code> function and when do I handle the event of the button being clicked?</p>","611884","","","","","2011-02-19 01:15:05","How to open blank html page when button is pressed on android","<android><html><button><activity><onclick>","1","0","1","",""
"5048553","1","","","2011-02-19 03:01:24","3","2437","<p>How to set WebView in android?</p>","622601","","","","","2012-11-08 12:46:29","WebView in android","<android>","3","1","1","2012-10-09 11:03:02",""
"5048586","1","5068537","","2011-02-19 03:07:30","29","18647","<p>I've got users with tablets that have a tab key on their soft keyboard.  I am using a table view and have 3 EditText Fields in one row with EditText fields below the current row.</p><p>When the user hits tab it takes them to the next field below, not the next field to the right.</p><p>Is there a way in the layout to set the tab order or is it only done programatically?</p><p>If it can only be done in Java, how exactly is it done?</p><p>Thanks for the tip on NextFocusRight but it didn' seem to work (or I did something wrong)</p><p>Here is the code I used.  I have to add the imeoptions to get the ""next"" button to show up in my emulator.  Do you see anything wrong with the way I did this? </p><pre><code>    &lt;EditText android:id=""@+id/bikeHHT""android:layout_width=""50dip""android:layout_height=""40dip""android:textSize=""14px""android:maxLength=""2""android:nextFocusLeft=""@+id/bikeMMT""android:imeOptions=""actionNext""android:layout_column=""1""/&gt;&lt;EditText android:id=""@+id/bikeMMT""android:layout_width=""50dip""android:layout_height=""40dip""android:textSize=""14px""android:nextFocusRight=""@+id/bikeSST""android:imeOptions=""actionNext""android:maxLength=""2""/&gt;</code></pre>","351112","","351112","","2011-02-19 14:12:31","2013-10-01 17:54:00","Can you set ""tab order"" in XML Layout?","<android>","7","0","2","",""
"5048604","1","","","2011-02-19 03:12:33","1","1661","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/3802887/public-boolean-onkey-called-twice"">public boolean onKey() called twice?</a>  </p></blockquote><pre><code>Display.setOnKeyListener(new OnKeyListener() {    public boolean onKey(View v, int keyCode, KeyEvent event) {        switch (keyCode) {             case KeyEvent.KEYCODE_ENTER:                solveExpression();                return true;        }        return false;    }});</code></pre><p>I'm trying to solve the expression contained within the Display(EditText), by pressing the enter button on the keyboard, yet it always interprets it as though I pressed the button twice.  Does anyone know why this happens?</p>","624038","","231917","","2011-02-19 03:13:02","2012-07-27 19:33:02","Android: onKeyListener simulating two instances of a pressed key","<android>","3","1","","2013-01-11 08:18:32",""
"5048615","1","5493294","","2011-02-19 03:16:30","0","1468","<p>I have been battling this ""memory leak"" for the past 3 days non-stop and while I have streamlined other parts of my application this problem has remained.</p><p>First what I am trying to do.  I am firing an Intent for IMAGE_CAPTURE with EXTRA_OUTPUT to save the image to a file.  Then I display the returned image scaled down by an order of 2, for the user, letting him select a square portion of the image.  Once he selects it, he is taken to another Activity that lets him tag the image with some text and such, and eventually upload everything using HTTPPost to the server.  </p><p>Right now, everything works great exactly once! I can go through it and everything works, without any problem.  If I try to take another picture however, I always get an Out of Memory Exception. Here is the Logcat for the latest time it's happened</p><pre><code>02-18 19:07:19.498: ERROR/dalvikvm-heap(6385): 1040400-byte external allocation too large for this process.02-18 19:07:19.498: ERROR/GraphicsJNI(6385): VM won't let us allocate 1040400 bytes02-18 19:07:19.498: DEBUG/AndroidRuntime(6385): Shutting down VM02-18 19:07:19.498: WARN/dalvikvm(6385): threadid=1: thread exiting with uncaught exception (group=0x4001d7f0)02-18 19:07:19.518: ERROR/AndroidRuntime(6385): FATAL EXCEPTION: main02-18 19:07:19.518: ERROR/AndroidRuntime(6385): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.hitpost/com.hitpost.SharePicture}: android.view.InflateException: Binary XML file line #29: Error inflating class &lt;unknown&gt;02-18 19:07:19.518: ERROR/AndroidRuntime(6385):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)02-18 19:07:19.518: ERROR/AndroidRuntime(6385):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)02-18 19:07:19.518: ERROR/AndroidRuntime(6385):     at android.app.ActivityThread.access$2300(ActivityThread.java:125)02-18 19:07:19.518: ERROR/AndroidRuntime(6385):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)02-18 19:07:19.518: ERROR/AndroidRuntime(6385):     at android.os.Handler.dispatchMessage(Handler.java:99)02-18 19:07:19.518: ERROR/AndroidRuntime(6385):     at android.os.Looper.loop(Looper.java:123)02-18 19:07:19.518: ERROR/AndroidRuntime(6385):     at android.app.ActivityThread.main(ActivityThread.java:4627)02-18 19:07:19.518: ERROR/AndroidRuntime(6385):     at java.lang.reflect.Method.invokeNative(Native Method)02-18 19:07:19.518: ERROR/AndroidRuntime(6385):     at java.lang.reflect.Method.invoke(Method.java:521)02-18 19:07:19.518: ERROR/AndroidRuntime(6385):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:858)02-18 19:07:19.518: ERROR/AndroidRuntime(6385):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)02-18 19:07:19.518: ERROR/AndroidRuntime(6385):     at dalvik.system.NativeStart.main(Native Method)02-18 19:07:19.518: ERROR/AndroidRuntime(6385): Caused by: android.view.InflateException: Binary XML file line #29: Error inflating class &lt;unknown&gt;02-18 19:07:19.518: ERROR/AndroidRuntime(6385):     at android.view.LayoutInflater.createView(LayoutInflater.java:513)02-18 19:07:19.518: ERROR/AndroidRuntime(6385):     at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)02-18 19:07:19.518: ERROR/AndroidRuntime(6385):     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:563)02-18 19:07:19.518: ERROR/AndroidRuntime(6385):     at android.view.LayoutInflater.rInflate(LayoutInflater.java:618)02-18 19:07:19.518: ERROR/AndroidRuntime(6385):     at android.view.LayoutInflater.rInflate(LayoutInflater.java:621)02-18 19:07:19.518: ERROR/AndroidRuntime(6385):     at android.view.LayoutInflater.inflate(LayoutInflater.java:407)02-18 19:07:19.518: ERROR/AndroidRuntime(6385):     at android.view.LayoutInflater.inflate(LayoutInflater.java:320)02-18 19:07:19.518: ERROR/AndroidRuntime(6385):     at android.view.LayoutInflater.inflate(LayoutInflater.java:276)02-18 19:07:19.518: ERROR/AndroidRuntime(6385):     at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:198)02-18 19:07:19.518: ERROR/AndroidRuntime(6385):     at android.app.Activity.setContentView(Activity.java:1647)02-18 19:07:19.518: ERROR/AndroidRuntime(6385):     at com.hitpost.SharePicture.onCreate(SharePicture.java:90)02-18 19:07:19.518: ERROR/AndroidRuntime(6385):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)02-18 19:07:19.518: ERROR/AndroidRuntime(6385):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)02-18 19:07:19.518: ERROR/AndroidRuntime(6385):     ... 11 more02-18 19:07:19.518: ERROR/AndroidRuntime(6385): Caused by: java.lang.reflect.InvocationTargetException02-18 19:07:19.518: ERROR/AndroidRuntime(6385):     at android.widget.ImageView.&lt;init&gt;(ImageView.java:108)02-18 19:07:19.518: ERROR/AndroidRuntime(6385):     at java.lang.reflect.Constructor.constructNative(Native Method)02-18 19:07:19.518: ERROR/AndroidRuntime(6385):     at java.lang.reflect.Constructor.newInstance(Constructor.java:446)02-18 19:07:19.518: ERROR/AndroidRuntime(6385):     at android.view.LayoutInflater.createView(LayoutInflater.java:500)02-18 19:07:19.518: ERROR/AndroidRuntime(6385):     ... 23 more02-18 19:07:19.518: ERROR/AndroidRuntime(6385): Caused by: java.lang.OutOfMemoryError: bitmap size exceeds VM budget02-18 19:07:19.518: ERROR/AndroidRuntime(6385):     at android.graphics.Bitmap.nativeCreate(Native Method)02-18 19:07:19.518: ERROR/AndroidRuntime(6385):     at android.graphics.Bitmap.createBitmap(Bitmap.java:468)02-18 19:07:19.518: ERROR/AndroidRuntime(6385):     at android.graphics.Bitmap.createBitmap(Bitmap.java:435)02-18 19:07:19.518: ERROR/AndroidRuntime(6385):     at android.graphics.Bitmap.createScaledBitmap(Bitmap.java:340)02-18 19:07:19.518: ERROR/AndroidRuntime(6385):     at android.graphics.BitmapFactory.finishDecode(BitmapFactory.java:488)02-18 19:07:19.518: ERROR/AndroidRuntime(6385):     at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:462)02-18 19:07:19.518: ERROR/AndroidRuntime(6385):     at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:323)02-18 19:07:19.518: ERROR/AndroidRuntime(6385):     at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:697)02-18 19:07:19.518: ERROR/AndroidRuntime(6385):     at android.content.res.Resources.loadDrawable(Resources.java:1709)02-18 19:07:19.518: ERROR/AndroidRuntime(6385):     at android.content.res.TypedArray.getDrawable(TypedArray.java:601)02-18 19:07:19.518: ERROR/AndroidRuntime(6385):     at android.widget.ImageView.&lt;init&gt;(ImageView.java:118)02-18 19:07:19.518: ERROR/AndroidRuntime(6385):     ... 27 more</code></pre><p>It is failing on the setContentView of the last Activity, as in it displays the picture once to the user, but is somehow not able to display it again.</p><p>I would really appreciate the help!</p><p><strong>Updated</strong>I have been testing this issue on multiple phones, and the only one where it seems to be doing this is the Nexus One with Froyo. Works on Samsung Captivate 2.1, doesn't crash in regard to this issue on Moto Milestone 2.1.</p><p>Also I need a 500 x 500 image at the end so I can't scale down by a factor more than 2.</p>","292851","","292851","","2011-02-21 21:35:47","2011-03-30 22:34:45","Android OOM For Bitmap with image Capture","<android><out-of-memory><android-camera-intent><bitmapfactory>","2","2","","",""
"5048759","1","5050708","","2011-02-19 04:04:08","1","1003","<p>I am extending DefaultHandler to parse an xml.I am parsing this page:<a href=""http://maps.googleapis.com/maps/api/directions/xml?origin=staten%20island&amp;destination=florida&amp;sensor=false"" rel=""nofollow"">http://maps.googleapis.com/maps/api/directions/xml?origin=staten%20island&amp;destination=florida&amp;sensor=false</a></p><p>I am getting all the polyline>points.Everything works fine except for one specific string.I am overriding the characters method in DefaultHandler like this:</p><pre><code>public void characters(char[] ch, int start, int length) throws SAXException {if (currentElement) {    Log.v(""Length"", length+"""");    currentValue = new String(ch, start, length);    currentElement = false;    }}</code></pre><p>The length returns 282 when the string is 660 characters long.This is the string:</p><p>qhitFxpifMn@t@vA<code>CdM</code>WnnBjeEtI|PlIxNxHhMjLdQ|dAlwA<code>~CxfEfOxRlK</code>O~PdUvOlTnHdJbYl\fVlW<code>q@~p@~gA</code>gAfKzKbP<code>Rpa@bi@|wAnuBjZ|c@rD~F</code>JjP|I|Qzr@<code>~AbKpS</code>J~OvGdKnPhUbMpN~{@~{@tLhMlZfZnI~Ilh@nh@nN<code>O~GbJjEpGpErHbIfPpDxIvDpKzRvp@rE|MrF|MhKpRbF</code>Ir_@jo@<code>LtS~MzYp[bw@hEvJ|F</code>LbLvQzHrJfv@fz@nUxXh<code>AtoAlGzIl</code>AbwAvMfRx_AnmAlr@z}@jQtTfJxJv]h]buDfqDjFrGbI~K|E~HpFnKlFfLzB|FjElMhCvI|T<code>w@vDnPzChPx@vFdBhOrh@xlFbNptAvAdMnB</code>MnEjT~EvQhF<code>O~F</code>NjCjFhEtHlEbHbk@bx@fWb^nSvXnSrYxGpKjDvGnDxHnHdR~_A|gCdNz]tEtMfs@zlBbHhQ|jDzoH|r@lzA|Yvk@xClFvJxRhInOhP<code>\hJ|PbIvOxB|E|m@plA~LpUzs@dwAvj@hfA|D|IrDrJzlAriDhFfR~Uv~@h</code>@j|Afy@<code>{DtFzX|BtOpArLvSjcCv@dNJjEGbFDdDVnElAnIx@xDnC~JbApFb@fDbKb~@</code>Dj^hBvN|BbO|Dl]</p><p>And this is what DefaultHandler returns:</p><p>qhitFxpifMn@t@vA<code>CdM</code>WnnBjeEtI|PlIxNxHhMjLdQ|dAlwA<code>~CxfEfOxRlK</code>O~PdUvOlTnHdJbYl\fVlW<code>q@~p@~gA</code>gAfKzKbP<code>Rpa@bi@|wAnuBjZ|c@rD~F</code>JjP|I|Qzr@<code>~AbKpS</code>J~OvGdKnPhUbMpN~{@~{@tLhMlZfZnI~Ilh@nh@nN<code>O~GbJjEpGpErHbIfPpDxIvDpKzRvp@rE|MrF|MhKpRbF</code>Ir_@jo@<code>LtS~MzYp[bw@hEvJ|F</code>LbLvQzHrJfv@fz@nUxXh`Ato</p><p>It stops at character 282 and I don't know why.</p>","624056","","","","","2011-02-19 12:15:16","DefaultHandler class in android doesnt read entire string from xml","<java><android><string><polyline>","1","1","1","",""
"5048784","1","","","2011-02-19 04:09:24","0","2119","<p>Hi I came across the listview example referencing a string array defined by an external class. I was wanting to inquire how would one change it to when the items in the list are clicked it would bring up a new page with info on it.</p><p>Thank you in advance sorry for the noob question I'm new at android/Java.    </p><pre><code>strings.xml        &lt;?xml version=""1.0"" encoding=""utf-8""?&gt;        &lt;resources&gt;            &lt;string name=""hello""&gt;Hello World, HelloListView!&lt;/string&gt;            &lt;string name=""app_name""&gt;HelloListView&lt;/string&gt;        &lt;string-array name=""countries_array""&gt;                &lt;item&gt;Bahrain&lt;/item&gt;                &lt;item&gt;Bangladesh&lt;/item&gt;                &lt;item&gt;Barbados&lt;/item&gt;                &lt;item&gt;Belarus&lt;/item&gt;                &lt;item&gt;Belgium&lt;/item&gt;                &lt;item&gt;Belize&lt;/item&gt;                &lt;item&gt;Benin&lt;/item&gt;            &lt;/string-array&gt;        &lt;/resources&gt;            package com.hope;            import android.app.Activity;            import android.app.ListActivity;            import android.os.Bundle;            import android.view.View;            import android.widget.AdapterView;            import android.widget.AdapterView.OnItemClickListener;            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);                    String[] countries = getResources().getStringArray(R.array.countries_array);                    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, 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();                      }                    });                  }            }        list_item.xml        &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>","616599","","","","","2011-02-19 04:24:28","Android String Listview","<android><string><listview>","1","1","","",""
"5048786","1","","","2011-02-19 04:09:47","1","466","<p>could someone let me know the country list that android app developer must be in so that he could sell his apps on Android Market?Thank you!</p>","624061","","","","","2013-10-28 14:51:33","Which countries must I be in to sell android app?","<android><google-play>","1","1","","2013-10-28 14:48:27",""
"5048845","1","","","2011-02-19 04:30:03","0","415","<pre><code>package com.smith.johnathan.phonefinder;import android.app.Activity;import android.app.AlarmManager;import android.app.PendingIntent;import android.content.Intent;import android.os.Bundle;import android.os.SystemClock;import android.view.View;import android.widget.Button;import android.widget.Toast;import java.util.Calendar;import android.app.AlarmManager;import android.app.PendingIntent;import android.content.Context;import android.content.Intent;import android.os.Bundle;import android.telephony.gsm.SmsMessage;import android.util.Log;import android.widget.Toast;public class PhoneFinder extends android.content.BroadcastReceiver {    private static final String LOG_TAG = ""SMSReceiver"";    public static final int NOTIFICATION_ID_RECEIVED = 0x1221;    static final String ACTION = ""android.provider.Telephony.SMS_RECEIVED"";    public void onReceive(Context context, Intent intent) {        if (intent.getAction().equals(PhoneFinder.ACTION)) {            StringBuilder sb = new StringBuilder();            Bundle bundle = intent.getExtras();            if (bundle != null) {                Object[] pdus = (Object[]) bundle.get(""pdus"");                for (Object pdu : pdus) {                    SmsMessage messages = SmsMessage                            .createFromPdu((byte[]) pdu);                    sb.append(""Received SMS Message\nFrom: "");                    sb.append(messages.getDisplayOriginatingAddress());                    sb.append(""\n----Message----\n"");                    sb.append(messages.getDisplayMessageBody());                }            }            Log.i(PhoneFinder.LOG_TAG, ""[SMSApp] onReceiveIntent: "" + sb);            Toast.makeText(context, sb.toString(), Toast.LENGTH_LONG).show();        }    }    private void beep()    {        Intent intent = new Intent(PhoneFinder.class, AlarmService.class);        startActivity(intent);    };}</code></pre>","589450","","236128","","2011-02-19 04:49:17","2011-02-20 13:56:28","Trying to set off a alarm if I get a SMS message!! Cant build the following code :(","<android><sms>","2","1","","",""
"5048867","1","","","2011-02-19 04:35:47","0","2424","<p>I'm pretty new to Android so I apologize if this question sounds stupid in any way.</p><p>I'm trying to create an attendance application with many classes but the 2 main ones will be Student and Courses.</p><p>I plan to use tabs to navigate with Student and Courses being the 2 tabs in my TabHost.</p><p>The Course page for example will list all of the courses currently in the system with an options menu for Adding a course which will bring up an Add Course screen (within the Course tab but changing the view).</p><p>So, to my question...</p><p>I plan to set an onclick for the options menu item which will call setContentView to display the add new course layout instead of starting a new Activity showing a new layout. </p><p>Does this sound like a sensible way to do this? If not what would be a better approach?</p><p>All my course logic will be contained within the Course class and so I want all of my code to be contained within there without having to create a class/activity for a course list, adding a course, viewing a course etc.</p><p>I hope this makes sense.</p>","624057","","","","","2011-02-19 05:15:31","Best way to display multiple setContentView in Android","<android><design><activity>","2","1","","",""
"5048986","1","5049062","","2011-02-19 05:04:19","0","794","<p>How do I detect when the reception returns to the phone? is there an intent I can registerto get a message when it does? Thanks</p>","505162","","","","","2011-02-19 05:23:51","Detecting when reception returns Android","<android>","1","0","","",""
"5049074","1","","","2011-02-19 05:27:43","0","1147","<p>I have a couple of JPG image files I'm decoding with BitmapFactory.decodeFile().  For some reason, decoding them is very (excruciatingly?) slow (on the order of 10s of seconds).  Eventually, they do decode.</p><p>I have other JPG files which are larger (both in terms of pixels and/or in terms of disk size) which decode reasonably and quickly (less than 1 second, certainly).</p><p>Interestingly, I notice these same images seem to display reasonably quickly in the Gallery app, but take a similarly very long time to display in (for example) Astro's picture viewer.</p><p>I'm guessing it's something about the particular JPG-encoding; I took one of the images, loaded into Paint.NET, resaved as JPG, and tried this file and the decoding was back to taking a reasonable amount of time.</p><p>If the Gallery app were slow too, I'd give up ;-) But since it behaves reasonably, I'm wondering if there's something I'm missing.  I've tried various combinations of settings for my BitmapFactory.Options (inSampleSize, inPreferredConfig, inDither) with no apparent difference.</p><p>Anyone else run into this?  Anyone have any ideas?</p><p>Thanks,Ken</p>","612537","","69802","","2011-07-12 19:01:04","2011-07-12 19:01:04","BitmapFactory.decodeFile is slow for some JPG images","<android><bitmap><decode><performance>","0","2","","",""
"5049087","1","5049190","","2011-02-19 05:31:13","1","608","<p>this seemingly simple issue is confusing me. I have the following code:</p><pre><code>Cursor c = getContentResolver().query(            MediaStore.Audio.Playlists.EXTERNAL_CONTENT_URI,            new String[] {MediaStore.Audio.Playlists._ID, MediaStore.Audio.Playlists.NAME},            null,            null,            MediaStore.Audio.Playlists.DEFAULT_SORT_ORDER);    c.moveToFirst();    Log.d(""TestTest"", String.format(""Count is %d"", c.getCount()));    for (int i = 0; i &lt; c.getCount(); i++) {        c.moveToPosition(i);        int id = c.getInt(c.getColumnIndex(MediaStore.Audio.Playlists._ID));        String s = c.getString(c.getColumnIndex(MediaStore.Audio.Playlists.NAME));        Log.d(""TestTest"", ""HEY!  "" + s + ""  "" + String.format(""%d"", id));    }</code></pre><p>The count is being reported as 1, and the apparently my only playlist is named 'm3u playlist'. </p><p>What's going on here? I have several playlists and just want to print a list of them.</p><p>Thanks for all answers!</p>","48998","","","","","2011-09-12 00:09:24","Android playlist query is inaccurate...?","<java><android><playlist><mediastore>","1","1","2","",""
"5049152","1","","","2011-02-19 05:51:16","0","1483","<p>I am having trouble with wakelocks. Basically, I had the wakelock running in my timer thread, a doInBackground of an AsyncTask for the entire duration of my app (it is a background app for taking performance measurements). Then I decided I only want the screen to wakeup every 10 minutes or so for a second or so. So I created another class extending AsyncTask and put the code below into it's doInBackground, but now the screen doesn't turn back on. I should note that I start this thread and two other threads that are AsyncTask with doInBackground methods from onCreate.</p><p>Here is my new inner class doing the waking up: Essentially all it is supposed to do is wake the phone screen up every 10 minutes for a bit until my other two background threads set their booleans true.</p><pre><code>private class WakeUp extends AsyncTask&lt;Void, Void, Void&gt; {    @Override    protected Void doInBackground(Void... arg0) {        PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE);        PowerManager.WakeLock wl = pm.newWakeLock(PowerManager.SCREEN_BRIGHT_WAKE_LOCK, getClass().getName());        do{            try {                Thread.sleep(WAKEUP_EVERY); //600000ms            } catch (InterruptedException e) {                e.printStackTrace();            }                       wl.acquire();            try {                Thread.sleep(1000);            } catch (InterruptedException e) {                e.printStackTrace();            }            wl.release();        }while(!timeCompleted || !transferCompleted);        return null;    }}</code></pre>","604996","","","","","2011-06-27 20:16:56","Android - Wakelock thread is not turning the screen on","<android><multithreading><sleep><wakelock>","1","5","","",""
"5049191","1","","","2011-02-19 06:04:39","1","3105","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/900294/android-1-5-reading-sms-messages"">Android 1.5: Reading SMS messages</a>  </p></blockquote><p>I need to get the sms details from Android phone, that is sent and received  messages and all messages that are stored in Android device. How can I get them programmatically. Please help me out of this.</p>","249634","","366904","","2011-02-19 06:30:34","2011-02-19 06:30:34","How to get the sent and received sms details programatically in Android phone","<android><sms>","1","0","","2011-10-03 11:51:59",""
"5049196","1","5049277","","2011-02-19 06:06:56","1","4409","<p>i keep getting a class cast exception error when i run my program and i am not entirely sure why. </p><p>error</p><pre><code>02-18 14:31:27.585: ERROR/AndroidRuntime(325): FATAL EXCEPTION: main02-18 14:31:27.585: ERROR/AndroidRuntime(325): java.lang.RuntimeException: Unable to start receiver com.app.notifyme.SmsReciever: java.lang.ClassCastException: java.lang.String02-18 14:31:27.585: ERROR/AndroidRuntime(325):     at android.app.ActivityThread.handleReceiver(ActivityThread.java:2821)02-18 14:31:27.585: ERROR/AndroidRuntime(325):     at android.app.ActivityThread.access$3200(ActivityThread.java:125)02-18 14:31:27.585: ERROR/AndroidRuntime(325):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2083)02-18 14:31:27.585: ERROR/AndroidRuntime(325):     at android.os.Handler.dispatchMessage(Handler.java:99)02-18 14:31:27.585: ERROR/AndroidRuntime(325):     at android.os.Looper.loop(Looper.java:123)02-18 14:31:27.585: ERROR/AndroidRuntime(325):     at android.app.ActivityThread.main(ActivityThread.java:4627)02-18 14:31:27.585: ERROR/AndroidRuntime(325):     at java.lang.reflect.Method.invokeNative(Native Method)02-18 14:31:27.585: ERROR/AndroidRuntime(325):     at java.lang.reflect.Method.invoke(Method.java:521)02-18 14:31:27.585: ERROR/AndroidRuntime(325):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)02-18 14:31:27.585: ERROR/AndroidRuntime(325):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)02-18 14:31:27.585: ERROR/AndroidRuntime(325):     at dalvik.system.NativeStart.main(Native Method)02-18 14:31:27.585: ERROR/AndroidRuntime(325): Caused by: java.lang.ClassCastException: java.lang.String02-18 14:31:27.585: ERROR/AndroidRuntime(325):     at android.app.ContextImpl$SharedPreferencesImpl.getInt(ContextImpl.java:2706)02-18 14:31:27.585: ERROR/AndroidRuntime(325):     at com.app.notifyme.SmsReciever.onReceive(SmsReciever.java:45)02-18 14:31:27.585: ERROR/AndroidRuntime(325):     at android.app.ActivityThread.handleReceiver(ActivityThread.java:2810)</code></pre><p>now if i read that right it is saying the error is at line 45 in SmsReciever which would make this the problem area.</p><pre><code>SharedPreferences pref = PreferenceManager.getDefaultSharedPreferences(context);unread = pref.getInt(SmsPrefs.COUNT, 0);</code></pre><p>I have everything defined as such</p><pre><code>private int unread = 0;//in preference classpublic static final String COUNT = """";</code></pre><p>I am just trying to use this variable to keep a count. Someone guide me along here because i really dont see a problem.</p><p><em><strong></em></strong><em>update</em><strong><em>*</em>**</strong></p><p>how code is</p><pre><code>public class SmsReciever extends BroadcastReceiver {static final String ACTION = ""android.provider.Telephony.SMS_RECEIVED"";NotificationManager notifyManag;String mLast = new String();private int unread = 0;@Overridepublic void onReceive(Context arg0, Intent arg1) {    boolean smsOn = false;    String smsColor = new String (""Green"");    Uri smsSound;    String smsVibrate = new String (""Normal"");    SharedPreferences pref = PreferenceManager.getDefaultSharedPreferences(arg0);     smsOn = pref.getBoolean(""PREF_SMS_ON"", false);     smsColor = pref.getString(""SMS_PREF_COLOR"", ""Green"");     smsSound = Uri.parse(pref.getString(""SMS_PREF_SOUND"", ""Silent""));     smsVibrate = pref.getString(""SMS_PREF_SOUND"", ""Normal"");     unread = pref.getInt(SmsPrefs.COUNT, 0);     mLast = pref.getString(SmsPrefs.LAST, """");       NotificationManager mNotificationManager = (NotificationManager) arg0.getSystemService(Context.NOTIFICATION_SERVICE);        if (arg1.getAction().equals(ACTION) &amp;&amp; smsOn == true){            String from = new String();            String body = new String();            Bundle bundle = arg1.getExtras();            if (bundle != null) {                Object[] pdus = (Object[]) bundle.get(""pdus"");                for (Object pdu : pdus){                SmsMessage messages = SmsMessage.createFromPdu((byte[]) pdu);                from = messages.getDisplayOriginatingAddress();                body= messages.getDisplayMessageBody();                }// end for            }//end if            int icon = 0;            CharSequence tickerText = null;            long when = 0;            SharedPreferences.Editor editor = pref.edit();            icon = icon(icon);            tickerText = from + "": "" + body;            when = System.currentTimeMillis();            CharSequence contentText = """";            CharSequence contentTitle = """";            /*             if no notifications do normal             else if notified &gt;= 1 and last message is from same person display name and how many messages             else if(notified &gt;=1 and last message is from different display new message and how many             */            if(unread == 0){                contentTitle = from;                contentText = body.toString();                unread = 1;                editor.putInt(SmsPrefs.COUNT, unread);                editor.commit();            }else if(unread &gt;= 1 &amp;&amp; mLast.equals(from)){                contentTitle = from;                contentText = unread + "" unread messages"";                unread++;                editor.putInt(SmsPrefs.COUNT, unread);                editor.commit();            }else if(unread &gt;= 1 &amp;&amp; !mLast.equals(from)){                contentTitle = ""New Messages"";                contentText = unread + "" unread messages"";                unread++;                editor.putInt(SmsPrefs.COUNT, unread);                editor.commit();            }            mLast = from;            editor.putString(SmsPrefs.LAST, mLast);            editor.commit();</code></pre><p>and in the preference activity I have count defined as i showed earlier, also tried putting something in the string but still the same result</p>","599346","","599346","","2011-02-19 22:33:37","2014-03-21 07:54:04","Class Cast Exception problem","<android><classcastexception>","4","1","","",""
"5049231","1","5049309","","2011-02-19 06:17:52","0","1794","<p>When ever I try to use a web view it gives me a null pointer exception, my code:</p><pre><code>import android.app.Activity;import android.os.Bundle;import android.webkit.WebChromeClient;import android.webkit.WebView;public class Main extends Activity {    WebView webView;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        webView = (WebView)findViewById(R.id.webView);        webView.getSettings().setJavaScriptEnabled(true);        webView.setWebChromeClient(new WebChromeClient());        webView.loadUrl(""file:///android_asset/www/index.html"");    }}</code></pre><p>the Logs are:</p><p>02-18 22:08:06.224: ERROR/AndroidRuntime(355): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.test.web/com.test.web.Main}: java.lang.NullPointerException02-18 22:08:06.224: ERROR/AndroidRuntime(355): Caused by: java.lang.NullPointerException02-18 22:08:06.224: ERROR/AndroidRuntime(355):     at com.test.web.Main.onCreate(Main.java:17)</p><p>(there where more logs just none of them pertained to the problem)</p><p>On a semi- related note how do you make code look like code on stackexchange?</p><p>So I'm guessing the webView isn't initializing correctly?</p>","531928","","379693","","2011-02-19 06:23:24","2011-02-19 07:24:31","Webview not initializing","<android><webview><android-webview>","1","2","","",""
"5049246","1","5049274","","2011-02-19 06:21:13","0","952","<p>I have wanted to build an Android app for a long time now, and I just haven't had time to try to learn how to make it so I have outsourced it to a reputable company in India. My app is a really simple db driven reader app. Initially, the development company said there was no problem with my app idea, they'd have it done in 2 weeks. </p><p>But then, they got back to me and said that my content is too large for the Android OS, and that it wasn't possible to make. For content, I have the text of a book in different languages that is simply displayed. Each sqlite db is about 12-15 mb. </p><p>Is it true that the OS can't handle db's of that size? THat doesn't seem right. If that is true, what can I do to get around the issue? Do any of you have experience with this issue?</p><p>Thanks very much</p>","624130","","","","","2011-02-19 06:28:55","Is there a limit to the size of database I can use in an Android OS app?","<android><database><sqlite><size><restrictions>","1","0","0","",""
"5049281","1","5049354","","2011-02-19 06:31:26","0","1261","<p>I need to many MAC address for one Device in Android.is it possible to get many MAC Address from one device.?plz help me.</p>","624069","","","","","2011-02-19 07:37:12","get many MAC Address","<android>","1","0","","",""
"5049290","1","5381473","","2011-02-19 06:33:57","2","1051","<p>I am drawing a line beside a textview using the drawableright property. There are a number of text views in the table and all I want is column divider. Heres the textview code:</p><pre><code>  &lt;TextView  android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:text=""units"" android:drawablePadding=""2pt"" android:drawableRight=""@drawable/linetable"" android:gravity=""center"" android:layout_margin=""2pt"" android:padding=""2pt"" &gt;&lt;/TextView&gt;  Linetable Code:    &lt;shape xmlns:android=""http://schemas.android.com/apk/res/android""   android:shape=""line""&gt;     &lt;solid android:color=""#000000""&gt;&lt;/solid&gt;     &lt;stroke        android:width=""2pt""        android:color=""#000000""        android:dashWidth=""8pt""        android:dashGap=""8pt""        /&gt;   &lt;/shape&gt;</code></pre><p>So I expected to draw a column beside all textviews and this may look like a column border. But it isnt working.</p><p>The images show what I am trying to achieve and what I have achieved.</p><p>I just need guidance. Thank You.</p><p><img src=""http://i.stack.imgur.com/ctdAM.png"" alt=""The Spinner in the image is what I am trying to make""><img src=""http://i.stack.imgur.com/HxQi9.png"" alt=""What I have achieved so far""></p>","557869","","","","","2011-03-21 17:44:34","Right Drawable in Android. Not Working","<android><xml><gui><android-layout>","1","0","1","",""
"5049320","1","5049416","","2011-02-19 06:41:28","2","2523","<p>I'd like to create an eBook reader app for Android but in my case, all books are basically just scanned images compiled in PDF format. </p><p>But after a lot head banging and several tests it turned out that PDF rendering on Android is awfully slow, especially on low-end devices.</p><p>So I'm wondering if theres a way to show these images directly instead of PDF but still show them as a ""book"", so technically an ""image viewer"" but the user doesn't notice. Is it possible? </p><p>I'd appreciate any help. Thanks!</p>","172637","","505088","","2011-02-19 07:28:58","2012-10-03 20:10:24","Image Viewer in Android","<android><pdf>","2","0","1","",""
"5049435","1","5051338","","2011-02-19 07:12:15","0","2776","<p>The problem im having is I call sendAffimationNotice() twice passing a unique <code>aff_id</code> each time (as confirmed by printing ""putting "" + <code>aff_id</code>).</p><p>This prints <code>'putting 1'</code> and on the second call <code>'putting 2'</code>.</p><p>The phone now has 2 notifications. Though when both are clicked they both have the same ID toasted in the onCreate method on the intents activity.</p><p>Both times it prints ""ID is: 1"" even though both notifications are unique.</p><pre><code>public class PossAffNotification{private static int notif_ID = 1;private static NotificationManager notificationManager;private static Notification note;private static PendingIntent contentIntent;public static void sendAffimationNotice(Context ctx, String title,String contentText,int aff_id){    notificationManager = (NotificationManager) ctx.getSystemService(Context.NOTIFICATION_SERVICE);    note = new Notification(android.R.drawable.btn_star_big_on, contentText, System.currentTimeMillis() );    note.defaults |= Notification.DEFAULT_SOUND;    note.defaults |= Notification.DEFAULT_VIBRATE;    note.defaults |= Notification.FLAG_AUTO_CANCEL;    note.flags |= Notification.FLAG_AUTO_CANCEL;    Intent notificationIntent = new Intent(ctx, com.mindfsck.PossAff.MainActivity.class);    notificationIntent.putExtra(""aff_id"",aff_id);    System.out.println(""putting "" + aff_id);    notificationIntent.setAction(""com.mindfsck.PossAff.intent.action.aff"");    notificationIntent = notificationIntent.setFlags(Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED);    contentIntent = PendingIntent.getActivity(ctx, 0, notificationIntent, 0);    note.setLatestEventInfo(ctx, title, contentText, contentIntent);    notificationManager.notify(notif_ID,note);    notif_ID += 1;}   };    public class MainActivity extends Activity{        @Override        public void onCreate(Bundle savedInstanceState){            super.onCreate(savedInstanceState);            Intent serviceIntent = new Intent(this,PAService.class);            this.startService(serviceIntent);            Bundle extras = getIntent().getExtras();            if(extras !=null) {                Toast.makeText(getApplicationContext(), ""ID is: "" + extras.getInt(""aff_id""),                Toast.LENGTH_SHORT).show();            }        }}</code></pre>","97464","","68805","","2011-02-19 07:25:34","2011-02-19 14:43:10","Notification getIntent().getExtras() gets the same bundle","<android>","2","0","","",""
"5049443","1","5049518","","2011-02-19 07:14:30","1","1650","<p>I want to use facebook api in my android application only for status updates in my application content.</p><p>First i made an api key from facebook api website and then developed a layout but still i have problem ... that is, i can login only once time and not the second time.</p><p>Can you help me use the login api's of facebook correctly? </p>","1004437","","68805","","2011-02-19 07:25:42","2012-03-09 05:58:44","Facebook api - login problem","<android><facebook>","2","0","","",""
"5049509","1","5049533","","2011-02-19 07:28:49","0","215","<p>I'm trying to display a ProgressDialog to indicate that the user should wait while something uploads in the background, however, the device (galaxy tab) just freezes for the time that the upload happens and then when it comes out of its stupor it just goes to the next thing (having never displayed the ProgressDialog.</p><p>When I eliminate the upload, the dialog appears as expected. I'm guessing this is an async issue? The dialog simple never gets a time slice and by the time it does it's already been dismissed?</p><pre><code>pd = ProgressDialog.show(getApplicationContext(),"""", ""Sending Image ..."", true);uploadImage(); //if I comment out this line, the dialog shows, otherwise not.pd.dismiss();</code></pre><p>Is there some way to block on the ProgressDialog line until it actually renders? Or am I overlooking something stupid (and obvious)?</p>","59947","","","","","2011-02-20 11:56:39","ProgressDialog never shows up when the task right after is an upload (or other processor intensitve process)","<android>","1","0","","",""
"5049541","1","5061139","","2011-02-19 07:36:08","13","9180","<p>I have been looking at appcelerator it seems pretty fine! Without a doubt, one of the advantages of appcelerator is its support for multi-platform. I am interested in building an android app and maybe a iphone app later on. So it is not crucial to support multiple platforms at the moment. </p><p>If you disregard supporting multiple platforms and just focus on android development. Is appcelerator still advantageous? Does it lack any features of ""Android sdk""? </p><p><em>(When I say ""Andorid sdk"" I mean development with Eclipse with native Android sdk, if it makes any sense)</em></p>","159346","","1288","","2012-07-12 11:07:14","2013-09-05 06:28:17","Appcelerator vs Android SDK","<android><titanium><appcelerator>","6","0","8","",""
"5049547","1","5049570","","2011-02-19 07:39:01","2","8293","<p>I have Windows 7 64-bit. I also have a Windows 7 64-bit <a href=""http://en.wikipedia.org/wiki/Windows_Virtual_PC"" rel=""nofollow"">Virtual PC</a> computer set up on the same computer.</p><p>I have an Android device installed. It does show up under device manager under Android Phone as a Android Composite ADB Interface on both the actual computer (64 bit) and the virtual computer.</p><p>The difference is that on the actual computer ADB devices don't show any devices whereas if I attach the device to the virtual computer ADB devices shows it just fine.</p><p>It seems to me that either this is a driver issue on the 64-bit side or it is an ADB installation problem.</p><p>What to try? I have tried uninstall/reinstall drivers, power down, power up computer and device over and over.</p><p>I know that at some level I have the right drivers, at least the 32-bit ones, because it works on Virtual PC.</p><p>You may ask why I don't just use Virtual PC. Well, I will if I have to, but it is slower. I would rather use the real computer if I could.</p>","856232","","63550","","2011-02-22 21:19:00","2011-02-22 21:19:00","ADB device doesn't show my device on one computer but does on the virtual computer","<adb><devices><android>","2","0","1","",""
"5049553","1","","","2011-02-19 07:40:16","0","3855","<p>Trying to obtain the ""path"" that a websites contact form has.Is there a way to ""reverse engineer"" the std. ""contact us"" form to find out the actualy email address that it goes to ?</p>","624181","","","","","2011-02-19 07:50:42","Can you extrapolate the ""email address"" from a websites std. contact us form?","<android>","2","0","","",""
"5049600","1","5051328","","2011-02-19 07:53:52","0","661","<p>I have developed android client which calls tomcat servlet which is on same PC. It runs fine.</p><p>I've used url</p><blockquote>  <p><a href=""http://10.0.2.2:8080/servletname"" rel=""nofollow"">http://10.0.2.2:8080/servletname</a></p></blockquote><p>to call servlet and its working properly. Now i want to keep android client on one PC and Tomcat server on other. How should i proceed?</p><p>I have connected two laptops using LAN cable. I'm unable to configure all settings and permissions to call remote tomcat server.</p><p>Can anyone please tell me, how should i properly configure network ? </p>","568796","","68805","","2011-02-19 08:11:30","2011-02-19 14:32:44","How do you call remote servlet from android client?","<android><servlets>","1","0","","",""
"5049613","1","","","2011-02-19 07:58:24","2","1542","<p>all.   when I use notifyDataSetChanged(), the listview display order will be change .</p><p>like this</p><ul><li>3 </li><li>2</li><li><p>1</p><p>when current activy was created. but when I change the data. it will be </p></li><li>1</li><li>2</li><li>3</li></ul><p>I don't want the order changed and i dont understand why its happening.</p><p>This is a piece of code from my adapter class</p><pre><code>    public static class ItemAdapter extends BaseAdapter {        private String[] mData;        private LayoutInflater mInflater;// I called this method  to change data        public void setEditText(int position, final String item) {            mData[position] = item;            notifyDataSetChanged();        }}</code></pre><p>I change data at some dialog like this</p><pre><code>       builder = new AlertDialog.Builder(ct);                            builder.setTitle(R.string.pickStatus)                                    .setView(edBuffer)                                    .setPositiveButton(R.string.save, new DialogInterface.OnClickListener() {                                                @Override                                                public void onClick(                                                        DialogInterface dialog, int id) {                                                    // TODO Auto-generated method stub                                                    canPop = true;                                                    final String tmp = edBuffer.getText().toString();                                                    KbonezLog.e(String.format( ""set into key %d"", key)); //use mData key to set valuesetEditText(key, tmp);dialog.dismiss();}})</code></pre>","576472","","683261","","2012-02-08 12:19:56","2012-02-08 12:19:56","android listview order changed when called notifyDataSetChanged","<android><listview><baseadapter>","4","2","1","",""
"5049616","1","5206304","","2011-02-19 07:59:12","1","4928","<p>When I call WebView#loadUrl I expect that I should only get a single WebViewClient#onPageFinished call and no WebViewClient#shouldOverrideUrlLoading call.  However, I get a WebViewClient#shouldOverrideUrlLoading (which I implement by always calling WebView#loadUrl and returning true) and then two WebViewClient#onPageFinished calls with the same URL.</p><p>The page I'm loading uses a lot of ajax requests.  Do ajax requests invoke the WebViewClient?  My page does not have any meta-refreshes in it.</p><p>This is quite frustrating.  Am I doing something wrong?</p>","9636","","","","","2011-03-05 19:40:56","Android WebViewClient callbacks called too often","<android><webview><webviewclient>","1","0","","",""
"5049648","1","5049931","","2011-02-19 08:06:11","9","10359","<p>I need to check that android device's manufacturer is dell or not.But i have no dell device, therefore cant get actually name of manufaturer of device(for dell).</p><p>I'm using <code>android.os.Build.MANUFACTURER;</code><br>Does anyone know  that what is the value returned for the above query in case of a dell device?</p>","624069","","168868","","2011-09-21 19:32:08","2012-07-31 23:32:11","Get manufacturer name in android device","<android><hardware>","2","0","2","",""
"5049708","1","","","2011-02-19 08:19:00","0","288","<p>I made an app that uses the application context to share data and run functions between activities (or when the activity is closed). I also have a BroadcastReceiver that processes intents, plus it spawns new threads to run common functions stored in the App Context. Since all the activities and the Broadcast receiver can access the App Context by calling this.getApplicationContext(), it seems to be a much easier way to run stuff in the background while sharing data and functions throughout the app. </p><p>But I have a few questions:Is there a downside to doing it this way? Why would I want to create a service if this works flawlessly? (and so far, it has)Is there a larger battery drain doing it this way vs. the service?</p><p>Thanks</p>","496854","","","","","2011-02-19 09:04:14","In an android app, can I just use the application context instead of a service service?","<android><service><context>","1","0","1","",""
"5049710","1","5049814","","2011-02-19 08:21:39","9","4314","<p>I think this is a pretty simply question, but how do I disable the predictive text for an EditText in Android. Do I set a property in the EditText's XML or a property in the EditText's object... or both? Thanks!</p>","394933","","1267661","","2012-10-23 03:24:04","2012-10-23 03:24:04","Disable Predictive Text in EditText","<android><edittext>","1","0","1","",""
"5049744","1","5843549","","2011-02-19 08:29:22","0","1908","<p>I have a Textview in my alert dialogue box and i am placing a URL in the text? When i use the following piece of code it gives me an error:</p><pre><code>                final TextView message = new TextView(context);                 final SpannableString s = new SpannableString(context.getText(R.string.SEND_SMS));                   message.setText(s);                message.setPadding(10, 0, 4, 0);                message.setGravity(Gravity.AXIS_CLIP);                message.setMovementMethod(LinkMovementMethod.getInstance());                new AlertDialog.Builder(MyClass.this)                   .setTitle(""Message 1\nStep 1 of 4"")                   .setView(message)                   .setPositiveButton(R.string.CONTINUE,new DialogInterface.OnClickListener() {                       public void onClick(DialogInterface dialog, int whichButton) {                           Log.e(""@@"",""Inside OnClick"");                        //new CheckLoginStatus().execute();                        sendSMS();                        myProgressDialog=new ProgressDialog(MyClass.this);                        myProgressDialog.setTitle(""Message 2\nStep 2 of 4"");                        myProgressDialog.setMessage(""Message\n"" +                                ""Please wait... attempt ""+(count));                        myProgressDialog.setCancelable(false);                        myProgressDialog.show();                        Thread splashTread = new Thread() {                            @Override                            public void run() {                                try {                                    for(int i=0;i&lt;3;i++)                                    {                                        if(!smsStatus || !smsSendStatus){                                            Log.e(""@@"",""Inside Run.."");                                            int waited = 0;                                            while( (waited &lt; 120000)) {                                                sleep(100);                                                waited += 100;                                            }                                            Log.e(""after"",""120sec count=""+count);                                            if(!smsStatus)                                                handler.sendEmptyMessage(0);                                        }                                    }                                } catch (InterruptedException e) {                                    e.printStackTrace();                                }                                finally                                {                                    Log.e(""Logs"", ""Inside stop of thread"");                                    stop();                                }                            }                        };                        splashTread.start();                    }                   })                .setNegativeButton(R.string.do_later,new DialogInterface.OnClickListener() {                       public void onClick(DialogInterface dialog, int whichButton) {                           finish();                    }                   })                .setCancelable(false).show();</code></pre><p>And the Handler Code is </p><pre><code> private Handler handler = new Handler() {    public void handleMessage(Message msg) {        count += 1;        if(count&lt;=3){            try{                Log.e(""@@"",""Inside handler try count=""+count);                if(myProgressDialog.isShowing())                    myProgressDialog.dismiss();            }catch(Exception e){                e.printStackTrace();            }            //new CheckLoginStatus().execute();            sendSMS();            if(!myProgressDialog.isShowing()){                myProgressDialog=new ProgressDialog(MyClass.this);                myProgressDialog.setTitle(""My Message\nStep 2 of 4"");                myProgressDialog.setMessage(""Me Message\n"" +                        ""Please wait... attempt ""+(count));                myProgressDialog.setCancelable(false);                myProgressDialog.show();            }        }else if(count == 4){            try{                Log.e(""@@"",""Inside handler else ""+count);                if(myProgressDialog.isShowing())                    myProgressDialog.dismiss();            }catch(Exception e){                e.printStackTrace();            }            count = 1;            final TextView message = new TextView(getBaseContext());             final SpannableString s = new SpannableString(getBaseContext().getText(R.string.SMS_NOT_RECEIVED));            Linkify.addLinks(s, Linkify.WEB_URLS);            message.setText(s);            message.setPadding(10, 0, 4, 0);            message.setGravity(Gravity.CLIP_HORIZONTAL);            message.setMovementMethod(LinkMovementMethod.getInstance());              new AlertDialog.Builder(MyClass.this)               .setTitle(""My Message\nError"")               .setView(message)            .setPositiveButton(R.string.OK_TEXT,new DialogInterface.OnClickListener() {                   public void onClick(DialogInterface dialog, int whichButton) {                       finish();                }               }).setCancelable(false).show();        }    }};</code></pre><p>I think my problem statement is this      Linkify.addLinks(s, Linkify.WEB_URLS);</p><p>Earlier it used to work without this statement. Please help</p>","617872","","","","","2011-04-30 17:46:23","Android: Calling startActivity() from outside of an Activity context","<android><textview><alertdialog><linkify>","1","0","","",""
"5049837","1","5049945","","2011-02-19 08:55:26","0","960","<p>I would like a customized spinner which comes up when I click a link button. So I don't want to see the spinner value or icon V at all.  Just click and the spinner pops up.  </p><p>So 1) Does android have a link button.  Or how could I use Button with just button label showing and now border seamless?</p><p>2) How do I bring up the spinner from the link button?</p><p>3) How do I catch the selected spinner value?</p>","602260","","","","","2011-07-15 13:07:34","Customized Spinner Link Button","<android><spinner>","1","0","","",""
"5049852","1","","","2011-02-19 08:59:28","187","120864","<p>I would like to draw a line right in the middle of a layout and use it as a separator of other items like TextView. Is there a good widget for this.  I don't really want to use an image as it would be hard to match the other components to it.  And I want it to be relatively positioned as well.  Thanks</p>","602260","","379693","","2011-02-19 09:17:18","2014-04-12 17:48:19","Android Drawing Separator/Divider Line in Layout?","<android><layout><draw>","13","3","81","",""
"5049863","1","","","2011-02-19 09:00:37","1","2087","<p>Hope you can help me, because I am almost sure that it can be done... but I don't seem to be able to do it.</p><p>I'm doing a task that can take very long (varies from a few seconds to a couple of hours), so I though of a service to make the task and an activity to start/stop/monitor. Organically similar to a MP3 player, which is why I think this to be possible.</p><p>However, when I rotate the screen, the activity is destroyed/created (this is not a problem), and so it is the service! (this <em>is</em> a problem, because the new service is a different service, with a different state). I want my service to survive the destruction of the activity (by the way, the current reproducible problem is rotation, but it may happen in any other moment, such as presing BACK in the activity or so).</p><p>1) Am I asking for something impossible? It is hard for me to believe it, because what I want is exactly what a music player wants...</p><p>2) if (impossible) { Any other idea? }</p><p>3) else { Any idea of what I am doing wrong? }</p><p>I would also apreciate something like ""what you are doing is right"", since that would tell me that the problem is in the code, and not in the concept.</p><p>Here is my pseudocode (android 2.2, api 8):</p><p>EDIT1: added ""return START_NOT_STICKY"", since it may be important...</p><pre><code>// THE SERVICEclass MyService extends Service {  private MyInterface.Stub binder = new MyInterface.Stub() {    public int getProgress() {...}    public void doStop() {...}  }  onCreate() {    Log(""MyService created"");  }  onDestroy() {    Log(""MyService destroyed"");    doStop();  }  onBind() {    Log(""MyService bound"");    return binder;  }  onStartCommand() {    (new Thread() {      void run() {        while (!stop) {          //Do long task        }        stopSelf();      }    }).start();    return START_NOT_STICKY;  }}// THE ACTIVITYclass MyActivity extends Activity {  MyInterface _service;  ServiceConnection conn = new ServiceConnection() {    onServiceConnected(s) {      _service = MyInterface.Stub.asInterface(s);    }    onServiceDisconnected() {      _service = null;    }  }  onCreate() {    Log(""MyActivity created"");    bindService(MyService, conn);  }  onDestroy() {    Log(""MyActivity destroyed"");    unbindService(conn);  }  clickStart() {    startService(new Intent(this, MyService));  }  clickStop() {    _service.doStop();  }  clickProgress() {    _service.getProgress();  }}// THE MANIFEST&lt;application&gt;  &lt;activity name="".MyActivity""&gt;  &lt;service name="".MyService"" android:process="":remote"" /&gt;&lt;/application&gt;</code></pre><p>Edit2: More information. My pseudocode says:</p><pre><code>class MyService extends Service {...}</code></pre><p>However, it is an oversimplification, since it actually is:</p><pre><code>class MyService extends MyBaseService {...}class MyBaseService extends Service {...}</code></pre><p>MyBaseService is in a different package and even in a different project (a ""library project"").</p><p>Then, if I do not start/bindto MyService, but MyBaseService (and change manifest acordingly), everything works as expected.</p><p>It is enough for me, since the behaviour implemented in MyService (in relation to MyBaseService) is easily coded into MyBaseService, and controlled via putExtra to the Intent which launches the service (although it breaks OOP, I don't mind).</p><p>However, I still can't find why this one works but the other does not. I will report if I progress further.</p><p>Edit3: fixed pseudocode (duplicated onCreate). But real code does not have it.</p><p>Edit4: a notice on the procedure:</p><p>1) Everything starts as expected.</p><p>2) The user clicks Start, so click_start() is run, the service is serviceStart()'ed.</p><p>3) The user changes orientation. MyActivyty.onDestroy() is called, causing unbindService().</p><p>4) The service is destroyed; MyService.onDestroy() is called.</p><p>5) The activity is re-created. MyActivity.onCreate() is called, causing bindService().</p><p>6) The service is re-created; MyService.onCreate() is called. State has been lost.</p><p>My problem is step 4 (6 is just a consecuence of 4).</p>","624211","","624211","","2011-02-19 21:50:30","2011-02-20 09:36:38","Service dies when activity dies","<android>","3","1","1","",""
"5049875","1","5049906","","2011-02-19 09:02:55","1","3669","<p>Rather then setting list view to to particular background color I would like to fill the background with an image?  How can this be done?  Thanks</p>","602260","","","","","2012-01-28 22:48:35","Android Using Image as Background of ListView?","<android><image><layout><background>","5","0","1","",""
"5049907","1","","","2011-02-19 09:10:38","0","723","<p>A WidgetProvider button will use a Pending Intent to communicate.<br>Inside the onUpdate(Context ...) method of the WidetProvider the following line appears:</p><p>PendingIntent buttonPendingIntent = PendingIntent.getBroadcast(context, 0, buttonIntent, PendingIntent.FLAG_UPDATE_CURRENT);</p><p>Which context is being passed in by the widget manager android?</p><p>Is it ok to use context.getApplicationContext() for the pending intent?  as I have found that the widget freezes are a certain about of time and different application conditions, even though onUpdate gets called.  Using context.getApplicationContext() seems to help.</p>","602260","","","","","2011-02-19 10:52:54","Android Using Application Context Inside Widget For Pending Intent","<android><widget><android-intent>","1","0","","",""
"5049914","1","5049996","","2011-02-19 09:12:56","1","1559","<p>I have used a webview named <code>Testview</code> to load html data in the webview. for that I am using the following code.</p><p><code>Testview.loadData(""&lt;html&gt;&lt;body&gt;helloindia&lt;/body&gt;&lt;/html&gt;"", ""text/html"", ""utf-8"");</code>  </p><p>I have given <code>&lt;uses-permission android:name=""android.permission.INTERNET"" /&gt;</code> in the manifest. But this above loine of code is generating <code>NullPointerException</code>. Can anyone point out the problem in my code?</p>","525004","","","","","2011-02-19 10:07:03","Android webview loaddata giving NullPointerException","<android><html><webview><nullpointerexception><loaddata>","1","2","","",""
"5050005","1","","","2011-02-19 09:33:18","3","3928","<p>Am having a great confusion between activity and service. My aim is to run a music player. In most of the document said, to run a background work for an activity you should use service. But its possible to invoke a player from a thread created by an activity itself. Moreover, the thread wont destroy  even if the activity destroyed. </p><p>If so, what is the usage of service here ?Why should we use service and when to use service ?</p><p>Plz clarify my doubt !</p><p>Thanks in advance.</p>","617510","","12113","","2011-12-05 14:44:26","2011-12-05 14:44:26","What is the difference between an Android Activity and Service","<android>","1","1","1","",""
"5050070","1","5050093","","2011-02-19 09:51:22","15","26713","<p>I'm making a mobile-friendly stylesheet for a page of mine. Is there a simple way to make it show that stylesheet to iPhone/Android users? Or do I have to pull the user-agents and figure it out that way - and how do I do that?</p><p>Also - any tools to make this sort of web dev easier?</p>","361883","","","","","2012-07-05 01:16:18","Exclusive CSS for iPhone/Android","<iphone><android><html><css><mobile>","3","0","7","",""
"5050112","1","","","2011-02-19 10:03:59","0","6329","<p>Anybody know how to include and use own icons in an android eclipse project. I found out how to convert them from ico to png files but other than that, I cannot use them in my project, I am simply lost.</p><p>Please help :)</p>","624276","","","","","2011-02-19 10:07:50","Include my own icons into my eclipse android project","<android><eclipse><icons>","1","1","","",""
"5050138","1","5053656","","2011-02-19 10:07:39","0","3527","<p>I am new to Android App. I am working on a app which needs to display image and text in listView. For that I had extend ListActivity. In that I had used EfficientAdapter extending BaseAdapter. I had setted the OnItemClickListner too. But When I try to open an New Screen while clicking on tany item my app trow a NullPointer exception in intent and startActivity Method.</p><pre><code>public class MyClass extends ListActivity {    public void onCreate(Bundle icicle){    super.onCreate(icicle);        setListAdapter(new StationAdapter(this));        ..    }    private static class StationAdapter extends BaseAdapter {        static LayoutInflater mYInflater;         public StationAdapter(Context context) {        mYInflater = LayoutInflater.from(context);        }        public int getCount() {        return MyArray.length;        }        public Object getItem(int position) {        return position;                    }        public long getItemId(int position) {        return position;        }        public View getView(int position, View convertView, ViewGroup parent) {        ViewHolder holder;        if(convertView == null) {            holder = new ViewHolder();            convertView = myInflater.inflate(R.layout.customlister, null);            holder.title = (TextView)convertView.findViewById(R.id.myTitle);            holder.icon = (ImageView)convertView.findViewById(R.id.myIcon);        }        else {            holder = (ViewHolder)convertView.getTag();        }        holder.title.setText(MyArray[position]);        holder.icon.setImageBitmap(iconImages[position]);        convertView.setOnClickListener(new OnItemClickListener(position));         return convertView;       }           static class ViewHolder {        TextView title;        ImageView icon;       }       private class OnItemClickListener implements OnClickListener {        private int mPosition;        OnItemClickListener(int position) {            mPosition = position;        }        public void onClick(View view) {            try {                  System.out.println(""Clicked On Row - = "" + mPosition);            Intent i = new Intent(MyCurrentClass.this,MyNewClass.class);                startActivity(i);           }           catch (Exception e) {            System.out.println(""XML Pasing Excpetion = "" + e);           }           }       }   }}</code></pre><p>The following two lines:</p><pre><code>Intent i = new Intent(MyCurrentClass.this,MyNewClass.class);    startActivity(i);</code></pre><p>Works fine If I directly write these in My Class which extend ListActivity. But its not working here. I had tried to set My Intent in OnCreate Method and then create a function:</p><pre><code> public void GoToNextScreen() {    try {        startActivity(i);    }    catch (Exception e) {        System.out.println(""XML Parsing Exception = "" + e);    }}</code></pre><p>Then in my OnItemClickListener implementation I had called this method but still exception. Please help me out how can I move on new screen.Any Help will be greatly appreciated.</p><p>Thanks in advance.</p>","493476","","493476","","2011-02-25 06:09:30","2011-02-25 06:09:30","startActivity() is not working with Custom ListView's ItemClick?","<android><activity><android-intent><listactivity>","1","3","","",""
"5050164","1","","","2011-02-19 10:13:47","1","901","<p>Does Android attempt to restart installed applications that have crashed?  Is there some settings to request the OS to restart an application?</p>","602260","","","","","2012-04-11 10:50:57","Will Android Try to Restart an Application that has Crashed?","<android><crash>","0","3","","",""
"5050199","1","5050222","","2011-02-19 10:22:58","0","1579","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/4376553/upgraded-to-sdk-2-3-now-no-emulators-have-connectivity"">Upgraded to SDK 2.3 - now no emulators have connectivity</a>  </p></blockquote><p>I just updated my Android SDK to latest version which has come up as 2.3.3 and now when I visit any website using its Emulator browser, it say ""Browser can not load the web page because there is no internet connection."" Is this a known issue?</p>","355507","","","","","2011-02-19 10:28:20","Android Emulator 2.3.3 with No Internet Connection","<android><android-emulator>","1","0","","2011-02-19 13:38:08",""
"5050255","1","5050406","","2011-02-19 10:35:15","0","1942","<p>I have a half screen custom view and a TextView in my activity.</p><p></p><pre><code>&lt;com.sted.test.mainView    android:id=""@+id/mainView"" android:layout_width=""fill_parent""    android:layout_height=""fill_parent"" /&gt;&lt;TextView android:id=""@+id/tvScore"" android:layout_height=""wrap_content"" android:layout_width=""wrap_content""    android:layout_alignParentLeft=""true"" android:layout_alignParentBottom=""true"" /&gt;</code></pre><p></p><p>Upon clicking on the custom view, how can I update the TextView in my activity?</p><p>Currently I have this piece of coding in my custom view's <code>onTouchEvent()</code> but it hits a NullPointerException in the <code>setText()</code> part. Should I never update the TextView in my custom view? </p><pre><code>TextView tvScore = (TextView) findViewById(R.id.tvScore);tvScore.setText(""Updated!"");</code></pre>","71724","","","","","2011-02-19 11:44:09","Update TextView in a custom View","<android><textview><android-custom-view>","1","1","","",""
"5050272","1","8619868","","2011-02-19 10:38:35","2","10126","<p>I'm currently trying to implement SeekBarPreference class using <a href=""http://android-journey.blogspot.com/2010/01/for-almost-any-application-we-need-to.html"" rel=""nofollow"">http://android-journey.blogspot.com/2010/01/for-almost-any-application-we-need-to.html</a> tutorial with RelativeLayout. First problem is TextView preferenceText isn't showing at all.Second problem is the bar can't be slided like those in regular preferences (like media volume bar)?</p><pre><code>public class SeekBarPreference extends Preference implements    OnSeekBarChangeListener {public static int maximum    = 100;public static int interval   = 5;private float oldValue = 25;private TextView Indicator;public SeekBarPreference(Context context) {    super(context);}public SeekBarPreference(Context context, AttributeSet attrs) {    super(context, attrs);}public SeekBarPreference(Context context, AttributeSet attrs, int defStyle) {    super(context, attrs, defStyle);}@Overrideprotected View onCreateView(ViewGroup parent) {    float scale = getContext().getResources().getDisplayMetrics().density;    RelativeLayout layout = new RelativeLayout(getContext());    RelativeLayout.LayoutParams textParams = new RelativeLayout.LayoutParams(            RelativeLayout.LayoutParams.WRAP_CONTENT,            RelativeLayout.LayoutParams.WRAP_CONTENT);    RelativeLayout.LayoutParams sbarParams = new RelativeLayout.LayoutParams(            Math.round(scale * 160),            RelativeLayout.LayoutParams.WRAP_CONTENT);    RelativeLayout.LayoutParams indParams = new RelativeLayout.LayoutParams(            RelativeLayout.LayoutParams.WRAP_CONTENT,            RelativeLayout.LayoutParams.WRAP_CONTENT);    TextView preferenceText = new TextView(getContext());    preferenceText.setId(0);    preferenceText.setText(getTitle());    preferenceText.setTextSize(18);    preferenceText.setTypeface(Typeface.SANS_SERIF, Typeface.BOLD);    SeekBar sbar = new SeekBar(getContext());    sbar.setId(1);    sbar.setMax(maximum);    sbar.setProgress((int)this.oldValue);    sbar.setOnSeekBarChangeListener(this);    this.Indicator = new TextView(getContext());    this.Indicator.setTextSize(12);    this.Indicator.setTypeface(Typeface.MONOSPACE, Typeface.ITALIC);    this.Indicator.setText("""" + sbar.getProgress());    textParams.addRule(RelativeLayout.ALIGN_PARENT_LEFT);    sbarParams.addRule(RelativeLayout.RIGHT_OF, preferenceText.getId());    indParams.setMargins(Math.round(20*scale), 0, 0, 0);    indParams.addRule(RelativeLayout.RIGHT_OF, sbar.getId());    preferenceText.setLayoutParams(textParams);    sbar.setLayoutParams(sbarParams);    this.Indicator.setLayoutParams(indParams);    layout.addView(preferenceText);    layout.addView(this.Indicator);    layout.addView(sbar);    layout.setId(android.R.id.widget_frame);    return layout;}@Overridepublic void onProgressChanged(SeekBar seekBar, int progress,        boolean fromUser) {    progress = Math.round(((float) progress)/interval) * interval;    if(!callChangeListener(progress)) {        seekBar.setProgress((int) this.oldValue);        return;    }    seekBar.setProgress(progress);    this.oldValue = progress;    this.Indicator.setText("""" + progress);    updatePreference(progress);    notifyChanged();}@Overridepublic void onStartTrackingTouch(SeekBar seekBar) {}@Overridepublic void onStopTrackingTouch(SeekBar seekBar) {}@Overrideprotected Object onGetDefaultValue(TypedArray ta, int index) {    int dValue = ta.getInt(index, 25);    return validateValue(dValue);}@Overrideprotected void onSetInitialValue(boolean restoreValue,        Object defaultValue) {    int temp = restoreValue ? getPersistedInt(25) : (Integer)defaultValue;    if(!restoreValue)        persistInt(temp);    this.oldValue = temp;}private int validateValue(int value) {    if(value &gt; maximum)         value = maximum;    else if (value &lt; 0)        value = 0;    else if (value % interval != 0)        value = Math.round(((float) value)/interval) * interval;    return value;}private void updatePreference(int newValue) {    SharedPreferences.Editor editor = getEditor();    editor.putInt(getKey(), newValue);    editor.commit();}</code></pre><p>}</p>","607767","","","","","2013-12-10 19:56:22","Android SeekBarPreference","<android><seekbar><preference>","2","0","","",""
"5050369","1","5050455","","2011-02-19 10:57:06","0","97","<p>I have an interface a.xml and a java file a.java and b.java and 2 activity.</p><p>I want the interface b.xml (contains only an image)</p><p>When opening the application I want the interface b.xml opens and stays 3 seconds and then automatically switch to the interface a.xml</p><p>How can I do it?</p><p>Thank you in advance</p>","616263","","","","","2011-02-19 11:35:34","stay a few second on interface and switch automatically to an other interface","<android>","1","0","","",""
"5050443","1","5052786","","2011-02-19 11:09:33","8","17121","<p>I have recently installed Eclipse IDE for Java Developers (Version: 3.6.1) with the Android SDK Platform 2.1update1 - on Windows 7.</p><p>I can add, edit and run code for projects, however, in the Workbench area the Graphical Layout view of the layout xml files always shows a ""missing theme"" message in bottom right navigation area.The left Palette navigator area is ok and the remaining area is blank.</p><p>The error message reads: ""Selecting page '0' in AndroidXmlEditor failed""</p><pre><code>The first and last 10 lines from the Exception Stack Trace reads:java.lang.NullPointerExceptionat com.android.ide.eclipse.adt.internal.editors.layout.gle2.Gra phicalEditorPart.renderWithBridge(Unknown Source)at com.android.ide.eclipse.adt.internal.editors.layout.gle2.Gra phicalEditorPart.recomputeLayout(Unknown Source)at com.android.ide.eclipse.adt.internal.editors.layout.gle2.Gra phicalEditorPart.activated(Unknown Source)at com.android.ide.eclipse.adt.internal.editors.layout.LayoutEd itor.pageChange(Unknown Source)at org.eclipse.ui.part.MultiPageEditorPart.setActivePage(MultiP ageEditorPart.java:1067)at org.eclipse.ui.forms.editor.FormEditor.setActivePage(FormEdi tor.java:607)at com.android.ide.eclipse.adt.internal.editors.AndroidXmlEdito r.selectDefaultPage(Unknown Source)at com.android.ide.eclipse.adt.internal.editors.AndroidXmlEdito r.addPages(Unknown Source)at org.eclipse.ui.forms.editor.FormEditor.createPages(FormEdito r.java:138)at org.eclipse.ui.part.MultiPageEditorPart.createPartControl(Mu ltiPageEditorPart.java:348)at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:79)at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:369)at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.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)</code></pre><p>Thanks for your help in advance.</p>","474986","","","","","2012-10-11 07:59:52","Android development - 'missing theme error' in eclipse ide for layout xml files","<android><xml><eclipse><gui>","8","1","2","",""
"5050453","1","5050716","","2011-02-19 11:13:06","0","951","<p>I have a listview with two textviews as columns.I am using a custom adapter to manage the adapter.</p><pre><code>public class MyCustomBaseAdapter extends BaseAdapter { private static ArrayList&lt;SearchResults&gt; searchArrayList; private LayoutInflater mInflater; public MyCustomBaseAdapter(Context context, ArrayList&lt;SearchResults&gt; results) {  searchArrayList = results;  mInflater = LayoutInflater.from(context); } public int getCount() {  return searchArrayList.size(); } public Object getItem(int position) {  return searchArrayList.get(position); } public long getItemId(int position) {  return position; } public View getView(int position, View convertView, ViewGroup parent) {  ViewHolder holder;  if (convertView == null) {   convertView = mInflater.inflate(R.layout.row, null);   holder = new ViewHolder();   holder.txtName = (TextView) convertView.findViewById(R.id.left);   holder.txtCityState = (TextView) convertView.findViewById(R.id.right);   convertView.setTag(holder);  } else {   holder = (ViewHolder) convertView.getTag();  }  holder.txtName.setText(searchArrayList.get(position).getName());  holder.txtCityState.setText(searchArrayList.get(position).getCityState());  return convertView; } static class ViewHolder {  TextView txtName;  TextView txtCityState; }}</code></pre><p>I using global variables to change the layout of the listview. As you can see txtName is set to the ""left"" textview and txtCityState is set to the right textview. </p><p>In the activity i am setting the globalvariable to 0 or 1 depending on user clicks on Button01 or Button02:</p><pre><code> final Button sortdate = (Button)findViewById(R.id.Button01);      sortdate.setOnClickListener(new View.OnClickListener()   {    public void onClick(View v)     {    //  lv1.setAdapter(simpleAdapter);        GlobalVars.setEset(0);        //Toast.makeText(MainActivity.this, String.valueOf(GlobalVars.getEset()), Toast.LENGTH_SHORT).show();     }  });      final Button sortname = (Button)findViewById(R.id.Button02);      sortname.setOnClickListener(new View.OnClickListener()   {    public void onClick(View v)     {        GlobalVars.setEset(1);        //Toast.makeText(MainActivity.this, String.valueOf(GlobalVars.getEset()), Toast.LENGTH_SHORT).show();     }  });</code></pre><p>The variable seem to be set as the Toast message shows 0 or 1 if i click the buttons.</p><p>In my MyCustomBaseAdapter i am trying to change the layout like this:</p><pre><code> if (GlobalVars.getEset() == 0)   {   holder.txtName = (TextView) convertView.findViewById(R.id.left);   holder.txtCityState = (TextView) convertView.findViewById(R.id.right);   }   else if (GlobalVars.getEset() == 1)   {       holder.txtName = (TextView) convertView.findViewById(R.id.right);       holder.txtCityState = (TextView) convertView.findViewById(R.id.left);   }</code></pre><p>but nothing happens. What can be wrong with this? Everything else is working fine.</p><p>It should be easier to use another adapterview with another row.xml file. In another row.xml I would set different widths for the textviews so this would be an easy solution but there is a problem with the lv1.setAdapter.... line.</p><pre><code>  final Button sortname = (Button)findViewById(R.id.Button02);      sortname.setOnClickListener(new View.OnClickListener()       {        public void onClick(View v)         {            GlobalVars.setEset(1);            ArrayList&lt;SearchResults&gt; searchResults = GetSearchResults();            lv1 = (ListView) findViewById(R.id.ListView01);            lv1.setAdapter(new MyCustomBaseAdapter2(this, searchResults));        }      });</code></pre><p>As u you see it refers to MyCustomBaseAdapter2.java. But problem is ""The constructor MyCustomBaseAdapter2(new View.OnClickListener(){}, ArrayList) is undefined"" This happens also when its about MyCustomBaseAdapter.java here. Out of the button listener it works fine.</p>","571648","","571648","","2011-02-19 14:01:39","2011-03-13 12:53:48","Android global variable and custom adapter","<android><adapter>","3","4","","",""
"5050498","1","5051378","","2011-02-19 11:22:50","4","7621","<p>I have made a custom button bar as described <a href=""http://stackoverflow.com/questions/2422689/creating-a-custom-compound-button-bar"">here</a>. </p><p>Now, I want to add a separator between the first and the second and between the second and the third button. My button bar is defined as follows:</p><pre><code>&lt;LinearLayout            android:id=""@+id/buttonBar""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""            android:background=""@drawable/buttonbarstyle""            android:layout_alignParentBottom=""true""            android:orientation=""horizontal""            &gt;            &lt;ImageButton                android:id=""@+id/buttonBarImageButton1""                 android:scaleType=""centerInside""                android:layout_height=""wrap_content""                android:layout_width=""wrap_content""                android:layout_weight=""1""                android:src=""@drawable/copy""                android:padding=""2dip""                android:background=""@drawable/buttonbar_background_selector""                android:layout_gravity=""center_vertical""            /&gt;                          &lt;ImageButton                 android:id=""@+id/buttonBarImageButton2""                android:scaleType=""centerInside""                android:layout_height=""wrap_content""                android:layout_width=""wrap_content""                android:layout_weight=""1""                android:src=""@drawable/options""                android:padding=""2dip""                android:background=""@drawable/buttonbar_background_selector""                android:layout_gravity=""center_vertical""            /&gt;                          &lt;ImageButton                android:id=""@+id/buttonBarImageButton3""                 android:scaleType=""centerInside""                android:layout_height=""wrap_content""                android:layout_width=""wrap_content""                android:layout_weight=""1""                android:src=""@drawable/media_play""                android:padding=""2dip""                android:background=""@drawable/buttonbar_background_selector""                android:layout_gravity=""center_vertical""            /&gt;                      &lt;/LinearLayout&gt;</code></pre><p>The task seems so simple, but I can't find a good way to do it. It's supposed to have a grey-ish separator between each button, so that it looks somewhat like <a href=""http://newsrob.blogspot.com/2010/12/newsrob-november-release-45.html"" rel=""nofollow"">this</a>.</p><p>I'm sure it's easy, please just point me to the right direction.</p>","388826","","1292730","","2012-05-01 17:58:26","2012-07-10 15:34:57","Separator between buttons in custom button bar","<android><button><separator><buttonbar><togglebuttonbar>","2","0","2","",""
"5050562","1","","","2011-02-19 11:38:09","0","258","<p>Hi <br>My application implements 2 content providers:<br>1) Local - based on Sqlite<br>2) Remote - based on app engine.<br></p><p>When I am disconnected from the internet I want to use #1.<br> When I have internet connectivity I would like to switch to #2.</p><p>How can I do that? </p><p>Thanks</p><p>Avishay</p><p>[30 min later... :-)<br>After a deeper research I think that by switching  the ""content provider URI"" I can switch from #1 to #2.</p><p>Avishay</p>","415016","","415016","","2011-02-19 12:32:10","2011-03-08 16:10:01","Android: Switching content provider in runtime","<android><sqlite><runtime><switch><android-contentprovider>","1","0","","",""
"5050613","1","5062794","","2011-02-19 11:54:18","0","183","<p>Android activities can execute when not in foreground. In one page am having chronometer means can i run that with out pause..No means wt i do to run with out pause.. give me any idea.. thank you,</p>","565106","","","","","2011-02-21 05:50:58","Android activities can execute when not in foreground","<android>","2","0","","",""
"5050638","1","","","2011-02-19 11:59:38","1","559","<p>I've got an application that is written in Java and which talks to a device using virtual serial port (ie a USB CDC ACM device). Currently it runs an a PC (Windows/Linux/Mac OS X),but it would be a perfect match to be able to port this to a cheap tablet PC to create a stand alone system. </p><p>I've been googling for hours now and it seems quite a lot of people are interested in this sort of thin (no surprise there) and some have managed, but I've not found a good match for what I'm looking for or a good place to discuss this.</p><p>I'm looking at something like this:</p><p><a href=""http://www.prlog.org/10776061-101-inch-android-ipad-android-google-mid-tablet-pc.html"" rel=""nofollow"">http://www.prlog.org/10776061-101-inch-android-ipad-android-google-mid-tablet-pc.html</a></p><p>I would like to discuss the following:</p><p>This says that it supports USB host so it should be doable, eh? </p><p>Android is a kind of Linux so I should be able to use a serial dongle there, right? </p><p>Has Android got drivers so that I could just plug in a serial port dongle and open it as /dev/tty?</p><p>Would the above quoted APAD be usable as a development platform ?</p><p>So where would be a best place to discuss this?</p><p>br Kusti</p>","624338","","","","","2011-03-03 04:11:07","Serial port on an APAD - where to discuss this?","<android>","2","0","","",""
"5050639","1","","","2011-02-19 12:00:04","6","836","<p>I have a set of <code>RadioButton</code>s with a custom style. I want to display a border around the button that is currently checked. This should be easy enough using XML, but now I want the border to be animated. If a new radio button is checked, the border should ""fly"" to its new location with a fancy animation:</p><pre><code>+------+|* btn1| o btn2+------+    +------+ o b|n1  * |tn2    +------+        +------+ o btn1 |* btn2|        +------+</code></pre><p>Because of this, I decided to make the border into a separate <code>View</code> object, so I can animate it properly. The trouble is in tracking the location of the corresponding radio button on the screen.</p><p>I'm trying to get it to work <em>without</em> animations first. My current attempt looks something like this (only showing the relevant attributes):</p><pre><code>    &lt;RelativeLayout        android:layout_alignParentLeft=""true""        android:layout_alignParentTop=""true""&gt;        &lt;RadioGroup            android:id=""@+id/radio_group""&gt;            &lt;RadioButton/&gt;            &lt;RadioButton/&gt;            &lt;RadioButton/&gt;        &lt;/RadioGroup&gt;        &lt;View            android:id=""@+id/selection_border""            android:layout_alignParentLeft=""true""            android:layout_alignParentTop=""true""/&gt;    &lt;/RelativeLayout&gt;</code></pre><p>In the <code>OnCheckedChangeListener</code> of the <code>RadioGroup</code>, I move the selection border around by setting its margin (I could set the position, but that's a little harder with a <code>RelativeLayout</code>):</p><pre><code>View radioButton = findViewById(checkedId);View selectionBorder = findViewById(R.id.selection_border);ViewGroup radioGroup = (ViewGroup)findViewById(R.id.radio_group);RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(selectionBorder.getLayoutParams());params.leftMargin = radioGroup.getLeft() + radioButton.getLeft();params.topMargin = radioGroup.getTop() + radioButton.getTop();selection.setLayoutParams(params);selection.requestLayout();</code></pre><p>Trouble happens, however, on initialization. Because no layouting has been done yet, the position of the border is set incorrectly. It doesn't seem to be possible to force a relayout immediately, and it also doesn't seem to be possible to get an event after layouting has been done.</p><p>All this hassle leads me to believe that there must be a cleaner way to accomplish what I want. Any bright ideas?</p>","14637","","","","","2011-06-22 17:13:29","How to make a selection border that tracks the checked radio button?","<android><android-layout>","2","1","2","",""
"5050700","1","","","2011-02-19 12:13:18","0","213","<p>I was wandering if there was a way to have a ImageView group set in res/layout/xml. From which I can call different images to show on the click of a button. Also set the image to be in its own view on the page. So 3/4 of the page will be my application and the 1/4 will be an image view with different images showing on click. </p><p>Any help would be highly appreciated. </p><p>Thanks. </p>","608658","","","","","2011-02-19 12:58:28","ImageView in android","<android>","2","0","","",""
"5050721","1","5050790","","2011-02-19 12:18:37","2","1637","<p>When you long press on an email in Gmail application the dialog box is shown. I'm wondering is it just a dialog or an activity represented as dialog? Thank you.<img src=""http://i.stack.imgur.com/dWg6E.png"" alt=""enter image description here""></p>","397991","","","","","2012-03-22 20:19:41","Is this a dialog or activity?","<android>","2","0","1","",""
"5050730","1","","","2011-02-19 12:20:35","0","536","<p>hey people,I have created a class which extends application to share certain variables.  Within each activity I then use an object of that class (globalstate) as so:</p><pre><code>gs = (GlobalState) getApplication();</code></pre><p>I then declare local variable which reference the shared ones such as:</p><pre><code>boolean localStr = gs.str;</code></pre><p>Now I am under the impression this would be passed a a reference and therefore any change to localStr would be reflected in str within globalstate.  However this does not seem to be the case.</p><p>Some variables created in this manor such as an array of object seem to be passed as reference and therefore any changes are reflected within globalstate however for almost every other variables (booleans, strings &amp; ints) it seems the changes aren't reflected and therefore are being copied rather than referenced.</p><p>Have I done something wrong or is this how android works, if so how can i pass by reference?  Thanks.</p>","621854","","","","","2011-02-19 12:50:51","Android - Share Objects by Reference","<java><android><pass-by-reference>","2","0","","",""
"5050917","1","5050955","","2011-02-19 13:02:53","0","1102","<p>For example I've java string with [b?’f?:l] word.Set this string to TextView by .setTest method and it displays as [b[]f[]l] where [] is squear symbol.I've tried .getText from the TextView, but java string contains the same right symbols.</p><p>WebView gave the same result.What could be the problem?</p>","199556","","1043882","","2012-06-17 08:51:01","2012-06-17 08:51:01","Android TextView display phonetic(IPA) symbols?","<java><android><character-encoding>","1","0","","",""
"5050960","1","","","2011-02-19 13:12:40","0","168","<p>I want to get the number of requests send to server and number of responses received from server while loading a web page in android. I found some API's in <code>HttpConnectionMetrics</code></p><pre><code>getRequestCount(); getResponseCount();</code></pre><p>But i don't know how to use them. Please help me in this with a sample code. Thanks in advance</p>","399046","","115145","","2011-02-19 14:27:14","2011-02-19 14:27:14","How to use this API(HttpConnectionMetrics) in android?","<android><httpclient>","0","2","","",""
"5051033","1","","","2011-02-19 13:29:40","0","925","<p>I think it is common to load data and refresh it after some time as the data may change.My question is about how to load it periodly and how to retry the load action when load failed .</p><p>I tried to use AsyncTask to get this job done, but my code is ugly, I want to know if there are some elegant solution to deal with this.</p><p>I have some concerns:</p><ol><li>Reload it <em>rapidly</em> when the first time it loads failed. For the words <em>rapidly</em>, I mean I do not want to wait the next refresh time point to load it again, because the data is not loaded the first time, so I need to load it as soon as possible.</li><li>When it successfully been loaded, start the periodic refresh action. If loaded failed in one action, do not need to retry it as the data have been loaded before, I could just wait for the next refresh.</li><li>Stop retry action if it exist or the periodic refresh when the activity goes invisible</li><li>Resume retry action or the periodic refresh when the activity goes visible, still, retry action should happen <em>rapidly</em>, but the periodic refresh, I may want to check the last refresh time and to compare it with current time to determine whether the periodic refresh should start right now or later.</li></ol><p>Sounds complex, any good code example for this requirements?</p>","238061","","","","","2011-02-19 14:40:33","Android: Best practice to use AsyncTask to load internet data periodly and retry it when fail to load","<java><android><multithreading><android-asynctask>","1","0","","",""
"5051092","1","","","2011-02-19 13:45:08","0","517","<p>How do you get a view to position itself left, right and center in a TableLayout row.  Or Linear Layout?  Thanks</p>","602260","","","","","2011-02-19 14:31:08","android right-left justification of view element in layout","<android><relativelayout>","1","1","","",""
"5051094","1","","","2011-02-19 13:45:40","3","2837","<p>Firstly I'd like to say that I have only been working on Android for about a week now, so I guess you can consider me a newb! Therefore I apologise in advance if the solution is overly simple, but I can assure you that I have done my research before posting here, and haven't found an appropriate solution as of yet (or maybe I have and don't fully realise it!). Nonetheless, having lots of fun and just want to solve this problem and learn, so here goes... </p><p><strong>The Application</strong></p><p>The application I am developing is essentially a reminder service, and I am currently working on the <strong>preferences</strong> screen. </p><p><strong>The Problem</strong></p><p>I would like the user to be able to specifiy a time when he/she will be reminded daily. I want this selection to be done via the preferences screen. This is how my preferences screen looks so far...</p><p><a href=""http://img87.imageshack.us/img87/3129/preferencesm.png"" rel=""nofollow"">My preferences screen</a></p><p><strong>My Question</strong></p><p>Ideally, whenever the user selects the ""Alarm Time"" preference, I would like the following to appear (this is a screenshot of a preference from another application - PillReminder).</p><p><a href=""http://img580.imageshack.us/img580/2366/timepickerwidget.png"" rel=""nofollow"">Preference with Time Picker widget (taken from another app - ""PillReminder"") </a></p><p>My question is, what is the best way to create this? I really want to keep all the visual aspects of the application <strong>using only XML</strong>, therefore I don't want a Java solution. Is this possible or am I completely off track? Other potential solutions I have heard of are using themes, alert dialogs and extending preference classes etc. Maybe some of these are correct, but I am unsure.</p><p>Any help would be greatly appreciated, thanks! :)</p>","459708","","","","","2012-03-16 04:14:32","How do I customise a preference to display a time picker widget through XML","<android><xml><android-preferences>","2","0","","",""
"5051102","1","5051184","","2011-02-19 13:47:23","0","319","<p>I am trying to set the score in a game but it isn't doing anything at the moment. </p><p>I have declared a score variable:</p><pre><code>    static int score = 0;</code></pre><p>When an answer is shown in another textview as ""Correct"" I want the score to increment and show this in another textfield which will be for the score. </p><p>So far I have tried this: </p><pre><code>  public void score(){    check.getText();if(check.equals(""Correct"")){    score++;    Score.setText(String.valueOf(score));}</code></pre><p>check is a Textfield which shows Correct or Incorrect. Score is another textfield. and then I put the method score() into an onclick, but this doesn't update the textfield. </p><p>I would appreciate any advice on this. </p><p>Thanks</p><p>Edit:<img src=""http://i.stack.imgur.com/uZFQx.jpg"" alt=""enter image description here""></p>","608658","","608658","","2011-02-19 17:22:23","2011-02-19 17:22:23","Setting the score on textview","<android>","2","0","","",""
"5051113","1","5051122","","2011-02-19 13:50:07","-1","278","<p>This question was asked in an interview, let me know if anyone does know, while I crawl the web for the answer and understanding..</p><p><strong>Edit</strong></p><p>found it...</p>","121127","","121127","","2011-02-19 14:11:22","2011-02-19 14:11:22","is Service an abstract class?","<android>","1","5","","",""
"5051131","1","5051193","","2011-02-19 13:53:33","2","120","<p>I have written is code below, but button isn't shown because i've set FILL_PARENT in bar layoutParametrs. How i could fixed it without using XML?</p><pre><code>    TableRow        myLayout    = new TableRow      (this);    myLayout.setAlwaysDrawnWithCacheEnabled(true);    TextView        text        = new TextView      (this);        text.setText(""Test: "");    SeekBar         bar         = new SeekBar       (this);    ToggleButton    button      = new ToggleButton  (this);    myLayout.addView(   text    , new TableRow.LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT));    myLayout.addView(   bar     , new TableRow.LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.WRAP_CONTENT));    myLayout.addView(   button  , new TableRow.LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.WRAP_CONTENT));</code></pre><p>If FILL_PARENT set for bar</p><p><img src=""http://i.stack.imgur.com/QomrA.png"" alt=""If FILL_PARENT set for bar""></p><p>If isn't</p><p><img src=""http://i.stack.imgur.com/Tzmmr.png"" alt=""If not set""></p><p>both variant is wrong</p>","590952","","","","","2011-02-19 16:57:48","How to make visible all of the widgets from a single line(RowTable)?","<java><android><android-layout>","2","0","","",""
"5051205","1","5051222","","2011-02-19 14:10:22","1","2134","<p>I have an <code>Activity</code> and associated with it <code>layout</code>. Also I have another <code>layout</code> with some <code>Views</code>. I want to initialize a variable (<code>TextView</code>) from my <code>Activity</code> using a <code>View</code> from that standalone <code>layout</code>. I always get <code>null</code>. </p><pre><code>public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        button = (Button) findViewById(R.id.button); // This is OK // because R.id.button is from R.layout.main layout        tvOne = (TextView) findViewById(R.id.first_item); // This is not OK// because R.id.first_item is from another layout.}</code></pre>","397991","","","","","2011-08-23 16:54:19","Is it possible to initialize a View from different Layout?","<android>","2","0","1","",""
"5051364","1","5055471","","2011-02-19 14:37:14","7","10225","<p>The below code is used</p><pre><code>mWebView = (WebView) findViewById(R.id.webview);mWebView.getSettings().setAllowFileAccess(true);mWebView.getSettings().setJavaScriptEnabled(true);String base = Environment.getExternalStorageDirectory().getAbsolutePath().toString();String imagePath = base + ""/test.jpg"";  mWebView.loadUrl(imagePath);</code></pre><p>the image is not loading ... </p><p>also tried</p><pre><code>mWebView = (WebView) findViewById(R.id.webview);mWebView.getSettings().setAllowFileAccess(true);mWebView.getSettings().setJavaScriptEnabled(true);mWebView.getSettings().setBuiltInZoomControls(true);String base = Environment.getExternalStorageDirectory().getAbsolutePath().toString();String imagePath = base + ""/test.jpg"";String html = ""&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;&lt;img src=\""""+ imagePath + ""\""&gt;&lt;/body&gt;&lt;/html&gt;"";mWebView.loadData(html, ""text/html"",""utf-8"");</code></pre><p>Please help</p>","450487","","584440","","2013-01-10 07:05:30","2013-01-10 07:05:30","Load the image saved in sdcard in webview","<android><image><webview>","2","0","6","",""
"5051440","1","","","2011-02-19 14:49:10","0","490","<p>Can a BroadcastReceiver pass control to a Activity?</p><p>Maybe I am thinking about this in the wrong way but I have a BroadcasterReceiver waiting for a SMS message to come in.  once it comes in I would like it to pass control to a Activity so the Activity can set a alarm and beep.  but the following code will not build inside the BroadcastReceiver</p><pre><code>Intent intent = new Intent(PhoneFinder.class, AlarmService.class);    startActivity(intent);</code></pre>","589450","","21234","","2011-02-19 16:04:10","2011-02-19 16:04:10","Can a BroadcastReceiver pass control to a Activity?","<android><activity><broadcastreceiver>","1","1","","",""
"5051463","1","","","2011-02-19 14:54:10","2","1540","<p>I am trying to parse a XML file in Android. It contains a tag with special characters like</p><pre><code>&lt;subject&gt;&lt;![CDATA[FÚTBOL]]&gt;&lt;/subject&gt;</code></pre><p>while trying to parse the above text, i get an exception saying ""XML token not well formed"". I am using the XMLPullParser and has also sepcified the encoding using</p><pre><code>parser.setInput(this.getInputStream(),""iso-8859-1"");</code></pre><p>I am not getting error while reading other characters like ""áñí"". I tried with different encodings but they all gave error.</p><p>Update</p><p>The problem was solved when i used SAX Parser instead of XML Pull Parser.</p>","282826","","282826","","2011-02-20 17:11:23","2011-02-20 17:11:23","Character Encoding Issue while parsing XML in android","<android><encoding>","1","2","","",""
"5051569","1","","","2011-02-19 15:12:49","0","874","<p>Does anyone know if android marketplace has on api/feed to access information about their apps(title,summary,icon,version,etc...)?  My goal is to maintain my own database of android apps. </p><p>Thanks</p>","618765","","","","","2011-10-08 22:49:50","Android Marketplace API","<android><api><marketplace>","2","0","","",""
"5051636","1","5051881","","2011-02-19 15:26:51","1","3050","<p>Having some trouble with an ImageButton with a Selector.xml as the drawable source, keep getting the following error when I switch to the Graphical Layout in Eclipse:</p><p><em><strong>Unable to resolve drawable ""E:\Programing\Eclipse Workspace\com.commonsware.android.Sandbox\res\drawable-hdpi\keycselector.xml"" in attribute ""src""Exception details are logged in Window > Show View > Error Log</strong></em></p><p>This is the ImageButton showing the src being set to the keycselector.xml file:</p><pre><code>&lt;ImageButton   android:layout_width=""127px""  android:layout_height=""match_parent""   android:id=""@+id/BtnC""    android:padding=""0px""   android:src=""@drawable/keycselector""&gt;&lt;/ImageButton&gt;  </code></pre><p>Here's the keycselector.xml file, it's in \res\drawable-hdpi\</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;Selector xmlns:android=""http://schemas.android.com/apk/res/android"" android:constantSize=""true""&gt;    &lt;item android:state_pressed=""true"" android:drawable=""@drawable/keycimagepressed"" /&gt;    &lt;item android:state_focused=""true"" android:drawable=""@drawable/keycimagepressed"" /&gt;    &lt;item android:drawable=""@drawable/keycimage"" /&gt;&lt;/Selector&gt;</code></pre><p>Here's the trace, no idea what this is trying to say ""PI must not start with xml (position:unknown ï»¿@1:7 in java.io.FileReader@172b8dd)"":</p><p><em>org.xmlpull.v1.XmlPullParserException: PI must not start with xml (position:unknown ï»¿@1:7 in java.io.FileReader@172b8dd)at org.kxml2.io.KXmlParser.exception(Unknown Source)at org.kxml2.io.KXmlParser.error(Unknown Source)at org.kxml2.io.KXmlParser.parseLegacy(Unknown Source)at org.kxml2.io.KXmlParser.nextImpl(Unknown Source)at org.kxml2.io.KXmlParser.next(Unknown Source)at com.android.layoutlib.bridge.BridgeXmlBlockParser.next(BridgeXmlBlockParser.java:238)at android.graphics.drawable.Drawable.createFromXml(Drawable.java:721)at com.android.layoutlib.bridge.ResourceHelper.getDrawable(ResourceHelper.java:150)at com.android.layoutlib.bridge.BridgeTypedArray.getDrawable(BridgeTypedArray.java:670)at android.widget.ImageView.(ImageView.java:118)at android.widget.ImageButton.(ImageButton.java:82)at android.widget.ImageButton.(ImageButton.java:78)at sun.reflect.GeneratedConstructorAccessor19.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.rInflate(LayoutInflater.java:621)at android.view.LayoutInflater.rInflate(LayoutInflater.java:621)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.common.rendering.LayoutLibrary.createLegacySession(LayoutLibrary.java:382)at com.android.ide.common.rendering.LayoutLibrary.createSession(LayoutLibrary.java:276)at com.android.ide.eclipse.adt.internal.editors.layout.gle2.GraphicalEditorPart.renderWithBridge(Unknown Source)at com.android.ide.eclipse.adt.internal.editors.layout.gle2.GraphicalEditorPart.renderWithBridge(Unknown Source)at com.android.ide.eclipse.adt.internal.editors.layout.gle2.GraphicalEditorPart.recomputeLayout(Unknown Source)at com.android.ide.eclipse.adt.internal.editors.layout.gle2.GraphicalEditorPart$ReloadListener.reloadLayoutSwt(Unknown Source)at com.android.ide.eclipse.adt.internal.editors.layout.gle2.GraphicalEditorPart$ReloadListener.access$0(Unknown Source)at com.android.ide.eclipse.adt.internal.editors.layout.gle2.GraphicalEditorPart$ReloadListener$1.run(Unknown Source)at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:134)at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4041)at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3660)at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2640)at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2604)at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2438)at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:671)at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:664)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)</em></p>","498468","","498468","","2011-02-19 15:41:39","2012-02-29 09:10:02","ImageButton Selector XML File not found in Eclipse 3.6.1?","<android><eclipse>","2","2","","",""
"5051670","1","5185100","","2011-02-19 15:34:12","1","2895","<p>I want to ""transfer"" local resources to a page, loaded from remote server.</p><p>I want to do somthing like this:</p><pre><code>webView.loadUrl('http://my.server.com/page.html');webView.loadUrl('javascript:function someLong(){}function codeHere(){}....');</code></pre><p>This is for saving a bandwidth and reduce loading time.</p><p>As i see, assets files can't be loaded from remote web page...</p>","296433","","503826","","2011-02-19 16:39:32","2011-03-03 18:49:03","Is there any limitation on Url's length in Android's WebView.loadUrl method?","<android><webview>","3","0","","",""
"5051686","1","5051902","","2011-02-19 15:39:44","5","3413","<p>I am currently developing an android app where I create a notification Intent which adds parameters to the bundle of the intent. When the notification is clicked it calls an activity and gets the data from the bundle. However, the first time the app is used it works fine, but when you click on a different item its supposed to pass different data onto the notification activity but for some reason its not replacing the old data with the new. </p><p>I have tried to call bundle.removeExtra(""companyPassword"") before I use the putExtra but it doesn't seem to make any difference. Below is the code for the notification</p><pre><code>private void notification(String companyName, String companyURL, String companyUsername, String loginPassword){    String ns = Context.NOTIFICATION_SERVICE;    NotificationManager mNotificationManager = (NotificationManager)getSystemService(ns);    int icon = R.drawable.icon;    CharSequence tickerText = ""Click notification to copy password"";    long when = System.currentTimeMillis();    Notification notification = new Notification(icon, tickerText, when);    Context context = getApplicationContext();    CharSequence contentTitle = ""PM - Login Management"";    CharSequence contentText = ""Click here to copy password"";    Intent notificationIntent = new Intent(ShowLogins.this, DataManagement.class);    notificationIntent.setFlags(Intent.FLAG_ACTIVITY_NO_HISTORY);    notificationIntent.removeExtra(""companyName"");    notificationIntent.removeExtra(""companyURL"");    notificationIntent.removeExtra(""companyUsername"");    notificationIntent.removeExtra(""companyPassword"");    notificationIntent.putExtra(""companyName"", companyName);    notificationIntent.putExtra(""companyURL"", companyURL);    notificationIntent.putExtra(""companyUsername"", companyUsername);    notificationIntent.putExtra(""companyPassword"", loginPassword);    notification.flags |= Notification.FLAG_AUTO_CANCEL;    PendingIntent contentIntent = PendingIntent.getActivity(this, 0, notificationIntent, 0);    notification.setLatestEventInfo(context, contentTitle, contentText, contentIntent);    final int NOTIFICATION_ID = 1;    notification.defaults |= Notification.DEFAULT_SOUND;    //notification.defaults |= Notification.DEFAULT_VIBRATE;    notification.defaults |= Notification.DEFAULT_SOUND;    notification.defaults |= Notification.FLAG_AUTO_CANCEL;    mNotificationManager.notify(NOTIFICATION_ID, notification);    finish();</code></pre><p>And below is the code for the Notification activty where it retrieves the data that is passed into the bundle</p><pre><code>public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        try {            // setContentView(R.layout.data_mangement);            Bundle bundle = this.getIntent().getExtras();            company = bundle.getString(""companyName"");            companyURL = bundle.getString(""companyURL"");            username = bundle.getString(""companyUsername"");            password = bundle.getString(""companyPassword"");            bundle.clear();            ClipboardManager clipboard = (ClipboardManager) getSystemService(CLIPBOARD_SERVICE);            Encryption encryption = new Encryption();            String decryptedPassword = encryption.decrypt(password);            clipboard.setText(decryptedPassword);            toastNotification(""Password Successfully Copied\n\nPaste into password field"");            bundle.clear();            finish();            moveTaskToBack(true);        } catch (Exception ex) {            Log.d(""DataManagement Error"", ex.toString());        }    }</code></pre><p>For some reason when the activity for the notification is called it is only returning the data that was first sent when an item was first selected instead of retrieving the new data. </p><p>Thanks for any help you can provide. </p>","499448","","","","","2011-02-19 16:39:39","Bundle.putExtra problem with android","<android><bundle><android-intent>","1","1","","",""
"5051687","1","5053200","","2011-02-19 15:39:45","10","17069","<p>I've looked around here for similiar problems, but for some reason my BroadcastReceiver never ends up receiving the android.intent.action.BOOT_COMPLETED Intent.</p><p>Here is my (relative) Android.Manifest File:</p><pre><code>&lt;uses-permission android:name=""android.permission.RECEIVE_BOOT_COMPLETED""&gt;&lt;/uses-permission&gt;    &lt;receiver android:name="".BootReceiver""        android:enabled=""true""        android:exported=""true""        android:label=""BootReceiver""&gt;        &lt;intent-filter&gt;            &lt;action android:name=""android.intent.action.BOOT_COMPLETED""&gt;&lt;/action&gt;        &lt;/intent-filter&gt;    &lt;/receiver&gt;</code></pre><p>And Here is the actual Receiver.</p><pre><code>public class BootReceiver extends BroadcastReceiver {private static final String TAG=""BootReceiver"";@Override public void onReceive(Context context,Intent intent){    try{        context.startService(new Intent(context,ConnectivityListener.class));        Log.i(TAG,""Starting Service ConnectivityListener"");    }catch(Exception e){        Log.e(TAG,e.toString());    }}}</code></pre><p>Thanks!  Any help is greatly appreciated</p>","624470","","","","","2014-03-30 14:15:13","BroadcastReceiver not receiving BOOT_COMPLETED","<android><broadcastreceiver><boot>","7","2","14","",""
"5051713","1","","","2011-02-19 15:44:16","1","462","<p>I need to set the height and width of a EditText widget programmatically. I am using a RelativeLayout to do this, and it works fine as far as the size goes, but the actual widget paints itself incorrectly:</p><p><img src=""http://i.stack.imgur.com/w92oD.png"" alt=""Incorrect Drawing of EditText""></p><p>I would have expected it to paint like this (which it will if I set the height to ViewGroup.LayoutParams.WRAP_CONTENT instead of my requested height - sometimes):<img src=""http://i.stack.imgur.com/MF3M4.png"" alt=""enter image description here""></p><p><strong>Any ideas?</strong> </p><p><em>Please note that I can't switch to DIP:s (dpi independence is actually already handled by the engine that use this code). Also note that I haven't found any value of setTextSize() that fix the misbehaviour.</em></p><p><em>This is how I create my widget:</em></p><pre><code>  EditText et = new EditText(this);  et.setFocusable(true);  et.setSingleLine(true);  et.setHint(label);  et.setText(text);  et.setTextSize(TypedValue.COMPLEX_UNIT_PX,(h/3)+5);  et.setId(cn);   rllp = new RelativeLayout.LayoutParams(w,h);  rllp.leftMargin = x;  rllp.topMargin = y;  layout.addView(et,rllp);</code></pre>","16909","","16909","","2011-02-19 23:16:35","2011-02-19 23:16:35","How to make single-line EditText draw itself correctly when using a specific size","<java><android><edittext>","1","1","","",""
"5051716","1","5052303","","2011-02-19 15:45:10","0","123","<p>I am trying to make a score increment when an answer is shown as correct in a textfield. The code is as follows:</p><p>Variable is declared: </p><pre><code>static int score = 0;</code></pre><p>Method: </p><pre><code> public void score(){if(check.getText().equals(""Correct"")){    score++;}Score.setText(String.valueOf(score));}</code></pre><p>The Score is a textfield and check is another textfield</p><p>Then this is called in onclick as score();</p><p>I appreciate any ideas on why this gets a process closed error when I am clicking the button. </p><p>Thanks.</p><p>Edit:</p><p><img src=""http://i.stack.imgur.com/7c1s0.jpg"" alt=""enter image description here""></p>","608658","","608658","","2011-02-19 17:18:54","2011-02-19 17:22:13","Android Process closed onClick","<android>","1","4","","",""
"5051739","1","5051968","","2011-02-19 15:49:46","14","12878","<p>I have a small ap with preferences. In this class I've set the onPreferenceClick to get coordinates from the GPS. When the listener returns, my hope was to set the lat / long textedits automatically. I've tried every source sample out there, no luck:</p><pre><code>public void onLocationChanged(Location l) {  Log.d(""H"",""Location Received: ""+l.toString());  prefLocation.setSummary(l.toString());  SharedPreferences settings = getSharedPreferences(PREFS_NAME, MODE_PRIVATE);  SharedPreferences.Editor editor1 = settings.edit();  editor1.putString(""posLat"",""xxx"");  editor1.commit();}</code></pre><p>When this code executes when I click on my PreferenceScreen and the location listener returns, the EditTextPreference with the key ""posLat"" still shows the old value.</p><p>I'm going crazy trying to figure out what's wrong!</p><p>My prefs.xml:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;PreferenceScreen  xmlns:android=""http://schemas.android.com/apk/res/android""  android:key=""My_Shared_Preferences""&gt;    &lt;PreferenceCategory        android:title=""Your Location""&gt;        &lt;PreferenceScreen            android:title=""Find Location...""            android:key=""location""            android:summary=""Click here to read your location automatically""/&gt;        &lt;EditTextPreference            android:title=""Latitude""             android:key=""posLat"" /&gt;        &lt;EditTextPreference            android:title=""Longtitude""             android:key=""posLong"" /&gt;        &lt;EditTextPreference            android:title=""Altitude""             android:key=""posAlt"" /&gt;    &lt;/PreferenceCategory&gt;&lt;/PreferenceScreen&gt;</code></pre><p>Alternatively, maybe there is a better way to store the location value for an application? I don't really want the user to manually enter the coordinates, but I dont want to resort to saving and loading a text file with the settings, it seems so crude.</p>","181098","","","","","2012-05-29 10:28:20","Android: Setting preferences programmatically","<android>","2","0","1","",""
"5051753","1","5052750","","2011-02-19 15:52:29","11","21334","<p>I have a styles called Red and Green and I have an if statment to find out which to apply, but I don't know the code to actually apply a style from the java.</p>","614460","","","","","2013-10-30 18:45:20","How do I apply a style programmatically?","<android>","4","1","1","",""
"5051770","1","","","2011-02-19 15:55:13","1","933","<p>Created Spinner Dialog as explained here: <a href=""http://www.dotnetexpertsforum.com/dialog-box-with-spinner-view-in-android-t1485.html"" rel=""nofollow"">http://www.dotnetexpertsforum.com/dialog-box-with-spinner-view-in-android-t1485.html</a></p><p>How does one close the dialog after a user selection?</p><p>If I cancel the dialog everytime onItemCLick is called it will cancel immediately becuase onItemClick is called immediately once before user enters anyting.</p><p>Thanks</p>","602260","","","","","2011-02-19 16:06:11","Android How To Close Spinner Dialog","<android><dialog><spinner>","1","0","0","",""
"5051835","1","6855434","","2011-02-19 16:05:29","6","2224","<p>It's possible, to do things like this</p><p>XML:</p><pre><code>&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""              android:orientation=""vertical""              android:layout_width=""match_parent""              android:layout_height=""match_parent""&gt;    &lt;Button android:layout_width=""match_parent""              android:layout_height=""wrap_content""              android:id=""@+id/addContactButton""              android:text=""@string/addContactButtonLabel""                android:onClick=""launchContactAdder""/&gt;&lt;!-- here --&gt; &lt;/LinearLayout&gt;</code></pre><p>Java:</p><pre><code>public void launchContactAdder(View v){    Intent i = new Intent(this, ContactAdder.class);    startActivity(i);}</code></pre><p>but there is a requirement, that the method must be public, void and the most important take View as an argument.</p><p>Now i'd like to do exactly the same thing but with Checkbox button. Checkbox has android:onclick attribute, but in Android tutorial (http://developer.android.com/resources/samples/ContactManager/index.html) I can see this code</p><pre><code>showInvisibleControl.setOnCheckedChangeListener(new OnCheckedChangeListener(){    public void onCheckedChanged(CompoundButton buttonView, boolean isChecked)    {        Log.d(TAG, ""mShowInvisibleControl changed: "" + isChecked);        showInvisible = isChecked;        populateContactList();    }});</code></pre><p>So there is a onCheckedChanged(CompoundButton buttonView, boolean isChecked) method. Is there any way to do this by XML? There's no android:onCheckedChange attribute, only android:onClick attribute, but as I wrote above, name of that attribute must have corresponding method name, which takes View as an argument, but from the code above I understand that i must have a method with CompoundButton and boolean arguments.</p><p>Any way to do that in ""XML way""?</p>","522360","","247763","","2012-05-10 12:06:44","2013-04-26 18:42:49","Android, Checkbox listener in XML?","<android><xml><checkbox><listener>","2","0","0","",""
"5051840","1","","","2011-02-19 16:06:38","2","259","<p>AlarmService sample error building can't find AlarmService_Service.class. What am I missing?</p><p>Code:</p><pre><code>public class AlarmService extends Activity {  private PendingIntent mAlarmSender;  protected void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    // Create an IntentSender that will launch our service, to be scheduled    // with the alarm manager.    mAlarmSender = PendingIntent.getService(AlarmService.this, 0,        new Intent(AlarmService.this, AlarmService_Service.class), 0);    setContentView(R.layout.main);    // Watch for button clicks.    Button button = (Button) findViewById(R.id.Button01);    button.setOnClickListener(mStartAlarmListener);    button = (Button) findViewById(R.id.Button02);    button.setOnClickListener(mStopAlarmListener);  }  private OnClickListener mStartAlarmListener = new OnClickListener() {    public void onClick(View v) {      // We want the alarm to go off 30 seconds from now.      long firstTime = SystemClock.elapsedRealtime();      // Schedule the alarm!      AlarmManager am = (AlarmManager) getSystemService(ALARM_SERVICE);      am.setRepeating(AlarmManager.ELAPSED_REALTIME_WAKEUP, firstTime,          3 * 1000, mAlarmSender);      // Tell the user about what we did.      Toast.makeText(AlarmService.this, ""Repeating Scheduled"",          Toast.LENGTH_LONG).show();    }  };  private OnClickListener mStopAlarmListener = new OnClickListener() {    public void onClick(View v) {      // And cancel the alarm.      AlarmManager am = (AlarmManager) getSystemService(ALARM_SERVICE);      am.cancel(mAlarmSender);      // Tell the user about what we did.      Toast.makeText(AlarmService.this, ""Repeating Unscheduled"",          Toast.LENGTH_LONG).show();    }  };}</code></pre>","589450","","1136195","","2013-03-18 16:04:15","2013-03-18 16:04:15","AlarmService sample error building can't find AlarmService_Service.class","<android><android-alarms>","1","0","","",""
"5051889","1","5052014","","2011-02-19 16:17:49","0","1975","<p>Is it possible to supply pre-filled SQLite DB to my app?ie I want to use db(as ordinary SQLite db) which will have tables filled by hand and I want to include it into my .apk file.</p>","468311","","","","","2011-02-20 02:53:12","Android pre-filled DB","<android><sqlite>","2","2","0","",""
"5052009","1","5052251","","2011-02-19 16:35:39","1","482","<p>What happens if a child thread's call back method existed in an Activity that was destroyed or that is now NOT the Activity at the top of the stack?WIll this cause and exception? if so, what is the best practice to deal with this kind of issue? Thanks!</p>","234682","","","","","2011-02-19 17:16:18","Activity spawns a thread, but then the activity gets destroyed or an new activity (in the same task) gets created before child thread finishes","<java><android><multithreading>","3","0","","",""
"5052161","1","5052287","","2011-02-19 17:00:16","2","540","<p>I'm planning on writing an android app that can view and update data on a local network Oracle DB.</p><p>I have already written a python script which checks the oracle db every couple of minutes and writes out XML files which I then plan to parse through my android app to display the data.</p><p>As I mentioned though this will only work if the android device is part of the same network (either connected locally or through a vpn), and the XML will be stored on a Unix server.</p><p>The question is how to access that Unix server with the android app? Can I use FTP via an android app, or should I be looking to change the python script to send the XML to an easily retrievable location?</p><p><strong>EDIT</strong> To clarify what you mean, you have a web service running on something like tomcat, the client sends a request to get the data from the oracle db (can also use some form of authentication), the web service responds and sends the data in a format (XML, JSON etc.), the client then sends a request back to the web service to change some data on the oracle db, and in turn it does the clients bidding?</p>","564045","","564045","","2011-02-19 18:27:36","2011-02-19 18:29:42","Needs workflow ideas for Android app","<android><xml><oracle>","2","0","","",""
"5052164","1","5067985","","2011-02-19 17:00:47","0","1131","<p>In my application I have 4 tabs in my <code>TabActivity</code> I want a user confirmation dialog popup when user exits my application.</p><p>I have overridden the <code>onKeyDown</code> event of <code>TabActivity</code> and coded my requirements but the result is not as expected i.e. no popup comes when user exits, but when I am overriding on key down of my child tabs the requirement is full filled.</p><p>Yes I can simply copy paste the <code>onKeyDown</code> code for all my child tabs, but is there a best practice for this, may be I can dispatch the <code>onKeyDown</code> to my TabActivity.</p><p>Heres the code:</p><pre><code>    @Override    public boolean onKeyDown(int keyCode, KeyEvent event) {    if(keyCode == KeyEvent.KEYCODE_BACK) {        new AlertDialog.Builder(this)        .setTitle(""Confirm Quit"")        .setMessage(""Really Quit ?"")        .setPositiveButton(""OK"", new DialogInterface.OnClickListener() {            @Override            public void onClick(DialogInterface dialog, int which) {            }        })        .setNegativeButton(""Wait!"", null)        .show();        return true;    }    else {        return super.onKeyDown(keyCode, event);    }}</code></pre>","514553","","","","","2011-09-30 09:57:34","Dispatch keyDown to TabActivity","<android><events><exit><keydown>","3","0","","",""
"5052227","1","5052366","","2011-02-19 17:10:50","3","4064","<p>In my app, in the onCreate() method of the main activity I am creating a wake lock so that the CPU will keep running if the phone goes on standb/screen turns off.  </p><p>Also in the onCreate method I have an intent to create a service that uses the accelerometer. This service needs to be continuously running while the app is open and monitoring accelerometer values (I know this isn't good for battery but I need it to do that). Here is my code at the moment and the service starts fine.</p><pre><code>public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);          PowerManager pm = (PowerManager) getSystemService(POWER_SERVICE);        PowerManager.WakeLock wl = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, ""Howaya"");        wl.acquire();        if (appStart == true)          {             Intent AccelService = new Intent(this, Accelerometer.class);            AccelService.putExtra(""unreg"", false);            startService(AccelService);        }        appStart = false;  }</code></pre><p>I have the following permission set in my manifest -</p><pre><code>&lt;uses-permission android:name=""android.permission.WAKE_LOCK"" /&gt;</code></pre><p>I have tried this with different locks - dim screen and full brightness to no avail too. My output on logcat is here - </p><pre><code>F/PowerManager(15628): android.util.Log$TerribleFailure: WakeLock finalized while still held: HowayaF/PowerManager(15628):  at android.util.Log.wtf(Log.java:260)F/PowerManager(15628):  at android.util.Log.wtf(Log.java:239)F/PowerManager(15628):  at android.os.PowerManager$WakeLock.finalize(PowerManager.java:329)F/PowerManager(15628):  at dalvik.system.NativeStart.run(Native Method)</code></pre><p>I have seen people saying that partial wakelocks don't work like they should do, such as this link <a href=""http://code.google.com/p/android/issues/detail?id=3708"" rel=""nofollow"">Google standby error page</a> but this was released and closed last year so I don't know is that the case, can anyone help here please? I have a HTC Desire as regards that last point too, Thanks.</p>","506929","","506929","","2011-02-19 17:16:33","2011-03-29 20:03:23","Android - Wake lock not acquiring properly, app needs to keep running in standby","<android><accelerometer><standby><wakelock><android-wake-lock>","2","0","","",""
"5052267","1","5052314","","2011-02-19 17:17:36","1","387","<p>I'm, playing with the Android framework and try to get my mind deeper into Java. For This I read about Javas Generics and the Reflection API, while I'm not understanding it really. Because I'm a lazy Dev ;) I tried to write an 'Parcelable-Container' in which I can put ANY Object I wish to get it Parcelable without the need to implement this for every Object again using methods of Java Reflection.</p><p>I write a test method like these:</p><pre><code>public &lt;T&gt; void writeClassInformations(T t){        Class c = t.getClass();        System.out.println(""DeclaredFields: "");        for (Field f : c.getDeclaredFields()){            System.out.println(f.toGenericString());        }        System.out.println(""Fields: "");        for (Field f: c.getFields()){            System.out.println(f.toGenericString());        }}</code></pre><p>How can I get every member even if they are Objects or private Superclass members?And another Question: The output is like this:</p><p><em>public int hello.test.Testclass.myID</em></p><p>how I get the value of 'myID'? </p><hr><p>ADD:I'm running in serious problems now. The Interface of Parcelable.Creator forces me to write a statement like: <code>public static final Parcelable.Creator CREATOR =         new Parcelable.Creator&lt;ParcelableBox&lt;?&gt;&gt;()</code>Can I use <code>?</code> somehow? Normally I use a constructor like <code>ParcelableBox(E object)</code>. While it seems to me that I can't use Object methods on <code>?</code> I even cannot pass it into a class variable like </p><pre><code>public ParcelableBox&lt;?&gt; createFromParcel(Parcel source){    ...  return new ParcelableBox&lt;?&gt;(); }</code></pre><p>or <code>? myClass</code> to use Reflection on it. Is this the end of javas reflection power? How can I get Class of <code>?</code></p>","620053","","620053","","2011-02-20 04:21:23","2011-02-20 04:21:23","help requested understanding Java Reflection --> Android ParcelableContainer","<java><android><generics><reflection>","1","3","","",""
"5052278","1","5061889","","2011-02-19 17:19:22","1","1232","<p>I am working on the first stage of making a game.  I have a drawable that I want to move around on the screen while the dpad arrows are being held down.  </p><p>I set up a custom view, overrode onKeyDown and onKeyUp and I have a switch statement to identify the key being pressed.  If a key is pressed, a boolean for that key goes to true.  If the key is let up, the boolean goes to false.  In another routine, the boolean is checked and the movement updated.</p><p>The problem is, the device I am testing this on is the G2, which has it's own unique keyboard with no dpad, so I also did i,j,l,m as arrows for movement. (see <a href=""http://www.pcmag.com/article2/0,2817,2368902,00.asp"" rel=""nofollow"">here</a>, click on image)  In the android emulator, my setup and movement works well.  However, on the actual device, the drawable does not respond to any key press at all.  My brother is testing this for me (my phone has no keyboard) so I can't debug on the actual device.</p><p><strong>My questions are these:</strong>  Are the KeyEvent.KEYCODE_* constants different for different keyboards (i.e. qwerty, non-qwerty, etc.)?  Do I need to specify in the code a particular keyboard to use (e.g. keymap)?  </p><p>Any help or suggestions are welcome.Thanks.</p><p>If needed, here is an example of my doKeyDown routine called from onKeyDown (very much based on the LunarLander example source):</p><pre><code>boolean doKeyDown(int keyCode, KeyEvent msg) {        synchronized (mSurfaceHolder) {         //   Log.d(""KeyDown"", ""The key pressed was:"" + keyCode);         //   Log.d(""KeyDown"", ""UP: "" + mMove_Up + "" DOWN: "" + mMove_Down + "" LEFT: "" + mMove_Left +"" RIGHT: "" + mMove_Right);            mIsDown = false;            boolean handled = false;            switch (keyCode)            {            case KeyEvent.KEYCODE_DPAD_UP:                mMove_Up = true;                handled = true;                break;            case KeyEvent.KEYCODE_I:  //Also up                mMove_Up = true;                handled = true;                break;            case KeyEvent.KEYCODE_DPAD_DOWN:                mMove_Down = true;                handled = true;                break;            case KeyEvent.KEYCODE_M:  //Also down                mMove_Down = true;                handled = true;                break;            case KeyEvent.KEYCODE_DPAD_LEFT:                mMove_Left = true;                handled = true;                break;            case KeyEvent.KEYCODE_J:  // Also left                mMove_Left = true;                handled = true;                break;            case KeyEvent.KEYCODE_DPAD_RIGHT:                mMove_Right = true;                handled = true;                break;            case KeyEvent.KEYCODE_L:  // Also right                mMove_Right = true;                handled = true;                break;            }            return handled;        }    }</code></pre>","606853","","","","","2011-02-21 03:08:54","Android keyListener working well on emulator, but not on device","<android><keylistener>","1","1","","",""
"5052288","1","","","2011-02-19 17:20:57","4","12652","<p>I'm trying to learn how to develop Android using the Eclipse IDE. What I'm trying to do right now is make a hidden TableLayout visible when a button is pressed. However, I have no idea as to what I need to put in the button's OnClick property.</p><p>Also, are there any tutorials online that could help me learn how to develop Android apps in Eclipse?</p><p>Thanks!</p>","624556","","1228","","2013-08-13 14:10:56","2013-09-06 07:53:06","How can I hide/show an element when a button is pressed?","<android><eclipse><hide>","3","0","1","",""
"5052323","1","5052431","","2011-02-19 17:27:18","3","3346","<p>According to this blogpost on android developers blog it should be doable to change an outgoing call number:<a href=""http://android-developers.blogspot.com/2011/01/processing-ordered-broadcasts.html"" rel=""nofollow"">http://android-developers.blogspot.com/2011/01/processing-ordered-broadcasts.html</a></p><p>The problem is that it doesn't work for me, my code:</p><pre><code>String action = intent.getAction();if (Intent.ACTION_NEW_OUTGOING_CALL.equals(action)) {    // Try to read the phone number from previous receivers.    String phonenumber = getResultData();    if (phonenumber == null) {        // We could not find any previous data. Use the original        // phone        // number in this case.        phonenumber = intent                .getStringExtra(Intent.EXTRA_PHONE_NUMBER);    }        String reformatedNumber = reformatNumber(phonenumber);    setResultData(reformatedNumber);                                }</code></pre><p>Even though I reformat the number the phone number i dialed is the one being called up.</p><p>Any insight?</p><p>I have these permissions in my manifest:</p><pre><code>&lt;uses-permission android:name=""android.permission.PROCESS_OUTGOING_CALLS"" /&gt;&lt;uses-permission android:name=""android.permission.CALL_PHONE"" /&gt;&lt;uses-permission android:name=""android.permission.CALL_PRIVILEGED"" /&gt;</code></pre><p>The weird thig is that when I call I number that is not stored in the phone book I have a service that tries to figure out who I'm calling and I have to press a ""Call"" button on a dialog to complete the call. Then my code works, but when I call someone from the phonebook or if i disable the look-up service it doesn't work.</p>","452861","","950931","","2012-08-21 19:54:10","2012-08-21 19:54:10","Change the number for outgoing call, add prefix","<java><android><android-intent><broadcastreceiver>","2","0","4","",""
"5052324","1","5052674","","2011-02-19 17:27:27","6","7374","<p>Anyone know of a library or method I can use to emulate the way the Android homescreens work?</p><p>What I mean is this:</p><p>A control that will take any number of sub-Views.  It will only show one of those Views at a time, however, when the user drags their finger over the screen, it'll switch to the next or previous view, depending on which way the user dragged their finger.</p><p>I've seen a few examples (SwipeGestureListener comes to mind), but they don't work in the way I'd like.  They require a swipe gesture, which means the widget doesn't move unless there is an actual swipe.  For this reason, it's not readily obvious that the pages are switchable using this method.</p><p>Any information would be great.</p>","238849","","","","","2012-02-12 13:45:50","A page flipper control - like the android home screens","<android>","4","0","4","",""
"5052437","1","5052743","","2011-02-19 17:45:19","1","3697","<p>I am using the code below to download and show image from server to my ImageView</p><pre><code>import java.io.IOException;import java.io.InputStream;import java.net.HttpURLConnection;import java.net.MalformedURLException;import java.net.URL;import java.util.HashMap;import java.util.Map;import java.util.Random;import android.app.Activity;import android.graphics.Bitmap;import android.graphics.BitmapFactory;import android.os.Bundle;import android.util.Log;import android.view.View;import android.widget.Button;import android.widget.EditText;import android.widget.ImageView;public class HTTPTest extends Activity {     ImageView imView;     String imageUrl=""http://11.0.6.23/"";     Random r= new Random();    /** Called when the activity is first created. */     @Override    public void onCreate(Bundle icicle) {        super.onCreate(icicle);        setContentView(R.layout.main);        Button bt3= (Button)findViewById(R.id.get_imagebt);        bt3.setOnClickListener(getImgListener);        imView = (ImageView)findViewById(R.id.imview);    }        View.OnClickListener getImgListener = new View.OnClickListener()    {          @Override          public void onClick(View view) {               // TODO Auto-generated method stub               //i tried to randomize the file download, in my server i put 4 files with name like                        //png0.png, png1.png, png2.png so different file is downloaded in button press               int i =r.nextInt(4);               downloadFile(imageUrl+""png""+i+"".png"");               Log.i(""im url"",imageUrl+""png""+i+"".png"");          }    };    Bitmap bmImg;    void downloadFile(String fileUrl){          URL myFileUrl =null;                    try {               myFileUrl= new URL(fileUrl);          } catch (MalformedURLException e) {               // TODO Auto-generated catch block               e.printStackTrace();          }          try {               HttpURLConnection conn= (HttpURLConnection)myFileUrl.openConnection();               conn.setDoInput(true);               conn.connect();               int length = conn.getContentLength();               InputStream is = conn.getInputStream();               bmImg = BitmapFactory.decodeStream(is);               imView.setImageBitmap(bmImg);          } catch (IOException e) {               // TODO Auto-generated catch block               e.printStackTrace();          }     }}</code></pre><p>This code works file for all format of images but when it comes to PNG it wont let the image transparent after download and displaying on ImageView.</p><p>Any idea?</p>","563735","","","","","2012-08-30 18:23:00","Image download code works for all image format, issues with PNG format rendering","<android><imageview><imagedownload>","1","0","1","",""
"5052462","1","","","2011-02-19 17:49:35","3","4318","<p>I've searched through Stackoverflow, looked at the examples in Android Developer, and some books and I'm just not getting it.</p><p>I'm trying to show an AlertDialog Box that interrupts the program flow.  Most of the examples I've seen don't have code after the dialog box and I need my program to stop executing until the AlertDialog button is pressed.  Seems as if the AlertDialog is created from another thread and I'm not sure how to retrieve that thread.</p><p>Program logic:  If the parsing is bad the program will force close.  I want to let the user know to restart the program and everything will work.  (I'm dropping and recreating tables and they are repopulated when the program starts back up)</p><p>Here's some code:</p><pre><code>if(database populated){  ....code.....  if(parseok.contentEquals(""Error""))  {    doForceClose();  }displayDate = ""Last: "" + parseok;  //I don't want the program to continue to here.//Rest of code in the method.  If I continue the program will Force Close}else  do something else</code></pre><p>Here's the AlertDialog method:</p><pre><code>private void doForceClose(){  String themessage = ""Because some of the parameters have changed in the yada yada"";   AlertDialog.Builder ad = new AlertDialog.Builder (this);  ad.setTitle(""Internal Error"");  ad.setMessage(themessage);  ad.setPositiveButton(""Sorry"", new OnClickListener()  {    public void onClick(DialogInterface dialog, int which)    {    finish();    return;    }  });  ad.create();  ad.show();        }</code></pre><p>except ad doesn't show and the program continues to its force close.</p><p>Obviously I'm not getting something.  Any ideas?</p><p>edit:  I am in a Class that extends Activity</p>","278350","","278350","","2011-02-19 18:03:28","2012-10-27 07:16:42","Android AlertDialog Box Not Showing","<android><alertdialog>","3","4","","",""
"5052508","1","5052584","","2011-02-19 17:59:28","0","148","<p>I am playing around and I am trying to make a Android find phone app like the onces in the market place.  if someone text my phone ""beep"" I want the phone to make a loud sound and if the phone is on silent i still want the sounds. I was thinking to use a alarm but the alarm does not make sound.  can someone give me some </p>","589450","","","","","2011-02-20 05:48:19","Android Find Phone App","<android>","2","0","","",""
"5052572","1","","","2011-02-19 18:09:20","0","1685","<p>I'm starting in android. I want to add a menu to my application</p><p>How can I do it.</p><p>Thank you in advance.</p>","616263","","","","","2011-02-19 18:13:58","add a menu to my application","<android>","1","1","3","",""
"5052626","1","","","2011-02-19 18:18:19","0","114","<p>I just need to parse the header part of the media in my android application and take some decision accordingly.</p><p>Is it possible to implement a media parser in android java?</p><p>Thanks in Advance</p>","606335","","","","","2011-02-19 18:18:19","Is it possible to implement a media parser in android java?","<android><android-video-player><android-parser>","0","2","","",""
"5052643","1","5052900","","2011-02-19 18:20:22","1","3337","<p>I'm using KSoap within my Android application.My application using Web Service for communicate with the server.I have found a code sample of a KSoap wev service client.In the sample, the client uses the following code for communication with the server -</p><pre><code>Request = new SoapObject(NAMESPACE, METHOD_NAME);</code></pre><p>How do I pass arguments to the server?<br>How do I invoke the return value form the server?</p>","341497","","759866","","2013-12-27 14:48:00","2013-12-27 14:48:00","Ksoap sending arguments and receiving results","<android><web-services><ksoap2>","1","0","","",""
"5052659","1","5052861","","2011-02-19 18:22:25","0","1643","<p>I am looking at source code for PackageManager class and it is abstract as well as all the methods. Are manufactures supposed to write a real implementation for it or I am missing something? </p><p>I am trying to understand how ResolveActivity method works...</p>","473725","","473725","","2011-02-20 05:12:08","2011-07-16 14:03:53","PackageManager class","<android><class><source>","2","0","","",""
"5052680","1","","","2011-02-19 18:25:44","4","2275","<p>I'm trying to put a particle system together in Android, using OpenGL. I want a few thousand particles, most of which will probably be offscreen at any given time. They're fairly simple particles visually, and my world is 2D, but they will be moving, changing colour (not size - they're 2x2), and I need to be able to add and remove then.</p><p>I currently have an array which I iterate through, handling velocity changes, managing lifecyling (killing old ones, adding new ones), and plotting them, using glDrawArrays. What OpenGl is pointing at, though, for this call, is a single vertex; I glTranslatex it to the relevant co-ords for each particle I want to plot, one at a time,  set the colour with glColor4x then glDrawArrays it. It works, but it's a bit slow and only works for a few hundred particles.  I'm handling the clipping myself.</p><p>I've written a system to support static particles which I have loaded into a vertex/colourarray and plot using glDrawArrays, but this approach only seems suitable for particles which will never change relative location (ie I move all of them using glTranslate), colour and where I don't need to add/remove particles.  A few tests on my phone (HTC Desire) suggest that trying to alter the contents of those arrays (which are ByteBuffers, pointed to by OpenGL) is extremely slow.  </p><p>Perhaps there's some way of manually writing the screen myself with the CPU. If I'm just plotting 1x1/2x2 dots on the screen, and I'm purely interested in writing and not doing any blending/antialiasing, is this an option? Would it be quicker than whatever OpenGl is doing?  </p><p>(200 or so particles on a 1ghz machine with megs of ram.  This is way slower than I was getting 20 years ago on a 7mhz machine with &lt;500k of ram! I appreciate I'm using Java here, but surely there must be a better solution.  Do I have to use the NDK to get the power of C++, or is what I'm after possible)</p>","146043","","146043","","2011-02-21 13:51:08","2011-02-21 13:51:08","Simple particle system on Android using OpenGL ES 1.0","<android><optimization><opengl-es><particles>","1","0","1","",""
"5052681","1","","","2011-02-19 18:25:49","0","824","<p>I am new in Android development, and I am trying to receive a HashMap in RESULT by using XMLRPC but every time it's crash the application, this is my code please advice me :</p><pre><code>  Object RESULT =  XMLRPCClient.callEx(methodname,new Object[] {params});         Map FRESULT= (Map) RESULT; </code></pre>","624605","","","","","2011-11-25 20:49:47","Use HashMap in XMLRPC result","<java><android><hashmap><xml-rpc>","2","3","1","",""
"5052686","1","","","2011-02-19 18:26:33","-4","1844","<p>I am a fresh engineering graduate in computer science.I am going to start my career.I am strong in     core java..I know the basics of android programming too.For a fresher to start career, which is best ,java or android?I am really looking for good compnsation.I am ready to study anything.So Which is better for me Android or java?. </p>","624606","","","","","2011-02-19 18:39:55","which is better choice for fresher android and java?","<java><android>","1","3","","2011-02-19 19:49:31",""
"5052711","1","5052732","","2011-02-19 18:31:26","0","586","<p>When I try to add a DatePicker to my layout, whenever the activity is launched, it crashes with a stack overflow.</p><p>This is the layout that crashes when displayed on the emulator (renders fine in eclipse):</p><p>                                                        </p><pre><code>        &lt;/LinearLayout&gt;        &lt;TableLayout android:layout_width=""fill_parent""            android:layout_height=""fill_parent"" android:stretchColumns=""1""            android:layout_below=""@+id/topLayout"" android:paddingBottom=""5dip""            android:layout_marginBottom=""50dip""&gt;            &lt;TableRow android:layout_weight=""1""&gt;                &lt;LinearLayout android:layout_width=""fill_parent""                    android:layout_height=""fill_parent"" android:layout_weight=""1""&gt;                    &lt;TextView android:layout_width=""wrap_content""                        android:text=""Date:"" android:layout_height=""fill_parent""                        android:gravity=""center_vertical""&gt;&lt;/TextView&gt;                &lt;/LinearLayout&gt;            &lt;/TableRow&gt;            &lt;TableRow android:layout_weight=""1""&gt;                &lt;LinearLayout android:layout_width=""fill_parent""                    android:layout_height=""fill_parent"" android:layout_weight=""1""&gt;                    &lt;DatePicker android:layout_height=""wrap_content""                        android:layout_width=""fill_parent"" android:id=""@+id/datePicker"" android:duplicateParentState=""true""&gt;&lt;/DatePicker&gt;                &lt;/LinearLayout&gt;            &lt;/TableRow&gt;        &lt;/TableLayout&gt;    &lt;/RelativeLayout&gt;    &lt;LinearLayout android:gravity=""bottom|right""        android:layout_height=""wrap_content"" android:layout_width=""fill_parent""        android:layout_below=""@+id/RelativeLayout01""&gt;        &lt;Button android:layout_width=""wrap_content"" android:gravity=""center""            android:layout_gravity=""left"" android:layout_height=""fill_parent""            android:id=""@+id/btnCancel"" android:layout_weight=""1"" android:text=""Cancel"" /&gt;        &lt;Button android:layout_width=""wrap_content""            android:layout_gravity=""right"" android:gravity=""center""            android:layout_weight=""1"" android:layout_height=""fill_parent""            android:id=""@+id/btnFinish"" android:text=""Finish"" /&gt;    &lt;/LinearLayout&gt;&lt;/RelativeLayout&gt;</code></pre><p></p><p>And it crashes with this stack trace:</p><pre><code>Thread [&lt;3&gt; main] (Suspended (exception StackOverflowError))        ViewRoot.draw(boolean) line: 1235       ViewRoot.performTraversals() line: 1030     ViewRoot.handleMessage(Message) line: 1482      ViewRoot(Handler).dispatchMessage(Message) line: 99     Looper.loop() line: 123     ActivityThread.main(String[]) line: 3948        Method.invokeNative(Object, Object[], Class, Class[], Class, int, boolean) line: not available [native method]      Method.invoke(Object, Object...) line: 521      ZygoteInit$MethodAndArgsCaller.run() line: 782      ZygoteInit.main(String[]) line: 540     NativeStart.main(String[]) line: not available [native method]  </code></pre><p>When I comment out the DatePicker, it doesn't crash.</p><p>How can I actually get the DatePicker to not crash this app?</p>","12243","","12243","","2011-02-19 18:47:27","2011-02-19 19:23:03","DatePicker in android layout causes a stackoverflow","<java><android>","2","1","","",""
"5052762","1","5054304","","2011-02-19 18:42:29","2","1106","<p>I'm creating my own mipmaps when creating textures, and as soon as I enable mipmaps via GL_LINEAR_MIPMAP_NEAREST (or anything MIPMAP), the textures are just a very dark, blurry mess. If I switch to GL_LINEAR, they're fine.</p><p>Here's how I'm creating the texture:</p><pre><code>glGenTextures(1, &amp;m_TextureId);glBindTexture( GL_TEXTURE_2D, id );int level = 0;jobject mippedBitmap = srcBitmap;while (width &gt;= 2 &amp;&amp; height &gt;= 2) {    jniEnv-&gt;CallStaticVoidMethod(s_GLUtilsClass, s_texImage2DMethodID,                     GL_TEXTURE_2D, level, mippedBitmap, 0);    width &gt;&gt;= 1;    height &gt;&gt;= 1;    level++;    mippedBitmap = createScaledBitmap(jniEnv, srcBitmap, width, height, true);}</code></pre><p>I've omitted all Bitmap.recycle()/NewGlobalRef() calls for brevity. <code>createScaledBitmap</code> is obviously a JNI call to Bitmap.createScaledBitmap().</p><p>I also tried the other version of texImage2D that takes the format and type of the bitmap. I've verified that it's always RGBA.</p><p>EDIT: To elaborate on the textures - they're really almost black. I tried eraseColor() on the mips with bright colors, and they're still extremely dark.</p>","345717","","44729","","2011-02-20 04:08:49","2011-02-20 04:08:49","Using mipmaps results in garbage textures","<android><opengl-es><mipmaps>","3","2","","",""
"5052835","1","","","2011-02-19 18:54:52","0","452","<p>I'm doing a project where I want to invoke the Android calender and also set an alarm. The user enters the date and time in the application itself. Is there any way we can pass this date and time to the calendar application while opening it?</p>","624625","","29995","","2011-05-24 12:38:14","2011-05-24 12:38:14","Passing a date to the calendar application when the application starts","<android><calendar><alarm>","1","1","","",""
"5052845","1","5053944","","2011-02-19 18:57:25","1","806","<p>I have created Live Wallpaper app. When I start this via Wallpapers -> Live Wallpapers -> Settings and then Set wallpaper it works, but if I reboot the phone the drawing is just black color. </p><p>What's the way to optimize it? I want it to be as if I set it in the Walllpaper settings, but when the phone is booting up.</p><p>Any ideas? Just comment if there's any <strong>specific</strong> code you want to see.</p><p>Thanks!</p>","386562","","19750","","2011-03-31 15:36:39","2011-03-31 15:36:39","Live Wallpaper startup problem","<android><live-wallpaper>","2","2","","",""
"5052911","1","5052969","","2011-02-19 19:08:24","1","2585","<p>HiI am reading XML from web and displaying them in a listview. The xml contain an image location so I am displaying the image as well along with text. The image size is 48*48 px as suggested <a href=""http://developer.android.com/guide/practices/ui_guidelines/icon_design_list.html"" rel=""nofollow"">here</a>. But when I see the list view in actual device, the image looks very small. Any idea about how to make that image a little bit big?? is there any standard image and text size??This is my layout:-</p><pre><code>&lt;ImageView    android:id=""@+id/logo""    android:layout_gravity=""left""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""     /&gt;&lt;TextView   android:id=""@+id/name""  android:textSize=""16sp""   android:textStyle=""bold""   android:textColor=""#2B2B2B""   android:layout_width=""wrap_content""   android:layout_height=""wrap_content""  android:paddingLeft=""5dp""  android:layout_toRightOf=""@id/logo""</code></pre><p>/></p>","574308","","","","","2011-02-19 19:39:42","standard text and image size in android listview","<android><listview><android-layout>","4","0","","",""
"5052913","1","","","2011-02-19 19:08:30","1","758","<p>I want to change the font of preview layout in virtual keyboard.<br>I created a class that extends TextView and in constructor:</p><pre><code>Typeface mFont = Typeface.createFromAsset(mContext.getAssets(), ""fonts/MyFont.ttf"");this.setTypeface(mFont);</code></pre><p>and created a layout:</p><pre><code>&lt;com.example.android.softkeyboard.KeyPreviewTextView ...android:background=""@drawable/keyboard_key_feedback"" /&gt;</code></pre><p>and set the layout:</p><pre><code>android:keyPreviewLayout=""@layout/keyboard_key_preview""</code></pre><p>but I see no change in font<br>can you help me?</p>","456582","","456582","","2011-02-22 16:11:33","2011-02-22 16:11:33","How to change font of keyPreviewLayout in android virtual keyboard","<android><fonts><keyboard>","0","2","1","",""
"5053068","1","8053326","","2011-02-19 19:39:21","1","834","<p>I've spent several days trying to figure out what is wrong with my android phone's wifi at school. The school wifi is 802.1x EAP using PEAP..requires username, password.</p><p>I've had two Android phones, and have run many different ROMs on them so I know this isn't just a ROM specific problem. I'm currently running 2.2.1 on a Mytouch 3g fender ed. I don't have a data plan with my phone so I keep data off. I only use wifi.</p><p>The problem I have is that after I connect to the wifi, everything is fine for a while, but soon (perhaps 15 minutes to an hour later), I'll turn my phone on and when I see the wifi connection, it says Authenticating and it stays stuck there till I reset it. If I try to surf the Internet with normal HTTP it works fine, but if I try to run any apps that require wifi connection, they give an error saying there is a network connection (example would be Google Voice search which will say ""Connection Problem""). Feeds can't update, gmail won't update, etc. After I reset the connection, the wifi works perfectly again. I am not sure why this happens. I think it has something to do with how the school's wifi is set up.</p><p>To make a quick fix to the problem however, I'm writing an app that will test if the connection is authenticating and reassociate the connection if it is. I'm running into problems though.</p><p>Here is the code to see if the wifi is authenticating and also some debug output:</p><pre><code>private void checkWifi() {    WifiManager wifi = (WifiManager) getSystemService(Context.WIFI_SERVICE);    WifiInfo info = wifi.getConnectionInfo();    SupplicantState state = info.getSupplicantState();    Log.d(getClass().getSimpleName(), state.toString());    NetworkInfo.DetailedState state2 = WifiInfo.getDetailedStateOf(info.getSupplicantState());    Log.d(getClass().getSimpleName(), state2.toString());}</code></pre><p>And here's the log output:</p><pre><code>D/WifiCheckerService(24732): COMPLETEDD/WifiCheckerService(24732): OBTAINING_IPADDR</code></pre><p>The log output is the same no matter if the wifi on the phone says Connected or Authenticating which means my program as of now cannot distinguish if it is in the funky ""authentication"" state or not. I need to be able to distinguish in order to be able to know when to reset the wifi. Any help is greatly appreciated.</p>","218013","","218013","","2011-02-24 00:27:31","2011-11-08 16:00:38","Android authentication gets in deadlock when using EAP with PEAP","<android><authentication><android-wifi>","1","0","0","",""
"5053204","1","5053228","","2011-02-19 20:05:21","2","2308","<p>I have a service for my application that runs fine, but when a user is not using there phone for while like 20 minutes the service just doesnt work any more. is there something i suppose to be doing like saving a state or something, i am lost at this point. I dont see why the service doest keep running, I look in the application>running services on my phone and it still says its running. Any suggestions?</p>","516883","","","","","2013-06-01 07:00:47","android service stops working after application is not in use for awhile","<android><service>","3","0","1","",""
"5053222","1","5079054","","2011-02-19 20:09:05","1","772","<p>I'm trying to find out what is the right method of enabling plugins or extensions for my android application. As with any other plug-able application I want:1) list of installed plugins2) ability to call methods (which may or may not have UI) implemented in plugins</p><p>Goal is to isolate functionality which is not essential.</p><p>Ondra</p>","624678","","","","","2011-02-22 13:56:57","plugins for my android app","<android><plugins>","2","0","","",""
"5053250","1","5053359","","2011-02-19 20:16:48","1","582","<p>The accounts of Android Market, that are linked with the Google Checkout system, have all the syntax as xyz@gmail.com? Are all of them with the last characters with ""@gmail.com""? Or also as ""@googlemail.com"" or other?</p>","489146","","","","","2011-02-19 20:38:35","Android market accounts: are they, all, *@gmail.com?","<android><gmail><account>","4","2","","",""
"5053252","1","5053305","","2011-02-19 20:18:10","3","15129","<p>I wrote an app that reads and writes a couple of data files.    When I call the method <em>getFilesDir()</em> it returns <strong>/data/data/nel.prog.MyApp99/files</strong> (assuming my app is called MyApp99).</p><p>So how do I see that on my PC?   </p><p>When I attach my phone as a debugging target to my (XP) PC I get 2 external drives created -  one for the phone itself and one for the SD card, and I can't find that path in either one!   In XP I set my ""Folder options"" to <strong>show</strong> hidden files and folders and to <strong>not hide</strong> protected operating system files.  I can see a lot of stuff (i.e., lots of files and folders on both the phone and SD card).   But I don't see the above path nor the data files themselves. </p><p>Where are they and how do I access them?    Thanks in advance!   </p>","424690","","","","","2012-11-02 17:32:22","Where are my Android app's data files?","<android>","2","0","","",""
"5053371","1","5053453","","2011-02-19 20:39:35","0","369","<p>I have an inner class that is instantiated inside of a async callback. I would like a display a dialog when the callback completes, so I pass a handler to the inner class when the async operation is called, however, I'm getting:</p><pre><code> 02-19 15:33:49.152: ERROR/AndroidRuntime(635): Uncaught handler: thread main exiting due to uncaught exception    02-19 15:33:49.272: ERROR/AndroidRuntime(635): android.view.WindowManager$BadTokenException: Unable to add window -- token android.os.BinderProxy@4322fef0 is not valid; is your activity running?    02-19 15:33:49.272: ERROR/AndroidRuntime(635):     at android.view.ViewRoot.setView(ViewRoot.java:456)    02-19 15:33:49.272: ERROR/AndroidRuntime(635):     at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:177)    02-19 15:33:49.272: ERROR/AndroidRuntime(635):     at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:91)    02-19 15:33:49.272: ERROR/AndroidRuntime(635):     at android.view.Window$LocalWindowManager.addView(Window.java:409)    02-19 15:33:49.272: ERROR/AndroidRuntime(635):     at android.app.Dialog.show(Dialog.java:238)</code></pre>","420259","","","","","2011-02-19 20:52:30","Dialog won't show. UI Threading issue","<android>","1","2","","",""
"5053505","1","","","2011-02-19 21:01:13","3","3695","<p>I have some code I want to execute at 3:00am every day. I've read the <a href=""http://developer.android.com/reference/android/app/Service.html"" rel=""nofollow"">Service Class Documentation</a> and it seems I can use AlarmManager to fire an intent(Activity or Service, I think?), and then, in that intent create and post a message in the Android Notification area.</p><pre><code>Calendar threeAM = Calendar.getInstance();threeAM.set(Calendar.HOUR_OF_DAY,2);threeAM.set(Calendar.MINUTE,0);threeAM.set(Calendar.SECOND,0);threeAM.set(Calendar.MILLISECOND,0);AlarmManager alarmManager =         (AlarmManager)context.getSystemService(Context.ALARM_SERVICE);Intent i = new Intent(context, myNotifier.class);alarmManager.setRepeating(AlarmManager.RTC_WAKEUP, threeAM.getTimeInMillis(),        AlarmManager.INTERVAL_DAY, PendingIntent.getService(context, 1, i , 0));Log.i(""Service TEST"", ""Alarm set?"" );</code></pre><p>It runs through the code with no problems, but there is no indication that the alarm is set, and the activity doesn't start. I'm using an activity that I know works. I tried wrapping it in a try/catch, nothing in logcat...</p><p>Any help would be appreciated!! :)</p>","462307","","281545","","2013-03-16 23:42:00","2013-03-16 23:42:00","Using Alarm Manager to Start a Service","<android><alarmmanager>","2","0","2","",""
"5053507","1","","","2011-02-19 21:01:31","2","9700","<p>I just published an update to my app in the market.  I then tried to bring it up on the market on my Nexus One running 2.2.2.  I could not find it in the market on the phone.  I went to the web market, found it, but install was disabled saying ""this item is not compatible with your device"".  Below is my manifest - I can't see anything that would prevent it from working on my Nexus One.  Makes me think it is not showing for others also.  Can anyone else install (or see if it is able to be seen) ""Occupied for Kids"" or ""Occupied for Kids (Demo)"".  You can try the Demo version easily enough because it is free.  Both exhibit the 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.ecg.occupiedDemo""      android:versionCode=""15""      android:versionName=""2.01""      android:installLocation=""auto"" &gt;    &lt;supports-screens        android:smallScreens=""false""        android:normalScreens=""true""         android:largeScreens=""true""         android:anyDensity=""true""    /&gt;    &lt;uses-configuration android:reqTouchScreen=""finger""&gt;&lt;/uses-configuration&gt;    &lt;uses-permission android:name=""android.permission.INTERNET"" /&gt;    &lt;application android:icon=""@drawable/button_launchdemo"" android:label=""@string/app_name""&gt;        *&lt;Activity List Here&gt;*    &lt;/application&gt;    &lt;uses-sdk android:minSdkVersion=""7"" android:targetSdkVersion=""7"" /&gt;&lt;/manifest&gt; </code></pre>","336681","","","","","2012-10-20 00:27:24","My Android App shows as ""this item is not compatible with your device""","<android><google-play>","3","2","2","",""
"5053523","1","5106991","","2011-02-19 21:05:57","0","1572","<p>I'm building an application which relies on the Google Maps API, but running into some problems when I subclass MapView. The reason I'm trying to subclass MapView is that I want to detect and use double taps and long presses on the map to perform some functions. I've subclassed both MapActivity and MapView as I did in another application, where this seems to be working properly, but I can't seem to get it to work in this new application as I keep getting an exception when the application runs:</p><p>Exception data: android.view.InflateException: Binary XML file line #6: Error inflating class java.lang.reflect.Constructor</p><p>My MapView subclass is fairly simple:</p><pre><code>import android.content.Context;import android.util.AttributeSet;import android.view.GestureDetector;import android.view.MotionEvent;import android.view.GestureDetector.OnDoubleTapListener;import android.view.GestureDetector.OnGestureListener;import com.google.android.maps.MapView;public class TSMapView extends MapView {    private Context TSctx;    private GestureDetector gDetector;    public TSMapView(Context context, AttributeSet attrs) {        super(context, attrs);        this.TSctx = context;        this.gDetector = new GestureDetector((OnGestureListener) TSctx);        this.gDetector.setOnDoubleTapListener((OnDoubleTapListener)TSctx);        this.gDetector.setIsLongpressEnabled(false);    }    public boolean onTouchEvent(MotionEvent ev) {            if(this.gDetector.onTouchEvent(ev))               return true;            else              return super.onTouchEvent(ev);          }}</code></pre><p>As is the XML layout for my MapActivity which instantiates it:</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;com.badlucksoft.thisspot.TSMapView android:id=""@+id/tsmapview"" android:layout_width=""fill_parent"" android:layout_height=""fill_parent"" android:enabled=""true"" android:clickable=""true"" android:apiKey=""&lt;key&gt;"" /&gt;&lt;/RelativeLayout&gt;</code></pre><p>The odd thing is that if I replace my application's package/view name in the XML with default/normal ""com.google.android.maps.MapView"" my code seems to work just fine, but I can't detect double clicks or long presses. Comparing the code over and over again to the working application has left me with nothing but a headache. I imagine I'm doing something simple really wrong, but I can't figure out what at the moment. Here's the exception's stack trace if it matters, the MapActivity subclass is TSMapAct, and the primary activity is a TabHost subclass called ThisSpot:</p><pre><code>Exception data: android.view.InflateException: Binary XML file line #6: Error inflating class java.lang.reflect.ConstructorStack Trace 0: android.view.LayoutInflater.createView(LayoutInflater.java:512)Stack Trace 1: android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:564)Stack Trace 2: android.view.LayoutInflater.rInflate(LayoutInflater.java:617)Stack Trace 3: android.view.LayoutInflater.inflate(LayoutInflater.java:407)Stack Trace 4: android.view.LayoutInflater.inflate(LayoutInflater.java:320)Stack Trace 5: android.view.LayoutInflater.inflate(LayoutInflater.java:276)Stack Trace 6: com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:313)Stack Trace 7: android.app.Activity.setContentView(Activity.java:1620)Stack Trace 8: com.badlucksoft.thisspot.TSMapAct.onCreate(TSMapAct.java:43)Stack Trace 9: android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1123)Stack Trace 10: android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2364)Stack Trace 11: android.app.ActivityThread.startActivityNow(ActivityThread.java:2242)Stack Trace 12: android.app.LocalActivityManager.moveToState(LocalActivityManager.java:127)Stack Trace 13: android.app.LocalActivityManager.startActivity(LocalActivityManager.java:339)Stack Trace 14: android.widget.TabHost$IntentContentStrategy.getContentView(TabHost.java:631)Stack Trace 15: android.widget.TabHost.setCurrentTab(TabHost.java:317)Stack Trace 16: android.widget.TabHost.addTab(TabHost.java:210)Stack Trace 17: com.badlucksoft.thisspot.ThisSpot.onCreate(ThisSpot.java:35)Stack Trace 18: android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1123)Stack Trace 19: android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2364)Stack Trace 20: android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2417)Stack Trace 21: android.app.ActivityThread.access$2100(ActivityThread.java:116)Stack Trace 22: android.app.ActivityThread$H.handleMessage(ActivityThread.java:1794)Stack Trace 23: android.os.Handler.dispatchMessage(Handler.java:99)Stack Trace 24: android.os.Looper.loop(Looper.java:123)Stack Trace 25: android.app.ActivityThread.main(ActivityThread.java:4203)Stack Trace 26: java.lang.reflect.Method.invokeNative(Native Method)Stack Trace 27: java.lang.reflect.Method.invoke(Method.java:521)Stack Trace 28: com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)Stack Trace 29: com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)Stack Trace 30: dalvik.system.NativeStart.main(Native Method)</code></pre><p>Thank you for your time,Raymond</p>","624699","","180538","","2011-02-19 21:08:08","2011-02-24 15:51:28","Android/Google Maps API: Exception data: android.view.InflateException: Binary XML file line #6: Error inflating class java.lang.reflect.Constructor","<android><google-maps>","2","0","1","",""
"5053559","1","5053610","","2011-02-19 21:11:52","0","517","<p>I'm looking to extend the <a href=""http://developer.android.com/reference/android/os/StrictMode.html"" rel=""nofollow"">StrictMode API</a>, similar to what is suggested <a href=""http://stackoverflow.com/questions/4433629/detecting-forgotten-sqlite-transaction-on-android-using-strictmode"">in this StackOverflow question</a>.  I saw that the API was extended in Honeycomb to include a detectCustomSlowMethod() API, which sounds like it could handle some extension cases (although I'm not sure what it does because the documentation is copy-pasted from the disk methods).</p><p>However, I want to extend the API to include additional hardware access detection, which isn't possible with the API.  Therefore, my question is where can I find the code that implements the StrictMode API? </p>","428972","","","","","2011-02-22 05:54:19","Where is the Android StrictMode implemented?","<android><strictmode>","2","0","","",""
"5053622","1","5053643","","2011-02-19 21:23:23","0","932","<p>I want to get the date format like this feb 17,2011 18:13 in android...</p><p>Thanks.</p>","461972","","30618","","2011-02-19 21:26:17","2011-02-19 21:33:19","Dateformat in android","<java><android><date>","3","2","0","",""
"5053653","1","","","2011-02-19 21:28:46","0","784","<p>I've created a prototype for a 2d android game using the android canvas object.  Unfortunately, the performance is suffering greatly due to the large number of bitmaps that need to be redrawn frequently.</p><p>I'd like to migrate the drawing code to opengl, but I have no experience with it, and I'm having a difficult time getting the views configured properly.  I've tried a wide variety of methods, but I'm not sure if the view configurations were wrong, of if the drawing functions didn't match.</p><p>Since most of my touch events are based on the coordinates, I'd like to have the opengl canvas view's coordinate system match the touch event coordinate system if possible.  This would allow me to reuse a lot of code and avoid a lot of coordinate translation.</p><p>Can someone provide code or a link to code that would accomplish setting up a view and drawing a textured element?</p>","624745","","","","","2011-03-11 03:41:53","2D OpenGL Canvas Replacement","<java><android><opengl-es><2d>","1","0","","",""
"5053715","1","","","2011-02-19 21:39:50","0","4044","<p>I am trying to access the users' calendar and the only tutorial I have found so far is this one which seems to be quite old:<a href=""http://jimblackler.net/blog/?p=151"" rel=""nofollow"">http://jimblackler.net/blog/?p=151</a></p><p>Is there another tutorial I have missed ?</p><p>If I follow the tutorial, my program fails at this stage :</p><pre><code>final Cursor cursor = contentResolver.query(Uri.parse(""content://calendar/calendars""),                        (new String[] { ""_id"", ""displayName"", ""selected"" }), null, null, null);</code></pre><p>it says : </p><blockquote>  <p>02-19 22:34:10.475: ERROR/ActivityThread(6588): Failed to find provider info for calendar</p></blockquote><p>Can you guys help me .. I am not against reading documentation but I cannot find good one.</p><p>Swan</p>","624754","","","","","2012-11-15 06:52:08","Android calendar access","<android><calendar>","4","1","1","",""
"5053722","1","8657596","","2011-02-19 21:40:54","11","8322","<p>I am currently developing an application where I want to be able to have an option to allow the user to donate money for the app. Is there a particular way about doing this for android. I have tried looking at google but it mainly shows about paypal donation buttons for websites</p>","499448","","","","","2013-04-23 15:32:31","PayPal Donations on Android Apps","<android>","4","4","2","",""
"5053787","1","","","2011-02-19 21:56:06","6","1469","<p>I am trying to show a custom notification content on the status bar via Remote View.  I am using fill_parent for both width and height, but there is always a small gap on the right side.  What am I doing wrong here?</p><p>Please see the screen shot here: <a href=""http://img684.imageshack.us/img684/2347/devicenq.png"">http://img684.imageshack.us/img684/2347/devicenq.png</a></p><p>Layout code (I also used LinearLayout):</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=""@color/solid_yellow""              &gt;    &lt;ImageView android:id=""@+id/image""              android:layout_width=""wrap_content""              android:layout_height=""fill_parent""              android:layout_marginRight=""10dp""              android:src=""@drawable/stat_sample""              /&gt;    &lt;TextView android:id=""@+id/text""              android:layout_width=""wrap_content""              android:layout_height=""fill_parent""              android:textColor=""#000""              android:text=""Hello, this message is in a custom expanded view""              /&gt;&lt;/RelativeLayout&gt;</code></pre><p>And here is the code snippet:</p><pre><code>Intent notificationIntent = new Intent(this, MessengerService.class);PendingIntent contentIntent = PendingIntent.getActivity(    this, 0, notificationIntent, 0);Notification notification = new Notification(R.drawable.stat_sample,    ""Hello"", System.currentTimeMillis());RemoteViews contentView = new RemoteViews(getPackageName(),    R.layout.custom_notification_layout);notification.contentView   = contentView;notification.contentIntent = contentIntent;mNM.notify(R.string.remote_service_started, notification);</code></pre><p>I have been banging my head all day with this...Thank you.</p>","486927","","486927","","2011-02-19 22:26:59","2013-08-20 03:16:54","Android's custom status bar notification bug?","<android><notifications><statusbar>","1","3","2","",""
"5053788","1","5053830","","2011-02-19 21:56:09","15","31780","<p>I've just installed IntelliJ IDEA 10.0.0.2 Community edition<br>I've installed Android SDK ... (C:\Program Files\Android\android-sdk-windows)  </p><p>I want to make a new android project, so I a create a new project, select Android Module, next , next...</p><p>Then when i need to choose the JDK, I go to the android folder, and when i try to choose it, I get this error:</p><blockquote>  <p>The selected directory is not a valid  home for JSDK</p></blockquote><p>What am I doing wrong ? what can i do to fix this ?</p><p>I Installed android SDK with all the updates<br>When I choose <strong>IntelliJ IDEA Plugin SDK</strong> i get:</p><blockquote>  <p>The selected directory is not a valid  home for IntelliJ IDEA Plugin SDK</p></blockquote><p><strong>EDIT:</strong> </p><p>Still not solved...<br>I've already chose the SDK itself and chose android 2.2 Platform when creating the project.  </p><p>Can't load the JDK files. So i won't me compile, i get this error</p><blockquote>  <p>Cannot start compiler: the SDK is not  specified for module ""blah"".  Specify the SDK at Project Structure  dialog.</p></blockquote>","536086","","536086","","2011-02-20 11:00:55","2013-07-12 05:29:53","IntelliJ IDEA - Android JDK doesn't work","<android><intellij-idea>","13","0","4","",""
"5053848","1","5055751","","2011-02-19 22:08:56","0","978","<p>I am trying to create Custom Cursor adapter and attach it to my listview. </p><p>Though I am not yet there to create textboxes and set values inside my adapter, my code currently throws a runtime exception when I try to call super(ctx, c);</p><p>What could be wrong? Searched all over the web &amp; couldn't get it. Thanks in advance!</p><p>Custom Cursor adapter:</p><pre><code>public class CustomCursorAdaptor extends CursorAdapter {    private Context context;    private int layout;    public CustomCursorAdaptor (Context ctx, int layout, Cursor c, String[] from, int[] to) {        super(ctx,  c);        this.context = ctx;        this.layout = layout;    }    public View newView(Context context, Cursor cursor, ViewGroup parent) {        return(new View(context));    }    @Override    public void bindView(View v, Context context, Cursor c) {        }}</code></pre><p>and my Activity:</p><pre><code>public class DynamicScrollView extends Activity {     @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        Context ctx=getBaseContext();        RelativeLayout newLayout=new RelativeLayout(ctx);        ListView lv=new ListView(ctx);    SQLiteDatabase db;        db = ctx.openOrCreateDatabase(""TShow.db"", SQLiteDatabase.OPEN_READONLY, null);        db.setVersion(1);        db.setLocale(Locale.getDefault());        db.setLockingEnabled(true);        Cursor cur = db.query(""control"", new String[] {""id""}, ""parent_id=2"", null, null, null, null);        CustomCursorAdaptor adapter = new CustomCursorAdaptor(ctx, lv.getId(), cur, new String[] {""id""}, new int[] {2});        lv.setAdapter(adapter);         newLayout.addView(lv);         setContentView(newLayout);         }}</code></pre>","556816","","135152","","2011-05-25 02:56:03","2011-05-26 09:10:34","Android ListView (not ListActivity) connecting to SQLite DB using CustomCursorAdapter","<android><sqlite><android-listview>","3","0","0","",""
"5053865","1","","","2011-02-19 22:11:11","0","4689","<p>I'm trying to overlay a semi-transparent text box over a photo for description. Tapping on the screen should make it slide up/down. It should also contain a rating bar in the bottom.</p><p>Much like in Google Goggles <a href=""http://blogote.com/wp-content/uploads/2010/10/GoogleGoggles1.jpg"" rel=""nofollow"">http://blogote.com/wp-content/uploads/2010/10/GoogleGoggles1.jpg</a></p><p>How would you do it? This is what I have so far:</p><pre><code>&lt;FrameLayout     android:id=""@+id/mainlayout""     android:layout_height=""match_parent""     android:layout_width=""match_parent""     android:orientation=""vertical""     android:foregroundGravity=""bottom""    xmlns:android=""http://schemas.android.com/apk/res/android""&gt;&lt;ImageView    android:id=""@+id/imgview""     android:layout_width=""match_parent""    android:layout_height=""match_parent"" /&gt;&lt;TextView     android:layout_height=""wrap_content""     android:layout_width=""match_parent""     android:text=""@string/hello""/&gt;&lt;/FrameLayout&gt;</code></pre>","338825","","338825","","2011-02-19 23:53:46","2012-04-13 19:02:59","Semi-transparent text box over photo","<android><textview><photo><google-goggles>","2","0","1","",""
"5053870","1","5053934","","2011-02-19 22:11:48","2","4227","<p>I'm trying to add a <code>CheckBox</code> to every item in my <code>ListView</code>. I can't put a <code>CheckBox</code> widget in the <code>ListView</code>, so how do I do it? I think the Android settings has something like this.</p>","560096","","","","","2012-03-19 20:57:49","Add Checkbox to ListView Item in Android","<android><listview><checkbox>","2","0","","",""
"5053887","1","5071538","","2011-02-19 22:15:31","0","1585","<p>I'm looking at <a href=""http://stackoverflow.com/questions/2972845/i-want-send-image-through-using-mms-in-android/2973016#2973016"">the code posted here</a> for sending MMS through an Android Application, and I'm very close.  I have successfully sent an MMS while the Wifi connection is NOT enabled.  But when it comes time to use the <code>httpConnection</code> in never connections when Wifi is enabled.  I've read several posts saying to use</p><pre><code>ConnectivityManager.requestRouteToHost(ConnectivityManager.TYPE_MOBILE_MMS,APNBACKENDIP);</code></pre><p>And that function returns <code>true</code> meaning that it should route traffic over the <code>TYPE_MOBILE_MMS</code> interface, but it always times out.  Can anyone point me in the right direction?  Also I tried using <code>TYPE_MOBILE</code> instead of <code>TYPE_MOBILE_MMS</code> and the function returns false instead.</p>","624470","","56338","","2011-02-19 22:20:20","2011-08-17 16:08:57","Sending MMS Through Android Code","<android><mms><apn>","1","0","0","",""
"5053928","1","5054078","","2011-02-19 22:24:20","0","291","<p>I've copied the soft keyboard .java files into my project. I've got the keyboard to pop up in my view, but something tells me that i don't need the keyboard src files directly in my project unless I want to change the keyboard. I've commented out some of these files and the keyboard still pops up. do you just use the keyboard like any other class that ships with android. </p><pre><code>public void record() {            int frequency = 44100;            int channelConfiguration = AudioFormat.CHANNEL_CONFIGURATION_MONO;            int audioEncoding = AudioFormat.ENCODING_PCM_16BIT;            File file = new File(Environment.getExternalStorageDirectory().getAbsolutePath() + ""/reverseme.pcm"");        // Delete any previous recording.        if (file.exists())        file.delete();        // Create the new file.        try {        file.createNewFile();        } catch (Exception e) {        throw new IllegalStateException(""Failed to create "" + file.toString());        }        try {        // Create a DataOuputStream to write the audio data into the saved file.        os = new FileOutputStream(file);        bos = new BufferedOutputStream(os);        dos = new DataOutputStream(bos);        // Create a new AudioRecord object to record the audio.        //int bufferSize = AudioRecord.getMinBufferSize(frequency, channelConfiguration, audioEncoding);        int bufferSize = AudioRecord.getMinBufferSize(sampleRate, channelConfiguration, audioEncoding);        audioRecord = new AudioRecord(MediaRecorder.AudioSource.MIC,        frequency, channelConfiguration,        audioEncoding, bufferSize);        short[] buffer = new short[bufferSize];        audioRecord.startRecording();        while (isRecording) {        int bufferReadResult = audioRecord.read(buffer, 0, bufferSize);        for (int i = 0; i &lt; bufferReadResult; i++)        dos.writeShort(buffer[i]);        }        } catch (Exception e) {        Log.e(""AudioRecord"",""Recording Failed"");        e.printStackTrace();        }        InputMethodManager im = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);        im.showSoftInput(this.findViewById(R.id.editText1), InputMethodManager.SHOW_FORCED);        }</code></pre>","532462","","68805","","2011-02-20 01:24:39","2011-02-20 01:24:39","Do i need the soft keyboard .java files in project?","<android>","1","0","","",""
"5053953","1","5054016","","2011-02-19 22:28:15","4","926","<p>This may be an easy question, but I'm stuck.  I am trying to implement the ""shake to erase"" feature in a drawing program (simple paint app). I can't get it to work. Here's my code:</p><pre><code>private final SensorEventListener mSensorListener = new SensorEventListener() {        public void onSensorChanged(SensorEvent se) {          float x = se.values[0];          float y = se.values[1];          float z = se.values[2];          mAccelLast = mAccelCurrent;          mAccelCurrent = (float) Math.sqrt((double) (x*x + y*y + z*z));          float delta = mAccelCurrent - mAccelLast;          mAccel = mAccel * 0.9f + delta; // perform low-cut filter          if (mAccel &gt; 2) {                  mView.onDraw(mCanvas);              mCanvas.drawBitmap(cache, 0, 0, new Paint(Paint.DITHER_FLAG));          }        }        public void onAccuracyChanged(Sensor sensor, int accuracy) {        }      };</code></pre><p>The SensorEventListener is based off of <a href=""http://stackoverflow.com/questions/2317428/android-i-want-to-shake-it"">this example</a>. I make it into the if statement, but the canvas won't reset until <em>after</em> I've touched the screen (a new touch event). </p><p>I'd like the canvas to reset/erase during the shake event, without any further prompts from the user necessary.</p><p>Any help would be wonderful, thank you! </p>","597368","","","","","2011-02-19 22:44:30","Android - How to ""shake to erase""?","<android><canvas><paint><shake>","1","0","1","",""
"5054018","1","5054046","","2011-02-19 22:41:28","1","2629","<p>I want to have a <code>Button</code> that when clicked, removes all the checked items in the <code>ListView</code>. I already have all the xml items set up, I just don't know how to write the java code.</p>","560096","","","","","2011-02-20 09:36:39","How to delete checked items in a ListView","<android><listview><button><checkbox>","2","0","","",""
"5054047","1","5054802","","2011-02-19 22:50:54","0","603","<p>Is the ChildBrowser plugin for Android supposed to work on the emulator? cuz I think I have everything setup as <a href=""https://github.com/phonegap/phonegap-plugins/blob/master/Android/ChildBrowser/README.md"" rel=""nofollow"">explained here</a> but I dont have a real device to test it out. When running the app it doesnt trigger it after clicking the button. Ive put some console stuff there and is in fact reaching that point to run the script: window.plugins.childBrowser.showWebPage(url, true););</p><p>The iPhone version of the plugin runs beautifully.</p><p>btw, Im using the latest version of both phonegap: 0.9.4 and the ChildBrowser plugin. Thanks.</p>","304655","","","","","2011-04-20 07:36:41","Is the ChildBrowser plugin for Android supposed to run on the emulator?","<android><plugins><android-emulator><phonegap>","2","0","","",""
"5054076","1","","","2011-02-19 22:59:00","4","19638","<p>I've written a thread using <code>java.net.SocketServer</code> to listen on a particular port. It works fine in the android simulator (using port forwarding). I'm planning to connect over wifi to this port when the app is being used. However, the <code>SocketServer</code> documentation says that if you don't supply an <code>InetAddress</code>, the server listens on localhost.</p><p>Am I correct that if I do not supply the address, I will not be able to get a connection over wifi? How can I get the <code>InetAddress</code> of the wifi connection to pass to the <code>SocketServer</code>?</p>","351771","","","","","2011-02-19 23:21:50","How to write an Android SocketServer to listen on wifi","<android><sockets><wifi>","1","0","12","",""
"5054113","1","5179149","","2011-02-19 23:07:16","2","6639","<p>I'm trying out the new  class in android Honeycomb preview, and I've got a small issue. I am making a baseball scoring app, and I want the buttons on the left (Action Menu) to switch the ""Action Pane"" on the right, which I've set up as a fragment.</p><p>I'd like the buttons' onClickListener() to call a Fragment Transaction to swap it out. So far it works, EXCEPT that when the app loads, it creates the default fragment, but when I hit a button, instead of REPLACING the default fragment, it creates a whole new one next to it.</p><p>I've looked for hours, and I can't see what I'm doing wrong...</p><p>Keep in mind I'm new to java/android/programming, so I might be missing something that's painfully obvious.</p><h2>hc_test.java (main activity)</h2><pre><code>package com.pte.hc_test;import android.app.Activity;import android.app.Fragment;import android.app.FragmentTransaction;import android.os.Bundle;import android.view.View;import android.widget.Button;public class hc_test extends Activity {    /** Called when the activity is first created. */    /* declare class-level variables *///  private LinearLayout touchPad;//  private TextView touchCoordText;    private Button pitchButton;    private Button hitButton;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        pitchButton = (Button)findViewById(R.id.actionButton1);        hitButton = (Button)findViewById(R.id.actionButton2);        pitchButton.setOnClickListener(new View.OnClickListener() {            @Override            public void onClick(View v) {                swapFragment(actionType.PITCH_ACTION);            }        });        hitButton.setOnClickListener(new View.OnClickListener() {            @Override            public void onClick(View v) {                swapFragment(actionType.HIT_ACTION);            }        });    }    private void swapFragment(int myType){        Fragment f = new actionFragment(myType);        // Execute a transaction, replacing any existing        // fragment with this one inside the frame.        FragmentTransaction ft = getFragmentManager().beginTransaction();        ft.replace(R.id.actionFragment, f);        ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN);        ft.addToBackStack(null);        ft.commit();    }}</code></pre><h2>main.xml</h2><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;!-- this is the parent layout of the whole screen --&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=""#2F2F4F""    &gt;    &lt;!-- SCOREBOARD MASTER LAYOUT --&gt;    &lt;LinearLayout        android:orientation=""horizontal""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        &gt;        &lt;!-- team name placeholders --&gt;        &lt;LinearLayout            android:orientation=""vertical""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:layout_weight=""0""            android:padding=""5dp""            &gt;            &lt;TextView style=""@style/inningLabel""                android:text=""TEAM""                android:layout_width=""wrap_content""                android:layout_height=""wrap_content""                /&gt;            &lt;TextView style=""@style/inningValue""                android:text=""@string/visitor""                android:layout_width=""wrap_content""                android:layout_height=""wrap_content""                /&gt;            &lt;TextView style=""@style/inningValue""                android:text=""@string/home""                android:layout_width=""wrap_content""                android:layout_height=""wrap_content""                /&gt;        &lt;/LinearLayout&gt;        &lt;!-- end team names --&gt;        &lt;!-- Inning table --&gt;        &lt;HorizontalScrollView            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""            android:layout_weight=""1""            android:fadingEdge=""vertical""&gt;            &lt;TableLayout                android:id = ""@+id/innings""                android:layout_width=""wrap_content""                android:layout_height=""wrap_content""                android:padding=""5dp""                &gt;                &lt;!-- inning label row --&gt;                &lt;!-- get these done with code?? --&gt;                &lt;TableRow android:layout_height=""wrap_content""&gt;                    &lt;TextView style=""@style/inningLabel""                        android:id=""@+id/inn1_label""                        android:text=""1""                        android:layout_height=""wrap_content""                        /&gt;                    &lt;TextView style=""@style/inningLabel""                        android:id=""@+id/inn2_label""                        android:text=""2""                        android:layout_height=""wrap_content""                        /&gt;                    &lt;TextView style=""@style/inningLabel""                        android:id=""@+id/inn3_label""                        android:text=""3""                        android:layout_height=""wrap_content""                        /&gt;                    &lt;TextView style=""@style/inningLabel""                        android:id=""@+id/inn4_label""                        android:text=""4""                        android:layout_height=""wrap_content""                        /&gt;                    &lt;TextView style=""@style/inningLabel""                        android:id=""@+id/inn5_label""                        android:text=""5""                        android:layout_height=""wrap_content""                        /&gt;                    &lt;TextView style=""@style/inningLabel""                        android:id=""@+id/inn6_label""                        android:text=""6""                        android:layout_height=""wrap_content""                        /&gt;                    &lt;TextView style=""@style/inningLabel""                        android:id=""@+id/inn7_label""                        android:text=""7""                        android:layout_height=""wrap_content""                        /&gt;                    &lt;TextView style=""@style/inningLabel""                        android:id=""@+id/inn8_label""                        android:text=""8""                        android:layout_height=""wrap_content""                        /&gt;                    &lt;TextView style=""@style/inningLabel""                        android:id=""@+id/inn9_label""                        android:text=""9""                        android:layout_height=""wrap_content""                        /&gt;                &lt;/TableRow&gt;                &lt;!-- end inning labels --&gt;                &lt;!-- top inning row --&gt;                &lt;TableRow android:layout_height=""wrap_content""&gt;                    &lt;TextView style=""@style/inningValue""                        android:id=""@+id/top1_label""                        android:text=""0""                        android:layout_height=""wrap_content""                        /&gt;                    &lt;TextView style=""@style/inningValue""                        android:id=""@+id/top2_label""                        android:text=""0""                        android:layout_height=""wrap_content""                        /&gt;                    &lt;TextView style=""@style/inningValue""                        android:id=""@+id/top3_label""                        android:text=""0""                        android:layout_height=""wrap_content""                        /&gt;                    &lt;TextView style=""@style/inningValue""                        android:id=""@+id/top4_label""                        android:text=""0""                        android:layout_height=""wrap_content""                        /&gt;                    &lt;TextView style=""@style/inningValue""                        android:id=""@+id/top5_label""                        android:text=""0""                        android:layout_height=""wrap_content""                        /&gt;                    &lt;TextView style=""@style/inningValue""                        android:id=""@+id/top6_label""                        android:text=""0""                        android:layout_height=""wrap_content""                        /&gt;                    &lt;TextView style=""@style/inningValue""                        android:id=""@+id/top7_label""                        android:text=""0""                        android:layout_height=""wrap_content""                        /&gt;                    &lt;TextView style=""@style/inningValue""                        android:id=""@+id/top8_label""                        android:text=""0""                        android:layout_height=""wrap_content""                        /&gt;                    &lt;TextView style=""@style/inningValue""                        android:id=""@+id/top9_label""                        android:text=""0""                        android:layout_height=""wrap_content""                        /&gt;                &lt;/TableRow&gt;                &lt;!-- end top inning row --&gt;                &lt;!-- bottom inning row --&gt;                &lt;TableRow android:layout_height=""wrap_content""&gt;                    &lt;TextView style=""@style/inningValue""                        android:id=""@+id/bot1_label""                        android:text=""0""                        android:layout_height=""wrap_content""                        /&gt;                    &lt;TextView style=""@style/inningValue""                        android:id=""@+id/bot2_label""                        android:text=""0""                        android:layout_height=""wrap_content""                        /&gt;                    &lt;TextView style=""@style/inningValue""                        android:id=""@+id/bot3_label""                        android:text=""0""                        android:layout_height=""wrap_content""                        /&gt;                    &lt;TextView style=""@style/inningValue""                        android:id=""@+id/bot4_label""                        android:text=""0""                        android:layout_height=""wrap_content""                        /&gt;                    &lt;TextView style=""@style/inningValue""                        android:id=""@+id/bot5_label""                        android:text=""0""                        android:layout_height=""wrap_content""                        /&gt;                    &lt;TextView style=""@style/inningValue""                        android:id=""@+id/bot6_label""                        android:text=""0""                        android:layout_height=""wrap_content""                        /&gt;                    &lt;TextView style=""@style/inningValue""                        android:id=""@+id/bot7_label""                        android:text=""0""                        android:layout_height=""wrap_content""                        /&gt;                    &lt;TextView style=""@style/inningValue""                        android:id=""@+id/bot8_label""                        android:text=""0""                        android:layout_height=""wrap_content""                        /&gt;                    &lt;TextView style=""@style/inningValue""                        android:id=""@+id/bot9_label""                        android:text=""0""                        android:layout_height=""wrap_content""                        /&gt;                &lt;/TableRow&gt;                &lt;!-- end bottom inning row --&gt;            &lt;/TableLayout&gt;        &lt;/HorizontalScrollView&gt;        &lt;!-- end inning table --&gt;        &lt;!-- Runs, Hits, Errors Count --&gt;        &lt;TableLayout            android:id = ""@+id/RHE""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:layout_weight=""0""            android:padding=""5dp""&gt;            &lt;TableRow android:layout_height=""wrap_content""&gt;                &lt;TextView style=""@style/inningLabel""                    android:id=""@+id/runLabel""                    android:text=""R""                    android:layout_height=""wrap_content""                    /&gt;                &lt;TextView style=""@style/inningLabel""                    android:id=""@+id/hitLabel""                    android:text=""H""                    android:layout_height=""wrap_content""                    /&gt;                &lt;TextView style=""@style/inningLabel""                    android:id=""@+id/errorLabel""                    android:text=""E""                    android:layout_height=""wrap_content""                    /&gt;            &lt;/TableRow&gt;            &lt;TableRow android:layout_height=""wrap_content""&gt;                &lt;TextView style=""@style/inningValue""                    android:id=""@+id/visitorRuns""                    android:text=""0""                    android:layout_height=""wrap_content""                    /&gt;                &lt;TextView style=""@style/inningValue""                    android:id=""@+id/visitorHits""                    android:text=""0""                    android:layout_height=""wrap_content""                    /&gt;                &lt;TextView style=""@style/inningValue""                    android:id=""@+id/visitorErrors""                    android:text=""0""                    android:layout_height=""wrap_content""                    /&gt;            &lt;/TableRow&gt;            &lt;TableRow android:layout_height=""wrap_content""&gt;                &lt;TextView style=""@style/inningValue""                    android:id=""@+id/homeRuns""                    android:text=""0""                    android:layout_height=""wrap_content""                    /&gt;                &lt;TextView style=""@style/inningValue""                    android:id=""@+id/homeHits""                    android:text=""0""                    android:layout_height=""wrap_content""                    /&gt;                &lt;TextView style=""@style/inningValue""                    android:id=""@+id/homeErrors""                    android:text=""0""                    android:layout_height=""wrap_content""                    /&gt;            &lt;/TableRow&gt;        &lt;/TableLayout&gt;    &lt;/LinearLayout&gt;    &lt;!-- END OF SCOREBOARD LAYOUT --&gt;    &lt;!-- MAIN ACTIVITY SECTION --&gt;    &lt;LinearLayout        android:orientation=""horizontal""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""&gt;        &lt;!-- ACTION MENU BEGIN --&gt;        &lt;LinearLayout            android:orientation=""vertical""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""            android:layout_weight=""1""&gt;            &lt;Button                android:id=""@+id/actionButton1""                android:text=""ActionButton1""                android:layout_width=""fill_parent""                android:layout_height=""wrap_content""                /&gt;            &lt;Button                android:id=""@+id/actionButton2""                android:text=""ActionButton2""                android:layout_width=""fill_parent""                android:layout_height=""wrap_content""                /&gt;            &lt;Button                android:id=""@+id/actionButton3""                android:text=""ActionButton3""                android:layout_width=""fill_parent""                android:layout_height=""wrap_content""                /&gt;            &lt;Button                android:id=""@+id/actionButton4""                android:text=""ActionButton4""                android:layout_width=""fill_parent""                android:layout_height=""wrap_content""                /&gt;            &lt;Button                android:id=""@+id/actionButton5""                android:text=""ActionButton5""                android:layout_width=""fill_parent""                android:layout_height=""wrap_content""                /&gt;        &lt;/LinearLayout&gt;        &lt;!-- ACTION MENU END --&gt;        &lt;!-- ACTION FRAME BEGIN --&gt;        &lt;fragment class=""com.pte.hc_test.actionFragment""            android:id=""@+id/actionFragment""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""            android:layout_weight=""1"" /&gt;        &lt;!-- ACTION FRAME END --&gt;    &lt;/LinearLayout&gt;    &lt;!-- MAIN ACTIVITY SECTION END --&gt;    &lt;!-- LIVE STATS FRAME BEGIN --&gt;    &lt;LinearLayout        android:orientation=""horizontal""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""&gt;        &lt;!-- left live stat pane --&gt;        &lt;LinearLayout            android:id=""@+id/left_stat_pane""            android:orientation=""vertical""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""            android:layout_weight=""1""            &gt;            &lt;TextView style=""@style/statHeader""                android:id=""@+id/left_playerName""                android:text=""{PITCHER NAME}""                android:layout_width=""wrap_content""                android:layout_height=""wrap_content""                /&gt;            &lt;TextView style=""@style/statText""                android:id=""@+id/left_stat1""                android:text=""Stat1""                android:layout_width=""wrap_content""                android:layout_height=""wrap_content""                /&gt;            &lt;TextView style=""@style/statText""                android:id=""@+id/left_stat2""                android:text=""Stat2""                android:layout_width=""wrap_content""                android:layout_height=""wrap_content""                /&gt;            &lt;TextView style=""@style/statText""                android:id=""@+id/left_stat3""                android:text=""Stat3""                android:layout_width=""wrap_content""                android:layout_height=""wrap_content""                /&gt;        &lt;/LinearLayout&gt;        &lt;!-- end left live stat pane --&gt;        &lt;!-- right live stat pane --&gt;        &lt;LinearLayout            android:id=""@+id/right_stat_pane""            android:orientation=""vertical""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""            android:layout_weight=""1""            &gt;            &lt;TextView style=""@style/statHeader""                android:id=""@+id/right_playerName""                android:text=""{BATTER NAME}""                android:layout_width=""wrap_content""                android:layout_height=""wrap_content""                /&gt;            &lt;TextView style=""@style/statText""                android:id=""@+id/right_stat1""                android:text=""Stat1""                android:layout_width=""wrap_content""                android:layout_height=""wrap_content""                /&gt;            &lt;TextView style=""@style/statText""                android:id=""@+id/right_stat2""                android:text=""Stat2""                android:layout_width=""wrap_content""                android:layout_height=""wrap_content""                /&gt;            &lt;TextView style=""@style/statText""                android:id=""@+id/right_stat3""                android:text=""Stat3""                android:layout_width=""wrap_content""                android:layout_height=""wrap_content""                /&gt;        &lt;/LinearLayout&gt;        &lt;!-- end right live stat pane --&gt;    &lt;/LinearLayout&gt;&lt;/LinearLayout&gt;</code></pre><h2>actionFragment.java</h2><pre><code>package com.pte.hc_test;import android.app.Fragment;import android.content.Context;import android.os.Bundle;import android.util.Log;import android.view.LayoutInflater;import android.view.View;import android.view.ViewGroup;import android.widget.ImageView;import android.widget.LinearLayout;import android.widget.TableLayout;import android.widget.TableRow;import android.widget.TextView;public class actionFragment extends Fragment {    // class variables    int mActivityType;    // default (null) constructor    public actionFragment(){        Log.v(""PTE"", ""null constructor"");           }    public actionFragment(int n){        mActivityType = n;        Log.v(""PTE"", ""explicit constructor ("" + n + "")"");    }    @Override    public void onCreate(Bundle saved){        super.onCreate(saved);        if (saved != null){            mActivityType = saved.getInt(""Type"");        }        Log.v(""PTE"", ""FIRE: actionFragment.onCreate()"");    }    @Override    public void onSaveInstanceState(Bundle toSave){        toSave.putInt(""Type"", mActivityType);        Log.v(""PTE"", ""FIRE: actionFragment.onSaveInstanceState()"");    }    @Override    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState){        Log.v(""PTE"", ""FIRE: actionFragment.onCreateView()"");        Log.v(""PTE"", ""with mActivityType == "" + mActivityType);        try {            Log.v(""PTE"", ""with onCreateView()'s container = "" + container.toString());        } catch (Exception e) {            Log.v(""PTE"", ""could not convert container to string. Must be null"");            Log.v(""PTE"", e.toString());        }        Context c = getActivity().getApplicationContext();        LinearLayout actionPane = new LinearLayout(c);        switch (mActivityType) {            case actionType.PITCH_ACTION:                Log.v(""PTE"", ""FIRE: actionFragment.pitchPane()"");                // instantiate all the required views                 // parent container                TextView topLabel = new TextView(c);                TableLayout strikeZone = new TableLayout(c);                ImageView image = new ImageView(c);                // set properties for each view                actionPane.setOrientation(LinearLayout.VERTICAL);                topLabel.setText(""top Label Text"");                // create the strike zone table                for(int i=1; i&lt;6; i++){                    TableRow tr = new TableRow(c);                    for(int j=1; j&lt;6; j++){                        TextView tv = new TextView(c);                        tv.setText(""C"" + j + "":R"" + i);                        tv.setPadding(3, 3, 3, 3);                        tr.addView(tv);                    }                     strikeZone.addView(tr);                }                image.setPadding(0, 60, 0, 30);                image.setImageResource(R.drawable.homeplate);                // add child views to parent                actionPane.addView(topLabel);                actionPane.addView(strikeZone);                actionPane.addView(image);                return actionPane;            case actionType.HIT_ACTION:                Log.v(""PTE"", ""FIRE: actionFragment.hitPane()"");                // simple layout with a text view for testing                TextView placeholder = new TextView(c);                placeholder.setText(""This is a placeholder"");                actionPane.addView(placeholder);                return actionPane;            default:                Log.v(""PTE"", ""FIRE: actionFragment.defaultPane()"");                                             // If I comment this TextView out, I achieve my intended behavior                TextView label = new TextView(c);                label.setText(""This is the default pane"");                actionPane.addView(label);                return actionPane;        }    }}</code></pre>","284460","","750987","","2011-05-29 06:44:28","2011-05-29 06:44:28","Android Fragment Duplication","<android><android-fragments><android-3.0-honeycomb>","2","2","","",""
"5054132","1","5054217","","2011-02-19 23:11:23","58","57251","<p>Ok, so here it is.I have this little crazy method that converts BigDecimal values into nice and readable Strings.</p><pre><code>private String formatBigDecimal(BigDecimal bd){    DecimalFormat df = new DecimalFormat();    df.setMinimumFractionDigits(3);    df.setMaximumFractionDigits(3);    df.setMinimumIntegerDigits(1);    df.setMaximumIntegerDigits(3);    df.setGroupingSize(20);    return df.format(bd);}</code></pre><p>It however also produces a so called grouping seperator "","" that makes all my values come out like this:</p><pre><code>xxx,xxx</code></pre><p>I do however need the separator to be a dot or a point and not a comma. Does anybody have a clue of how to accomplish this little feat?</p><p>I have read <a href=""http://developer.android.com/reference/java/math/BigDecimal.html"">this</a> and in particular <a href=""http://developer.android.com/reference/java/text/DecimalFormat.html"">this</a> to death now but I cannot find a way to get this done.am I approaching this the wrong way? Is there propably a much more elegant way of doing this? Maybe even a solution that accounts for different local number representations, since the comma would be perfect by European standards.</p>","608728","","","","","2013-08-01 14:53:13","How to change the decimal separator of DecimalFormat from comma to dot/point?","<java><android><bigdecimal><decimal-point><decimalformat>","5","0","12","",""
"5054160","1","","","2011-02-19 23:20:54","0","787","<p>I have verified that an App does not need a Main Activity, and in fact does not need any activities. Thanks for the responses on this.  But here is another question. Is there any way to launch an application without a main activity declared?   If the answer is no, then I have a follow up, can the MAIN action be removed from the application at runtime after launch so that the app no longer has a MAIN activity after launch?  Or even can the activity itself be entirely removed from the application at runtime if it is no longer needed.  Thanks.    </p>","602260","","","","","2011-02-19 23:27:32","Can An Android Appliction Be Launched Without a Main Activity?","<android><launch>","1","2","","",""
"5054180","1","5054222","","2011-02-19 23:23:10","0","1364","<p><br>I'm in the process of making a music app and I'm currently working on the library functionality. I'm having some problems, however, in working with a list view (In particular, the cells). I'm trying to move from a simple textview layout in each cell that's created within java to one that uses an XML file for layout (Hence keeping the Java file mostly semantic)<br>This is my original code for the cell layout:</p><pre><code>public View getView(int position, View convertView, ViewGroup parent) {        String id = null;        TextView tv = new TextView(mContext.getApplicationContext());        if (convertView == null) {            music_column_index = musiccursor.getColumnIndexOrThrow(MediaStore.Audio.Media.TITLE);            musiccursor.moveToPosition(position);            id = musiccursor.getString(music_column_index);            music_column_index = musiccursor.getColumnIndexOrThrow(MediaStore.Audio.Media.DISPLAY_NAME);            musiccursor.moveToPosition(position);            id += ""\n"" + musiccursor.getString(music_column_index);            music_column_index = musiccursor.getColumnIndexOrThrow(MediaStore.Audio.Albums.ALBUM);            musiccursor.moveToPosition(position);            id += ""\n"" + musiccursor.getString(music_column_index);                tv.setText(id);          } else                tv = (TextView) convertView;    return tv;    }</code></pre><p>And my new version:</p><pre><code>public View getView(int position, View convertView, ViewGroup parent) {        View cellLayout = findViewById(R.id.albums_list_cell);        ImageView album_art = (ImageView) findViewById(R.id.album_cover);        TextView album_title = (TextView) findViewById(R.id.album_title);        TextView artist_title = (TextView) findViewById(R.id.artist_title);        if (convertView == null) {            music_column_index = musiccursor.getColumnIndexOrThrow(MediaStore.Audio.Albums.ALBUM);            musiccursor.moveToPosition(position);            album_title.setText(musiccursor.getString(music_column_index));            //music_column_index = musiccursor.getColumnIndexOrThrow(MediaStore.Audio.Media.DISPLAY_NAME);            //musiccursor.moveToPosition(position);            music_column_index = musiccursor.getColumnIndexOrThrow(MediaStore.Audio.Media.TITLE);            musiccursor.moveToPosition(position);            artist_title.setText(musiccursor.getString(music_column_index));        } else{            cellLayout = (TextView) convertView;        }    return cellLayout;    }</code></pre><p>The initialisation (done in the on create file):</p><pre><code>musiclist = (ListView) findViewById(R.id.PhoneMusicList);musiclist.setAdapter(new MusicAdapter(this));musiclist.setOnItemClickListener(musicgridlistener);</code></pre><p>And the respective XML files:</p><p>(main)</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/PhoneMusicList""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""    /&gt;    &lt;TextView         android:id=""@android:id/empty""        android:layout_width=""wrap_content""        android:layout_height=""0dip""        android:layout_weight=""1.0""        android:text=""@string/no_list_data""        /&gt;&lt;/LinearLayout&gt;</code></pre><p>(albums_list_cell)</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/albums_list_cell""  android:layout_width=""wrap_content""  android:layout_height=""wrap_content""&gt;    &lt;ImageView    android:id=""@+id/album_cover""    android:layout_alignParentLeft=""true""    android:layout_alignParentTop=""true""    android:layout_width=""50dip""    android:layout_height=""50dip""    /&gt;    &lt;TextView        android:id=""@+id/album_title""        android:layout_toRightOf=""@+id/album_cover""        android:layout_alignParentTop=""true""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""    /&gt;    &lt;TextView        android:id=""@+id/artist_title""        android:layout_toRightOf=""@+id/album_cover""        android:layout_below=""@+id/album_title""        android:layout_width=""wrap_content""        android:layout_height=""15dip""    /&gt;&lt;/RelativeLayout&gt;</code></pre><p>In theory (based on the tiny bit of Android I've done so far) this should work..it doesn't though. Logcat gives me a null pointer exception at line 96 of the faulty code, which is the album_title.setText line. It could be a problem with my casting but Google tells me this is ok :D</p><p>Thanks for any help and let me know if you need more info!</p><p>EDIT: Just to point out, the code this section is based on is from, most of is the same as mine for now</p><p><a href=""http://androidsamples.blogspot.com/2009/06/displaying-list-of-video-files-stored.html"" rel=""nofollow"">http://androidsamples.blogspot.com/2009/06/displaying-list-of-video-files-stored.html</a></p>","613428","","","","","2011-02-20 02:17:40","Android: Use XML Layout for List Cell rather than Java Code Layout (Widgets)","<java><android>","2","0","","",""
"5054207","1","5054243","","2011-02-19 23:30:40","0","1043","<p>Yo guys, this is bugging me and I can't find a fix for it,</p><p>I have a simple activity to launch a WebView and display a HTML file</p><pre><code>public class HelpViewer extends Activity {@Overrideprotected void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.help_page_layout);    WebView browser = (WebView) findViewById(R.id.help_page_webview);    browser.loadUrl(""file:///android_asset/help.html/"");}}</code></pre><p>The help_page_layout is your standard WebView resting in a LinearLayout - Not problems there.</p><p>The help.html is sitting under the /res/raw/ directory. From what I have see online, there shouldn't be a problem here either.</p><p>But when the WebView goes to load, it just tells me that the WebPage was not available because help.html couldn't be found.</p><p>What am I doing wrong?</p>","451575","","","","","2011-02-19 23:47:15","Web Page Not Available - Loading local HTML on Android","<java><android><webview>","1","0","","",""
"5054339","1","","","2011-02-20 00:03:12","4","374","<p>I'm developing my ""Hello, World"" application for Android and came around something that annoys me.</p><p>The theme used for my app's <code>AlertDialog</code> isn't the same used for other such dialogs presented on the device. The device is a HTC Desire HD on which I've changed the theme, but I was expecting that standard UI elements (like <code>AlertDialog</code>) would somehow reflect the device theme. It's something that I'm missing or maybe a know problem with some vendors/models?</p><p>Here's my code:</p><pre><code>final AlertDialog.Builder confirm = new AlertDialog.Builder(this);confirm.setTitle(""Delete"")       .setMessage(""Really Delete?"")       .setPositiveButton(""Delete"", new DialogInterface.OnClickListener() {           @Override           public void onClick(DialogInterface dialog, int which) {               // ...           }       })       .setNegativeButton(""Cancel"", null)       .show();</code></pre><p>And here's how the dialog looks like in different situations:</p><h3>Device's <code>AlertDialog</code> with default theme (Messages app)</h3><p><img src=""http://i.stack.imgur.com/R7Nh8.png"" alt=""enter image description here""></p><h3>Device's <code>AlertDialog</code> with changed theme (Messages app)</h3><p><img src=""http://i.stack.imgur.com/uT73U.png"" alt=""enter image description here""></p><h3>My app's <code>AlertDialog</code> (with both default and changed theme)</h3><p><img src=""http://i.stack.imgur.com/u89Q9.png"" alt=""enter image description here""></p><p>Thanks.</p>","58808","","","","","2011-02-22 08:20:13","How to use vendor theme in Android application","<android><themes><vendor>","1","1","2","",""
"5054364","1","5054443","","2011-02-20 00:08:03","0","1780","<p>I have list of files stored inside arraylist that I need to download in background thread. My initial thought is that AsyncTask should be up for that task. But, I have a problem, I don't know how to supply my list to doInBackground method.</p><p>My arraylist is defined as</p><pre><code>private ArrayList&lt;String&gt; FilesToDownload = new ArrayList&lt;String&gt;();</code></pre><p>My DownloadFiles subclass (the way it is written now) should be called with:new DownloadFiles().execute(url1, url2, url3, etc.);</p><p>This is not suitable for me since I never know how many urls I will have. It is pretty much changing from case to case. So, I would like somehow to pass my arraylist to doInBackground method. </p><p>I tried to convert to array with toArray():</p><pre><code>new DownloadFiles().execute(FilesToDownload.toArray());</code></pre><p>But, eclipse tells me that execute is not applicable for argument Object[].Suggestion was to cast to URL[], but when I tried that I got illegal casting error and app crashed.</p><p>It seems that doInBackground has to be implemented with parameters in varargs type (URL... urls).  </p><p>Any ideas how to solve my problem? Thanks.</p><pre><code>class DownloadFiles extends AsyncTask&lt;URL, Integer, Long&gt; {     protected Long doInBackground(URL... urls) {         int count = urls.length;         long totalSize = 0;                 for (int i = 0; i &lt; count; i++) {             Log.d(""Evento"", ""&amp;&amp;&amp;&amp; downloading: "" + FilesToDownload.get(i).toString());//             totalSize += Downloader.downloadFile(urls[i]);//             publishProgress((int) ((i / (float) count) * 100));         }         return totalSize;     }     protected void onProgressUpdate(Integer... progress) {        //setProgressPercent(progress[0]);     }     protected void onPostExecute(Long result) {       //showDialog(""Downloaded "" + result + "" bytes"");     }}</code></pre>","507153","","","","","2013-06-26 20:17:25","Trying to use AsyncTask do download some image files","<android><casting><arraylist><android-asynctask><params>","1","0","0","",""
"5054376","1","5407851","","2011-02-20 00:09:56","7","4459","<p>I'm trying to profile my JNI application. Is there something like ""Get ticks since startup"" that I can use to measure functions and/or systems? Anything with the precision of 1/10 of a millisecond will do.</p><p>Obviously, a fully native function would be nicer, I'd prefer not to call a Java function for every single thing I'm trying to profile, but if that's the only option, I'll take that too.</p>","345717","","21234","","2011-02-20 12:24:42","2012-04-03 19:34:08","High-precision timer in Android JNI","<android><profiling><jni>","2","0","2","",""
"5054477","1","5054601","","2011-02-20 00:31:13","0","1295","<p>How do I pass data using an http post from an Android app using Java to a php file on a IIS server?</p>","624765","","115145","","2011-02-20 00:54:59","2012-09-12 07:20:20","How to pass data with HttpPost","<android><http><iis><post><httpclient>","2","1","","",""
"5054514","1","5054576","","2011-02-20 00:40:27","1","769","<p>In my application I have about a dozen of Activities. However, most of these have some shortcut-buttons, so the user can start the most important ones from anywhere in the app. This means, that the user can just jump around the app., filling up the Activitiy Stack with Activities. I can't change this behaviour, because I need the history function the stack provides (so I can't just use the noHistory option).</p><p>Obviously, I'd like to do something against this possible memory leak. Is it possible to remove the entry from the bottom of the Activity Stack, if the stack's size is greater than a certain number? So the stack only remembers the newest X (e.g. 30) Activity?</p><p>Thanks</p>","446529","","","","","2011-02-20 05:50:01","How to remove the Activity in the bottom of the Activity Stack?","<android><limit><activity-stack>","2","0","","",""
"5054526","1","","","2011-02-20 00:42:57","3","1704","<p>I am using opencv on Android and have been successfully loading and processing jpg images from the phone's SD card. Now I want to manipulate frames from a video stored on the SD card. I have coded and tested the opencv code in C++, but am having a linking error when trying to put it into my android-opencv project. Specifically, when I add the line of code</p><pre><code>CvCapture* capture = cvCreateFileCapture( ""/sdcard/testVideo.MOV"" );</code></pre><p>And then try to rebuild the project I get the following output/error:</p><pre><code>OPENCV_CONFIG = ../../build/android-opencv.mkPROJECT_PATH defaulting to this directory/Users/me/Documents/Android/android-ndk-r4-crystax/ndk-build OPENCV_CONFIG=../../build/android-opencv.mk PROJECT_PATH=. V=0 Compile++ thumb: Assay &lt;= /Users/me/Documents/Android/opencv/android/apps/MyApp/jni/Processor.cppSharedLibrary  : libAssay.so/Users/me/Documents/Android/opencv/android/build/obj/local/armeabi-v7a/libhighgui.a(cap.o): In function `cvCreateVideoWriter':cap.cpp:(.text.cvCreateVideoWriter+0x16): undefined reference to `cvCreateVideoWriter_Images(char const*)'cap.cpp:(.text.cvCreateVideoWriter+0x20): undefined reference to `cvCreateVideoWriter_Images(char const*)'/Users/me/Documents/Android/opencv/android/build/obj/local/armeabi-v7a/libhighgui.a(cap.o): In function `cvCreateFileCapture':cap.cpp:(.text.cvCreateFileCapture+0x2): undefined reference to `cvCreateFileCapture_Images(char const*)'collect2: ld returned 1 exit statusmake[1]: *** [/Users/me/Documents/Android/opencv/android/apps/MyApp/obj/local/armeabi/libAssay.so] Error 1make: *** [libs/armeabi-v7a/libAssay.so] Error 2</code></pre><p>It seems like it's having problems linking to the <code>cvCreateFileCapture</code>. I have read that the order in which the opencv libraries are specified matters, but am not sure what order I should use (or if this is my problem). My opencv libraries are specified in this order:</p><pre><code>OPENCV_LIBS := $(OPENCV_LIB_DIRS) -lfeatures2d  -lcalib3d -limgproc -lobjdetect  \     -lvideo  -lhighgui -lml -llegacy -lcore -lopencv_lapack -lflann \    -lzlib -lpng -ljpeg -ljasper </code></pre><p>Anyone have any idea how to get <code>cvCreateFileCapture</code> working?</p><p>Thanks!</p>","624873","","1288","","2011-06-02 12:43:40","2011-06-02 12:43:40","OpenCV-Android highgui linking error","<android><opencv>","1","0","","",""
"5054560","1","","","2011-02-20 00:50:35","30","20656","<p>I've built a web app that uses the HTML5  tag and JavaScript code that renders other content synchronized with the running video. It works great in desktop browsers: Firefox, Chrome, and Safari. On an iPhone or a DroidX, the native video player pops up and takes over the screen, thus obscuring the other dynamic content that I want to display simultaneously with the video.</p><p>Is there any way around this? If necessary, I'll figure out how to write native apps for both those platforms, but it would save me a ton of effort if I could just stick with HTML5/JavaScript.</p>","624863","","","","","2014-01-23 11:09:46","Can I avoid the native fullscreen video player with HTML5 on iPhone or android?","<iphone><android><html5><video><fullscreen>","4","1","23","",""
"5054580","1","5054654","","2011-02-20 00:55:36","1","4096","<p>I am trying to use the new window and attaching edittext to get name from the user. It just always fail when it hits the line "" ""name""<strong>.getText()</strong>.toString()""</p><p>Here is my main</p><pre><code>public class chatter extends Activity {private String name;/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);}@Overridepublic boolean onCreateOptionsMenu(Menu menu) {    MenuInflater inflater = getMenuInflater();    inflater.inflate(R.menu.menu, menu);    return true;}@Overridepublic boolean onOptionsItemSelected(MenuItem item) {    // Handle item selection    switch (item.getItemId()) {    case R.id.setNameMenu:        setname();        return true;    default:        return super.onOptionsItemSelected(item);    }}public void setname(){    final EditText textNameInput = (EditText) findViewById(R.id.nameBox);    /*Dialog dialog = new Dialog(chatter.this);    dialog.setTitle(""This is my custom dialog box"");    */    setContentView(R.layout.custom_dialog);    //dialog.setCancelable(true);    Button button = (Button) findViewById(R.id.submitNameButton);    button.setOnClickListener(new OnClickListener() {    @Override        public void onClick(View v) {            //String nameinput = textNameInput.getText().toString();            **//this is where it does not work**        **Editable debug1 = textNameInput.getText();**          String nameinput = debug1.toString();            name = nameinput;            finish();        }    });}}</code></pre><p>Here is the layout</p><pre><code>&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:padding=""10dp""&gt;&lt;TextView    android:id=""@+id/dialogueText""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:text=""please input your name:""    /&gt;&lt;EditText     android:id=""@+id/nameBox""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""           android:layout_below=""@+id/dialogueText"" /&gt;&lt;Button    android:text="" Set ""    android:id=""@+id/submitNameButton""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:layout_below=""@+id/nameBox""    android:layout_alignParentRight=""true""    /&gt;&lt;/RelativeLayout&gt;</code></pre><p>I am new to programing in android, please kindly explain what went wrong.</p>","581194","","","","","2011-02-20 01:13:18","Trying to convert Edit text to String, got error with ""name"".getText().toString() line","<android><edittext><gettext>","2","1","1","",""
"5054610","1","5054714","","2011-02-20 01:01:16","0","228","<p>Is it possible to display an image in the background of the camera preview? The image be 80% transparent, so don't worry about not seeing the preview. I want to be able to see both the camera preview and the transparent image. I believe this falls into the augmented reality category</p>","200477","","200477","","2011-02-20 01:17:41","2011-02-20 01:29:49","Display image on Camera perview?","<java><android><camera>","1","0","1","",""
"5054626","1","","","2011-02-20 01:05:20","1","2336","<p>Is it possible to communicate an Android application with a PIC microcontroller by the serial port? What phones of low cost can I use?Sorry by my englisg, I'm from Colombia.</p>","624887","","","","","2014-01-21 18:22:06","Android + PIC Microcontroler","<android><pic>","4","0","1","",""
"5054855","1","5057984","","2011-02-20 02:21:06","1","519","<p>Here is basically my code:</p><pre><code>private Dialog mDialog;private BluetoothAdapter mBluetoothAdapter;... private void onCreate(Bundle savedInstanceState) {    ...    enabltBTButton = getMyButton();    enableBtButton.setOnClickListener(this.enableBT);    ...}...public View.OnClickListener enableBT = (new View.OnClickListener() {    public void onClick(View view) {        mDialog.hide();        mBluetoothAdapter.enable();        Toast.makeText(Main.this, ""Bluetooth enabled"", Toast.LENGTH_LONG).show();        return;    }});</code></pre><p>The problem: when I click the button nothing happens! I am positive that <code>enableBTButton</code> is referring to the correct object, but my guess is that this has something to do with my referencing <code>mDialog</code> and <code>mBluetoothAdapter,</code> both of which are declared outside of the inner <code>onClick</code> function.</p><p>What is an alternative solution to this?</p>","148824","","148824","","2011-02-20 15:17:48","2011-02-20 15:34:05","Android/ Java closure onClick problem?","<java><android><reference><closures>","3","4","","",""
"5054974","1","5059241","","2011-02-20 03:03:49","7","3027","<p>Is it possible with OrmLite to create a sql script file to easily populate the database with data?  I did some searching and couldn't come up with anything easy.  I know I can create some objects with data, I'm just looking for a cleaner method.</p><p>I'm thinking create a script file, open a a reader at load, and process each file as raw SQL the executeRaw() method.  Any thoughts?</p>","546489","","","","","2011-08-31 00:49:14","Android OrmLite pre-populate database","<android><sqlite><orm><ormlite>","2","0","1","",""
"5055020","1","5055495","","2011-02-20 03:19:15","0","606","<p>This is a good one, i am trying to pass a intent to the alarm clock to set it off.  Can someone please help me out if this can be done..  it sounds like something that can be done but cant find it anyway</p>","589450","","","","","2011-02-20 05:51:45","Can I setup the Alarm Clock!","<android><alarm>","1","1","","",""
"5055115","1","5055136","","2011-02-20 03:43:13","1","3611","<p>I am learning the concept of <code>Intent</code>s and the application I am working on crashes when i try to go from one intent to another,the intent object is fired on <code>onClickListener()</code> of a button.</p><p>Below is the code:</p><p><code>intentdemo.java</code>: first activity</p><pre><code>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;public class intentdemo extends Activity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        Button btn1= (Button) findViewById(R.id.button1);        btn1.setOnClickListener(new OnClickListener() {            public void onClick(View v) {                Intent i = new Intent(intentdemo.this,Intentdemo2.class);                startActivity(i);            }       });    }}</code></pre><p><code>Intentdemo2.java</code>: Activity 2</p><pre><code>package com.test.intent;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;public class Intentdemo2 extends Activity {    @Override    public void onCreate(Bundle savedInstanceState)    {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        Button btn = (Button)findViewById(R.id.button2);        btn.setOnClickListener(new OnClickListener() {            public void onClick(View v) {                // TODO Auto-generated method stub                Intent i = new Intent(getBaseContext(),intentdemo.class);                startActivity(i);            }        });    }}</code></pre><p><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.test.intent""  android:versionCode=""1""  android:versionName=""1.0""&gt;&lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;    &lt;activity android:name="".intentdemo""              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="".Intentdemo2""&gt;&lt;/activity&gt;&lt;/application&gt;&lt;/manifest&gt;</code></pre><p>main.xml: for first activity</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""    /&gt;&lt;Button     android:text=""Button""     android:id=""@+id/button1""     android:layout_width=""wrap_content""     android:layout_height=""wrap_content""&gt;    &lt;/Button&gt;&lt;/LinearLayout&gt;</code></pre><p>layout.xml: for second activity</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=""match_parent""  android:layout_height=""match_parent""&gt;    &lt;Button android:id=""@+id/button2"" android:layout_height=""wrap_content"" android:text=""Button"" android:layout_width=""wrap_content""&gt;&lt;/Button&gt;    &lt;TextView     android:text=""@string/text""     android:id=""@+id/textView1""     android:layout_width=""wrap_content""     android:layout_height=""wrap_content""&gt;&lt;/TextView&gt;&lt;/LinearLayout&gt;</code></pre><p>I would appreciate if someone can point me towards my mistake here, first Activity is displayed, When i click on button it gives me the message ""the activity has stopped unexpectedly"", how should I debug in case the error in activity is not intuitive.</p><p>Thanks,Sid</p>","2288136","","844882","","2012-03-22 03:32:46","2013-06-29 11:30:46","intent not working","<android><android-intent>","3","0","","",""
"5055145","1","","","2011-02-20 03:55:01","0","3126","<p>Hi We are developing a complex application which involves multiple screens.We decided to keep the common activities in a separate applications apk ( commonScreen apk), so that these can be used by ourselves as well as others using intents.</p><p>Now, we need a common way to store and share the data between the activities present in our main application and commonScreen apk.</p><p>We thought of storing data in Application object ( extend Application)But, when we call startActivityForResult(commonScreenApkIntent),onActivityResult, we can see that the data present in Application is gone (null)see <a href=""http://www.mail-archive.com/android-developers@googlegroups.com/msg117318.html"" rel=""nofollow"">Dont store global data in application</a> for issues using them. </p><p>Is storing and retrieving the data in each activity using preference is a good method when large data is involved?</p><p>Please note : the amount of data we want to store are more, which are basically application buttons state ( disabled/enabled), value and configurations. It might go up to 1000 values.</p><p>Can you please suggest a way to share the data?</p>","446383","","750987","","2011-05-29 06:28:10","2013-02-17 17:27:25","Android sharing data (state,value,config) between multiple apps & activities","<android><android-preferences>","3","1","","",""
"5055199","1","5146064","","2011-02-20 04:11:50","6","3201","<p>I have struggled with several class implementations to retrieve chunked data without success.  Following is a simplified code module that has the problem.  After surfing around the web, it appears there have been problems in the past (2009, 2010; ver 1.1, 1.5), but they should be resolved by now.  I have not seen any definitive success with Android platform for this protocol.</p><p>Help!</p><p>I am able to see some response if I put an invalid token -- the web service will respond with an application error message.  However, the valid url and token will simply respond with a detection of the chunked protocol (isChunked() returns true), but nothing gets read and nothing times-out, etc.</p><p>The exact same URL issued with CURL from a command line works as expected and displays the continuous content (published data from web service).</p><p>Are there any web service side hacks e.g., add more end-of-lines, to force the receiving stream??</p><pre><code>                URI uri;                try {                    uri = new URI(""http://cws.mycompany.com/service/events?accesskeyid=8226f3ddc65a420abc391d8f1fe12de44766146762_1298174060748"");                    HttpClient httpClient=new DefaultHttpClient();                     HttpGet httpGet=new HttpGet(uri);                     ResponseHandler&lt;String&gt; rh=new BasicResponseHandler();                     String responseString=httpClient.execute(httpGet,rh);                     Log.d(TAG, ""response as string:\n"" + responseString);                } catch (URISyntaxException e) {                    Log.e(TAG, e.toString());                    e.printStackTrace();                } catch (ClientProtocolException e) {                    Log.e(TAG, e.toString());                    e.printStackTrace();                } catch (IOException e) {                    Log.e(TAG, e.toString());                    e.printStackTrace();                }</code></pre>","157804","","","","","2011-03-01 00:14:34","Have any Android developers had success receiving chunked transfer protocol from a web service?","<android><http><chunked><http-chunked>","1","4","6","",""
"5055242","1","5055250","","2011-02-20 04:27:24","0","1833","<p>I'm having an issue with my phone,it not get detected in eclipse IDE as I turned on the debugging mode (nothing in LogCat also).But it's working fine with USB file transferring (get detected as USB mass storage device) I have re-installed the drivers, restart the machine/phone but no result.</p><pre><code>adb shell</code></pre><p>also reports as no device found </p><p><code>adb devices</code> </p><p>also not listing any devices</p><p>My phone is:- LG GT540Windows XP SP2</p>","87072","","","","","2011-11-27 16:23:29","USB debugging issue","<android>","4","0","","",""
"5055278","1","5055336","","2011-02-20 04:41:18","1","5155","<p>I have something like this in my code:</p><pre><code>String boundary = ""thisIsMyBoundaryString"";StringBuilder body = new StringBuilder();  ...  byte[] data = bos.toByteArray();  body.append(new String(data));  body.append(""\r\n--"" + boundary + ""--\r\n"");  String entity = body.toString();  </code></pre><p>I'm building a POST request and need to insert some binary data (JPEG compressed bitmap).</p><p>After appending byteArray, I want to append newLine and boundary string,<br>but the StringBuilder gets corrupted - seems that the bytes from the added boundary<br>become misaligned from that point on<br>and they are no longer being interpreted as my original string but as some random characters.</p><p>Is this what is happening here?</p><p>How can I resolve this? Maybe I should add a byte of padding to byteArray before appending boundary?</p><p>What is the proper way of adding binary data to POST request?<br>Please note that using <b>Base64</b> encoding <b>is not an option</b> here.  </p><p> <br> <br><b>[edit]</b><br><b>Solution</b> was to use MultipartEntity to make such requests<br>and forget about adding boundaries manually.</p><p>Here is relevant code snippet:</p><pre><code>FileBody bin = new FileBody(new File(Environment.getExternalStorageDirectory() + ""/"" + FILE_NAME));MultipartEntity entity = new MultipartEntity();entity.addPart(""message"", new StringBody(""A message that goes with request""));entity.addPart(""file"", bin);</code></pre><p>(Third line has to be inside of a try/catch block but I removed it for readability)</p>","524537","","524537","","2011-02-20 19:56:51","2011-02-20 19:56:51","How to upload binary data using POST","<java><android><post><upload><binary-data>","2","0","1","",""
"5055483","1","5061909","","2011-02-20 05:49:44","1","625","<p>I am able to prepare route between two points. Now i want that in addition if i want to travel via a different point in between my route, what approach i should take.</p>","569938","","569938","","2011-02-20 06:01:34","2011-02-21 03:14:43","Is it possible to calculate route with a route point in between (android)?","<android><geolocation>","2","2","1","",""
"5055525","1","5055589","","2011-02-20 06:00:47","2","1083","<p>I have successfully used a SimpleCursorAdapter to list displayname and value (both in my DB) and displayed them in my list activity.</p><p>What I am was trying to do now was add a new view (ImageView) for each item in my list activity. It is supposed to look like this in the end.</p><pre><code>Image_1_NotInDB -- DisplayName1FromDB -- DisplayName1FromDBImage_2_NotInDB -- DisplayName2FromDB -- DisplayName2FromDB.</code></pre><p>The image is going to different (based on DisplayName1FromDB). I don't think SimpleCursorAdapter is good anymore for this purpose.</p><p>I tried creating a customSimpleCursorAdapter extending SimpleCursorAdapter and tried to use 'newView' and 'bindView' methods to achieve. I pretty much followed this: <a href=""http://thinkandroid.wordpress.com/2010/01/11/custom-cursoradapters/"" rel=""nofollow"">Custom CursorAdapters</a>.</p><p>The problem is; what Image I use is based on a value from DB (which I intended to pass in the constructor or customSimpleCursorAdapter)</p><pre><code>public View newView(Context pContext, Cursor pCursor, ViewGroup pParent){    Cursor lCursor = getCursor();    final LayoutInflater inflater = LayoutInflater.from(pContext);    View lView = inflater.inflate(layout, pParent, false);    int lImage = ""dog"".equals(variable) ? R.drawable.dog : R.drawable.cat;    // ""variable"" is a member variable (set at the constructor)    ImageView lImageView = (ImageView) lView.findViewById(R.id.appImage);    if (lImageView != null)    {        lImageView.setImageResource(lImage);    }    return pParent;}public void bindView(View pView, Context pContext, Cursor pCursor){    int lImage = ""dog"".equals(variable) ? R.drawable.dog : R.drawable.cat;    // ""variable"" is a member variable (set at the constructor)    ImageView lImageView = (ImageView) lView.findViewById(R.id.appImage);    if (lImageView != null)    {        lImageView.setImageResource(lImage);    }}</code></pre><p>This is how I tried using the ""customSimpleCursorAdapter""</p><pre><code>    String[] lDisplay = new String[] {KEY_NAME, KEY_TIME};    int[] lValues = new int[] {R.id.name, R.id.time};    CustomRowCursorAdapter lCursorAdapter = new CustomRowCursorAdapter(this, R.layout.row, lSTime, lDisplay, lValues, ""MY IDEA WAS TO PASS THE ANIMAL NAME HERE, BUT NOT LUCK as I am not sure How "");    lCursorAdapter.newView(this, lSTime, getListView());    lCursorAdapter.bindView(getListView(), this, lSTime);    setListAdapter(lCursorAdapter);</code></pre><p>Is ArrayAdapter the answer? If yes, could you share what parameters would you pass to it?</p>","614693","","942391","","2012-09-26 11:14:58","2013-03-15 00:36:55","Is is possible to add additional column to SimpleCursorAdapter","<android><simplecursoradapter>","3","0","","",""
"5055700","1","5055722","","2011-02-20 06:54:29","0","1190","<p>I have set an Android List which has image for background.  Looks great, but when I select an item in the ItemList it covers up the picture in back with a default color.  I would like to do something more consistent with the background to highlight the selection, like perhaps leave it transparent, but highlight border of the list item row?  How could I do this or something else that fits better with an image. </p><p>Also I notice dragging down on the list turned several of them black all at once.  What can be done about this.</p>","602260","","","","","2011-02-20 07:01:12","Android ListView Selection When Image is Background","<android><image><listview>","2","0","","",""
"5055755","1","","","2011-02-20 07:12:29","2","1713","<p>To get the Android Market Account, I do so:</p><pre><code>AccountManager accountManager = AccountManager.get(this);Account[] accounts = accountManager.getAccountsByType(""com.google"");androidCheckout = accounts[0].name.trim().toLowerCase();</code></pre><p>With my phone and my credentials the above statement is fine.I've an account so masked: ""something@gmail.com"".</p><p>My question is: I know that the accounts can be either Gmail or Google Apps accounts. And also that Google Apps accounts can have any domain name. So, in this case, instead of @gmail.com there can be everything: depending on the domain name, for instance ""cippalippa.us"", the account could be ""geltrude@cippalippa.us"". In this case, the above statement will still be ok??</p>","489146","","","","","2012-05-22 06:47:37","Getting Android Market Account programmatically","<android><gmail><google-play><account>","1","0","1","",""
"5055768","1","5057105","","2011-02-20 07:15:58","3","2738","<p>Can you access the bluetooth API of android via adobe air for mobile?</p>","103504","","","","","2013-01-07 00:16:45","is there a way to access bluetooth on android via adobe air","<android><air><bluetooth>","3","1","1","",""
"5055927","1","","","2011-02-20 08:00:39","1","370","<p>I'm writing my first app of any consequence, so I may be going about this the entire wrong way, but...</p><p>I have a resource image that is 1600x880.  I'd like to fill the entire screen with a subset of that image to my canvas, such that an arbitrary x,y coordinate marks the top-left corner drawn at the top-left corner of the screen.  For instance, if I was viewing this image on an N1 and I entered x=100 and y=50, I'd expect to see from 100,50 to 580,850 since it's display area is 480x800.</p><p>I think I need to use <code>Canvas.drawBitmap(Bitmap bitmap, Rect src, Rect dst, Paint paint)</code>.  But, no matter what I plug in to either Rect (even if it's a perfectly sane set of values that shouldn't butt up against any edges of the image), I end up with an unexpected area or a grossly stretched/smooshed output.</p><p>I've tried using various combinations of calculations involving <code>display.getWidth()</code> and <code>getHeight()</code>, <code>canvas.getWidth() and getHeight()</code>, and <code>bitmap.getWidth() and getHeight()</code> but nothing seems to be working.</p><p>I don't know what I'm doing wrong.</p>","2325678","","603744","","2011-06-16 06:04:05","2011-06-16 06:04:05","Drawing subset of a bitmap to a canvas?","<android><bitmap>","0","4","0","",""
"5056066","1","","","2011-02-20 08:49:29","3","6504","<p>I'm trying to send a couple of values from an android application to a web service which I've setup. I'm using Http Post to send them but when I run the application I get the error- request time failed java.net.SocketException: Address family not supported by protocol.</p><p>I get this while debugging with both the emulator as well as a device connected by wifi. I've already added the internet permission using:</p><pre><code>&lt;uses-permission android:name=""android.permission.INTERNET"" /&gt;</code></pre><p>This is the code i'm using to send the values</p><pre><code>    void insertData(String name, String number) throws Exception {    String url = ""http://192.168.0.12:8000/testapp/default/call/run/insertdbdata/"";    HttpClient client = new DefaultHttpClient();    HttpPost post = new HttpPost(url);    try {        List&lt;NameValuePair&gt; params = new ArrayList&lt;NameValuePair&gt;(2);        params.add(new BasicNameValuePair(""a"", name));        params.add(new BasicNameValuePair(""b"", number));        post.setEntity(new UrlEncodedFormEntity(params));        HttpResponse response = client.execute(post);    }catch(Exception e){        e.printStackTrace();    }</code></pre><p>Also I know that my web service work fine because when I send the values from an html page it works fine -</p><p></p><p></p><pre><code>&lt;form name=""form1"" action=""http://192.168.0.12:8000/testapp/default/call/run/insertdbdata/"" method=""post""&gt;    &lt;input type=""text"" name=""a""/&gt;    &lt;input type=""text"" name=""b""/&gt;    &lt;input type=""submit""/&gt;</code></pre><p></p><p>I've seen questions of similar problems but haven't really found a solution.</p><p>Thanks</p>","625100","","211674","","2011-03-01 23:12:18","2013-10-08 21:51:00","Address family not supported by protocol exception","<java><android>","5","1","2","",""
"5056122","1","","","2011-02-20 09:06:19","0","227","<p>i am fetching data from server storing it to the database and again storing it to arraylist from database to arraylist and than using in listview.so suppose if i am using direct database i have to query it numberof times so is there any overhead using direct database.</p><p>thnakx.</p>","411359","","","","","2011-02-21 08:27:35","android comparison between arraylist and database?","<android>","1","0","","",""
"5056169","1","5057278","","2011-02-20 09:19:36","0","744","<p>I'd like to use in my own app the standart android icon, which is displayed when I delete widgets from my desktop (Android 2.1). But I can't find it in the sdk. </p><p>Where do I find it?</p>","190148","","","","","2013-12-15 17:45:55","Android 2.1 standart recycle bin icon","<android><icons><android-sdk-2.1>","1","0","","",""
"5056194","1","5056255","","2011-02-20 09:26:44","0","1239","<p>So I'm looking to upload an image from the user's phone to a php server using the FILES request method. I think this is the better choice as compared to POST. I've seen a handful of sample code for this, but it always uses POST and includes things like headers, strings, or MPEs. I just want to upload the image, nothing else. So here is my php:</p><pre><code>$uploadedFile = $_FILES['image']['name'];$uploadedType = $_FILES['image']['type'];$uploadedSize = $_FILES['image']['size'];$temp = $_FILES['image']['tmp_name'];$error = $_FILES['image']['error'];if ($error &gt; 0) {    die(""File could not be uploaded. $error"");}else {    if ($uploadedType != (""image/jpg"" || ""image/png"") || $uploadedSize &gt; 500000) {        die(""Sorry, png and jpgs are the only supported filetypes."");    }    else {        move_uploaded_file($temp, ""images/"".$uploadedFile);        echo ""Upload Complete. "".$uploadedType;    }}</code></pre><p>This works with an html-based client. For android, I am able to retrieve the image's path, so right now I'm making a method which will take the path as a parameter, and then upload the image @ the given path to the web server.</p><p>Specific questions which cause confusion:</p><ol><li><p>Why is everyone using POST for this? I feel that FILES is the better choice from what I know of PHP. If I'm wrong please clarify.</p></li><li><p>I have the path, so I'd do something like</p><p><code>File file = new File(path);</code></p></li></ol><p>then...</p><pre><code>FileInputStream fis = new FileInputStream(file);</code></pre><p>But then what from here? Sorry, a bit new at this.</p><p>So yea, I just need a push in the right direction I think, but most of the answers I've seen aren't really trying to accomplish what I am, or at least so I think. Thanks for your time.</p>","588758","","","","","2012-06-19 01:15:16","Uploading an image from Android using the FILES request method to a php server","<php><android><upload>","1","1","","",""
"5056252","1","","","2011-02-20 09:45:11","0","457","<p>I am trying to lock the screen using monkeyrunner.Please help me out.</p><p>Thanks</p>","625112","","","","","2012-06-25 13:05:39","Does anyone know how to lock the screen using monkeyrunner?","<android>","2","0","","",""
"5056282","1","5056413","","2011-02-20 09:52:20","0","60","<p>It looks like my stuff like menus, alert dialogs and other things are growing and I have a lot of classes, xml files mixed all together. I want to move these 'addons' to a separate package. What is a common name for such kind of things?</p>","397991","","","","","2011-02-20 18:25:27","What subpackage name to choose for menus, dialogs, etc?","<java><android>","2","0","","",""
"5056359","1","","","2011-02-20 10:09:49","1","335","<p>I'm trying to ask the user if he wants to retry a login process if the initial one has failed.I do this using an AlertDialog. The problem is i'm going around in a circle. Let me explain:I have the login method named Login which I call from the main activity. If this fails, I open an AlertDialog. The response from AlertDialog comes on the main thread. How do I make the AlertDialog dissapear before I call Login again? </p><p>Now I have something like this onCreate->Login->AlertDialog->ResponseHandler->Login. If I do this, the AlertDialog will never close because everything happens on the same thread. </p><p>Is there a way to send the response from the AlertDialog to the activity in a asynchronous way?</p>","625136","","1137432","","2013-07-29 19:40:10","2013-07-29 19:40:10","How to Send Message From AlertDialog to Activity","<java><android><interface><dialog>","1","0","","",""
"5056368","1","5057609","","2011-02-20 10:13:10","0","339","<p>Need to use an existing Database Sqlite (that i add in the Assets folder) but don't know how to deal with and i did not see any complete example that can help me.</p><p>if someone know any good example or can give a help i will very appreciate.</p><p>Ps: i am new on Android!</p><p>Thank you </p>","625139","","","","","2011-02-20 14:31:45","Need to use a Database but no idea how to do that in Android","<android><sqlite>","3","0","","",""
"5056395","1","5056457","","2011-02-20 10:18:53","2","7019","<p>Using the following URL <a href=""http://stackoverflow.com/questions/2139134/how-to-send-an-object-from-one-android-activity-to-another-with-intent-putextra"">How to send an object from one Android Activity to another with Intent.putExtra?</a></p><p>I have made sample application as follow</p><p>Scrollview1.java</p><pre><code>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;public class Scrollview1 extends Activity {    static int i;    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        Button b = (Button)findViewById(R.id.Button01);        b.setOnClickListener(new OnClickListener(){            public void onClick(View v) {                Intent i = new Intent(Scrollview1.this, Result.class);                Name n = new Name();                n.setI(20);                n.setS1(""Hello"");                n.setS2(""World"");                i.putExtra(""Name"", n);                startActivity(i);            }                   });    }}</code></pre><p>//Name.java</p><pre><code>import android.os.Parcel;import android.os.Parcelable;public class Name implements Parcelable{    int i;    String s1;    String s2;    public Name(){    }    private Name(Parcel in){        in.readInt();        in.readString();    }    public int getI() {        return i;    }    public void setI(int i) {        this.i = i;    }    public String getS1() {        return s1;    }    public void setS1(String s) {        this.s1 = s;    }    public String getS2() {        return s2;    }    public void setS2(String s) {        this.s2 = s;    }    public int describeContents() {        return 0;    }    public void writeToParcel(Parcel dest, int flags) {             dest.writeInt(i);        dest.writeString(s1);        dest.writeString(s2);    }      public static final Name.Creator&lt;Name&gt; CREATOR = new Name.Creator&lt;Name&gt;() {            public Name createFromParcel(Parcel in) {                return new Name(in);            }            public Name[] newArray(int size) {                return new Name[size];            }        };  }</code></pre><p>//Result.java </p><pre><code>import android.app.Activity;import android.os.Bundle;public class Result extends Activity{    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);      Name a = (Name)getIntent().getParcelableExtra(""Name"");      System.out.println(""Int : ""+a.getI());      System.out.println(""String : ""+a.getS1());      System.out.println(""String : ""+a.getS2());    }}</code></pre><p>but it is Result class I getting null. What is wrong?</p>","484073","","","","","2012-01-03 06:38:59","How to send an object from one Activity to another with Intent.putExtra and Parcel?","<android><android-intent><parcelable>","3","0","2","",""
"5056704","1","5057251","","2011-02-20 11:23:15","7","5856","<p>I have an Android project and it has a (Java) project folder reference . I developed with eclipse. Now I want to compile with Ant. What I want to add in build.xml to include the reference. </p>","405747","","","","","2012-06-14 06:43:49","Android Ant project reference","<android>","1","0","1","",""
"5056734","1","5206580","","2011-02-20 11:29:34","43","46176","<p>I would like to be able to remove the focus from the EditText. For example if the Keyboard appears, and the user hides it with the back button, I would like the focus and the cursor to disappear. How can it be done?</p>","171911","","","","","2014-03-18 13:11:27","Android: Force EditText to remove focus?","<android><focus><edittext>","12","5","13","",""
"5056826","1","","","2011-02-20 11:48:27","1","307","<p>In scerenio, I have application calllog include 4 tabs ,first tab list all calls , the second list outgoing calls, the third is incoming calls, the fourth lists miss calls.Every tab is implement by activity.</p><p>when i enter my app , tab all calls is set first.After that there is a missed call on status bar.And i press icon missed calls,my app is implemented to launch tab missed call.At this time , I press Back button , it back tab all calls in my app.But I dont want to back tab all calls, i want to back activity before activity for tabs all calls.Do you have any way to do this?please help me , thanks a lot.</p>","625095","","","","","2011-02-20 11:54:50","How to clear previous activity in a application use TabActivities which every tab is a activity","<android>","1","1","","",""
"5056910","1","","","2011-02-20 12:06:40","1","391","<p>My app allows you to share a photo from a gallery view to other services, such as Facebook.  I am launching a dialog to allow the user to select which service they want.  The code looks like this:</p><pre><code>public void sharePhoto(String fileName)    {        logger.debug(""User selected to share photo {}"", fileName);        final String extension = FilenameParser.extension(fileName);        String mimeType = MimeTypeMap.getSingleton().getMimeTypeFromExtension(extension.toLowerCase());        if(mimeType == null)        {            mimeType = MimeTypeMap.getSingleton().getMimeTypeFromExtension(extension.toUpperCase());        }        if(mimeType == null)        {            logger.warn(""Unable to share file {} because it's mime type could not be determined by the system."", fileName);            Toast.makeText(MainActivity.this, String.format(""Cannot share file %s because of an unknown file type."", selectedFile.getFileName()), Toast.LENGTH_SHORT).show();        }        else        {            logger.debug(""Launching Share Intent for file {}"", fileName);            Intent share = new Intent(Intent.ACTION_SEND);            share.setType(mimeType);            share.putExtra(Intent.EXTRA_STREAM, Uri.parse(""file://"" + fileName));            startActivity(Intent.createChooser(share, ""Share""));        }    }</code></pre><p>The code seems to be working just fine.  If I select services such as Flickr, Dropbox, Gmail, or the HTC Facebook app, everything is perfect.  If I select the Official Facebook app, and try to upload the photo through it, the photo is deleted from the SD card!  It seems to be deleted (or moved?) whether you go through and finish the upload process, or cancel it.  </p><p>I've stepped through my code about a dozen times making sure that there's no way my delete photo code is running in this case (it is another menu item if the user wants to do that).  I have a lot of trace in my delete code, and that code is not executing.  </p><p>If this isn't a known issue (or an issue with the way I am launching FB), does anyone know how to file a bug report with them?!?</p><p>Thanks,Kevin</p>","271177","","271177","","2011-02-20 14:25:21","2011-11-28 16:32:30","Official Facebook App seems to be deleting my photos when selected through Share API","<android>","0","2","1","",""
"5056941","1","9172287","","2011-02-20 12:13:20","1","759","<p>I have a sliding drawer implemented. But the problem is this:</p><p>I have a list view on the main screen with a drawer handle seen in the bottomIf I click on the list view - I have programmed it to open another activity.</p><p>When I open the sliding drawer it pops open beautifully.But when I click inside the sliding drawers contents, It responds as if I have clicked the list view in the previous screen!</p><p>Any help as to how to avoid this might be of great help!Thanks in advance.</p>","614285","","","","","2012-02-07 07:08:30","Clicking inside a sliding drawer","<android><slidingdrawer>","1","1","","",""
"5057080","1","5057263","","2011-02-20 12:38:49","1","1130","<p>I'm playing for learning purposes with Javas Generics and try to use Reflection on them. In the same moment I thoght I understand the half of it, I'm running into problems I didn't see a way to solve. I have a simple Box class:</p><pre><code>public class ReflectionBox&lt;E&gt;  {    protected E e;    public ReflectionBox(){}    public ReflectionBox(E element){ this.e = element; }    public void set(E element){ e = element; }    public E get(){ return e; }    //... a few reflection methods...}</code></pre><p>I extended this Class to try to implement an Interface with it. This Interface forces me to write an statement like this:</p><pre><code>public static final Parcelable.Creator&lt;ParcelableBox&lt;?&gt;&gt; CREATOR =         new Parcelable.Creator&lt;ParcelableBox&lt;?&gt;&gt;() {    @Override    public ParcelableBox&lt;?&gt; createFromParcel(Parcel source) {        return new ParcelableBox&lt;Object&gt;(source);    }}</code></pre><p>Is it Possible to get Class informations from <code>?</code> using Reflection? I cannot use methods from <code>Object</code> on it to reflect which Class is put inside, neither instanciate a <code>new ParcelableBox&lt;?&gt;(? element)</code>.The Parcel isn't the Class which E should be, but my Class is IN that Parcel and should be the Class of <code>?</code>. </p><hr><p>EDIT: Hi, thanks for all the answers: As many User don't understand, what I'm trying to do:There is an Interface <code>Parcelable</code>,which I think it works as a Data Stream, in which You can put Object members. You Use something like <code>parcel.writeString(String string)</code> or  <code>parcel.writeValue(Object value)</code> to store and <code>parcel.readValue</code> in the same direction as you put it inside. For learning I wanna implement this into a generic. So I wanna be able to store to Parcel, and read from it using Reflection.because CREATOR is static I cannot use E. </p>","620053","","620053","","2011-02-20 22:42:12","2011-02-20 22:42:12","Java Reflection on unknown Generic","<java><android><generics><reflection>","3","0","2","",""
"5057145","1","","","2011-02-20 12:52:52","2","1078","<p>I would like to register a broadcast receiver in Activity A, and unregister it in Activity B.I have this code which is static:</p><pre><code>private static BroadcastReceiver smsReceiver;    public static void registerSMSBR(Context context){        smsReceiver = new SmsReceiver();        IntentFilter filter = new IntentFilter();        filter.addAction(""SMS_RECEIVED"");        context.registerReceiver(smsReceiver, filter);    }    public static void unregisterSMSreceiver(Context context){        if(smsReceiver != null){            context.unregisterReceiver(smsReceiver);        }    }</code></pre><p>I've added the right permission and I'm calling <code>registerSMSBR(context);</code> in Activity A and <code>unregisterSMSreceiver(context);</code> in Activity B.</p><p>The problem is that ""unregisterSMSreceiver(context)"" doesn't unregister and onReceive still runs on new sms message. </p><p>What am I doing wrong? </p>","178016","","","","","2011-02-20 13:17:49","Unregister Broadcast Receiver in a static way - Android","<java><android><static><broadcastreceiver>","1","0","1","",""
"5057150","1","","","2011-02-20 12:53:27","2","504","<p>I have a ScrollView with some EditTexts in it. If I click on one of the EditTexts, software keyboard opens and the ScrollView scrolls so that the EditText is at the top. The scroll is not animated - the EditText just ""jumps"" to the top, which doesn't look nice. Can I make it animated?</p>","243225","","","","","2011-02-20 12:53:27","Animated scrolling in ScrollView","<android>","0","0","","",""
"5057171","1","5057579","","2011-02-20 12:59:17","2","5833","<p>eclipse seemed to be working ok with the rest of my projects until i created a new project. As i try to create it a dialog pops up from eclipse saying cannot find C:\android\tools\lib...\proguard.cfg. if i go ahead and create the project then no R.java is generated. i've search stackover flow and rebuilding project or doing a project clean does not work. any ides? thanks</p>","532462","","","","","2012-05-21 22:15:30","trying to start a new project and proguard.cfg not found","<android><proguard>","2","0","","",""
"5057194","1","5057207","","2011-02-20 13:05:34","0","805","<p>I have a ListView with a pretty standard view for each row - an icon with two labels (source below). I can use the keyboard to select items (which stay selected), but if I tap an item it's selected then deselected. Should it not stay selected? I've tried overriding the onKeyDown and onListItemClick events and just returning super.onKeyDown, but then the app just hangs.</p><p>The source of each row 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:orientation=""vertical""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:padding=""5dip""&gt;        &lt;LinearLayout            android:orientation=""horizontal""            android:layout_width=""fill_parent""            android:layout_height=""fill_parent""&gt;            &lt;ImageView android:id=""@+id/icon""                       android:layout_width=""wrap_content""                       android:layout_height=""wrap_content""                       android:minWidth=""24px""                       android:maxWidth=""24px""                       android:layout_marginRight=""4dip""                       android:layout_gravity=""center_vertical""/&gt;            &lt;TextView android:id=""@+id/name""                android:textSize=""18dip""                android:layout_width=""wrap_content""                android:layout_height=""wrap_content""/&gt;        &lt;/LinearLayout&gt;        &lt;TextView android:id=""@+id/description""           android:textSize=""12dip""           android:layout_marginTop=""2dip""           android:layout_width=""wrap_content""           android:layout_height=""wrap_content""/&gt;&lt;/LinearLayout&gt;</code></pre>","30512","","","","","2011-02-20 13:10:23","Android: ListView item deselected after tap","<android><events><listview><layout><click>","1","0","","",""
"5057364","1","5057824","","2011-02-20 13:42:22","2","3908","<p>I have a database as follows:</p><pre><code>------------------------------BOOK NAME | BOOK FORMAT | COUNT |------------------------------Android   | HTML       | 1WPF       | PDF        | 10Symbian   | PS         | 2Windows   | HTML       | 2</code></pre><p>I am showing this database to the userby making use of a CustomSimpleCursorAdapter.</p><p>CustomSimpleCursorAdapter extends SimpleCursorAdapterimplements Filterable</p><p>with getView() &amp; runQueryonBackgroundThread() being overriden. The Grid view of books is properly shown.</p><p>The user has the following options:</p><p>HTML | PDF | PS | DELETE </p><pre><code>Constraint: BOOK FORMAT[HTML - 1, PDF - 2, PS - 3] </code></pre><p>When the user presses HTML menu option, the books with HTMLtype has to be shown.</p><p>inside MenuOption handler(), I wrote as follows:</p><pre><code>adapter.getFilter().filter(""1"");runQueryonBackgroundThread(){if(mCursor != null)mCursor.close();mCursor = query(using the constraint)return mCursor;}</code></pre><p>This constraint reaching my overriden runQueryonBackgroundThread()method. But its not updating the grid view and throws an exception.</p><p>""FILTER: android.view.ViewRoot$CalledFromWrongThreadException: Only theoriginal thread that created a view hierarchy can touch its views""</p><p>Please help me.</p><p>Thank you,</p><p>Ram</p>","625250","","625250","","2011-02-20 13:48:46","2011-05-16 14:43:12","FilterQueryProvider, filter and ListView","<android>","1","0","1","",""
"5057394","1","5058761","","2011-02-20 13:47:50","4","3716","<p>I am trying to MAKE / Compile a single AOSP project from the repository - specifically packages/apps/Email.</p><p>Does anyone know how to do it?(I have no problem compiling the entire repository, but I really would like to be able to compile a single project as well).</p>","609444","","1108213","","2012-02-11 00:15:57","2012-02-11 00:15:57","CyanogenMod or AOSP: Compile a single project","<android><cyanogenmod><android-source>","2","2","1","",""
"5057410","1","5057488","","2011-02-20 13:51:17","1","730","<p>i am working on a simple home launcher, but a cant find a way to access global android setting like wireless,application etc, i've alredy read <a href=""http://developer.android.com/reference/android/provider/Settings.System.html"" rel=""nofollow"">http://developer.android.com/reference/android/provider/Settings.System.html</a> but couldnt find the answer,please someone tell me how to do that, sorry for my bad english</p>","625259","","","","","2011-02-20 14:07:19","access android global setting via code","<android>","2","2","","",""
"5057417","1","5057608","","2011-02-20 13:52:37","4","7292","<p>I am trying to open input and output streams in android but I'm not sure how to go about this. I have opened a socket connection in J2ME previously by using the following in the server:</p><pre><code>scn = (ServerSocketConnection) Connector.open(""socket://:5000"");     String myAddress = scn.getLocalAddress();si.setText(""My address: "" + myAddress);// Wait for a connection.sc = (SocketConnection) scn.acceptAndOpen();//Get address of socket connectionString yourAddress = sc.getAddress();si.setText(""Connected to: "" + yourAddress);is = sc.openInputStream();os = sc.openOutputStream();</code></pre><p>Now I want to put this into android but its not letting me open input and output streams and also I had to change a few things which I'm not sure would work in the same way.</p><pre><code>scn = (ServerSocket) Connector.open(""socket://:5000"");        String myAddress = scn.getLocalAddress();        Connection.setText(""My address: "" + myAddress);        // Wait for a connection.        Socket sc = scn.accept();        //Get address of socket connection        String yourAddress = sc.getAddress();        Connection.setText(""Connected to: "" + yourAddress);        is = sc.openInputStream();        os = sc.openOutputStream();</code></pre><p>The errors which I am getting in android are with the Connector, getLocalAddress, getAddress and openInput and OutputStreams. </p><p>I would appreciate any help on this, as I am having great difficulty setting this up in android. </p><p>Thanks</p><p>Edit: </p><p>I have changed the Android code to this: </p><pre><code>ServerSocket scn = new ServerSocket(5554);        InetAddress myAddress = scn.getInetAddress();        Connection.setText(""My address: "" + myAddress);        // Wait for a connection.        Socket sc = scn.accept();        //Get address of socket connection        InetAddress yourAddress = sc.getInetAddress();        Connection.setText(""Connected to: "" + yourAddress);        is = sc.openInputStream();        os = sc.openOutputStream();</code></pre><p>Which compiles fine but I get an error on:</p><pre><code> is = sc.openInputStream();        os = sc.openOutputStream();</code></pre><p>Is there another way to open input and output streams in android?</p><p>Thanks.</p>","608658","","608658","","2011-02-20 14:11:57","2011-02-20 14:31:43","Socket connection android","<android>","1","2","1","",""
"5057510","1","5059865","","2011-02-20 14:11:27","1","2420","<p>I am drawing some Bitmaps to a canvas.  Some (most) of these bitmaps utilize the alpha channel, and transparency/translucency is critical for the image to look correct.  This is necessary due to some image manipulation I perform throughout the <code>Activity</code>.</p><p>Eventually the user is finished with their task and I take the canvas and save it to a PNG via use of this method:</p><pre><code>Bitmap.createBitmap(this.getWidth(), this.getHeight(), Bitmap.Config.ARGB_8888);</code></pre><p>At this point I no longer make any modifications to the canvas/image but I do display the image to a <code>Canvas</code> in another <code>Activity</code>.  I want it to look <em><strong>exactly</strong></em> the same as in the previous <code>Activity</code>, so does it matter if I use <code>Bitmap.Config.RGB_565</code> instead or will I lose information?</p>","432209","","","","","2011-02-20 20:40:33","Bitmap.Config differences with/without alpha channel on a canvas","<android><canvas><bitmap>","1","0","1","",""
"5057623","1","5057770","","2011-02-20 14:33:31","0","912","<p>I've set up a new Access Point on my emulator so that I can view traffic in Fiddler by following the instructions here: <a href=""http://aurir.wordpress.com/2010/03/22/tutorial-getting-android-emulator-working-with-fiddler-http-proxy-tool/"" rel=""nofollow"">http://aurir.wordpress.com/2010/03/22/tutorial-getting-android-emulator-working-with-fiddler-http-proxy-tool/</a></p><p>This works for the browser requests from the Emulator but the HttpPost request in my application is now visible in Fiddler.</p><p>Here's the code I'm using:</p><pre><code>private InputStream post(String url, Hashtable&lt;String, String&gt; postvariables) {    DefaultHttpClient httpClient = new DefaultHttpClient();    URI uri;    InputStream data = null;    try {        uri = new URI(url);        HttpPost method = new HttpPost(uri);        method.setHeader(""Content-Type"",""application/json"");        String param = new String();        Enumeration&lt;String&gt; e = postvariables.keys();        while(e.hasMoreElements())        {            String key = e.nextElement();            param = param + key + ""="" + postvariables.get(key);             if(e.hasMoreElements()) {                param = param + ""&amp;"";            }        }        Log.i(""RestClient"",url + param);        HttpEntity entity = new StringEntity(param);        method.setEntity(entity);        HttpResponse response = httpClient.execute(method);        data = response.getEntity().getContent();    } catch (Exception e) {        e.printStackTrace();    }    return data;}</code></pre><p>Any idea what I'm doing wrong?</p>","4950","","","","","2011-02-20 14:57:45","Android: Why is HttpPost request not going through proxy?","<android><http-requests>","1","0","","",""
"5057719","1","5057870","","2011-02-20 14:48:23","0","502","<p>I want the user to be able to select from a list of string values (about 25 in all) and like the idea of using the DatePicker style component to do it. However, all I can find is the spinner which is a drop down box and my selection list is just a little too big for it. Is there a component like DatePicker I can use?</p>","616076","","","","","2011-02-20 15:14:30","Is there a component like DatePicker for selecting String values?","<android><components>","2","0","","",""
"5057828","1","5057888","","2011-02-20 15:07:31","5","10608","<p>In my android app, I show some users in a ListView. I want to display (user's pic, first_name, last_name). Right now, it works only with first_name and last_name. I want to add the picture. The data JSON I receive from my server (python) is like this:</p><pre><code>[{""profil"":""first_name"": ""Jim"", ""last_name"": ""Carrey""}}, ""_id"": {""$oid"": ""4d595cda1d41c81536000000""}}, {""profil"":{""first_name"": ""Mathieu"", ""last_name"": ""Polnari""}}, ""_id"": {""$oid"": ""4d5916581d41c80e88000000""}}, {""profil"": {""first_name"": ""Vincent"", ""last_name"": ""Fatou""}}, ""_id"": {""$oid"": ""4d58fc7e1d41c8090e000000""}}...] </code></pre><p>It should be better if I add one parameter in that JSON for the picture.</p><p>Do you think it is a good idea to return the picture as a string in the JSON et use Base64 to decode it?      </p>","420574","","","","","2011-02-20 15:18:55","How can I pass images in a server's response using JSON? Base64?","<python><android><image><listview><base64>","2","0","1","",""
"5057880","1","5350453","","2011-02-20 15:16:53","2","570","<p>I have an ArrayList of contacts that contains a phone number and a status field.  I want to update the status field on a successful send result.</p><p>I even tried passing the index of the ArrayList item in to the Pending Intent with contacts.indexOf(c.getPhoneNumber()) as the int requestCode.  I just cant' figure out how to tell which message is reporting back as successful and update my contact item.</p><pre><code>package com.example.SMS;public class SendSMSActivity extends SMSActivity {    private EditText smsMessageBody;    private Button send_button;    private SmsManager sms;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.sendsmsactivity);        setupViews();    }    private void setupViews() {        smsMessageBody = (EditText) findViewById(R.id.smsText_editText1);        broadcast_button = (Button) findViewById(R.id.sendsms_button);        send_button.setOnClickListener(new View.OnClickListener() {            public void onClick(View v) {                if (smsMessageBody.getText().toString().length() &gt; 0 ) {                    if (!getSendSMSApplication().getCurrentContacts().isEmpty()) {                        sendSMSLoop();                        Toast.makeText(getBaseContext(), R.string.messages_sent, Toast.LENGTH_SHORT).show();                        getSendSMSApplication().setCurrentContacts(null);  //  Clear existing contacts after send                        finish();                    } else {                        Toast.makeText(getBaseContext(), R.string.error_no_numbers, Toast.LENGTH_SHORT).show();                    }   //  there are phone numbers to send to?                } else {                    Toast.makeText(getBaseContext(), R.string.error_no_message, Toast.LENGTH_SHORT).show();                }   //  user entered a message?            }        });    }    protected void sendSMSLoop() {        ArrayList&lt;ContactItem&gt; contacts = getSendSMSApplication().getCurrentContacts();        for (ContactItem c:contacts) {            sendSMS(c.getPhoneNumber().toString(), smsMessageBody.getText().toString(), contacts.indexOf(c.getPhoneNumber()));        }    }    public void sendSMS(String phoneNumber, String message, int messageIndex)    {                String SENT = ""SMS_SENT"";        PendingIntent sentPI = PendingIntent.getBroadcast(this, messageIndex, new Intent(SENT), 0);        registerReceiver(new BroadcastReceiver(){            @Override            public void onReceive(Context arg0, Intent arg1) {                switch (getResultCode())                {                case Activity.RESULT_OK:                    Toast.makeText(getBaseContext(), R.string.sms_sent, Toast.LENGTH_SHORT).show();                    break;                }            }        }, new IntentFilter(SENT));        sms = SmsManager.getDefault();        sms.sendTextMessage(phoneNumber, null, message, sentPI, null);    }}</code></pre>","617044","","","","","2011-03-18 10:07:19","Which request is my onReceive answering to?","<android><sms><arraylist><android-pendingintent>","2","0","1","",""
"5057894","1","5057925","","2011-02-20 15:20:04","0","42","<p>I understand that to apply a style you have to create the textview and apply the style programmatically, which I haven't figured out how to do yet, but what can you edit on the fly. Like text color? Background color? What things can or what cannot be edited on the fly from the java. Also can it be defined in the xml and then edited in the Java or must anything you want to change or set be defined solely from the Java?</p>","614460","","","","","2011-02-20 15:24:59","What can be edited on the fly?","<android>","1","0","","",""
"5057920","1","","","2011-02-20 15:24:13","0","621","<p>Can we customize the PreferenceActivity's layout screen.</p>","622910","","","","","2011-05-10 11:31:32","PreferenceActivity Customization","<android><android-preferences>","1","1","1","",""
"5058007","1","5058621","","2011-02-20 15:38:31","1","818","<p>I was doing the HelloGridview Android tutorial, Managed to fix the errors I was experiencing and got it to compile, but when I run the project all I see is a blank screen.</p><p>Is it something to do with the folder layout in my project? I created a new folder called 'drawable', separate to the drawable-hdpi, drawable-idpi and drawable-mdpi folders</p><p>Here's the xml and the two classes</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;package com.example.hellogridview;import android.app.Activity;import android.os.Bundle;import android.view.View;import android.widget.AdapterView;import android.widget.AdapterView.OnItemClickListener;import android.widget.GridView;import android.widget.Toast;public class HelloGridView 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.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();            }           });    }}package com.example.hellogridview;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><p>Any help would be much appreciated, thanks.</p>","625333","","","","","2014-01-10 09:25:43","HelloGridview Android tutorial - blank screen when run","<android>","4","0","2","",""
"5058016","1","5059137","","2011-02-20 15:39:48","3","5012","<p>I would like to make my own dialog, completely drawn myself, as a custom view. Can I display it in such a way that it displays above all other views and that all touch events, even those outside the dialog's area, are redirected to the dialog?</p>","606036","","","","","2011-03-01 15:17:57","Android: How to make a modal custom view?","<android><layout><view>","2","0","3","",""
"5058020","1","5058371","","2011-02-20 15:40:14","0","360","<p>Is it possible to us file aliases within an Android APK?</p><p>For example, I have the same file that I wish to reference using <code>R.drawable.icon_name,</code> and I am using the same icon for hdpi, ldpi, and mdpi. Is it possible to use file aliases/ symlinks to have the icon in <code>/res/hdpi/</code> and create aliases in <code>/res/mdpi/</code> and <code>/res/ldpi/</code> pointing to that file, or is there a better approach altogether?</p>","148824","","","","","2011-02-20 16:38:02","Using file aliases inside an Android APK?","<android><alias><symlink><apk>","1","2","2","",""
"5058048","1","6287825","","2011-02-20 15:44:04","0","141","<p>I am creating an app that requires the user to type into an EditText. sometimes they need to type in a different language. the problem is, this language is not available on android, and I don't know how to customize my own keyboard. does anybody know how to do this?</p>","599402","","","","","2011-06-09 03:31:25","how do I ceate a keyboard in android","<android><android-softkeyboard>","1","3","","",""
"5058069","1","5063364","","2011-02-20 15:48:32","0","263","<p>I am creating <code>SharePreference</code> using:</p><pre><code>sharedPreference=getSharedPreferences(SHARED_PREFE_LOCATION, 0);preferenceEditor=mSharedPreference.edit();preferenceEditor.commit();</code></pre><p>And have setup a screen using <code>Preference From Code</code> SDK sample.</p><p>Now what I want is when user changes the preference using the code generated <code>PreferenceScreen</code> the changes should reflect in preference file <code>SHARED_PREFE_LOCATION</code> (from my code variable.) and not in <code>defaultSharedPreference</code>.</p><p>How can I do that.</p><p><strong>EDIT</strong></p><p>I know I can implement on <code>PreferenceChangeListener</code> and reflect the changes in the desired file. But thats tedious. Is there any straight forward way?</p>","514553","","514553","","2011-02-20 16:06:47","2011-02-21 07:30:15","Android SharedPreference specific storage and retreival","<android><storage><preferences>","1","0","1","",""
"5058085","1","5058375","","2011-02-20 15:50:27","0","973","<p>I am currently developing an app where the main screen hasn't got an actual view as in setContentView(R.layout.myScreen); is used. Instead it uses an XML file which just details a textview which is assigned to an list adapter and fill with data from the database. </p><p>Below is the XML file that is used</p><pre><code>    &lt;?xml version=""1.0"" encoding=""utf-8""?&gt;    &lt;TextView xmlns:android=""http://schemas.android.com/apk/res/android""            xmlns:myapp=""http://schemas.android.com/apk/res/com.BoardiesITSolutions.PasswordManager""            android:id=""@+id/showLogin""            android:layout_width=""fill_parent""            android:layout_height=""fill_parent""            android:padding=""10dp""            android:textSize=""16dp""&gt;    &lt;/TextView&gt;</code></pre><p>And below is the code where data is added to the textview list adapter</p><p>public class ShowLogins extends ListActivity {</p><pre><code>String LOGINS[] = null;String company = null;String longClickCompany;String companyName = """";String companyURL = """";String companyUsername = """";String companyPassword = """";Boolean passwordEnabled;public void onCreate(Bundle savedInstanceState){    SharedPreferences settings = getSharedPreferences(""prefs"", 0);    boolean enablePassword = settings.getBoolean(""enablePassword"", false);    boolean loggedIn = settings.getBoolean(""loggedIn"", false);    super.onCreate(savedInstanceState);    if (loggedIn)    {        passwordEnabled = settings.getBoolean(""enablePassword"", false);        setContentView(R.layout.show_login);    //registerForContextMenu(getListView());    addToArray();    setListAdapter(new ArrayAdapter&lt;String&gt;(this, R.id.showLoginBox, LOGINS));    //ListView lv = getListView();    ListView lv = (ListView)findViewById(R.id.show_list_view);    //View myView = findViewById(R.layout.advert);    //lv.addView(myView);    lv.setTextFilterEnabled(true);    lv.setOnItemLongClickListener(new OnItemLongClickListener() {        @Override        public boolean onItemLongClick(AdapterView&lt;?&gt; parent, View view,                int position, long id) {            longClickCompany = ((TextView) view).getText().toString();            return false;        }    });    lv.setOnItemClickListener(new OnItemClickListener() {        @Override        public void onItemClick(AdapterView&lt;?&gt; parent, View view, int position, long id) {            company = ((TextView) view).getText().toString();            StringTokenizer st = new StringTokenizer(company, ""\n"");            String companyName = st.nextToken();            String username = st.nextToken();            prepareLoadingWebsite(companyName, username);        }    });    }    else    {        Intent intent = new Intent(ShowLogins.this, SplashScreen.class);        startActivity(intent);    }}private void addToArray(){    int totalRows = 0;    int added = 0;    int arrayField = 0;    SQLiteDatabase myDB = null;    Cursor c = null;    Cursor count = null;    try    {        myDB = this.openOrCreateDatabase(""PasswordManager"", MODE_PRIVATE, null);        count = myDB.rawQuery(""SELECT COUNT(*) FROM PASSWORD"", null);        if (count.moveToNext())        {            totalRows = count.getInt(0);        }        LOGINS = new String[totalRows];        c = myDB.rawQuery(""SELECT * FROM password ORDER BY pas_company ASC"", null);        while(arrayField &lt;=2 &amp;&amp; c.moveToPosition(added))        {            LOGINS[added] = c.getString(1) + ""\n"" + c.getString(3);            added++;        }        if (totalRows == 0)        {            AlertDialog.Builder builder = new AlertDialog.Builder(this);            builder.setMessage(""No login records have been found.\n\n Press menu &gt; New login to add a record"")                .setCancelable(false)                .setPositiveButton(""OK"", new DialogInterface.OnClickListener() {                    @Override                    public void onClick(DialogInterface dialog, int which) {                        dialog.cancel();                    }                });            AlertDialog alert = builder.create();            alert.show();        }        else        {            setListAdapter(new ArrayAdapter&lt;String&gt;(this, R.layout.show_login, LOGINS));            ListView lv = getListView();            lv.setTextFilterEnabled(true);        }    }    catch (SQLiteException ex)    {        Log.d(""Database Error"", ex.toString());    }    finally    {        myDB.close();        c.close();        count.close();    }}</code></pre>","499448","","499448","","2011-02-20 16:35:50","2011-02-20 16:38:44","Using AdMob Adverts with ListAdapter on Android","<android><admob>","3","0","1","",""
"5058136","1","5355249","","2011-02-20 15:58:27","1","83","<p>So I'm making a task management app in Android and have thus far made an implementation that just displays a list of tasks which are store in an SQLite database.</p><p>I want to be able to add categories or folders that the tasks can be sorted in to, and planned to do it using a one to many relationship with SQLite but from what I've read SQLite isn't great with foreign keys?</p><p>I would appreciate any input or thoughts regarding the best method for doing such a thing.</p>","319940","","","","","2011-03-18 16:51:09","Making a ""folder"" in Android app - sqlite or other method?","<android>","2","0","","",""
"5058291","1","5058401","","2011-02-20 16:23:40","22","48697","<p>I have a list of albums (several hundred).When I touch the selected album I want to offer the user a choice of playing the whole album, or moving to its track ListView. No problem.However, after touching the ablum in albumListView I want the row to remain highlighted so the user knows which item they have clicked on, and can then move to OK or PLAY. How do I highlight a row in ListView?</p>","611089","","","","","2013-11-02 17:20:26","Highlight ListView selected row","<android><listview><row><highlight>","8","0","9","",""
"5058310","1","5058356","","2011-02-20 16:25:39","1","1376","<p>I've done absolute positioning on Android via density independent pixels and it works great on all the available emulator profiles. However, the Samsung Galaxy Tab has a density of 240 (like WVGA devices), but a much larger resolution: 1024x600. As a result, the positioning is off.</p><p>Are there other devices where density and resolution don't seem to fit together? How should I tackle these issues? It basically means I can't use density independent pixels, doesn't it?</p>","606036","","1140748","","2012-05-06 16:03:18","2012-05-06 16:03:18","Android: Density independent pixels and the Samsung Galaxy Tab","<android><resolution><css-position>","2","0","1","",""
"5058332","1","5058569","","2011-02-20 16:29:59","5","7671","<p>I'm planning Android app which extensively uses local DB. DB would contain approx 15 tables , properly normalized  (FK, PK etc).  4 Main tables would have up to 1000 entries and about 15 columns with text, date/time and numbers only. </p><p>I wondering whether this configuration is feasible on Android phone/tablet.Am I pushing sqlite and Android OS to the limits?I cant find any firm figures about sqlite limitations on Android OS.</p><p>Many thanks</p>","413824","","457982","","2011-02-20 17:13:57","2011-02-20 17:24:48","SQLite database limits in Android","<android><sqlite>","3","0","2","",""
"5058440","1","5058494","","2011-02-20 16:50:01","5","4300","<p>Are there any decent Android NDK examples and tutorials out there? Where can I find them? If there are any geared more specifically towards game engine development (as I am looking to convert mine over to android) that would be most helpful.</p>","573203","","573203","","2011-11-08 20:22:01","2012-08-31 06:38:33","Android NDK tutorials?","<android><android-ndk>","3","0","3","",""
"5058449","1","5061515","","2011-02-20 16:51:45","1","3278","<p>I'm developing an Android 2.2 application.</p><p>I want to move an image from left side of the screen to the right side of the screen.</p><p>How can I do that? I've read that I have to add this image to a ListView or to a GridView to setup this animation.</p><p><strong>UPDATE</strong><br/><br/>I've created the following files:<br/><br/><strong>anim/translate_right</strong><br/></p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;set xmlns:android=""http://schemas.android.com/apk/res/android""    android:interpolator=""@android:anim/accelerate_decelerate_interpolator""&gt;    &lt;translate        android:fromXDelta=""-100%p""        android:toXDelta=""0""        android:duration=""5000"" /&gt;&lt;/set&gt;</code></pre><p><strong>anim/ship_layout_controller</strong><br/></p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;layoutAnimation xmlns:android=""http://schemas.android.com/apk/res/android""        android:delay=""10%""        android:animationOrder=""reverse""        android:animation=""@anim/translate_right"" /&gt;</code></pre><p><strong>layout/startpage</strong><br/></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;TextView         android:id=""@+id/appNameTextView""        android:text=""@string/app_name""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:layout_gravity=""center""        android:layout_marginTop=""40px""/&gt;    &lt;Button        android:id=""@+id/PlayButton""        android:text=""@string/play""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:layout_gravity=""center""        android:layout_marginTop=""40px""/&gt;    &lt;AbsoluteLayout        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        xmlns:android=""http://schemas.android.com/apk/res/android""&gt;        &lt;ImageView            android:id=""@+id/greekShip""            android:persistentDrawingCache=""animation|scrolling""            android:layoutAnimation=""@anim/ship_layout_controller""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:src=""@drawable/greekship""            android:maxWidth=""176px""            android:maxHeight=""87px""            android:layout_x=""-300px""/&gt;    &lt;/AbsoluteLayout&gt;&lt;/LinearLayout&gt;</code></pre><p><strong>StartActivity.java</strong><br/></p><pre><code>public class StartActivity extends Activity {    @Override    protected void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.startpage);    }    @Override    protected void onResume() {        super.onResume();        ImageView ship = (ImageView)findViewById(R.id.greekShip);        ship.startAnimation(AnimationUtils.loadAnimation(this, R.anim.translate_right));    }}</code></pre><p>But it doesn't work.</p>","68571","","68571","","2011-02-22 17:21:43","2013-05-14 23:31:20","Moving an image through a linearlayout","<android><animation><imageview><android-2.2-froyo>","4","9","","",""
"5058529","1","5058619","","2011-02-20 17:05:27","0","554","<p>Is there a way to get emails from built-in Android email application. If so, how can i achieve that?</p>","611206","","","","","2011-02-20 17:20:49","Get email from built-in email application in Android","<android><email>","1","1","2","",""
"5058542","1","5058607","","2011-02-20 17:06:52","1","268","<p>In an given Android activity, I would like to start a new activity for the user at some point. Once they leave the first activity and arrive at the second, the first activity is hidden.. </p><p>Now my question is </p><p>I want to bring back the first activity (i dont want to create a new instance of the first activity but to bring back the already existing instance of the first activity) when a button is clicked in the second activity ...</p><p>thanks :) </p>","601142","","","","","2011-02-21 03:37:00","Switching between activity?","<android><eclipse><activity><android-intent>","4","0","","",""
"5058661","1","5058733","","2011-02-20 17:25:27","13","5543","<p>I'm writing an application that validates login credentials on an external webserver - so I have the basic issue of creating a login screen that when submitted will send an HTTP request to a server in the background and not cause the UI to hang - whilst providing a ProgressDialog to the user.</p><p>My problem lies in, I want to write a generic HTTP Request class that extends AsyncTask, so when I call <code>.execute()</code> I will then pass String parameters which may contain something like 'post', and when <code>doInBackground</code> is called this will see the 'post' string and then forward those parameters onto the respective call in my class.  Pseudo code would be something like</p><pre><code>public class HTTPOperations extends AsyncTask&lt;String, Void, String&gt;{doInBackground(String... string1,additionalParams){  if string1.equals ""post""      response = httpPost(additionalParams)       return response;}httpPost(params){// do http post request}}</code></pre><p>This is all I could think of, other than creating a class for every HTTP Post/GET etc request I wish to make and extending ASyncTask...</p><p>Which leads me to my next problem, if the HTTP POST is successful and it returns an authentication token, how do I access this token?</p><p>Because new httpOperations.execute(), does not return the string from doInBackground, but a value of type </p><p>Sorry if this doesn't make sense, I can't figure this out at all.  Please ask for elaboration if you need it.  AsyncTask design patterns and ideas are hugely welcomed.</p>","614442","","","","","2012-12-16 01:40:16","AsyncTask Android - Design Pattern and Return Values","<android><http><design-patterns><android-asynctask>","1","0","7","",""
"5058694","1","18869668","","2011-02-20 17:30:43","3","863","<p>I am building an app that contains a WebView which will be used to show the user some links and some plain text. I want to make it so that the user can LongClick on a link, or a body of text and get the option to delete that thing from the html thats being shown in the WebView. <a href=""http://stackoverflow.com/questions/3449098/enable-longclick-in-webview"">This question</a> got me half way there. LongClicking on the links works by using the wv.getHitTestResult() method. But now my problem is when I long click on plain text the onLongClick() method of the listener doesn't get called, and even if it did getHitTestResult() would not return the text that the user is touching(I tried setting an onTouchListener to see if getHitTestResult().getExtra() had a value when I touched plain text)</p><p>So my questions is does anyone know how I can get LongClick events inside of a WebView that are on text that is not Linkified?(I assume this is possible some how because that is how I can select text in the default browser). and once I get the LongClick event how can I get access to which body of text was clicked?</p>","507810","","","","","2013-09-18 10:21:44","onLongClick for plain text inside of a WebView","<android><webview><onlongclicklistener>","1","3","","",""
"5058715","1","","","2011-02-20 17:34:05","0","722","<p>I have a beagle board, i have ported android on it.Now i want to integrate GPS with it.Are there any solutions available? if not how to do it?</p>","625445","","","","","2012-04-04 10:51:48","how to port Android on beagle board with GPS?","<android><beagleboard>","1","0","","",""
"5058739","1","5058757","","2011-02-20 17:37:24","1","467","<p>I created a file  option_menu.xml:  in the directory /res/menu/</p><p>I created a file menu.java that contains this code: </p><pre><code>  @Overridepublic boolean onCreateOptionsMenu(Menu menu) {     MenuInflater inflater = getMenuInflater();     inflater.inflate(R.menu.option_menu, menu);     return true;}</code></pre><p>where I can put this code for my menu works?(In menu.java?</p><pre><code>@Overridepublic boolean onOptionsItemSelected(MenuItem item) {    switch (item.getItemId()) {        case R.id.nelp:            help();            return true;        case R.id.quit:           quit();        default:            return super.onOptionsItemSelected(item);    }}</code></pre><p>My application contains 4 java files  </p><p>I Hope the menu to be accessible at any Activity.</p><p>Thank you in advance</p>","616263","","","","","2011-02-20 17:45:53","add a menu to my application with android","<android>","1","0","","",""
"5058851","1","5060868","","2011-02-20 17:59:18","0","564","<p>My application has a simple 'About' box. </p><p>It has a few clickable TextViews (email addresses, phone nos, addresses) all contained within a relative layout within a ScrollView (To accommodate low res screens). </p><p>The device I am testing with (Motorola Charm O.S ver 2.1 update 1) has a regular QWERTY keyboard. The problem I am facing is with the use of the arrow keys.</p><p>I want the cursor to move predictably from one clickable field to the next and this is where I need help. On the fields that don't need focus I have set the android:cursorVisible=""false"".I tried using the android:nextFocus* properties but still don't get the desired behavior. </p><p>The cursor gets stuck in the first field and overall the behavior is a bit unpredictable. Any ideas on how to get this done. Right now trapping the keys using code seems to be the only option. </p>","541919","","","","","2011-02-20 23:29:51","Navigating Textviews using arrow keys","<android><keyboard><textview><arrow>","1","0","","",""
"5058880","1","5058939","","2011-02-20 18:03:23","4","4664","<p>I'm new to both Java and Android development so this might be a stupid question, but I've been searching for days now and can't find a solution:</p><p>I try to output a <code>java.util.Date</code> depending on the user's locale.</p><p>Searching on StackOverflow lead me to this:</p><pre><code>java.util.Date date = new Date();String dateString = DateFormat.getDateFormat(getApplicationContext()).format(date);</code></pre><p>This outputs:</p><pre><code>20/02/2011</code></pre><p>On my french localized phone. Almost fine.</p><p>How can I also output the <strong>hours, minutes and seconds parts</strong> of the <code>Date</code>, using the user's locale ? I've been looking in the android documentation but couldn't find anything.</p><p>Many thanks.</p>","279259","","279259","","2011-02-20 18:15:28","2012-12-10 20:57:01","Date and time formatting depending on locale","<java><android><date><formatting><locale>","4","0","2","",""
"5058915","1","","","2011-02-20 18:08:31","2","8242","<p>I have my droid device connected through USB and using Eclipse for debugging my application running on the device. Everything is fine, except my application needs to connect to a web application running on the same host computer (Windows XP, IE). The web address on the IE was ""http://local:4566/MyApp/"".</p><p>I tried to set my android app to ""http://10.0.2.2:4566/MyApp"", but no luck. The android app's connection simply times out. The document under <a href=""http://developer.android.com/guide/developing/tools/emulator.html"" rel=""nofollow"">http://developer.android.com/guide/developing/tools/emulator.html</a> says that the ip address may be different for devices (see Network Address Space section) but no further details on how to find that.</p><p>Question is, how to I connect to a local web application running on my host computer (windows xp) from an Android application connected through USB running debug under Eclipse?</p><p>Appreciate any help.</p><p>thanks,Guna</p>","625474","","","","","2012-09-20 09:35:52","How to connect android application running on a device to a local web application?","<android><web-applications><windows-xp><connection><device>","3","1","","",""
"5058934","1","5059024","","2011-02-20 18:10:55","1","7516","<p>In the app I'm developing for Android I'm letting users create files specific to my application with the extension "".rbc"". So far I have been successful in creating, writing to, and reading from these files.</p><p>Right now I am trying to count the number of these files that exists. I'm not particularly familiar with Java and I'm just beginning programming for Android so I feel a bit lost. All of my attempts so far at doing this have not been able to locate any files with my extension.</p><p>So I basically have two questions I need answered so that I can figure this out:</p><p>Where is the default directory where Android stores files created by an application?</p><p>Do you have any examples do you can give me of counting files with a specific extension on Android?</p><p>Thank you very much in advance for your time.</p>","473481","","","","","2011-02-20 18:28:43","How do I count the number of files with a specific extension on Android?","<java><android><file-io><file><filesystems>","3","0","2","",""
"5058962","1","5059018","","2011-02-20 18:15:39","5","939","<p>Is it possible to add a button to an app that tries to upgrade the app?</p><p>I'd love to be able to add a button to the preferences that looks for a newer version of the app. If there is one available, I'd like that button to become active so the user can click it to upgrade.</p><p>UPDATE:Thanks this got me going the right direction. I took a pretty simple approach. Here's the final code for including a ""Check for Updates"" button to the preferences.</p><p>In the preference XML:</p><pre><code>&lt;Preferenceandroid:title=""Check for Updates""android:summary=""Version: 1.3""android:key=""versionPref"" /&gt; </code></pre><p>In java:</p><pre><code>// select buttonPreference versionPref = findPreference(""versionPref"");// set stringString versionName = getVersionName();versionPref.setSummary(""Version: ""+versionName);// attach to buttonversionPref.setOnPreferenceClickListener(new OnPreferenceClickListener() {    public boolean onPreferenceClick(Preference preference) {    Intent intent = new Intent(Intent.ACTION_VIEW);     intent.setData(Uri.parse(""market://search?q=pname:com.mycompany.myapp""));     startActivity(intent);    return true;    }});</code></pre><p>//Get string name</p><pre><code>   public String getVersionName() {       String versionName = """";       try {         versionName = getPackageManager().getPackageInfo(getPackageName(), 0).versionName;       } catch (NameNotFoundException e) {          // Huh? Really?       }       return versionName;    }</code></pre>","401183","","401183","","2011-02-21 01:06:45","2011-02-21 01:06:45","Android: adding an upgrade button","<android><button><upgrade>","2","0","3","",""
"5059028","1","5060245","","2011-02-20 18:27:38","4","2503","<p>I have a question about the Activity's state while in onActivityResult.  Specifically, is it 'guaranteed' that either onRestoreInstanceState or onCreate have been called prior to onActivityResult for an Activity?  In other words, is it safe to assume that the state data (member variables and such) of the Activity are 'usable' while in onActivityResult (assuming you have properly handled onRestoreInstanceState and or onCreate)? </p>","625469","","","","","2011-02-20 21:39:22","State of Activity while in onActivityResult question","<android><activity>","2","0","5","",""
"5059062","1","5059075","","2011-02-20 18:33:08","0","2382","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/4842611/r-file-is-missing-android"">R file is missing android</a>  </p></blockquote><p>HelloThe file R.java is deleted when i clicked on ""clean""</p><p>How can i recreated it??</p><p>thank you</p>","616263","","19750","","2011-02-20 22:46:31","2011-02-21 01:45:55","R.java is deleted","<android><r.java-file>","2","4","","2011-02-21 02:28:54",""
"5059096","1","","","2011-02-20 18:39:23","0","252","<p>I'd like to test that my activity has the correct number of menu items. How do I get a reference to the menu items from an ActivityInstrumentationTestCase2 ?</p>","338825","","","","","2012-06-26 21:54:15","How to write JUnit tests for menus?","<android><menu>","1","0","","",""
"5059103","1","","","2011-02-20 18:41:04","0","1876","<p>Hey everybody,I am writing an app that uses geolocation to track a user while he is walking from point A to point B. Here is my code so far:</p><pre><code>public class LocationTest extends Activity {       private static final String[] S = { ""out of service"", ""temporarily unavailable"", ""available"" };    ArrayList&lt;Location&gt; list = new ArrayList&lt;Location&gt;();    private TextView output;    private String best;    LocationListener locationListener;    LocationManager mgr;    @Override    public void onCreate(Bundle savedInstanceState){        super.onCreate(savedInstanceState);        setContentView(R.layout.main);         output = (TextView) findViewById(R.id.output);        mgr = (LocationManager) getSystemService(LOCATION_SERVICE);        Criteria criteria = new Criteria();         best = mgr.getBestProvider(criteria, true);        log(""\nBest provider is: "" + best);        locationListener = new LocationListener(){        public void onLocationChanged(Location location){            dumpLocation(location);            list.add(location);        }        public void onStatusChanged(String provider, int status, Bundle extras){            log(""\nProvider status changed: "" + provider + "", status="" + S[status]);        }        public void onProviderEnabled(String provider){            log(""\nProvider enabled: "" + provider);        }        public void onProviderDisabled(String provider){            log(""\nProvider disabled: "" + provider);        }    }; } @Override protected void onResume(){     super.onResume();     mgr.requestLocationUpdates(best, 120000, 50, locationListener); } @Override protected void onPause(){     super.onPause();     mgr.removeUpdates(locationListener);     log_gen(list);}</code></pre><p>The app currently displays longitude and latitude whenever new fix is obtained. However, the tracking only works when the Activity is displayed on the screen and as soon as  the user quits the app the tracking stops. What I want my app to do is keep tracking the user in the background even if he quits the app. Whenever he re-opens an app few minutes later, for example, all the coordinates captured in the background should be displayed on the screen.</p><p>From what I researched so far, there are two ways one can go about it: either use a background service to do the tracking or use</p><pre><code>requestLocationUpdates (String provider, long minTime, float minDistance, PendingIntent intent)</code></pre><p>in combination with <code>BroadcastReceiver</code> to continue getting location updates even if the user quits the app. If I am understanding correct, the second method would continue running in the background. Can someone please show to me in code how to implement <code>BroadcastReceiver</code> with the alternate version of <code>requestLocationUpdates</code></p><p>Many thanks in advance.</p>","283188","","","","","2011-02-20 18:41:04","How to enable android background location updates?","<android><geolocation><broadcastreceiver>","0","3","1","",""
"5059114","1","5059293","","2011-02-20 18:43:32","0","691","<p>I want to create some sort of graphical arrow, or possibly draw an arrow over a compass to show the user what direction the wind is coming from. This would obviously change, given the orientation of the persons handset.</p><p>My application can tell me what direction (in degrees) the wind direction is coming from.My question is, what is the best way to implement something like this? </p><p>Thanks</p>","604469","","604469","","2011-02-22 23:25:20","2011-02-22 23:25:20","How to display wind direction?","<android><graphics><compass-geolocation><direction>","2","0","1","",""
"5059185","1","","","2011-02-20 18:53:41","1","2595","<p>I have been sitting for at least 4 hours trying to solve this problem.</p><p>To understand this there are 3 files you need to know about:</p><p>eggCatcher.java which extends Activity, this class is not used for much more than       saving gamestate and showing the optionsmenu.</p><p>eggCatcherView.java which extends SurfaceView and contains ""the game"".</p><p>eggCatcher_layout.xml which is shown below:</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=""match_parent""    android:layout_height=""match_parent""    android:id=""@+id/layouten""&gt;    &lt;FrameLayout        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""&gt;        &lt;easter.fun.EggCatcherView            android:id=""@+id/eggcatcher""            android:layout_width=""match_parent""            android:layout_height=""match_parent""/&gt;        &lt;RelativeLayout android:id=""@+id/relativeLayout1""             android:layout_width=""wrap_content""             android:layout_height=""wrap_content""            android:layout_alignParentTop=""true""&gt;            &lt;TextView android:text=""Score: ""                 android:id=""@+id/totalscore""                 android:layout_width=""wrap_content""                 android:layout_height=""wrap_content""                android:layout_alignParentLeft=""true""&gt;             &lt;/TextView&gt;             &lt;TextView android:text=""Bonus: ""                android:id=""@+id/bonus""             android:layout_width=""wrap_content""             android:layout_height=""wrap_content""            android:layout_alignParentRight=""true""&gt;        &lt;/TextView&gt;        &lt;/RelativeLayout&gt;    &lt;/FrameLayout&gt;&lt;/LinearLayout&gt;</code></pre><p>As shown in the xml file, EggCatcherView is put in the xml file.When the applications i started the onCreate calls setContentView(layout.eggcatcher_layout);</p><p>My question now is:how can i, from EggCatcherView.java access and edit the TextViews defined in the xmlfile?</p><p>if it was in EggCatcher.java it would be easy, just use findViewById(id.bonus), but frominside the surfaceView appears to be a little more difficult.</p><p>I hope i have made everything clear, if you dont understand just ask!</p><p>//micke</p>","625531","","","","","2013-01-10 14:25:53","Android: edit textview defined in xml","<java><android><xml><android-layout>","3","0","","",""
"5059296","1","5059355","","2011-02-20 19:07:58","1","1912","<p>I'm writing an XML file to the sd card, and I need to be able to open that XML file and append data to it. How can I accomplish this? For example, my XML file is: </p><pre><code>&lt;items&gt;    &lt;item attr=""value""&gt;data&lt;/item&gt;    &lt;item attr=""value2""&gt;data 2&lt;/item&gt;&lt;/items&gt;</code></pre><p>I later need to open this XML file and append a new item to it:</p><pre><code>&lt;item attr=""value3""&gt;data 3&lt;/item&gt;</code></pre><p>How can I do this?</p>","1497409","","","","","2012-01-29 13:49:32","How to append an XML file in Android?","<java><android><xml>","2","0","","",""
"5059325","1","","","2011-02-20 19:11:24","0","664","<p>I have setup 2 emulators in run configurations I run one as a server and then I need to change the run configurations to run the other as a client. </p><p>The client takes a little time to load but gives an error when I try to send someting: </p><pre><code> catch (Exception e) {               tv.setText(""Error3"");               e.printStackTrace();</code></pre><p>I have been trying for a long time now and may need to take another approach. I would like to know if I am running the emulators correctly. Thanks</p>","608658","","608658","","2011-02-20 19:35:58","2011-03-13 18:29:36","TCP Socket connection Android","<android><emulator>","0","3","1","",""
"5059410","1","5059497","","2011-02-20 19:24:54","1","688","<p>I am trying to display an image on a <a href=""http://developer.android.com/reference/android/graphics/Canvas.html"" rel=""nofollow""><code>Canvas</code></a>, but when I call the <code>drawBitmap</code> method, I get only the VERY top left corner, the image doesn't scale to the the screen height and width. Here is my code that involves the custom view:</p><pre><code>    private class ImageOverlay extends View {    public ImageOverlay(Context context) {        super(context);    }    @Override    protected void onDraw(Canvas canvas) {        Bitmap image = BitmapFactory.decodeFile(getPath(baseImage));        Paint paint = new Paint();        paint.setAlpha(200);        canvas.drawBitmap(image, 0, 0, paint);        Log.v(TAG, ""Drew picture"");        super.onDraw(canvas);               }    private String getPath(Uri uri) {        String[] projection = { MediaStore.Images.Media.DATA };        Cursor cursor = managedQuery(uri, projection, null, null, null);        if(cursor!=null)        {            int column_index = cursor            .getColumnIndexOrThrow(MediaStore.Images.Media.DATA);            cursor.moveToFirst();            return cursor.getString(column_index);        }        else return null;    }</code></pre><p><code>baseImage</code> is a <code>Uri</code> object that is passed to my activity and it is <strong>NOT</strong> null! Here is the actual image:<br><img src=""http://i.stack.imgur.com/2uJli.png"" alt=""Actual image""><br>And here is the <code>Canvas</code> image:<br><img src=""http://i.stack.imgur.com/QmsFM.png"" alt=""The canvas image""></p>","200477","","","","","2011-02-20 19:40:23","Bitmap image displaying VERY top left corner, not scaling","<java><android><canvas><bitmap>","2","0","","",""
"5059439","1","5059527","","2011-02-20 19:29:08","2","3097","<p>I am having another problem with my android app which I can't find an answer to basically I have an android view that has been created programatically, then when I change the orientation of my device the application crashes due to: java.lang.IllegalArgumentException: Wrong state class -- expecting View State</p><p>I have tried to use the onConfigufagionChange method to then set the content view again but I don't know if I am barking up the wrong tree here. I have included the full class and error from the log incase it helps.</p><pre><code>package org.project.accessible;import java.io.IOException;import android.app.Activity; import android.app.AlertDialog;import android.graphics.Color;import android.os.Bundle;import android.text.InputType;import android.text.method.PasswordTransformationMethod;import android.view.Gravity;import android.view.View;import android.view.ViewGroup.LayoutParams;import android.content.DialogInterface;import android.content.res.Configuration;import android.database.Cursor;import android.database.SQLException;import android.database.sqlite.SQLiteDatabase;import android.widget.*;public class RegisterScreen extends Activity implements View.OnClickListener{     private EditText username;      private EditText password;      private EditText password2;     private EditText email;      private EditText surname;      private EditText forename;      private EditText street;     private EditText postcode;     private EditText city;     private EditText county;     private String country;     private int checkboxAmount;     private LinearLayout layoutMain;    @Override    protected void onCreate(Bundle savedInstanceState) {         super.onCreate(savedInstanceState);         //initiate the database to be qureied        DatabaseData db = new DatabaseData(this);        db = new DatabaseData(this);        try {                db.createDataBase();            }         catch (IOException ioe) {            throw new Error(""Unable to create database"");            }        try {             db.openDataBase();            }        catch(SQLException sqle){            throw sqle;            }        SQLiteDatabase rdb = db.getReadableDatabase();        //main layout of the screen             layoutMain = new LinearLayout(this);        layoutMain.setOrientation(LinearLayout.VERTICAL);        layoutMain.setBackgroundColor(Color.WHITE);            //Linear Layout for the Banner            LinearLayout banner = new LinearLayout(this);            banner.setOrientation(LinearLayout.VERTICAL);            banner.setBackgroundColor(Color.rgb(17, 168, 191));                //layout params for height and width                LayoutParams bannerParams = new android.widget.LinearLayout.LayoutParams(                        android.widget.LinearLayout.LayoutParams.FILL_PARENT, 40);                banner.setLayoutParams(bannerParams);                //Banner text                TextView bannerText = new TextView(this);                bannerText.setText(""Register"");                bannerText.setTextColor(Color.WHITE);                banner.addView(bannerText);                bannerText.setTextSize(24);                bannerText.setGravity(Gravity.CENTER);                //add banner layout to main layout                layoutMain.addView(banner);            //Scroll view for the rest of the screen            ScrollView sv = new ScrollView(this);            //sv.setFillViewport(true);                    //Table layout to align the items register form items                    TableLayout tl = new TableLayout(this);                    //Table rows to put items on left and right sides of the page                    TableRow usernameTR = new TableRow(this);                        //Username label                        TextView usernameL = new TextView(this);                        usernameL.setText(""Username:"");                        usernameL.setTextColor(Color.BLACK);                        usernameTR.addView(usernameL);                        //Username textbox                        EditText usernameTB = new EditText(this);                        usernameTB.setId(1001);                        usernameTB.setSingleLine(true);                        usernameTR.addView(usernameTB);                        tl.addView(usernameTR);                        TableRow passwordTR = new TableRow(this);                        //password label                        TextView passwordL = new TextView(this);                        passwordL.setText(""Password:"");                        passwordL.setTextColor(Color.BLACK);                        passwordTR.addView(passwordL);                        //password textbox                        EditText passwordTB = new EditText(this);                        passwordTB.setId(1009);                        passwordTB.setSingleLine(true);                        passwordTB.setInputType(InputType.TYPE_TEXT_VARIATION_PASSWORD);                        passwordTB.setTransformationMethod(PasswordTransformationMethod.getInstance());                        passwordTR.addView(passwordTB);                        tl.addView(passwordTR);                        TableRow password2TR = new TableRow(this);                        //password2 label                        TextView password2L = new TextView(this);                        password2L.setText(""Confirm Pass:"");                        password2L.setTextColor(Color.BLACK);                        password2TR.addView(password2L);                        //password2 textbox                        EditText password2TB = new EditText(this);                        password2TB.setId(1010);                        password2TB.setSingleLine(true);                        password2TB.setInputType(InputType.TYPE_TEXT_VARIATION_PASSWORD);                        password2TB.setTransformationMethod(PasswordTransformationMethod.getInstance());                        password2TR.addView(password2TB);                        tl.addView(password2TR);                    TableRow emailTR = new TableRow(this);                        //email label                        TextView emailL = new TextView(this);                        emailL.setText(""Email:"");                        emailL.setTextColor(Color.BLACK);                        emailTR.addView(emailL);                        //email textbox                        EditText emailTB = new EditText(this);                        emailTB.setId(1002);                        emailTB.setSingleLine(true);                        emailTR.addView(emailTB);                        tl.addView(emailTR);                    TableRow forenameTR = new TableRow(this);                        //forename label                        TextView forenameL = new TextView(this);                        forenameL.setText(""Forename:"");                        forenameL.setTextColor(Color.BLACK);                        forenameTR.addView(forenameL);                        //forename textbox                        EditText forenameTB = new EditText(this);                        forenameTB.setId(1003);                        forenameTB.setSingleLine(true);                        forenameTR.addView(forenameTB);                         tl.addView(forenameTR);                    TableRow surnameTR = new TableRow(this);                        //surname label                        TextView surnameL = new TextView(this);                        surnameL.setText(""Surname:"");                        surnameL.setTextColor(Color.BLACK);                        surnameTR.addView(surnameL);                        //surname textbox                        EditText surnameTB = new EditText(this);                        surnameTB.setId(1004);                        surnameTB.setSingleLine(true);                        surnameTR.addView(surnameTB);                           tl.addView(surnameTR);                    TableRow streetTR = new TableRow(this);                        //street label                        TextView streetL = new TextView(this);                        streetL.setText(""Street:"");                        streetL.setTextColor(Color.BLACK);                        streetTR.addView(streetL);                        //street textbox                        EditText streetTB = new EditText(this);                        streetTB.setId(1005);                        streetTB.setSingleLine(true);                        streetTR.addView(streetTB);                         tl.addView(streetTR);                    TableRow postcodeTR = new TableRow(this);                        //postcode label                        TextView postcodeL = new TextView(this);                        postcodeL.setText(""Postcode:"");                        postcodeL.setTextColor(Color.BLACK);                        postcodeTR.addView(postcodeL);                        //postcode textbox                        EditText postcodeTB = new EditText(this);                        postcodeTB.setId(1006);                        postcodeTB.setSingleLine(true);                        postcodeTR.addView(postcodeTB);                         tl.addView(postcodeTR);                    TableRow cityTR = new TableRow(this);                               //city label                        TextView cityL = new TextView(this);                        cityL.setText(""City:"");                        cityL.setTextColor(Color.BLACK);                        cityTR.addView(cityL);                        //city textbox                        EditText cityTB = new EditText(this);                        cityTB.setId(1007);                        cityTB.setSingleLine(true);                        cityTR.addView(cityTB);                         tl.addView(cityTR);                    TableRow countyTR = new TableRow(this);                        //county label                        TextView countyL = new TextView(this);                        countyL.setText(""County:"");                        countyL.setTextColor(Color.BLACK);                        countyTR.addView(countyL);                        //county textbox                        EditText countyTB = new EditText(this);                        countyTB.setId(1008);                        countyTB.setSingleLine(true);                        countyTR.addView(countyTB);                         tl.addView(countyTR);                        TableRow countryTR = new TableRow(this);                        //country label                        TextView countryL = new TextView(this);                        countryL.setText(""Country:"");                        countryL.setTextColor(Color.BLACK);                        countryTR.addView(countryL);                        //country dropdown                          Spinner countrySpinner = new Spinner(this);                        countrySpinner.setId(1009);                        countrySpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {                            public void onItemSelected(AdapterView&lt;?&gt; parent, View view, int pos, long id) {                              country = parent.getItemAtPosition(pos).toString();                            }                            public void onNothingSelected(AdapterView&lt;?&gt; parent) {                            }                        });                        //get array of countries                        Countries countries = new Countries();                        String countriesList[] = countries.getList();                        ArrayAdapter&lt;String&gt; countriesAdapter = new ArrayAdapter&lt;String&gt;(this, android.R.layout.simple_spinner_item, countriesList);                        countrySpinner.setAdapter(countriesAdapter);                        //add the array to the dropdown                         countryTR.addView(countrySpinner);                        tl.addView(countryTR);                    TextView catTitle = new TextView(this);                    catTitle.setText(""\nPlease select the categories which affect you:\n"");                    catTitle.setTextColor(Color.BLACK);                    tl.addView(catTitle);                    //categories                    //categories title                    String[] cols =  {""_id"", ""cat_name""}; //columns to be searched                    Cursor cursor = rdb.query(""aa_category"", cols, null, null, null, null, null); //save teh querey to the db                    checkboxAmount = cursor.getCount();                    while (cursor.moveToNext()) {                         CheckBox catCB = new CheckBox(this);                        String name = cursor.getString(1);                        int id = cursor.getInt(0);                        catCB.setId(id);                        catCB.setText(""\n""+name+""\n"");                        catCB.setTextColor(Color.BLACK);                        tl.addView(catCB);                        }                    cursor.close();                    rdb.close();                    //add field for new category with a text field that will become active on clicking the checkbox                    Button submitButton = new Button(this);                    submitButton.setId(99);                    submitButton.setText(""Submit"");                tl.addView(submitButton);                //Add table layout to the scroll view                sv.addView(tl);                //Add scroll view to the main layout            layoutMain.addView(sv);        this.setContentView(layoutMain);        View submitButtonListener = findViewById(99);        submitButtonListener.setOnClickListener(this);        }        @Override        public void onConfigurationChanged(Configuration newConfig) {          super.onConfigurationChanged(newConfig);          this.setContentView(layoutMain);        }        public void onClick(View v) {            String messageString = null;            //String usernameStr = null;            //save the id of the edit text fields to a variable            username = (EditText)findViewById(1001);            password = (EditText)findViewById(1009);            password2 = (EditText)findViewById(1010);            email = (EditText)findViewById(1002);            forename = (EditText)findViewById(1003);            surname = (EditText)findViewById(1004);            street = (EditText)findViewById(1005);            postcode = (EditText)findViewById(1006);            city = (EditText)findViewById(1007);            county = (EditText)findViewById(1008);            //save the edit text values            String usernameStr = username.getText().toString();            String passwordStr = password.getText().toString();            String passwordStr2 = password2.getText().toString();            String emailStr = email.getText().toString();            String forenameStr = forename.getText().toString();            String surnameStr = surname.getText().toString();            String streetStr = street.getText().toString();            String postcodeStr = postcode.getText().toString();            String cityStr = city.getText().toString();            String countyStr = county.getText().toString();            String checkboxStr = """";            int checkBoxCheck = 0;            for(int i = 1; i&lt;=checkboxAmount; i++){                 CheckBox cbx = (CheckBox)findViewById(i);                 if(cbx.isChecked()){                     if(checkBoxCheck == 0){                     checkboxStr += i;                     checkBoxCheck ++;                     }                     else{                         checkboxStr += "":"" + i;                      }                 }            }            //Check for nulls            if(usernameStr.equals("""")){                messageString = ""Username can't be blank please check and try again"";            }            else if(emailStr.equals("""")){                messageString = ""Email can't be blank please check and try again"";            }            else if(forenameStr.equals("""")){                messageString = ""Forename can't be blank please check and try again"";            }            else if(surnameStr.equals("""")){                messageString = ""Surname can't be blank please check and try again"";            }            else if(streetStr.equals("""")){                messageString = ""Street can't be blank please check and try again"";            }            else if(postcodeStr.equals("""")){                messageString = ""Postcode can't be blank please check and try again"";            }            else if(cityStr.equals("""")){                messageString = ""City can't be blank please check and try again"";            }            else if(countyStr.equals("""")){                messageString = ""County can't be blank please check and try again"";            }            else if(country.equals("""") || country.equals(""Please select a country"")){                messageString = ""Please select a country"";            }            else if(checkBoxCheck == 0){                messageString = ""You must select at least one category"";            }            else if(passwordStr.equals("""")){                messageString = ""Password can't be blank please check and try again"";            }            else if(passwordStr2.equals("""")){                messageString = ""Confirm pass can't be blank please check and try again"";            }            else if(!passwordStr.equals(passwordStr2)){                messageString = ""Passwords don't match please check and try again"";                         }            else{                //get checkbox values                messageString = ""New user added"";                ConnectionToDb connec = new ConnectionToDb();                connec.registerUser(usernameStr, passwordStr, emailStr, forenameStr, surnameStr, streetStr, postcodeStr, cityStr, countyStr, country, checkboxStr);            }            new AlertDialog.Builder(this)            .setTitle(""Accessible Application"")            .setMessage(messageString)            .setNeutralButton(""Ok"",            new DialogInterface.OnClickListener() {            public void onClick(DialogInterface dialog,            int which) {            }            }).show();    }}I/WindowManager(   84): Setting rotation to 1, animFlags=1I/WindowManager(   84): Config changed: { scale=1.0 imsi=0/0 loc=en_GB touch=3 keys=2/1/1 nav=3 orien=2 layout=18}D/StatusBar(   84): updateResourcesD/AndroidRuntime( 1357): Shutting down VMW/dalvikvm( 1357): threadid=3: thread exiting with uncaught exception (group=0x4001da28)E/AndroidRuntime( 1357): Uncaught handler: thread main exiting due to uncaught exceptionE/AndroidRuntime( 1357): java.lang.RuntimeException: Unable to start activity ComponentInfo{org.project.accessible/org.project.accessible.RegisterScreen}: java.lang.IllegalArgumentException: Wrong state class -- expecting View StateE/AndroidRuntime( 1357):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2401)E/AndroidRuntime( 1357):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2417)E/AndroidRuntime( 1357):    at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:3502)E/AndroidRuntime( 1357):    at android.app.ActivityThread.access$2200(ActivityThread.java:116)E/AndroidRuntime( 1357):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1798)E/AndroidRuntime( 1357):    at android.os.Handler.dispatchMessage(Handler.java:99)E/AndroidRuntime( 1357):    at android.os.Looper.loop(Looper.java:123)E/AndroidRuntime( 1357):    at android.app.ActivityThread.main(ActivityThread.java:4203)E/AndroidRuntime( 1357):    at java.lang.reflect.Method.invokeNative(Native Method)E/AndroidRuntime( 1357):    at java.lang.reflect.Method.invoke(Method.java:521)E/AndroidRuntime( 1357):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)E/AndroidRuntime( 1357):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)E/AndroidRuntime( 1357):    at dalvik.system.NativeStart.main(Native Method)E/AndroidRuntime( 1357): Caused by: java.lang.IllegalArgumentException: Wrong state class -- expecting View StateE/AndroidRuntime( 1357):    at android.view.View.onRestoreInstanceState(View.java:5713)E/AndroidRuntime( 1357):    at android.widget.TextView.onRestoreInstanceState(TextView.java:2408)E/AndroidRuntime( 1357):    at android.view.View.dispatchRestoreInstanceState(View.java:5689)E/AndroidRuntime( 1357):    at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:1125)E/AndroidRuntime( 1357):    at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:1125)E/AndroidRuntime( 1357):    at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:1125)E/AndroidRuntime( 1357):    at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:1125)E/AndroidRuntime( 1357):    at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:1125)E/AndroidRuntime( 1357):    at android.view.View.restoreHierarchyState(View.java:5668)E/AndroidRuntime( 1357):    at com.android.internal.policy.impl.PhoneWindow.restoreHierarchyState(PhoneWindow.java:1506)E/AndroidRuntime( 1357):    at android.app.Activity.onRestoreInstanceState(Activity.java:833)E/AndroidRuntime( 1357):    at android.app.Activity.performRestoreInstanceState(Activity.java:805)E/AndroidRuntime( 1357):    at android.app.Instrumentation.callActivityOnRestoreInstanceState(Instrumentation.java:1172)E/AndroidRuntime( 1357):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2378)E/AndroidRuntime( 1357):    ... 12 more</code></pre>","625558","","","","","2011-02-20 19:44:17","Android app crashes on orientation change java.lang.IllegalArgumentException: Wrong state class -- expecting View State","<android><orientation><screen-orientation><illegalargumentexception>","1","0","","",""
"5059543","1","","","2011-02-20 19:46:04","0","664","<pre><code>- (FMWebDAVRequest*) createDirectory {if (!_endSelector) {    _endSelector = @selector(requestDidCreateDirectory:);}NSMutableURLRequest *req = [NSMutableURLRequest requestWithURL:_url];[req setCachePolicy:NSURLRequestReloadIgnoringLocalCacheData];[req setTimeoutInterval:60 * 5];[req setHTTPMethod:@""MKCOL""];if (![[NSUserDefaults standardUserDefaults] boolForKey:@""skipMKCOLContentType""]) {    [req setValue:@""application/xml"" forHTTPHeaderField:@""Content-Type""];}[self sendRequest:req];return self;</code></pre><p>This code i use for iPhone, i write WebDav client for both platformsBut i don't know how to implement MKCOL for android, that what i doMKCOL it's WebDav method to create path, any ideas ?</p><pre><code>HttpPut request = new HttpPut();    request.addHeader("""", ""MKCOL /test879797 HTTP/1.1"");    request.addHeader(""Host"",""myserver:port"");    request.addHeader(""Authorization"",""Basic YWRtaW46MTIzNDU2"");</code></pre>","625565","","115145","","2011-02-20 20:53:10","2011-06-12 21:38:33","Android Method MKCOL, http, addHeader,","<java><android><httpclient><webdav>","1","0","","",""
"5059550","1","5059629","","2011-02-20 19:47:50","4","618","<p>I would like to put fairly extensive help information within my app - both ""how to use"" and explanation of what one is seeing.</p><p>The app (map oriented) has a row of buttons at the bottom, and I was considering adding a help button.</p><p>Context sensitive help is mostly not appropriate, btw.</p><p>What are common and best practices for this? </p><p>Thanks</p>","547914","","","","","2011-02-20 20:07:55","what are best practices for showing help information","<android>","3","0","","",""
"5059639","1","5059705","","2011-02-20 20:00:36","2","1085","<p>I cannot get a string broken into fixed length chunks and added to an ArrayList ... the code below iterates through as expected, but all the messageToSplit[] upto the last one are null.  The last one actually has a value in it.</p><p>In the example below if the edit text returned, ""01234567890"" then """", """" and ""890"".</p><pre><code>Pattern p = Pattern.compile("".{4}"");ArrayList&lt;String&gt; myText = new ArrayList&lt;String&gt;();String[] messageToSplit = TextUtils.split(myStringEditText.getText().toString(), p);int x = 0;while(x  &lt;= (myStringEditText.getText().toString().length() / 4)) {  Toast.makeText(getBaseContext(), x+"": '"" + messageToSplit[x] + ""'"", Toast.LENGTH_SHORT).show();  myText.add(messageToSplit[x]);  x++;}</code></pre>","617044","","","","","2011-02-20 22:38:57","Android TextUtils.split to deliver a fixed length string[]","<android><regex><string><split><textutils>","1","1","","",""
"5059658","1","5059997","","2011-02-20 20:03:04","9","13375","<p>I'm now facing a problem with Eclipse on Ubuntu. My device is connected, list by ""adb devices"" command and I can see the list of processes running in the Devices view. But all controls in the Emulator Control are disabled. </p><p>Does anyone know what may be the reason for this? </p><p>Thanks</p>","94892","","94892","","2011-08-08 17:15:43","2014-01-15 20:20:53","Android: Emulator control is disabled in the DDMS perspective","<android><eclipse><ddms>","3","1","1","",""
"5059663","1","","","2011-02-20 20:03:20","37","10525","<p>Using Joda 1.6.2 with Android</p><p>The following code hangs for about 15 seconds. </p><pre><code>DateTime dt = new DateTime();</code></pre><p>Originally posted this post <a href=""http://stackoverflow.com/questions/4542867/android-java-joda-date-is-slow-in-eclipse-emulator"">Android Java - Joda Date is slow in Eclipse/Emulator -</a></p><p>Just tried it again and its still not any better.  Does anyone else have this problem or know how to fix it?</p>","528130","","38896","","2011-06-15 07:17:29","2014-03-09 13:33:01","Android Java - Joda Date is slow","<android><jodatime>","8","0","26","",""
"5059704","1","5129171","","2011-02-20 20:11:23","1","1298","<p>I have been trying to mimic the behavior of the android browser with the scrolling of the address bar on top of the WebView. If you notice, if the user scrolls down, the address bar ""moves"" up with the WebView (but the WebView doesn't scroll). Only when the address bar disappears completely the WebView starts to scroll. At first I tried to override the onScrollChanged method of WebView, and got something but it wasn't as smooth as the desired goal. I noticed in the docs that WebView inherits from AbsoluteLayout, so I was wondering if it's possible to add a View programmatically on top the ""browser"" in the WebView and by that achieve the desired scrolling effect? </p><hr><p>EDIT</p><p>Ok so after poking around in the source code of the native browser app, I found out that there is an hidden method for that called <strong>setEmbeddedTitleBar(View v)</strong></p><p>And here is the description (from the Android source):</p><pre><code> /**Add or remove a title bar to be embedded into the WebView, and scroll * along with it vertically, while remaining in view horizontally. Pass * null to remove the title bar from the WebView, and return to drawing * the WebView normally without translating to account for the title bar. * @hide*/</code></pre><p>Do you know how I can hack my way to use this ?</p>","171911","","171911","","2011-02-24 16:29:05","2011-02-26 19:19:52","Android: Put EditText on top of WebView","<android><scrolling><webview><absolutelayout>","2","0","","",""
"5059731","1","5059745","","2011-02-20 20:16:06","1","10723","<p>I have this code:</p><pre><code>startActivityForResult(new Intent(MediaStore.ACTION_IMAGE_CAPTURE), CAMERA_IMAGE);</code></pre><p>That allows that user to take a photo. Now how would I get the <code>Uri</code> of that photo in <code>onActivityResult</code>? Is it an <code>Intent</code> extra? Is it through <code>Intent.getData()</code>?</p>","200477","","","","","2011-02-20 20:28:15","Get image Uri in onActivityResult after taking photo?","<java><android><image><camera><uri>","2","0","0","",""
"5060011","1","5060046","","2011-02-20 21:05:31","1","855","<p>I am having trouble using and IF statement based on a string from my preferences.</p><p>Here is the code:</p><pre><code>  preferences = PreferenceManager.getDefaultSharedPreferences(this);         String themePref = preferences.getString(""theme"", ""null"");         Log.i(""Theme"", ""Current theme is "" + themePref );         if (themePref == ""dark""){             setTheme(android.R.style.Theme_Black);         }else{             setTheme(android.R.style.Theme_Light);         }</code></pre><p>I have two options at this point; light and dark.  The code successfully sets themePref as light or dark as needed, and I've confirmed via debugging, but for some reason the if statement fails.  I have manually set a string to ""dark"" and it then works correctly.</p><p>Am I missing something here?  Why would a string coming from the preferences process any differently?</p><p>Any help would be greatly appreciated.</p><p>Thanks,Josh</p>","453305","","65977","","2011-02-20 21:14:32","2011-02-20 21:14:32","Android: IF statement not working when set by preferences","<java><android><string><preferences>","2","0","","",""
"5060031","1","5060688","","2011-02-20 21:09:27","0","193","<p>I'm trying to create a web filter app that will intercept an incoming website(one that is being browsed to) and redirect it's data to my app.  Then it will compare the site to certain criteria and display it if it passes.</p><p>Basically, I want to turn my app into a proxy of sorts.  How might I go about doing this?</p>","467090","","","","","2011-02-20 22:57:01","Route website through Android app?","<android><proxy><filter><web-traffic>","1","0","","",""
"5060103","1","5060585","","2011-02-20 21:19:27","1","865","<p>I'm writing a configuration menu with many options and I'd like to add in the main PreferenceScreen an option that can launch an other PreferenceScreen.</p><p>I can't figure out how to create a generic menu entry (so, nor EditTextPreference nor CheckBoxPreference etc.)</p><p>Thanks to all.</p>","201065","","","","","2011-02-20 22:38:52","start an other PreferenceScreen through a PreferenceActivity option","<android><preferenceactivity>","1","0","1","",""
"5060156","1","5060873","","2011-02-20 21:27:37","1","1475","<p>Let's say I have 3 classes.</p><ul><li>Class A (extends Activity)<br>Class B<br>Class C (extends View)</li></ul><p>A creates a B object that holds a <code>Bitmap</code>.  A also invalidates C.  C's <code>onDraw</code> draws a <code>Bitmap</code> to its <code>Canvas</code>.</p><p>How do I draw the <code>Bitmap</code> that B holds without creating another <code>Bitmap</code> object in C?  Note it is important for me to keep the same ""class structure.""</p><p>Here is the pseudo code.  You can see this puts 2 <code>Bitmap</code> objects in memory.  Thanks!</p><pre><code>public class A extends Activity {    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        B b = new B();        C c = (C) findViewById(R.id.c);        c.passTheBitmap(b.bitmap);        c.postInvalidate();    }       }public class B {    public Bitmap bitmap;    public B(){        bitmap = BitmapFactory.decodeResource(ActivityAContext.getResources(), R.drawable.fooBitmap);    }}public class C extends View {    public Bitmap bitmap;    public C(Context context, AttributeSet attrs) {        super(context, attrs);    }    public passTheBitmap(Bitmap b) {        bitmap = b;    }    @Override    public void onDraw(Canvas canvas) {        if (bitmap != null) {            canvas.drawBitmap(bitmap, 0, 0, null);        }    }}</code></pre>","432209","","82118","","2011-02-20 23:37:02","2011-02-25 05:22:01","How do I pass an object in Java from Class B to Class C via Class A without duplication","<java><android><object><class-structure>","2","9","","",""
"5060221","1","","","2011-02-20 21:36:35","0","1294","<p>After developing and testing for months my android application both on the emulator and on a phone, I suddenly can not connect any more to the phone in one of the two PCs I use for development. One PCs runs Windows XP 32bits. Here everything is ok. But my main development machine is a Windows 7 32bits: Both of them run Eclipse Galileo. I can not get connected to the Samsung Galaxy S GT-I9000T phone from there. Two Sundays ago I updated my application last version to the phone. Went on vacations. After returning I upgraded the Samsung Kies suite to the new version 2. It is supposed it installs USB drivers for Windows. I also upgraded to Android SDK 9 and ADT 9 but I'm not sure it was after the problem appeared. Then I realized can not connect to the phone. My first suspect was Samsung Kies. But I made all these intallations on the xp PC and the connection works OK. Then I returned to the Windows 7. There is another driver called ""USB Driver for Windows"" which I have installed from Android's SDK ""SDK and AVD Manager""/""Available Components""/""Android Repository"" I tried to reinstall it. I deleted the package despite the warning it can not be undone. Then I tried to find it on the ""Available Packages"" but it was no more there.</p><p>I reinstaled Samsung Kies, Eclipse, Android SDK but the problem remains the same:Another fact: with USB debugging active, Samsung Kies can not connect to the phone. It detects something is connected but it stays forever trying to connect.But it occurs also on the XP machine.In summary:</p><ul><li>I can not get listed the ""USB Driver for Windows"" in the ""SDK and AVD Manager""/""Available Components"" for installation, even after reinstalling all the development environment</li><li>I can not get the development environment to connect to the phone for debugging.</li></ul><p>How to fix this?</p><p>Any hint is welcomed.Thanks in advance.Sammy</p>","625603","","","","","2011-02-22 02:45:26","I can not connect to the phone for debugging any more","<android>","1","0","","",""
"5060307","1","5060718","","2011-02-20 21:49:19","7","10838","<p>On Android, a direct ByteBuffer does not ever seem to release its memory, not even when calling System.gc(). </p><p>Example: doing</p><pre><code>Log.v(""?"", Long.toString(Debug.getNativeHeapAllocatedSize()));ByteBuffer buffer = allocateDirect(LARGE_NUMBER);buffer=null;System.gc();Log.v(""?"", Long.toString(Debug.getNativeHeapAllocatedSize()));</code></pre><p>gives two numbers in the log, the second one being at least LARGE_NUMBER larger than the first.</p><p>How do I get rid of this leak?</p><hr><p><strong>Added:</strong></p><p>Following the suggestion by Gregory to handle alloc/free on the C++ side, I then defined</p><pre><code>JNIEXPORT jobject JNICALL Java_com_foo_bar_allocNative(JNIEnv* env, jlong size)    {    void* buffer = malloc(size);    jobject directBuffer = env-&gt;NewDirectByteBuffer(buffer, size);    jobject globalRef = env-&gt;NewGlobalRef(directBuffer);    return globalRef;    }JNIEXPORT void JNICALL Java_com_foo_bar_freeNative(JNIEnv* env, jobject globalRef)    {    void *buffer = env-&gt;GetDirectBufferAddress(globalRef);    free(buffer);    env-&gt;DeleteGlobalRef(globalRef);    }</code></pre><p>I then get my ByteBuffer on the JAVA side with</p><pre><code>ByteBuffer myBuf = allocNative(LARGE_NUMBER);</code></pre><p>and free it with</p><pre><code>freeNative(myBuf);</code></pre><p>Unfortunately, while it does allocate fine, it a) still keeps the memory allocated according to <code>Debug.getNativeHeapAllocatedSize()</code> and b) leads to an error </p><pre><code>W/dalvikvm(26733): JNI: DeleteGlobalRef(0x462b05a0) failed to find entry (valid=1)</code></pre><p>I am now thoroughly confused, I thought I at least understood the C++ side of things... Why is free() not returning the memory? And what am I doing wrong with the <code>DeleteGlobalRef()</code>?</p>","120751","","120751","","2011-02-21 20:12:50","2012-03-27 14:08:41","ByteBuffer not releasing memory","<android><memory-leaks><jni><bytebuffer>","3","5","4","",""
"5060348","1","5060957","","2011-02-20 21:56:10","1","708","<p>I've got ArrayList of custom objects. There are near 200 of them. When I use debug mode I explore my list in Eclipse variables tab and see that it is split like this:array  [0...99]  [100...199]  [200...201]That looked strange to me. Then I found out that when I use for each loop to run through ArrayList I've got only first 100 items. Could you just explain these mechanism to me?</p><p>Here is my code</p><pre><code> public void saveMakeList(ArrayList&lt;ParamItem&gt; list){    for(ParamItem item:list){        ContentValues values=new ContentValues();        values.put(NATIVE_ID, item.nativeID);        values.put(PART_URI, item.partUri);        values.put(MAKE_NAME, item.name);        db.insertOrThrow(MAKE_TABLE, null, values);    }}</code></pre>","468311","","468311","","2011-02-20 22:05:37","2011-02-20 23:45:12","Android ArrayList of custom Objects issue","<java><android><collections><arraylist>","1","2","","",""
"5060436","1","","","2011-02-20 22:14:02","1","695","<p>I know that it's not possible for Android applications to access Facebook contact info. What I'd like to do is just to retrieve the raw contact ID of a Facebook Raw Contact based on it's lookup URI. I don't need any other info from the contact.I can obtain the lookup URI if the Facebook contact is linked to a GMail or Twitter contact. I'd like to use this lookup URI to retrieve the FB contact even if the contacts get unlinked.Thanks</p>","200821","","","","","2011-02-20 22:14:02","Access Raw Contact ID of a Facebook contact from the lookup URI","<android><facebook><android-contacts><android-contentprovider>","0","0","0","",""
"5060513","1","5060888","","2011-02-20 22:26:40","0","1015","<p>I have a java application trying to post to a php file on an IIS server and when I execute the post I get the java.net UnknownHostException. I have the  set in the androidmanifet.xml right above the application element. Can somebody please help?</p>","624765","","624765","","2011-02-20 22:32:34","2011-02-20 23:33:16","Android HttpPost error java.net UnknownHostException","<android><http><iis>","2","2","","",""
"5060628","1","5060690","","2011-02-20 22:47:10","0","3232","<p>I'm using the sensors to balance a robot, but <code>SENSOR_DELAY_FASTEST</code> only provides a 10Hz sampling rate, which is simply not fast enough. Is there a way of sampling even faster?</p><p>Is there a way of polling the sensors rather than waiting for a <code>SensorEvent</code> ?</p>","604793","","1727342","","2012-11-17 11:55:07","2012-11-17 11:55:07","Android SENSOR_DELAY_FASTEST isn't fast enough","<android><sensor><sampling>","3","0","1","",""
"5060672","1","","","2011-02-20 22:54:28","1","402","<p>I am trying to display admod ads on my android app. Instad of writing java code, I was going to use a WevView that displayed a web page with the following codeTED</p><pre><code>&lt;script type=""text/javascript""&gt; var admob_vars = {  pubid: 'Mu Publisher id is here', //  bgcolor: '000000', // background color (hex)  text: 'FFFFFF', // font-color (hex)  test: true // test mode, set to false if non-test mode }; &lt;/script&gt; &lt;script type=""text/javascript"" src=""http://mm.admob.com/static/iphone/iadmob.js""&gt;&lt;/script&gt;</code></pre><p>The WebView only displays TED and no test message.</p><ul><li>Ted</li></ul>","564653","","71724","","2011-02-20 23:47:43","2011-09-29 14:48:45","My Android AdMod ad is blank in test mode","<android><webview><admob>","1","0","","",""
"5060723","1","5060825","","2011-02-20 23:02:56","1","1837","<p>I am programming a game on android. I'm using a Thread while calling a Surface View class to update and draw my game. Inside the update I wanted to start an activity based on if the game has just started and this would launch my MENUS.</p><p>My Thread for the most part..</p><pre><code>    while (myThreadRun) {        Canvas c = null;        try {            gameTime = System.currentTimeMillis();            c = myThreadSurfaceHolder.lockCanvas(null);            synchronized (myThreadSurfaceHolder) {                // Update Game.                myThreadSurfaceView.onUpdate();                // Draw Game.                myThreadSurfaceView.onDraw(c);</code></pre><p>You can see there where I am updating the game... here is onUpdate();</p><pre><code>protected void onUpdate() {    // Test if menu needs to be displayed.    while (thread.getMenu()) {        // Test if menu activity has been started.        if (thread.getMenuRunning() == false) {            Intent menuIntent = new Intent(this.getContext(), MyMenu.class);            ((Activity) cxt).startActivityForResult(menuIntent, 1);            thread.setMenuRunning(true);        }    }</code></pre><p>I am using a while loop because if I didn't use it the thread just keeps going.</p><p>Basically I just don't know how to implement my menus using a thread as a game loop. Everywhere I look it seems like that's best practice.</p><p>In my menu activity I just display the menu layout and a few buttons and when the person wants to start the game it uses finish() to go back to my thread where they play the game.</p><p>I am very new to this so any insight will be helpful,</p><p>Thanks </p>","625740","","","","","2011-02-20 23:21:59","How: Start an Activity inside a Thread and use finish() to get back","<android>","1","0","1","",""
"5060846","1","5136074","","2011-02-20 23:25:40","2","3279","<p>I used the tabhost tutorial to get started with the Tabhost control.</p><p>After some play around I wanted to make the tabhost scrollable, which I figured out.</p><p>Now I want the tabhost at the bottom of the display which is just not working for me.</p><p>Switched to Relative Layout which was suggested here: <a href=""http://android-pro.blogspot.com/2010/08/iphone-like-tab-bar-in-android.html"" rel=""nofollow"">iPhone-like Tabbar</a></p><p>My code:</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""android:scrollbars=""horizontal"" android:isScrollContainer=""true""&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"" android:layout_alignParentBottom=""true""&gt;    &lt;RelativeLayout android:layout_height=""fill_parent""        android:layout_width=""fill_parent""&gt;        &lt;HorizontalScrollView android:layout_width=""fill_parent""            android:layout_height=""fill_parent"" android:scrollbars=""none""            android:layout_alignParentBottom=""true""&gt;            &lt;TabWidget android:id=""@android:id/tabs""                android:layout_alignParentBottom=""true"" android:layout_width=""fill_parent""                android:layout_height=""wrap_content"" /&gt;        &lt;/HorizontalScrollView&gt;        &lt;FrameLayout android:id=""@android:id/tabcontent""            android:layout_width=""fill_parent"" android:layout_height=""fill_parent""            android:padding=""2dp"" /&gt;    &lt;/RelativeLayout&gt;&lt;/TabHost&gt;</code></pre><p></p><p>I need a hint why it's not working / how this would work. I tried with relative layout and <code>layout_alignParentBottom=""true""</code> now it's there a few times (in the HorizontalScrollView and the TabWidget)</p>","162723","","","","","2011-02-27 21:20:43","Scrolling Tabhost at the bottom","<android><android-layout>","2","0","","",""
"5060971","1","5061032","","2011-02-20 23:47:26","5","4174","<p><strong>What Is Working Fine</strong></p><p>I have 2 activities in my app. First activity calls second actifity for results.</p><p>Second activity shows a new layout and lets user perform certain actions. There is a ""OK"" button. When user presses this button, second activity is finished and user goes back to first activity.</p><p>Under the hood, first activity calls second ativity like this:</p><pre><code>Intent intent = new Intent(this, NextAct.class);intent.putExtra(""input"", input);this.startActivityForResult(intent, 99);</code></pre><p>On ""OK"" button press, second activity returns with result like this:</p><pre><code>Intent intent = new Intent();intent.putExtra(""output"", output);setResult(RESULT_OK, intent);finish();</code></pre><p>After that, first activity's <em>onActivityResult</em> is called with results successfully:</p><pre><code>protected void onActivityResult(int requestCode, int resultCode, Intent data) {    // requestCode is 99    // resultCode is -1    // data holds my output}</code></pre><p>Above setup is working perfectly</p><p><strong>What Is Not Working</strong></p><p>Now I had a simple requirement, I wanted the user to close the second activity not with an ""OK"" button, but in a natural way with ""HARDWARE BACK"" button.</p><p>I tried moving the <em>setResult logic</em> in <em>onStop</em> and <em>onDestroy</em> methods of second activity, but it turned out that <em>onActivityResult</em> of first activity is called before <em>onStop</em> or <em>onDestroy</em> methods of second activity and as a result <em>setResult logic</em> does not get a chance to run at all.</p><p>Then I tried moving the <em>setResult logic</em> in <em>onPause</em> method of second activity like this</p><pre><code>protected void onPause() {  super.onPause();  Intent intent = new Intent();  intent.putExtra(""output"", output);  setResult(RESULT_OK, intent);  //finish();  enabling or disabling this does not work}</code></pre><p>But although <em>onPause</em> is being called well before <em>onActivityResult</em> and <em>setResult logic</em> runs properly, still I get all null values in <em>onActivityResult</em></p><pre><code>protected void onActivityResult(int requestCode, int resultCode, Intent data) {    // requestCode is 99    // resultCode is 0    // data comes as null}</code></pre><p><strong>I need to know why this is happening and if <em>onResume</em> is not a proper place to put <em>setResult logic</em>, what is the most natural way to do it?</strong></p><p>Thanks much.</p>","453906","","","","","2012-08-08 16:02:36","How to return result 'in a natural way' when the called the called Activity exits?","<android>","3","0","1","",""
"5060988","1","","","2011-02-20 23:51:29","5","2290","<p>I trying to animate the ImageView from child layout(Relativelayout) to parent layout(Relative layout). the imageview is not getting painted while entering into the parent layout.  </p><pre><code>enter code /** Called when the activity is first created. */private static final int   SWIPE_MIN          = 20;private static final int   SWIPE_MAX_OFF_PATH = 250;private static final int   SWIPE_THRESHOLD    = 20;GestureDetector detector;ImageView topImage;ImageView bottomImage;ImageView aView;RelativeLayout rlBottomChild;RelativeLayout rlTopChild;FrameLayout flTopChild;FrameLayout flBottomChild;RelativeLayout table;RelativeLayout relativeLayout ;FrameLayout frameLayout ;WindowManager wManger;int screenWidth;int screenHeight;@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    wManger = getWindowManager();    screenWidth = wManger.getDefaultDisplay().getWidth();    screenHeight = wManger.getDefaultDisplay().getHeight();    detector = new GestureDetector(this);    bottomImage = new ImageView(this);    bottomImage.setImageResource(R.drawable.icon);    bottomImage.setOnTouchListener(this);    bottomImage.setDrawingCacheEnabled(true);    topImage = new ImageView(this);    topImage.setImageResource(R.drawable.icon);    topImage.setOnTouchListener(this);    topImage.setDrawingCacheEnabled(true);    initRelativeLayout();    setContentView(relativeLayout);}/** * &lt;p&gt; Used to &lt;/p&gt; */private void initRelativeLayout() {    // Top Player     rlTopChild = new RelativeLayout(this);    rlTopChild.setId(1);    LayoutParams p2 = new LayoutParams(LayoutParams.FILL_PARENT  , ((10*screenHeight)/100));    p2.addRule(RelativeLayout.ALIGN_PARENT_TOP);    rlTopChild.setBackgroundColor(Color.BLUE);    rlTopChild.addView(topImage);    rlTopChild.setLayoutParams(p2);    // Bottom Player     rlBottomChild = new RelativeLayout(this);    rlBottomChild.setId(3);    LayoutParams p = new LayoutParams(LayoutParams.FILL_PARENT  , ((10*screenHeight)/100));    p.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM);    rlBottomChild.setBackgroundColor(Color.BLUE);    rlBottomChild.addView(bottomImage);    rlBottomChild.setClipChildren(false);    rlBottomChild.setLayoutParams(p);    // Table Layout     table = new RelativeLayout(this);    table.setId(2);    LayoutParams p3 = new LayoutParams(LayoutParams.FILL_PARENT  , ((50*screenHeight)/100));    p3.addRule(RelativeLayout.CENTER_IN_PARENT);    p3.addRule(RelativeLayout.BELOW , rlTopChild.getId());    p3.addRule(RelativeLayout.ABOVE , rlBottomChild.getId());    table.setBackgroundColor(Color.WHITE);    table.setLayoutParams(p3);    relativeLayout =new RelativeLayout(this);    relativeLayout.setBackgroundColor(Color.GREEN);    relativeLayout.addView(rlBottomChild);    relativeLayout.addView(rlTopChild);    relativeLayout.addView(table);}/** * &lt;p&gt; Overriding the method &lt;/p&gt; * @param v * @param event * @return * @see android.view.View.OnTouchListener#onTouch(android.view.View, android.view.MotionEvent) */@Overridepublic boolean onTouch(View v, MotionEvent event) {    return  detector.onTouchEvent(event);}/** * &lt;p&gt; Overriding the method &lt;/p&gt; * @param e * @return * @see android.view.GestureDetector.OnGestureListener#onDown(android.view.MotionEvent) */@Overridepublic boolean onDown(MotionEvent e) {    // TODOAuto-generated method stub    return true;}/** * &lt;p&gt; Overriding the method &lt;/p&gt; * @param e1 * @param e2 * @param velocityX * @param velocityY * @return * @see android.view.GestureDetector.OnGestureListener#onFling(android.view.MotionEvent, android.view.MotionEvent, float, float) */@Overridepublic 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;        }        if (e1.getX() - e2.getX() &gt; SWIPE_MIN &amp;&amp; Math.abs(velocityX) &gt; SWIPE_THRESHOLD) {           debug(""Left Swipe"");           TranslateAnimation animation= new TranslateAnimation(e1.getX(),e2.getX(),e1.getY() ,e2.getY());           animation.setAnimationListener(this);           animation.setDuration(3000);           bottomImage.startAnimation(animation);        } else if (e2.getX() - e1.getX() &gt; SWIPE_MIN &amp;&amp; Math.abs(velocityX) &gt; SWIPE_THRESHOLD) {            debug(""Right Swipe "");            debug(""Swipe down ..."");            TranslateAnimation animation= new TranslateAnimation(e1.getX(),e2.getX(),e1.getY() ,e2.getY());            animation.setAnimationListener(this);            animation.setDuration(3000);            topImage.startAnimation(animation);        } else if (e1.getY() - e2.getY() &gt; SWIPE_MIN &amp;&amp; Math.abs(velocityX) &gt; SWIPE_THRESHOLD) {           debug(""Swipe up ... "");           TranslateAnimation animation= new TranslateAnimation(e1.getX(),e2.getX(),e1.getY() ,e2.getY());           animation.setAnimationListener(this);           animation.setDuration(3000);           bottomImage.startAnimation(animation);        } else if (e2.getY() - e1.getY() &gt; SWIPE_MIN &amp;&amp; Math.abs(velocityX) &gt; SWIPE_THRESHOLD) {            debug(""Swipe down ..."");            TranslateAnimation animation= new TranslateAnimation(e1.getX(),e2.getX(),e1.getY() ,e2.getY());            animation.setAnimationListener(this);            animation.setDuration(3000);            topImage.startAnimation(animation);        }    } catch (Exception e) {        // nothing    }    return true;}/** * &lt;p&gt; Used to &lt;/p&gt; * @param string */private void debug(String string) {    Log.d(""TAGGG"", string);         }/** * &lt;p&gt; Overriding the method &lt;/p&gt; * @param e * @see android.view.GestureDetector.OnGestureListener#onLongPress(android.view.MotionEvent) */@Overridepublic void onLongPress(MotionEvent e) {    // TODOAuto-generated method stub}/** * &lt;p&gt; Overriding the method &lt;/p&gt; * @param e1 * @param e2 * @param distanceX * @param distanceY * @return * @see android.view.GestureDetector.OnGestureListener#onScroll(android.view.MotionEvent, android.view.MotionEvent, float, float) */@Overridepublic boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY) {    // TODOAuto-generated method stub    return true;}/** * &lt;p&gt; Overriding the method &lt;/p&gt; * @param e * @see android.view.GestureDetector.OnGestureListener#onShowPress(android.view.MotionEvent) */@Overridepublic void onShowPress(MotionEvent e) {    // TODOAuto-generated method stub}/** * &lt;p&gt; Overriding the method &lt;/p&gt; * @param e * @return * @see android.view.GestureDetector.OnGestureListener#onSingleTapUp(android.view.MotionEvent) */@Overridepublic boolean onSingleTapUp(MotionEvent e) {    // TODOAuto-generated method stub    return true;}/** * &lt;p&gt; Overriding the method &lt;/p&gt; * @param animation * @see android.view.animation.Animation.AnimationListener#onAnimationEnd(android.view.animation.Animation) */@Overridepublic void onAnimationEnd(Animation animation) {    // TODOAuto-generated method stub}/** * &lt;p&gt; Overriding the method &lt;/p&gt; * @param animation * @see android.view.animation.Animation.AnimationListener#onAnimationRepeat(android.view.animation.Animation) */@Overridepublic void onAnimationRepeat(Animation animation) {    // TODOAuto-generated method stub}/** * &lt;p&gt; Overriding the method &lt;/p&gt; * @param animation * @see android.view.animation.Animation.AnimationListener#onAnimationStart(android.view.animation.Animation) */@Overridepublic void onAnimationStart(Animation animation) {}</code></pre><p>}</p><p>here</p><p>Thanks. jega </p>","625771","","625771","","2011-02-21 00:27:03","2011-06-04 08:02:31","How animate the imageView across the layout on android?","<android><android-layout>","3","2","2","",""
"5060997","1","","","2011-02-20 23:53:23","1","788","<p>Why import javax.security.sasl.Sasl; does not work with android ????</p>","623968","","","","","2011-02-20 23:59:40","Sasl with android","<android><sasl>","1","1","","",""
"5061183","1","","","2011-02-21 00:27:20","0","631","<p>I have made an app that will simulate the iOS.</p><p>When the settings button is clicked i need it to open the settings on the android phone.</p><p>Same thing for all of the other icons such as the phone button will open the dialer on the android phone.</p><p>How can i do this??</p><p>EXAMPLE</p><p>iOS APP1 FOR ANDROID</p><p>Settings (image button) clicked = Android Settings opens</p><p>Phone (Image Button) clicked = Android Dialer Opens</p><p>-</p><p>Sincerely,IntelSoftApps</p><p>-</p><p>p.s. If any one want to be part of this app/project let me know. Just send me an email at admin@intelsoftapps.com</p>","583952","","583952","","2011-02-21 00:35:17","2011-02-21 07:48:53","How to have a Button on click open an app on an android?","<android>","2","0","","",""
"5061201","1","8706010","","2011-02-21 00:30:46","2","1819","<p>I want to make a simple Android app which connect to facebook, but i'?? begin to make it and found missing pics<a href=""http://developers.facebook.com/docs/guides/mobile/#android"" rel=""nofollow"">http://developers.facebook.com/docs/guides/mobile/#android</a>http://developers.dev.facebook.com/attachment/app_wizard.png<a href=""http://developers.dev.facebook.com/attachment/app_properties.png"" rel=""nofollow"">http://developers.dev.facebook.com/attachment/app_properties.png</a></p><p>and just don't know how to import or make right compilation of Facebook source to add it as a library to ""simple"" example.I'm using Intellij IDEA, but if you describe for eclipse, i'll be appreciated.Thanks!</p>","464328","","","","","2012-01-02 22:33:44","How to import android facebook sdk to simple app example?","<android><facebook><sdk><import>","1","0","1","",""
"5061210","1","","","2011-02-21 00:32:18","0","876","<p>I'm using Phonegap Android and it's building well and very happy so far. My app incorporates some web pages. If I'm on a network everything is fine but if there is no network, I get a dialog box that states ""Application Error, the URL could not be found. (http://myurl.com). This doesn't happen on the iPhone implementation of phonegap. Is there a way to turn off this alert or change the alert to ""No Network Detected"" or something less detailed that doesn't list the URL? Thanks.</p>","625808","","","","","2011-02-21 04:05:53","Phonegap Android 'Application Error' when no network present. How to avoid?","<android><networking><phonegap><detection>","1","0","","",""
"5061257","1","5061315","","2011-02-21 00:43:06","0","530","<p>So I'm having the user create a profile, which includes an avatar. I would like the program to, like the user's name and other info, remember the avatar so it appears as their avatar whenever they use the app. I'd prefer for this bitmap to be saved when created, so the app doesn't need to rebuild the avatar (which is scaled and whatnot) each time the app is started. Is this possible? From the looks of it this wouldn't be able to be saved in SharedPrefs... any idea what the best way to do this would be? Thanks.</p><p>Followup: Followed CommonWares's suggestion. Saved to SD... but having trouble calling it back when the app is reloaded.</p><p>Currently, in onCreate:</p><pre><code>String path = ""testapp/images/thumbs/""+m_username+"".jpg"";        File file = new File(""testapp/images/thumbs/""+m_username+"".jpg"");        if(file.exists()) {            Log.e(""TRY TO GET THUMB"", ""I EXIST"");            m_thumb = BitmapFactory.decodeFile(path);            Drawable draw = new BitmapDrawable(getResources(), m_thumb);            m_photoButtonE.setBackgroundDrawable(draw);        }</code></pre><p>Does not find the file, says it does not exist, though when I check my SD card the image is in that exact spot, with the proper file name and everything. Any ideas? Thanks all.</p>","588758","","588758","","2011-02-21 02:49:58","2011-02-21 02:49:58","Android: Saving a created bitmap to some equivalent of SharedPreferences?","<android><bitmap>","1","0","","",""
"5061261","1","5112875","","2011-02-21 00:43:32","15","8555","<p>I have a layout which has three fields for the entry of three map coordinates.  So far so good.  I'm using android:inputType=""numberDecimal"" in the layout.  When entering the field the user gets the numeric keypad.  Still good.  </p><p>However, when a negative coordinate needs to be entered, there is no apparent way to do this.</p><p>23.2342 works fine.232.3421 works fine.-11.23423 can not be entered - there is no way to enter the leading negative sign, or even wrap the coordinate in ().</p><p>I'm sure I can go the route of changing this to straight text inputType, and then use a regular expression to validate that what was entered is in fact a numeric coordinate, handle error messaging back to the user, etc.  But I'd rather not go that route.  </p><p>I have Googled and Stackoverflowed this question for a couple hours with no luck.  Any suggestions?</p>","464361","","","","","2014-03-22 12:31:47","Android InputType layout parameter - how to allow negative decimals?","<android><layout>","6","1","3","",""
"5061274","1","5077890","","2011-02-21 00:47:02","0","774","<p>I implemented codes for receiving multicast diagram.My phone can get a diagram when screen is on.</p><p>However when screen is off, phone does not get any diagram from subnet.(PC sends a diagram on subnet for searching phone.)I though that multicast lock api(WifiManager.MulticastLock) can solve this problem, but it does not work.</p><p>How can I listen multicast diagram, phone screen is off ?</p>","512941","","183791","","2011-02-22 12:18:30","2011-02-22 12:18:30","Android SDK - is multicastlock working? it does not work when screen is off!","<android><sdk><locking><multicast><listen>","1","2","","",""
"5061285","1","5061295","","2011-02-21 00:48:15","4","2296","<p>In the affirmation text field I press the newline button and it puts spaces.However after I click done the field actually has the correct new lines (second screen capture).</p><p>Its not a problem with the device as it works correctly for the compose mail filed in the gmail app. Which is how I would like this to work.</p><p><img src=""http://i.stack.imgur.com/SUZwb.png"" alt=""W""></p><p><img src=""http://i.stack.imgur.com/SySvx.png"" alt=""enter image description here""></p><pre><code>&lt;TextView        android:inputType=""textMultiLine""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:layout_marginTop=""10dip""        android:text=""@string/edit_affimation""/&gt;&lt;EditTextandroid:id=""@+id/affText""android:layout_width=""fill_parent""android:layout_height=""wrap_content""android:text=""""android:textSize=""18sp""android:singleLine=""false""&gt;&lt;/EditText&gt;</code></pre>","97464","","","","","2012-08-09 06:36:49","Android EditText keyboard newline not working (only on input view)","<android>","2","0","","",""
"5061679","1","5061701","","2011-02-21 02:16:37","0","1016","<p>I'm making an Android app using Processing, and have decided to port my code to Eclipse. I guess there are a lot of differences between Processing and pure Java, because right off the bat I am getting errors that make little sense to me. For example:</p><pre><code>int inactiveThreshold = 300 + int(random(-100, 100));int randomPointInterval = int(random(300, 500));</code></pre><p>I get the error ""Syntax error on token ""int"", delete this token""</p><p>As for the random function, I extend PApplet and have imported processing.core.* so I don't see why that wouldn't work properly. </p><p>Also getting errors on anything referencing a color that I created:</p><pre><code>back.drawBackground(""shadow"", backgroundColor);back.drawBackground(""front"", backgroundColor);</code></pre><p>""Color cannot be resolved to a type"", despite initializing backgroundColor as an integer:</p><pre><code>int backgroundColor = color(100, 100, 120);</code></pre><p>There's also a function in the main class that handles mouse movement, and when I make a reference to it says that the function is undefined. </p><p>These errors are just in the main class, so I figured I should tackle that before anything else. I've mainly been following this for porting the code:</p><p><a href=""http://www.learningprocessing.com/tutorials/processing-in-eclipse/"" rel=""nofollow"">http://www.learningprocessing.com/tutorials/processing-in-eclipse/</a></p><p>I haven't done much in pure Java so there are probably a lot of differences that Processing's precompiler handles that I'm not noticing. </p>","191726","","","","","2012-07-21 17:23:33","Porting some Processing code to Eclipse, getting slew of errors","<java><android><processing>","3","0","","",""
"5061714","1","5061876","","2011-02-21 02:26:59","0","86","<p>Trying my hand at java and android and have run into a problem which I cannot determine is java related, or android related. Essentially I have created some spinners with AdapterArrays on the main onCreate method of the activity, the indices of which I would like to reference from a method I've created which is called from a button using the android:onclick xml attribute.</p><p>However, the  onclick method cannot resolve the spinner object I am referencing. I imagine I am improperly placing the code somewhere within the app, and since I'm very new to java I'm not sure if I'm supposed to be overriding the method, and what I'm doing the the View parameter which the android documentation says I am required to pass. Psedo XML as follows:</p><pre><code>&lt;Button android:onclick=""method"" /&gt;</code></pre><p>Pseduo app.java as follows:</p><pre><code>public class sampleApp extends Activity {@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);Spinner cloudSpinner = (Spinner) findViewById(R.id.cloud_spinner);ArrayAdapter&lt;CharSequence&gt; cloudAdapter = ArrayAdapter.createFromResource(this, R.array.cloud_array, android.R.layout.simple_spinner_item);cloudAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);cloudSpinner.setAdapter(cloudAdapter);}public void method(View v){if(cloudSpinner.getSelectedItem()){}}}</code></pre><p>From there the spinner object is unresolvable. Can anyone point out where I'm going wrong?</p>","387316","","387316","","2011-02-21 03:36:29","2011-02-21 19:20:56","Class level spinner object unresolvable from method in same class in Android","<java><android><button>","1","0","","",""
"5061733","1","5061801","","2011-02-21 02:31:42","2","519","<p>How could I find the number of pixels per centimetre with respect to the physical screen size? </p>","200477","","19750","","2011-02-21 03:59:51","2014-01-06 01:06:18","Find pixels per centimetre depending on screen sizes?","<java><android><screen><dpi>","1","0","0","",""
"5061760","1","5402575","","2011-02-21 02:36:58","6","2940","<p>I simply want to start and stop the sync icon that is in the status bar.  I thought it would be a simple call using NotificationManager, but I cannot find the documentation or sample Q&amp;A on the web or SO.</p>","157804","","","","","2014-01-13 20:50:46","How does one animate the Android sync status icon?","<android><icons><sync><statusbar><notificationmanager>","3","0","4","",""
"5061780","1","5062378","","2011-02-21 02:42:35","1","704","<p>Can anybody tell me how to browse for a movie file from the android folders (either phone/SD Card memory). Let's say I got a movie file on the phone memory and I want to access it from my application, what is the best way to do it?</p><p>Please help me.</p>","574911","","574911","","2011-02-23 20:07:48","2011-02-23 20:07:48","How to browse android gallery for movie/media files in SDK","<android-emulator><android><directory-browsing>","1","0","","",""
"5061914","1","5061994","","2011-02-21 03:16:00","0","62","<p>My application doesn't force close but it does return to the login screen after clicking the home screen or on clicking the recent items.  </p><p>Do i have to save the state of the app on each activity or something ?</p>","516883","","68805","","2011-02-21 03:34:47","2011-02-21 03:34:47","My android application shuts it self down","<android>","1","1","","",""
"5061987","1","5062191","","2011-02-21 03:31:03","1","249","<p>I want to use the latest HttpClient 4.1 version in my application. But Android already bundled with HttpClient.</p><p>The only way that I see is to build this library from sources, and change package name.</p><p>Is there any other solution?</p><p><strong>EDIT:</strong></p><p>At <a href=""http://hc.apache.org/downloads.cgi"" rel=""nofollow"">download page</a> I see OSGi bundle. I have no experience in using OSGi, but AFAIK, OSGi intended to solve libraries versioning problems? If so, how can I use it?</p>","62192","","62192","","2011-02-21 03:58:19","2011-02-21 04:06:28","How to use library with different version then one bundled with Android?","<java><android><versioning><libraries>","1","1","","",""
"5061992","1","5062028","","2011-02-21 03:32:45","0","677","<p>I have a simple problem (maybe) with my code... I have a facebook button that will open the login dialog for the user, which works fine. but if there is no internet it'll take forever and I don't know how to timeout it... I've put it in a 'try' block, but it still takes way too long </p><p>this is the code for it</p><pre><code>try{        facebook.authorize(this,new String[] {""publish_stream"", ""read_stream"", ""offline_access""}, new DialogListener() {        @Override        public void onComplete(Bundle values) {}        @Override        public void onFacebookError(FacebookError error) {}        @Override        public void onError(DialogError e) {}        @Override        public void onCancel() {}        });    } catch(Exception e) {        e.printStackTrace();    }</code></pre><p>any help will be highly appreciated </p><p>P.S. this applies for the post into facebook as well</p>","609146","","68805","","2011-02-21 03:39:37","2011-12-02 17:12:36","facebook login dialog when no internet","<android><facebook>","2","0","","",""
"5062048","1","5062224","","2011-02-21 03:42:05","0","420","<p>My app requires the user to go through multiple pages of input (signing up process).As the user goes deeper into the signup, I have to keep the data intact till the user clicks on ""finish"". This process involve activity calling sub-activities and those sub activities calling another sub-activity.</p><p>The flow is like this: Main -> Sub-Activity (part 1 of signup) -> Sub-Activity (part2) -> Sub-Activity (part 3).</p><p>The problem here is, I'm having a low memory warning from the logcat and various processes are being killed as the user goes in deeper into the app. I already tried to save on-hand memory by not passing custom objects among activity but by storing them into mysqllite and retrieving them when needed. One more point to add is, I'm not dealing with images and controls used are just textviews, editviews and spinners.</p><p>My question is, is it common to have low memory issues when there are multiple sub-activities chained? How do I go about it to free up memory? Does custom controls uses significantly more memory than preset controls? (One of my hunch)</p><p>*<strong><em>Edit</em>*</strong> I found the reason for the low memory issues. It has nothing to do with sub activities. The culprit is the custom controls i'm using. I did a test by using the preset controls instead and the overall performance of the app improve drastically. I no longer have the low memory warning and everything works smoothly now.</p>","584187","","584187","","2011-02-21 05:25:26","2011-02-21 05:25:26","multiple sub-activities that causes low memory","<android><memory-management><subactivity>","1","0","","",""
"5062061","1","6218038","","2011-02-21 03:43:55","0","739","<p>First to explain how projects are setup:</p><ul><li>Android Library project with two classes:<ul><li>UserActivity - uses static field in HolderClass</li><li>HolderClass - this one has static field Data</li></ul></li><li>Android Application that references Library project, has only one class:<ul><li>StarterActivity - when app is started, in onCreate it sets static field Data to some value, and it starts UserActivity</li></ul></li></ul><p>Now, the problem is: <em>sometimes</em> I get java.lang.NullPointerException for that static field Data - as if I never initialized it (or value got deleted in meantime). It never happened on my test device, but I keep getting error reports from client devices. I can only guess how that happens - maybe user navigates away from app, then comes back and system recreates whole application context, but in that context HolderClass has empty static field Data?</p><p>My question: </p><p>Is initialization of that static field from Activity's onCreate wrong approach? Should I put data in ApplicationContext? Or do something else?</p><p>I am open for all suggestions.</p><p>P.S. If you have problem visualizing from description, here is how everything I've said would look in code:</p><pre>// IN ANDROID APP PROJECTpublic class StarterActivity extends Activity {    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);         // just start activity in library        Intent myIntent = new Intent(this, AutolaunchActivity.class);        startActivityForResult(myIntent, 1);        }    @Override    protected void onActivityResult(int requestCode, int resultCode, Intent data) {        super.onActivityResult(requestCode, resultCode, data);        // exit when activity from library exits        finish();           }}// IN LIBRARY PROJECTpublic class HolderClass {    public static String Data;}public class UserActivity extends Activity {    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);         // init layout      }    public void someButtonClicked() {        HolderClass.Data.trim();    }}</pre>","237858","","237858","","2011-02-21 03:53:46","2011-06-02 17:33:33","java.lang.NullPointerException for static field in Android library project","<android><android-library>","2","3","2","",""
"5062070","1","5062219","","2011-02-21 03:45:35","0","296","<p>I have a reference application that downloads an sql lite file in the beginning to use to reference the data.  I need to have a way to verify if the file has downloaded completely.  I was saving the file length after the file downloads and putting it into preferences and checking against the actual file at the start of the application.  I'm adding tables and other data to the database now and cannot use that method.  What do I use?</p>","1491425","","","","","2011-02-21 04:12:11","How can I verify that a file was completely downloaded in android?","<java><android><database><sqlite>","1","0","","",""
"5062090","1","5062842","","2011-02-21 03:48:30","1","650","<p>I know how to put ringtones in the ringtonemanage but I want to be able to set the ringtone that the user pick and also get the title for Ringtone the user pick. I have no clue on how to do that. Every article seems to only be about how to put ringtones in ringtonemanager.</p>","583713","","244296","","2011-02-21 03:54:10","2011-02-23 07:08:32","How to get the title of the current ringtone?","<android>","1","0","3","",""
"5062131","1","","","2011-02-21 03:54:32","1","279","<p>If my app is running and I press either the home or back buttons my app will still continue to make ad requests as if it is running. I can see this in logcat.</p><pre><code>02-21 11:52:38.118: INFO/AdMobSDK(5782): No fill.  Server replied that no ads are available (9041ms)02-21 11:52:51.391: INFO/CheckinService(5182): Preparing to send checkin request02-21 11:52:51.391: INFO/EventLogService(5182): Accumulating logs since 129826003122102-21 11:52:51.461: INFO/CheckinTask(5182): Sending checkin request (3032 bytes)02-21 11:53:47.164: INFO/AdMobSDK(5782): No fill.  Server replied that no ads are available (9044ms)</code></pre><p>The above is all after I have closed my application using the home button. It does the same thing if I use the back button though. Why on earth is it doing this? It even does it if i set the ad view to null in 'onPause()'. How can I stop it from happening?</p>","549859","","","","","2011-02-21 05:22:37","Admob still making requests when app closed or in background?","<java><android><sdk><admob>","1","1","","",""
"5062132","1","5062535","","2011-02-21 03:54:44","3","3639","<p>I want to create a simple game like Space Invaders. I know that I can use Android NDK, but I have to port the libraries that I use. I can not use third-party proprietary libraries.</p><p>I will use OpenGL, but OpenGL API seems different on Android. I have to use jpeg and png textures, and write texts. Can I compile libjpeg, libpng and freetype for Android?</p><p>I can not have specific implementation of the game engine (C++) and rendering routines (C++ and OpenGL), because that is the complex part.</p><p>There are components that I am disposed to implement for each platform. There is no problem with windowing system and user input, because I will use a specific implementation for each system, it is simple for me. </p><p>I use SDL and its extensions for audio on PC, but it is easy to use. I can use specific audio libraries for Android.</p><p>Thanks</p>","405030","","","","","2013-01-27 19:22:26","How to port a PC game to Android written in C++","<c++><android><porting>","1","0","1","",""
"5062264","1","16262479","","2011-02-21 04:21:24","10","8457","<p>I am looking to find all the views in a specified activity that have the tag ""balloon"" for example then hide them using <code>setVisibility</code> to <code>GONE</code>.</p><p>Does anyone know how to retrieve a list of views with a given tag?</p>","568508","","202522","","2013-04-09 17:16:25","2013-04-28 11:41:34","Find all views with tag?","<android>","3","2","2","",""
"5062275","1","5063046","","2011-02-21 04:23:47","2","2871","<p>I have dynamic and quite large contents which needs to be populated on user interaction (click next / prev page).The dynamic contents displayed programmatically on myTableLayout (see xml below). Each time user clicked next/prevpage then I call <code>myTableLayout.removeAllViews()</code>, do some stuff and repopulate with <code>myTableLayout.addView()</code>.On small contents it draws quite fast, but I notice two to three seconds lag if populating large contents.</p><p>I already saw an application that do same functionality as mine (also with quite large contents) but it really paging so fasteven on low-end device.</p><p>Need some advice on how to increase the layout performance.</p><p>Thanks.</p><p>Note: Upper TableLayout used as title (header), LinearLayout below it is where the contents placed.</p><p></p><pre><code>&lt;TableLayout    android:layout_width=""fill_parent""    android:layout_height=""45dip""    android:stretchColumns=""0,2""    android:shrinkColumns=""0,2""    &gt;        &lt;TableRow&gt;            &lt;LinearLayout                android:id=""@+id/llLeft""                android:layout_width=""wrap_content""                android:layout_height=""fill_parent""            &gt;                &lt;TextView                    android:id=""@+id/tvLeft1""                    android:layout_width=""fill_parent""                    android:layout_height=""fill_parent""                /&gt;            &lt;/LinearLayout&gt;            &lt;LinearLayout                android:id=""@+id/llCenter""                android:layout_width=""wrap_content""                android:layout_height=""fill_parent""            &gt;                &lt;TextView                    android:id=""@+id/tvCenter1""                    android:layout_width=""wrap_content""                    android:layout_height=""fill_parent""                /&gt;                &lt;TextView                    android:id=""@+id/tvCenter2""                    android:layout_width=""wrap_content""                    android:layout_height=""fill_parent""                /&gt;            &lt;/LinearLayout&gt;            &lt;LinearLayout                android:id=""@+id/llRight""                android:layout_width=""wrap_content""                android:layout_height=""fill_parent""            &gt;                &lt;TextView                    android:id=""@+id/tvRight1""                    android:layout_width=""fill_parent""                    android:layout_height=""fill_parent""                /&gt;            &lt;/LinearLayout&gt;    &lt;/TableRow&gt;&lt;/TableLayout&gt;&lt;LinearLayout    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""&gt;    &lt;com.MyScrollView        android:id=""@+id/myScrollView""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        &gt;        &lt;TableLayout            android:id=""@+id/**myTableLayout**""            android:layout_width=""wrap_content""            android:layout_height=""wrap_content""            android:shrinkColumns=""1""            android:stretchColumns=""1""            /&gt;    &lt;/com.MyScrollView&gt;&lt;/LinearLayout&gt;</code></pre><p></p><p>Here is the code that create the dynamic content. The content fetched from memory (ArrayList) so it should not be the problem.</p><pre><code>private void gotoPage() {    myTableLayout.removeAllViews();    GlobalVar g = GlobalVar.getInstance();    ArrayList&lt;String&gt; arrScripts = g.getDatasMap().get(SCRIPT_INDEX);    ArrayList&lt;String&gt; arrTrans = g.getTranslationMap().get(SCRIPT_INDEX);    Log.i(APP_NAME, ""finished preparing data"");    try {        // Data Title        tvCenter1.setText(arrScripts.get(0));        tvCenter2.setText("" ("" + SCRIPT_INDEX + "")"");        int countScripts = arrScripts.size();        for(int i=1; i&lt;countScripts; i++) {            // Row Script            TableRow trScript = new TableRow(this);            trScript.setPadding(0, 5, 0, 0);            TextView tvIndex = new TextView(this);            tvIndex.setGravity(Gravity.CENTER);            tvIndex.setWidth(40);            tvIndex.setText("""" + i);            TextView tvScript = new TextView(this);            tvScript.setGravity(Gravity.RIGHT);            tvScript.setTypeface(g.getFontTypeFace());            tvScript.setTextSize(FONT_SIZE);            tvScript.setPadding(0, 0, 5, 0);            tvScript.setText(arrScripts.get(i));            trScript.addView(tvIndex);            trScript.addView(tvScript);            TableRow trTrans = null;            if(IS_USE_TRANSLATION) {                // Row Translation                trTrans = new TableRow(this);                TextView tvBlank = new TextView(this);                tvBlank.setPadding(0, 0, 0, 5);                TextView tvTrans = new TextView(this);                tvTrans.setPadding(0, 0, 0, 5);                tvTrans.setText(arrTrans.get(i));                trTrans.addView(tvBlank);                trTrans.addView(tvTrans);            }            // Place for line separator            View vSep = new View(this);            ViewGroup.LayoutParams p = new ViewGroup.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT);            p.height = 3;            vSep.setLayoutParams(p);            // Combine rows to table            if(IS_USE_SCRIPT) myTableLayout.addView(trScript);            if(IS_USE_TRANSLATION) myTableLayout.addView(trTrans);            myTableLayout.addView(vSep);        }    } catch (Exception e) {        Log.e(APP_NAME, e.getMessage());    }}</code></pre><p>Here is the <a href=""http://i.stack.imgur.com/LkB6t.gif"" rel=""nofollow"">traceview result</a>.</p>","622029","","1108213","","2012-03-08 08:59:02","2013-04-06 21:48:24","How to increase layouting performance","<android><performance><layout>","5","0","","",""
"5062364","1","5067179","","2011-02-21 04:40:49","1","207","<p>Given a nexus one (rather any Android phone), is it a way to find out which 3g band it supports (t-mobile or att), without inserting any SIM cards ? currently I'm just interested in nexus one, but generic info can be useful too.</p>","517940","","31161","","2011-08-05 11:15:26","2011-08-05 11:15:26","Find the 3G band for Nexus One","<android><3g><nexus-one>","1","0","","",""
"5062367","1","","","2011-02-21 04:41:15","0","99","<p>I want to draw an Hexagon but i cant figure out how to set up the coordinates</p><p>right now i have something like.......</p><pre><code>private short[] _indicesArray = {0, 1, 2, 6, 7, 8, 3, 4, 5, 2, 5, 7};</code></pre><p>every three is a triangle... something like below /\|/| /</p>","604620","","1844392","","2013-09-16 08:26:57","2013-09-16 08:31:58","Android ""Open GL""","<android>","3","0","","",""
"5062419","1","","","2011-02-21 04:49:58","10","24953","<p>i want to know about twitter api for android application....please send me link or source for twitter api which api just only for send the tweet.... </p>","1004437","","","","","2013-03-30 11:29:58","how to use twitter api in android application for send tweet only","<android>","4","0","8","",""
"5062421","1","","","2011-02-21 04:50:22","1","128","<p>When i run the app. I am getting this error.[INSTALL_FAILED_MISSING_SHARED_LIBRARY] when installing the application.</p>","617285","","","","","2011-02-21 04:59:47","Android Application","<android>","1","1","","",""
"5062446","1","5062475","","2011-02-21 04:53:31","0","705","<p>I want to install an app/idea i have developed int a demo on my phone (HTC Hero). I have read several posts some from as far back as '08 on different options. I was hoping I could install this using the debug bridge and eclipse, but can't seem to find a way.</p><p>Is there an easy way for me to get this on my phone?</p><p>Thanks in advance,Pat</p>","625983","","80425","","2012-04-10 16:51:04","2012-04-10 16:51:04","installing APKs outside of android market","<android><deployment>","3","0","","",""
"5062494","1","","","2011-02-21 05:02:17","0","65","<pre><code>public void execute(String sqlStatement) throws DBException {    Statement statement;    try {        statement = database.createStatement(sqlStatement);        statement.prepare();        statement.execute();        statement.close();    } catch (DatabaseException databaseException) {        throw new DBException(Class.class.getName(), ""execute"", databaseException.getMessage());    }}</code></pre><p>This is the function in java that i have to implement in android. In android how can i use the createstatement(), statement.prepare() and statement.execute() functions?</p>","620787","","19750","","2011-02-21 05:05:34","2011-02-21 05:12:26","which function is there in android for the following java function--statement = database.createStatement(sqlStatement);?","<android>","1","0","","",""
"5062547","1","","","2011-02-21 05:11:32","2","1716","<p>I need to implement DUKPT encryption &amp; decryption in Java/Android. </p><p>I have studied the reference and understand somewhat. I searched any any tutorial with sample code in Java to implement but I have not got any sample.</p><p>Can anybody know how to implement this in Java.</p><p>Any help or suggestion will be helpful for me.</p><p>Thanks in advance for your help.</p>","370804","","","","","2012-07-30 10:15:44","How to implement DUKPT encryption & decryption in Java/Android?","<java><android>","2","0","1","",""
"5062584","1","5063510","","2011-02-21 05:16:16","0","1086","<p>Which platform is best?</p><p>Android or Java EE in terms of growth and future career?</p>","1131639","","472792","","2012-03-18 13:35:14","2013-06-14 06:53:00","Android or Java EE","<android><java-ee>","2","1","","2011-02-21 10:37:33",""
"5062652","1","","","2011-02-21 05:26:42","0","1702","<p>can we change the size of popup window which shows when click on spinner,</p><p>actually its look very wide and i want to reduce the width of pop window, but dn't knw how is it possible</p>","475748","","366904","","2011-02-21 05:30:29","2011-06-08 19:35:01","How to change size of spinner in android?","<android><spinner>","1","0","1","",""
"5062667","1","","","2011-02-21 05:30:04","2","431","<p>In android is there any direct method that executes a query and returns a cursor??</p><p>like in java there is statement.getCursor()is there any equivalent method in android?</p>","620787","","","","","2011-02-21 05:55:59","In android is there any direct method that executes a query and returns a cursor?","<android>","2","0","","",""
"5062673","1","","","2011-02-21 05:31:26","0","86","<p>we have making media player that play the media files from server.in my current flow we are get the server response in json format, then we store that data in database and again it store in array list and after that it is display by custom list everything is in working mode. but i m not happy with flow. pls anybody suggest me good flow. or any peturn </p>","562296","","","","","2011-02-21 05:38:58","which is the best flow of using both the sql database and web service data?","<android><database>","1","1","","",""
"5062722","1","5066246","","2011-02-21 05:38:23","4","6023","<p>The <code>android:screenOrientation</code> tag when placed in <code>&lt;application&gt;</code> does not work.But when I put <code>android:screenOrientation</code> in a <code>&lt;activity&gt;</code> tag it works.</p><p>If <code>android:screenOrientation</code> tag works in <code>&lt;application&gt;</code> then, there would no need to put <code>android:screenOrientation</code> handling for every activity.</p><p>I wonder, why there is such strange behavior in Android platform for <code>screenOrientation</code> tag?</p>","493423","","963519","","2012-09-20 11:22:38","2012-10-05 12:21:58","android:screenOrientation tag in application does not work","<android><screen-orientation>","1","4","2","",""
"5062729","1","5062766","","2011-02-21 05:40:19","2","1010","<p>I have a set of 3 functions which i uses in 3 activity classes. Instead of putting the 3 methods in each of the 3 classes, how can i write the 3 methods only once and then call these methods in all other classes...</p><pre><code>@Override    public boolean onCreateOptionsMenu(Menu menu) {        MenuInflater inflater = getMenuInflater();        inflater.inflate(R.menu.menu, menu);        return true;    }    @Override    public boolean onOptionsItemSelected(MenuItem item) {         // Handle item selection        switch (item.getItemId()) {        case R.id.icon:            settingBoard();            return true;        default:            return super.onOptionsItemSelected(item);        }    }    public void settingBoard() {        Log.i(MY_DEBUG_TAG, ""Preparing settings page.."");        /*         * progressDialog.setMessage(""Preparing settings page....."");         * progressDialog.show();         */        Intent lma = new Intent(this, SettingsActivity.class);        startActivityForResult(lma, 3);    }</code></pre><p>Any help is appreciated</p>","396543","","396543","","2011-02-21 06:49:04","2011-02-21 06:49:04","Use common functions in Android","<android>","3","2","2","",""
"5062754","1","5062791","","2011-02-21 05:45:16","0","232","<p>I know there's a big difference between the <code>drawable-*</code> folders, but what should I do to create my images? What DPI should I use? As it's been said, you can always go down (in DPI) but you can't go up.</p>","128967","","","","","2011-02-21 05:50:31","What DPI should I be creating images at for use in an Android application?","<android><android-layout>","1","0","0","",""
"5062769","1","","","2011-02-21 05:47:03","0","654","<p>I am zooming a drawable image and then dragging it with the following codes. The image is getting zoomed but throwing a CLASSCASTEXCEPTION  on dragging. The code for dragging image is as:</p><pre><code>    public boolean onTouch(View view,MotionEvent event)    {        ImageView v =(ImageView) view;// here the cast error occurs        v.setScaleType(ImageView.ScaleType.MATRIX);         //zoomControler+=10;        // invalidate();        switch (event.getAction() &amp; MotionEvent.ACTION_MASK) {         case MotionEvent.ACTION_DOWN: //first finger down only              savedMatrix.set(matrix);              start.set(event.getX(), event.getY());           Log.d(""mode=DRAG"", null);              mode = DRAG;              break;           case MotionEvent.ACTION_MOVE:                   if (mode == DRAG) { //movement of first finger                     matrix.set(savedMatrix);                     if (v.getLeft() &gt;= -392){                        matrix.postTranslate(event.getX() - start.x, event.getY() - start.y);                     }                  }                 }           // Perform the transformation           v.setImageMatrix(matrix);           return true; // indicate event was handled         }}}</code></pre><p>Please help me on this as  I am new to android.Thanks in adv</p>","626045","","535871","","2011-02-21 05:51:21","2011-02-21 05:51:44","how to cast drawable image to imageview in android","<android><imageview><drawable>","1","1","","",""
"5062780","1","5062811","","2011-02-21 05:49:26","0","540","<p>i am currently trying to assign each character that i get from a file in SD card into a different text view</p><p>could anyone advise how would i have to do this?</p><p>am quite unsure about adding textviews on the fly</p><pre><code>        try {        BufferedReader br = new BufferedReader(new FileReader(file));        String line="""";        int c,counter=0;        while ((c = br.read()) != -1) {            line+=(char)c;            counter++;                      }        char[] singleText = line.toCharArray();        for (int i = 1; i &lt; counter; i++)        {            //text.append(singleText[i]);        }    }    catch (IOException e) {        //You'll need to add proper error handling here    }    //Find the view by its id    TextView tv = (TextView)findViewById(R.id.TextView01);    //Set the text    tv.setText(text);</code></pre><p>i have done a counter to count how many textviews should be added as well as assigned the characters into an array but i cant seem to find the code to add a textview with a specific size for each char on the fly</p><p>Thanks in Advance</p>","578198","","","","","2011-02-21 05:53:33","adding textviews on the fly","<android>","1","0","","",""
"5062803","1","5062855","","2011-02-21 05:52:05","2","6218","<p>I used a custom XML file created bind my db cursor in a ListActivity. Each item in the XML file has 2 buttons. I want to capture the click event of the button and the position in the list.</p><p>This is my XML file</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""&gt;    &lt;TextView android:id=""@+id/smListName"" android:paddingTop=""2dip"" android:paddingBottom=""3dip"" android:layout_width=""wrap_content""        android:layout_height=""fill_parent"" android:textSize=""22dip"" /&gt;    &lt;Button android:id=""@+id/smListCompleted"" android:layout_width=""wrap_content"" android:layout_height=""fill_parent"" android:layout_gravity=""right"" android:textStyle=""bold"" android:textColor=""#0000ff""  /&gt;    &lt;Button android:id=""@+id/smListNotCompleted"" android:layout_width=""wrap_content"" android:layout_height=""fill_parent"" android:layout_gravity=""right"" android:textColor=""#ff0000""         android:textStyle=""bold"" /&gt;&lt;/LinearLayout&gt;</code></pre><p>And this is how I'm binding</p><pre><code>db = openOrCreateDatabase(""ITC"", MODE_PRIVATE, null);Cursor outlets = db.rawQuery(""Select s.salesmanid as _id, s.name ..."", null);this.setListAdapter(new SimpleCursorAdapter(this, R.layout.salesmanlist, outlets, new String[] { ""name"", ""complete"", ""incomplete"" }, new int[] {R.id.smListName, R.id.smListCompleted, R.id.smListNotCompleted }));db.close();</code></pre><p>I'm not using a custom adapter. Now I want to capture the click of smListNotCompleted and smListCompleted along with the row position.</p><p>Thanks</p>","161633","","","","","2012-09-12 22:06:19","Capturing Click on a custom listview in Android","<android><listadapter>","3","0","1","",""
"5062806","1","5062847","","2011-02-21 05:52:44","4","4830","<p>I want to display images in my application. But in emulator there no any picture present by default. So it needs to add some images to emulator. I tried it with adding images in sdcard by could't be successful. Please specify steps.</p>","550966","","","","","2012-03-23 15:17:19","Adding images in gallery of emulator","<android><image><android-emulator>","1","0","","",""
"5062845","1","5063009","","2011-02-21 06:00:32","1","413","<p>Is there some way of executing a block of code as soon as the device connects to the internet? </p><p>The situation is this: Currently I have an application that sends information to a server. This works fine when the device is connected. However, when there is no connection, the information never gets sent. Is there some way of putting this code on hold until the user connects to the internet? Kinda like an 'onInternetConnectionEstablished()'. Or perhaps a way of having a service block or loop until a connection is established?</p>","615759","","","","","2011-02-21 06:33:35","On Connection to Internet?","<android><internet>","1","0","1","",""
"5062876","1","13426345","","2011-02-21 06:07:13","3","2270","<blockquote>  <p><a href=""http://androidapt.wordpress.com/2010/11/19/pulse-news-reader-an-android-app-that-kicks-rss/"" rel=""nofollow"">http://androidapt.wordpress.com/2010/11/19/pulse-news-reader-an-android-app-that-kicks-rss/</a></p></blockquote><p>Gallery inside ListView it's clear, but:</p><ol><li>What is the technology that allows you to show a ScrollView under opening ListView?</li><li>How to make gallery and top bar move down by touching screen inside opened Scrollview?</li></ol><p>I don't need the direct code, just show me where to lurk for this info. </p><p><img src=""http://i.stack.imgur.com/MgaJe.png"" alt=""enter image description here""></p><p>I though that it uses <a href=""https://github.com/commonsguy/cw-android/tree/master/Fancy/DrawerDemo"" rel=""nofollow"">SlideDrawer</a>, but it reacts only on touches, then i think it is something similar to <a href=""https://github.com/commonsguy/cw-advandroid/tree/master/Animation/SlidingPanel"" rel=""nofollow"">SlidingPanel</a></p>","464328","","464328","","2011-02-21 16:16:13","2012-11-28 13:50:09","How to make an app similar to Pulse News Reader for Android","<android>","3","5","2","",""
"5062947","1","5063935","","2011-02-21 06:19:37","0","843","<p>I want to call activity on menu event.I am new to android so i am trying to open new screen on delete option on menu, for this i write switch case but i didnt get how to call another activity in that please help me my code is </p><pre><code>@Override     public boolean onCreateOptionsMenu(Menu menu)     {         MenuInflater inflater = getMenuInflater();         inflater.inflate(R.menu.menu, menu);         return true;     }     @Override     public boolean onOptionsItemSelected(MenuItem item)     {        switch(item.getItemId())          {            case R.id.delete:   Intent i= new Intent(this,deleteAct.class);                                 startActivity(i);break;            case R.id.edit://calling another  intent; break;            case R.id.showall://calling another intent; break;          }       return true;     }</code></pre><p>please help me ..</p>","573776","","71724","","2011-02-21 06:32:25","2011-02-21 08:55:04","How to add intent on menu event","<android>","1","4","","",""
"5063043","1","5063525","","2011-02-21 06:38:05","0","940","<p>I would like to know how to find whether an Android stack in phone is Original or Jail-broken?  </p><p><strong>My Intention :</strong><br>My application will check for the genuineness of the Android OS in phone.<br>If it finds that, the phone does not have a genuine Android, it will not allow the application to install on phone.  </p><p>Is it possible to implement this?  </p><p>Thanks,<br>Sen</p>","449378","","229745","","2011-02-21 06:48:03","2011-02-21 09:03:12","How to find whether an Android stack in phone is Original or Jail-broken?","<android><root><jailbreak>","2","1","1","",""
"5063094","1","5063148","","2011-02-21 06:45:52","1","1590","<p>i want to develop a screen that is similar to default dial screen.and want to override the functionality for the call button.Can you suggest the best method to implement this?</p><p>Can I use the andorid's dial screen and override the call button functionality or need to develop the entire view too?</p><p>If we need to develope the screen from the scratch, what layout is best suited for this..(gridview/tablelayout)?</p><p>Thanks in advance.</p>","540638","","","","","2011-02-21 06:55:44","android: custom dial screen","<android>","1","0","1","",""
"5063097","1","","","2011-02-21 06:46:49","0","498","<p>I have a set of java code which i try to detect touch gestures by users. When a user do a simple touch/swipe down etc, a text view will display out what the user has currently done. However when i run the code on my emulator, it is just a black screen which show Hello World! and when i do a touch, nothing is display.. why is that so? Attached is the code. Thanks for your help...</p><pre><code>package org.tp.iit.cds.BrailleTypeSend;import android.app.Activity;import android.app.AlertDialog;import android.content.DialogInterface;import android.os.Bundle;import android.widget.LinearLayout;import android.view.MotionEvent;import android.view.GestureDetector.OnGestureListener;import android.view.GestureDetector;import android.widget.TextView;import android.graphics.Color;public class BrailleSend extends Activity implements OnGestureListener {    /** Called when the activity is first created. */    public LinearLayout main;        public TextView viewA;    public GestureDetector gestureScanner;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        gestureScanner = new GestureDetector(this);        main = new LinearLayout(this);        main.setBackgroundColor(Color.GRAY);        main.setLayoutParams(new LinearLayout.LayoutParams(320,480));        viewA = new TextView(this);        viewA.setBackgroundColor(Color.YELLOW);        viewA.setTextColor(Color.WHITE);        viewA.setTextSize(16);        viewA.setLayoutParams(new LinearLayout.LayoutParams(320,80));        main.addView(viewA);        setContentView(R.layout.main);    }    @Override    public boolean onDown(MotionEvent e) {          viewA.setText(""Down Stroke"");        return true;    }    @Override    public boolean onSingleTapUp(MotionEvent e) {               viewA.setText(""tap"");        return true;    }} </code></pre>","502963","","","","","2011-05-07 15:58:12","Gesture detecter not working","<java><android><gesturedetector>","2","0","","",""
"5063100","1","6891361","","2011-02-21 06:46:58","3","1499","<p>i have three checkboxes in my preference screen. i want to make the user select only one checkbox at a time.How do i achieve this?</p><p>thank you in advance.</p>","590849","","","","","2013-12-11 13:17:25","multiple dependency in checkboxpreference android","<android><dependencies><checkboxpreference>","4","0","3","",""
"5063141","1","5063635","","2011-02-21 06:54:48","0","183","<p>I have a window that opens in a Dialog theme, which is how I want it to look. it's to update the title of a note (example)... so there is a text box and 2 buttons.</p><p>problem is as soon as I click on the edittext for the keyboard to show up the dialog window closes !!!!</p><p>this is the declaration I have in the mainfest for the dialog activity (note: I tried with the windowSoftInputMode value and without) </p><pre><code>&lt;activity android:name="".EditComment""    android:theme=""@android:style/Theme.Dialog""    android:windowSoftInputMode=""stateAlwaysVisible""    android:label=""Comment""/&gt;</code></pre>","609146","","918414","","2013-02-10 02:16:17","2013-02-10 02:16:17","dialog window with edittext closes when edittext is clicked","<android>","1","0","","",""
"5063173","1","5063435","","2011-02-21 06:58:42","1","1806","<p>I am using the below code.</p><pre><code>    listView = (ListView) findViewById(R.id.SkiiplistListView);    listView.setOnItemClickListener(new OnItemClickListener() {        @Override        public void onItemClick(AdapterView&lt;?&gt; arg0, View v, int position,                long arg3) {            // TODO Auto-generated method stub            System.out.println(""--position--""+position);            Intent intent = new Intent(SkiipListScreen.this, SkiiperProfileScreen.class);            Bundle bundle = new Bundle();            bundle.putString(""uid"", uid);            intent.putExtras(bundle);            startActivity(intent);        }    });</code></pre><p>I have also tried the below.</p><pre><code>   listView = (ListView) findViewById(R.id.SkiiplistListView);   listView.setOnItemClickListener(this);    @Override    public void onItemClick(AdapterView&lt;?&gt; arg0, View arg1, int position, long arg3) {    // TODO Auto-generated method stub    System.out.println(""--position--""+position);    Intent intent = new Intent(this, SkiiperProfileScreen.class);    Bundle bundle = new Bundle();    bundle.putString(""uid"", uid);    intent.putExtras(bundle);    startActivity(intent);    }</code></pre><p>I have used this kind of code in many classes.But in some classes this code responds and in some it doesn't. In many cases after some time it starts responding after some time.</p><p>I don't know why it is so inconsistent. Please if you have any answer, let me know.</p>","444277","","596465","","2011-02-21 07:27:44","2012-12-03 11:09:11","listview onitem clicklistener not responding always","<android><listview>","2","0","2","",""
"5063194","1","","","2011-02-21 07:04:12","2","6706","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/2795833/check-orientation-on-android-phone"">Check orientation on Android phone</a>  </p></blockquote><p>how to know programatically whether screen is in portrait or landscape mode.please help me </p>","626132","","","","","2014-02-28 20:21:29","android portrait or landscape","<android>","4","0","1","2011-07-13 22:52:02",""
"5063232","1","5063436","","2011-02-21 07:10:04","0","208","<p>Hey team i am new to android and building an application in which there would be two buttons one for setting and the other for use mirror.  Now when i will click on use mirror button , the color of the screen should become silver ,so that any one can use it as a mirror......</p><p>so plz help me to solve the problem </p><p>thanks  </p>","626122","","","","","2011-02-21 07:42:05","building an application to change the color of screen , clicking on the button in android","<android>","1","3","","",""
"5063265","1","","","2011-02-21 07:15:07","0","2337","<p>I am using AutoCompleteTextView in my application for search option. In my case I want to show some suggestions along with image as drawable left/right to the TextView. How to filter some suggestion and add drawable resource while displaying the suggestios.Because this drawable I have to add for some options only. Can we give our own layout for the suggestions display?</p><p>Suggest me.</p><p>RegardsMurthy</p>","622910","","","","","2011-02-21 08:39:20","AutoCompleteTextView suggestions can be customize?","<android><autocompletetextview>","1","1","2","",""
"5063404","1","8565634","","2011-02-21 07:37:26","4","1374","<p>Is anyone aware of <a href=""http://en.wikipedia.org/wiki/Wi-Fi_Direct"" rel=""nofollow"">WiFi Direct</a> (a WiFi peer-to-peer variant) libraries or SDKs for Android?</p>","612472","","23897","","2011-02-21 07:53:45","2011-12-19 18:22:00","""Wi-Fi Direct"" libraries for Android?","<android><wifi><android-wifi>","2","0","3","",""
"5063519","1","","","2011-02-21 07:53:48","2","1791","<p>I am new to android and java so please bear with me with the incorrect terms used. I am programming an application that helps to identify the location with an image. </p><ol><li>Capture image from camera</li><li>Send captured image to a web server</li><li>Listen and receive information from the web server regarding the location of the captured image and display to user.</li></ol><p>Hence main problems are:</p><ul><li>Send image to web server</li><li>Receive information from web server</li></ul>","626189","","626189","","2011-02-21 08:09:31","2011-11-30 11:21:45","Send image to web server and receive information","<android><image><send>","1","5","","",""
"5063527","1","5066187","","2011-02-21 07:54:46","0","625","<p>I have been paging through the Android documentation and I was curious. When would you bind a service as opposed to not binding the service? What advantages/limitations does it provide?</p>","420377","","","","","2011-02-21 12:51:32","When to bind a service and when not to bind a service","<android><service>","1","0","","",""
"5063539","1","","","2011-02-21 07:55:57","1","225","<p>i want to display different currencies symbols in combo box(Spinner).The currencies may me follows:</p><pre><code>usaeuropounds</code></pre><p>e.t.c</p><p>i preferred to read these symbols from the xml. is there any code for the currencies symbols.</p><p>how can i do it?</p><p>thanks</p>","309990","","","","","2011-02-21 08:10:40","how to display different currencies symbols in android?","<android>","1","0","","",""
"5063601","1","5063867","","2011-02-21 08:06:21","0","180","<p>Android question: I am currently in Activity A and inside of A I start Activity B using <code>startActivityForResult</code>. At different points in B I can set different values as the result using <code>setResult</code>. While I am still inside of Activity B, is there any way for me to check what will be the current result that will be sent back to Activity A? (Or do I have to keep track of this information myself?) Thanks.</p>","299080","","","","","2011-02-21 08:46:53","Android: How to retrieve the result to be returned by the current Activity?","<android><activity><result>","2","0","","",""
"5063609","1","5063698","","2011-02-21 08:08:33","4","10379","<p>How do I set the border between listview items. I need to have specific color and width.</p>","602260","","","","","2011-02-21 11:51:47","Android ListView Item Border Width and Color","<android><listview>","2","0","","",""
"5063675","1","5063942","","2011-02-21 08:20:37","1","1443","<p>I'm trying to create a custom <code>GridView</code> but i'm having troubles with the touch listeners.</p><p>What i want to do: </p><ul><li>Create a <code>GridView</code> with custom <code>Views</code>.</li><li>Longpress on an item so it becomes 'editable'.</li><li>Drag the view horizontal or vertical to move it's position in the <code>GridView</code>. </li></ul><p>Here's where i'm having trouble:<br>I'm implementing <code>GestureDetector.OnGestureListener</code> for the longpress functions, because for some reason using the <code>gridview.setOnItemLongClickListener()</code> isn't working when overriding the <code>onTouchEvent()</code> of the <code>GridView</code> itself (Which i need for the dragging part). So everything is fine at this point. Now i only need to know when the longpress is finished. So i though: ""Well this shouldn't be hard."" I couldn't have be more wrong. I've fiddled around for quite some time with this and it looks like using different touch events isn't helping me :/<br>When stepping through the <code>onTouchEvent()</code> i noticed that only 1 action is given: <code>MotionEvent.ACTION_DOWN</code>. So what am i doing wrong? i need the <code>MotionEvent.ACTION_UP</code>...</p>","571088","","","","","2011-02-21 08:56:04","GridView problems with touchlisteners","<android><gridview><ontouchevent>","1","1","1","",""
"5063730","1","5063774","","2011-02-21 08:28:14","1","3812","<p>I am using my layout code as </p><pre><code>&lt;LinearLayout android:orientation=""horizontal"" android:background=""@android:drawable/bottom_bar""    android:paddingLeft=""4.0dip"" android:paddingTop=""5.0dip""    android:paddingRight=""4.0dip"" android:paddingBottom=""1.0dip""    android:id=""@+id/select_names_tags_ll1""    android:layout_width=""fill_parent"" android:layout_height=""wrap_content""    android:layout_alignParentBottom=""true""&gt;    &lt;Button android:id=""@+id/button1""            android:layout_width=""0.0dip""            android:text=""ZZZZZZZZZZZZZ""            android:layout_weight=""1.0""            android:layout_height=""wrap_content""            android:padding=""5dp"" /&gt;    &lt;Button android:id=""@+id/button2""            android:layout_width=""10.0dip""            android:text=""KKKKK""            android:layout_weight=""1.0""            android:layout_height=""wrap_content""            android:padding=""5dp""/&gt;    &lt;Button android:id=""@+id/button3""            android:layout_width=""10.0dip""            android:text=""YYY""            android:layout_weight=""1.0""            android:layout_height=""wrap_content""android:padding=""5dp""/&gt;</code></pre><p></p><p>its output as <img src=""http://i.stack.imgur.com/aheGh.png"" alt=""enter image description here""></p><p>I want to fix width of buttons depends on their text length. How it will be possible?</p>","550966","","","","","2011-02-21 08:35:33","Resizing buttons in android","<android><android-layout>","2","1","0","",""
"5063850","1","","","2011-02-21 08:44:30","1","6411","<p>Hey Everyone I have had a lot of help here in the past and was wondering if you guys could help me out with something.  </p><p>I would like to load a bitmap from the assets and then add it to the background of a linear layout image view that i created in code. I know how to do this with an xml layout file but in this case i need to do it in code. I have this so far and it works with an .xml layout but when I try to create the linear layout and ImageView in code the image is not showing up. Is there something i am overlooking or doing wrong. here is the code I got </p><pre><code>ImageView backgroundPainting = new ImageView(this);    backgroundPainting.setAdjustViewBounds(true);    LinearLayout rel = new LinearLayout(this);//    RelativeLayout backgroundPaintingRL = (RelativeLayout) findViewById(R.id.RelativeLayout01);    LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(            LinearLayout.LayoutParams.FILL_PARENT,            LinearLayout.LayoutParams.FILL_PARENT);    //lp.addRule(RelativeLayout.BELOW, R.id.ButtonRecalculate);    //lp.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);    rel.addView(backgroundPainting, lp);    // backgroundPainting = (ImageView) findViewById(R.id.backgroundPainting2);     getArtist = levelSelect.getArtistNameSelected();     getLevel = level.getLevelSelected() ;     String imagePath = ""artists-images/""+getArtist + getLevel+"".jpg"";     try { // Get reference to AssetManager         AssetManager mngr = getAssets();         // Create an input stream to read from the asset folder            InputStream ins = mngr.open(imagePath);            // Convert the input stream into a bitmap            levelBitmap = BitmapFactory.decodeStream(ins);            backgroundPainting.setImageBitmap(levelBitmap);      } catch (final IOException e) {            e.printStackTrace();            Toast.makeText(levelView.this, ""couldn't set image to background"", Toast.LENGTH_LONG).show();      }</code></pre><p>Please Help thnx,</p><p>Pengume</p>","626239","","517247","","2011-02-21 09:52:47","2014-04-15 12:48:11","Get bitmap from assests then load it into the background ","<android><background><bitmap><imageview>","3","4","","",""
"5063868","1","","","2011-02-21 08:47:04","-2","195","<p>edit 4:33pm 022111</p><p>I forgot to include my xml code. I'm so stupid.</p><p>Now I tried attrs to the super class and it still didn't help...</p><hr><p>I tried searching for everything but no avail.</p><p>My code is very very simple.</p><p>The following includes everything I changed from the initial code I get from creating a project.</p><p>Thumbknightview.java</p><pre><code>package com.google.www.Thumbknight;import android.content.Context;import android.util.AttributeSet;import android.view.View;public class ThumbKnightView extends View{public ThumbKnightView(Context context) {    super(context);}public ThumbKnightView(Context context,  AttributeSet attrs) {    super(context, attrs); // edit 4:33pm 022111}}</code></pre><p>YoAndroid.java</p><pre><code>package com.google.www.Thumbknight;import android.app.Activity;import android.os.Bundle;public class YoAndroid extends Activity {/** Called when the activity is first created. *///private ThumbKnightView tnv;float x;float y;float lastx;float lasty;float maxspeed = 8;int ipi = -1;int firstfinger;@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main); }}</code></pre><p>main.xml        </p><p>I know it might look stupid for experts but for me, it gave me 3+ hours of searching and reading. Please go easy on me.</p>","626225","","626225","","2011-02-21 21:34:32","2011-02-21 21:34:32","Simple Custom View Problem","<android><view>","1","1","1","",""
"5063887","1","6628298","","2011-02-21 08:49:07","1","9083","<p>How can I read WiFi-Proxy setting programmatically? </p><p>GalaxyS and GalaxyTab have their own HTTP-Proxy setting specially for WiFi connection in OS level. (Menu -> Settings -> Wireless and network -> Wi-Fi setting -> Menu Key and then Advanced)  It's very nice feature for otherwise you cannot use proxy servers from WiFi.  (See the issue <a href=""http://code.google.com/p/android/issues/detail?id=1273"" rel=""nofollow"">http://code.google.com/p/android/issues/detail?id=1273</a>)</p><p>Now my application use http connection with usual HttpClient.  I want to read the proxy setting from OS and put into the connection but I don't know how to read it.  </p><p>With getprop command I can read proxy setting for APN, but not for WiFi.  APN proxy setting is stored with key ""net.gprs.http-proxy"".</p><pre><code>adb -d shell$ getprop net.gprs.http-proxygetprop net.gprs.http-proxyhttp://proxy.example.com:8888/$</code></pre><p>The Advanced Setting for WiFi screen is implemented in com.android.settings.wifi.AdvancedSettings and, naturally, the preference is stored in  /data/data/com.android.settings/shared_prefs/com.android.settings_preferences.xml. I just cannot read the file from my application, right?</p><p>I guess I'm stuck unless Samsung provides special API to access the setting but I couldn't find such information.  BTW, many applications including mine will have great advantages with global HTTP proxy setting so I hope there is a way...</p>","626209","","","","","2012-08-31 09:28:34","Use Galaxy HTTP Proxy setting from programs","<android><galaxy>","1","0","","",""
"5063902","1","","","2011-02-21 08:50:38","0","504","<p>I need to develop a dialer for my android application. i need to develop an activity which uses the customised dialer.Can anybody help me out??</p>","574079","","","","","2011-06-24 00:57:17","need a customised dialer layout in android","<android>","1","0","","",""
"5063908","1","11984955","","2011-02-21 08:51:24","4","626","<p>I have many custom buttons (ToggleButton) in my app and want to apply different styles for each button. I created a selector for all the buttons and I currently change only the drawable for the button, 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_checked=""true""    android:drawable=""@drawable/button_gradient_selected"" /&gt;  &lt;item    android:drawable=""@drawable/button_gradient"" /&gt;&lt;/selector&gt;</code></pre><p>When I try to change the style the same way:</p><pre><code>&lt;item   android:state_checked=""true""   android:drawable=""@drawable/button_gradient_selected""   style=""@style/button_checked /&gt;</code></pre><p>It does not work, I have tried to change the drawable in the style instead (and just stated the style in the selector), I've also tried to create a separate selector but nothing seems to work.</p><p>Any ideas?</p>","525016","","","","","2012-08-16 10:08:46","Different styles depending on button states? - Android","<android><button>","2","0","3","",""
"5063925","1","5063974","","2011-02-21 08:53:53","1","1437","<p>I'm designing an application that searches a bunch of items and I was wondering if there was a way to place a Preferences-like layout (similar to Shared Preferences) inside a SlidingDrawer, for example, so I could filter the results. I don't mind whether it actually uses the Shared Preferences system or not (and I don't find it possible at all), though it would be a plus. So, as mentioned:</p><p><strong>Is there a way to insert a Preference layout inside another layout?</strong></p><p>I include my code, just in case.</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;ListView android:layout_height=""fill_parent"" android:id=""@+id/lista_recetas""        android:layout_width=""fill_parent"" android:layout_alignParentTop=""true""        android:paddingBottom=""40dip""&gt;&lt;/ListView&gt;    &lt;SlidingDrawer android:layout_alignParentBottom=""true""        android:id=""@+id/slidingDrawer"" android:layout_width=""fill_parent""        android:layout_height=""fill_parent"" android:handle=""@+id/handle""        android:content=""@+id/content""&gt;        &lt;LinearLayout android:id=""@+id/handle""            android:layout_width=""fill_parent"" android:layout_height=""40dip""            android:background=""#000000""&gt;&lt;/LinearLayout&gt;        &lt;LinearLayout android:id=""@+id/content""            android:layout_width=""fill_parent"" android:layout_height=""fill_parent""            android:background=""#333333""&gt;            &lt;ExpandableListView android:layout_width=""fill_parent""                android:layout_height=""fill_parent""&gt;&lt;/ExpandableListView&gt;        &lt;/LinearLayout&gt;    &lt;/SlidingDrawer&gt;&lt;/RelativeLayout&gt;</code></pre><p>Thanks in advance.</p>","616225","","","","","2011-07-24 12:26:27","Insert Android Preferences-like inside another Activity and layout","<android><layout><android-preferences><sharedpreferences>","1","0","2","",""
"5063992","1","","","2011-02-21 09:02:08","0","2896","<p>Waiting for Debugger ...</p><p>LogCat</p><p>Android Runtime Registering Native FunctionIgnoring Second Debugger  Accepting and DroppingDebugger has DetachedActivityManager Unstilling process (for the application)</p><p>No Error messagesHowever a warning Resource does not contain a package for resource 0xFFIIIOOSDialog Waiting for Debugger never leaves.  10 + minutes.  </p><p>Don't see the error in the Log, so really tough to see what this might be.What should one do when seeing this attach debugger error??????????</p>","602260","","","","","2014-02-08 01:40:12","Android Debugger Does not Attach","<android><debugging>","3","2","","",""
"5064006","1","","","2011-02-21 09:03:35","0","186","<p>I have my app setting a repeating alarm.  I want to debug in the Eclipse IDE when the alarm wakes up and the BroadcastReceiver is activated.  It seems that once the alarm is set the debug process finishes.  Should the debug breakpoints still be usable after the alarm is set or am I expecting too much?</p>","538847","","","","","2011-12-01 22:16:25","debug android device after alarm","<android>","1","2","","",""
"5064123","1","","","2011-02-21 09:16:09","0","576","<p>I'm trying to load an array of data into a Spinner component and it's throwing a NullPointerException. The code I'm using is below and it all seems okay.</p><pre><code>    Spinner spinner = (Spinner) findViewById(R.id.spinner);    ArrayAdapter&lt;?&gt; spin_adapter = ArrayAdapter.createFromResource(            this, R.array.letters_array, android.R.layout.simple_spinner_item);    spin_adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);    spinner.setAdapter(spin_adapter);</code></pre><p>The string-array looks like this</p><pre><code>&lt;string-array name=""letters_array""&gt;    &lt;item&gt;A&lt;/item&gt;    &lt;item&gt;B&lt;/item&gt;    &lt;item&gt;C&lt;/item&gt;    &lt;item&gt;D&lt;/item&gt;    &lt;item&gt;E&lt;/item&gt;    &lt;item&gt;F&lt;/item&gt;    &lt;item&gt;G&lt;/item&gt;    &lt;item&gt;H&lt;/item&gt;    &lt;item&gt;I&lt;/item&gt;    &lt;item&gt;J&lt;/item&gt;    &lt;item&gt;K&lt;/item&gt;    &lt;item&gt;L&lt;/item&gt;    &lt;item&gt;M&lt;/item&gt;    &lt;item&gt;N&lt;/item&gt;    &lt;item&gt;O&lt;/item&gt;    &lt;item&gt;P&lt;/item&gt;    &lt;item&gt;Q&lt;/item&gt;    &lt;item&gt;R&lt;/item&gt;    &lt;item&gt;S&lt;/item&gt;    &lt;item&gt;T&lt;/item&gt;    &lt;item&gt;U&lt;/item&gt;    &lt;item&gt;V&lt;/item&gt;    &lt;item&gt;W&lt;/item&gt;    &lt;item&gt;X&lt;/item&gt;    &lt;item&gt;Y&lt;/item&gt;    &lt;item&gt;Z&lt;/item&gt;&lt;/string-array&gt;</code></pre><p>Is there a limit to the number of items in a Spinner or am I doing something else wrong?</p>","616076","","","","","2011-02-21 09:55:28","Data not loading into my Spinner","<android><components>","2","4","","",""
"5064173","1","","","2011-02-21 09:21:12","1","101","<p>Suppuse that with my app, users are payed (with true money, don't care 'how', in this question) when they conquer prefixed goals.Obviously i want to pay them only if the app is not hacked!! Matching, for example, their phone account with the account used in google checkout...Wich approach will you use?</p>","489146","","21234","","2012-02-19 10:17:12","2012-02-19 10:17:12","Paying users only if they download and payed from the market. How?","<android><payment><anti-hacking>","1","0","","",""
"5064187","1","5064394","","2011-02-21 09:23:18","0","154","<p>I have got a listview with 2 textviews inside it. I have set up my OnItemClickListener which works fine however i was wondering if anyone could point me in the right direction to figure out how to determine whether the OnItemClickListener was triggered by TextView01 or TextView02</p><p>Thanks for any help</p><p>Jonathan</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_height=""wrap_content"" android:gravity=""left|center"" android:layout_width=""wrap_content"" android:paddingBottom=""5px"" android:paddingTop=""5px"" android:paddingLeft=""5px""&gt; &lt;TextView android:id=""@+id/TextView01"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:gravity=""center"" android:background=""@drawable/bg"" android:textColor=""#FFFF00"" android:text=""hi""&gt;&lt;/TextView&gt; &lt;TextView android:text=""@+id/TextView02"" android:id=""@+id/TextView02"" android:layout_width=""wrap_content"" android:layout_height=""wrap_content"" android:layout_marginLeft=""10px"" android:textColor=""#0099CC""&gt;&lt;/TextView&gt;&lt;/LinearLayout&gt;` public void onItemClick(AdapterView&lt;?&gt; a, View v, int position, long id) { } });</code></pre>","607851","","379693","","2011-02-21 09:53:53","2011-02-21 09:53:53","Determine which element triggered OnItemClickListener","<android><listview>","1","0","","",""
"5064190","1","","","2011-02-21 09:23:24","1","6483","<p>i want to add a grey border to my edittext control. How do i add such a border, either via xml or programatically.</p><p>thank you in advance.</p>","590849","","","","","2013-01-27 04:37:55","add border to edittext control in android","<android><android-edittext>","2","1","","",""
"5064192","1","","","2011-02-21 09:23:43","1","2230","<p><strong>Hi. I'm adding a background xml file to an Imageview but i get this error in the Eclipse Graphical layout:</strong></p><blockquote>  <p>error! Unable to resolve drawable  ""com.android.ide.common.rendering.api.ResourceValue@1ae0c2""  in attribute ""background"" Exception  details are logged in Window > Show  View > Error Log</p></blockquote><p><strong>When i run the widget on the device, the background is displayed in the right way, but the error in Eclipse is really annoying. The background file is:</strong></p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;bitmap    xmlns:android=""http://schemas.android.com/apk/res/android""    android:src=""@drawable/grey_back_tile""    android:tileMode=""repeat"" /&gt;</code></pre><p><strong>And here's where I use it:</strong></p><pre><code>    &lt;ImageView android:layout_gravity=""top|center_horizontal"" android:layout_marginTop=""4dp"" android:layout_width=""286dp"" android:layout_height=""47dp"" android:background=""@drawable/widget_background_banner""/&gt;        </code></pre><p><strong>The error log stack trace shows:</strong></p><blockquote>  <p>org.xmlpull.v1.XmlPullParserException:  Binary XML file line #5:   requires a valid src attribute    at  android.graphics.drawable.BitmapDrawable.inflate(BitmapDrawable.java:341)    at  android.graphics.drawable.Drawable.createFromXmlInner(Drawable.java:779)    at  android.graphics.drawable.Drawable.createFromXml(Drawable.java:720)    at  com.android.layoutlib.bridge.ResourceHelper.getDrawable(ResourceHelper.java:150)    at  com.android.layoutlib.bridge.BridgeTypedArray.getDrawable(BridgeTypedArray.java:668)    at  android.view.View.(View.java:1846)    at  android.widget.ImageView.(ImageView.java:109)    at  android.widget.ImageView.(ImageView.java:105)    at  sun.reflect.GeneratedConstructorAccessor16.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:499)    at  android.view.BridgeInflater.onCreateView(BridgeInflater.java:77)    at  android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:562)    at  android.view.BridgeInflater.createViewFromTag(BridgeInflater.java:122)    at  android.view.LayoutInflater.rInflate(LayoutInflater.java:617)    at  android.view.LayoutInflater.rInflate(LayoutInflater.java:620)    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:377)    at  com.android.ide.common.rendering.LayoutLibrary.createLegacySession(LayoutLibrary.java:394)    at  com.android.ide.common.rendering.LayoutLibrary.createSession(LayoutLibrary.java:276)    at  com.android.ide.eclipse.adt.internal.editors.layout.gle2.GraphicalEditorPart.renderWithBridge(Unknown  Source)   at  com.android.ide.eclipse.adt.internal.editors.layout.gle2.GraphicalEditorPart.renderWithBridge(Unknown  Source)   at  com.android.ide.eclipse.adt.internal.editors.layout.gle2.GraphicalEditorPart.recomputeLayout(Unknown  Source)   at  com.android.ide.eclipse.adt.internal.editors.layout.gle2.GraphicalEditorPart.activated(Unknown  Source)   at  com.android.ide.eclipse.adt.internal.editors.layout.LayoutEditor.partActivated(Unknown  Source)   at  com.android.ide.eclipse.adt.internal.editors.layout.LayoutEditor.partBroughtToTop(Unknown  Source)   at  org.eclipse.ui.internal.PartListenerList$2.run(PartListenerList.java:87)    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.firePartBroughtToTop(PartListenerList.java:85)    at  org.eclipse.ui.internal.PartService.firePartBroughtToTop(PartService.java:208)    at  org.eclipse.ui.internal.WorkbenchPagePartList.firePartBroughtToTop(WorkbenchPagePartList.java:76)    at  org.eclipse.ui.internal.WorkbenchPagePartList.fireActiveEditorChanged(WorkbenchPagePartList.java:52)    at  org.eclipse.ui.internal.PartList.setActiveEditor(PartList.java:162)    at  org.eclipse.ui.internal.WorkbenchPage.makeActiveEditor(WorkbenchPage.java:1281)    at  org.eclipse.ui.internal.WorkbenchPage.setActivePart(WorkbenchPage.java:3530)    at  org.eclipse.ui.internal.WorkbenchPage.requestActivation(WorkbenchPage.java:3077)    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.PartPane.setFocus(PartPane.java:325)    at  org.eclipse.ui.internal.EditorPane.setFocus(EditorPane.java:127)    at  org.eclipse.ui.internal.PartStack.presentationSelectionChanged(PartStack.java:844)    at  org.eclipse.ui.internal.PartStack.access$1(PartStack.java:827)    at  org.eclipse.ui.internal.PartStack$1.selectPart(PartStack.java:137)    at  org.eclipse.ui.internal.presentations.util.TabbedStackPresentation$1.handleEvent(TabbedStackPresentation.java:133)    at  org.eclipse.ui.internal.presentations.util.AbstractTabFolder.fireEvent(AbstractTabFolder.java:269)    at  org.eclipse.ui.internal.presentations.util.AbstractTabFolder.fireEvent(AbstractTabFolder.java:278)    at  org.eclipse.ui.internal.presentations.defaultpresentation.DefaultTabFolder.access$1(DefaultTabFolder.java:1)    at  org.eclipse.ui.internal.presentations.defaultpresentation.DefaultTabFolder$2.handleEvent(DefaultTabFolder.java:88)    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.Widget.sendEvent(Widget.java:1077)    at  org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1062)    at  org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:774)    at  org.eclipse.swt.custom.CTabFolder.setSelection(CTabFolder.java:2743)    at  org.eclipse.swt.custom.CTabFolder.onMouse(CTabFolder.java:1429)    at  org.eclipse.swt.custom.CTabFolder$1.handleEvent(CTabFolder.java:257)    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:2640)    at  org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2604)    at  org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2438)    at  org.eclipse.ui.internal.Workbench$7.run(Workbench.java:671)    at  org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)    at  org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:664)    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)</p></blockquote><p><strong>Naturally the ""grey_back_tile.png"" is a valid resource, and it's located int the ""drawable-hdpi"" folder. Any clue to get rid of that error?</strong></p>","626283","","21234","","2011-07-25 22:34:25","2011-07-25 22:34:25","Eclipse Grapic Layout: Unable to resolve drawable ... in attribute ""background""","<android><eclipse><background><bitmap>","1","1","","",""
"5064201","1","","","2011-02-21 09:24:39","0","577","<p>I have using a Spinner and Dialog.  Don't good option to cancel the spinner when I like the current value of the spinner.  It cancels once I select a val</p>","602260","","","","","2011-02-21 09:24:39","Android Cancel Spinner Dialog When No Value Change?","<android><spinner>","0","7","","",""
"5064234","1","5064299","","2011-02-21 09:28:11","0","2806","<p>I have the following problem:</p><p>I am working on an Android application where at some point I load a webview with content from the internet. The HTML and javascript code of the webview includes the appropriate tag (<code>&lt;a href=""tel:0863274XX""&gt; blablabla &lt;/a&gt;</code>) in order to perform the call through the application by launching the appropriate app of my android phone. </p><p>Unfortunately, when I click on the image that has the a href, the browser gives an error by saying that the ""web page is not available"" and it can't load the tel:0863274XX element.</p><p>The headers of the loaded webview also include (which I don't really know the effect):</p><pre><code>&lt;meta name=""viewport"" content=""width=device-width, user-scalable=no""/&gt;&lt;meta name=""format-detection"" content=""telephone=no"" /&gt;</code></pre><p>What am I doing wrong ? What should I look for ?I have also tried to use the whole phone number (with country and area code) and the ""call"" tag instead of the ""tel"" but with no success. </p><p>Any ideas and comments are welcome :)</p>","326967","","","","","2011-02-21 09:34:47","Initiate call from webview programmatically","<android><mobile-website><phonecalls>","1","0","","",""
"5064288","1","5190832","","2011-02-21 09:33:36","2","317","<p>I have a home page which consists of a Spinner. The values in the spinner are populated by Json values.</p><p>I have 5 Tabs in the application in which the first tab consists of the Home page itself.</p><p>The flow is like this Home Page->Select a Values from Spinner->Then display the Tabs only if a value is selected-> The first page in the Tabs is the Home page again with the Spinner Value selected </p><p>Can anyone please help me because i am stuck at displaying tabs only when a item is selected from the spinner...</p>","303155","","","","","2011-03-04 07:16:42","Making Tabs visible only if a value is selected","<android><tabs><spinner>","2","0","1","",""
"5064291","1","5064403","","2011-02-21 09:33:47","1","511","<p>I need to public game result in user's twitter page. Is there a way to do it automatically using XAuth or OAuth (I saw a few aexamples and each one needs user actions). Thanks!</p>","577841","","","","","2011-02-21 09:47:32","android: twitter OAuth XAuth","<android><twitter><oauth><xauth>","1","0","1","",""
"5064304","1","5075528","","2011-02-21 09:35:44","5","14340","<p>I know it is possible to forward a port from my develop machine to an Android emulator, but how is this done?I've found the solution on the android-developers site, but I couldn't see how they've meant their instructions...Anybody got some clear instructions on this? My develop machine is running Windows.</p>","603059","","","","","2013-10-21 08:14:52","How can I forward my localhost IP-Address to an Android Emulator?","<android><android-emulator><ip>","2","0","6","",""
"5064305","1","","","2011-02-21 09:35:48","1","1033","<p>How to know the resolution of phone programatically in android .help me please</p>","626132","","","","","2011-02-21 20:09:55","android screen resolution","<android>","2","0","2","",""
"5064308","1","","","2011-02-21 09:36:15","0","861","<p>What I would like to do is indicate selection of a list item by changing the border only, and only changing it during the selection.  Afterwords normal width and color.  I want to keep my listview image in the background as the background for all the list items.  So I don't want to see anything different in the background when the list view item is selected.  Just want to see some temporary highlighting of the border.  How could this be done.  Thanks</p>","602260","","","","","2011-04-29 04:06:51","Android ListView Highlight Border During Selection Only","<android><listview>","2","0","","",""
"5064464","1","","","2011-02-21 09:52:38","0","167","<p>How does one setup custom options menu items so that when you click on them they issue an intent to start an Activity?  Thanks  I saw example, but not one which shows how to handle clicking on a menu options.  Thanks</p>","602260","","","","","2011-02-21 09:52:38","Android Context Options for Activity","<android><options-menu>","0","2","","",""
"5064477","1","5064720","","2011-02-21 09:53:30","3","1799","<p>I am creating an android application but while(if?) server is not found, it will hang the tool kit (SDK/emulator?). I have attached my login code. Please help me to find the solution. I just want that if server is not available, my application will stay on at the login page without hanging itself.</p><p>when I debugged my code I didn't get value of httpResponse and after this line </p><pre><code>HttpResponse httpResponse = httpclient.execute(httpPost);</code></pre><p>the problem occurred</p><pre><code>public String login(String userName, String password){        try {            String url = URL+ ""?flag=""+""on""+""&amp;user=""+userName+""&amp;pass=""+password;            httpPost = new HttpPost(url);            HttpResponse httpResponse = httpclient.execute(httpPost);            int statuscode = httpResponse.getStatusLine().getStatusCode();            if (statuscode == 200) {                String responseMsg = getResponse(httpResponse);                 return responseMsg;            }else{                Log.e(TAG, statuscode+"""");            }        } catch (ClientProtocolException e) {            Log.e(TAG, e.getMessage(),e);        } catch (IOException e) {            Log.e(TAG, e.getMessage(),e);        }        return null;    }</code></pre>","785775","","18501","","2011-02-21 10:10:32","2011-02-21 10:18:39","android is hang while android don't find connection","<android>","4","0","1","",""
"5064497","1","","","2011-02-21 09:55:32","1","584","<p>In my application we are achieving the page-animation by using setContentView everytime the animation occurs. The layout contains just an image so its definately not too heavy. But are there any other problems in calling setContentView again and again on the same activity. Will it cause memory leaks or something similar. </p><p>Tried searching the net but since our layouts contain only the imageviews the onSaveInstance also doesnt have much to do. </p><p>Let me know your inputs.</p><p>PS I know about ViewFlippers and other waqys of animation. Was just curious if its advisable not to call setContentView in a activity repeatedly and Why?</p><p>And i cant create a tag for setContentView if any of you can please tag this question with that tag.</p><p>BR,J</p>","523134","","708720","","2011-06-07 14:13:15","2011-06-07 14:13:15","Calling setContentView for animation","<android><animation><activity>","0","0","","",""
"5064530","1","","","2011-02-21 09:58:39","0","328","<p>i got stuck in a critical situation plz sme1 help me in resolve the problem, i have a edittext and a spinner initially they r set invinsible when i select a program depending on the program credentials it will appear either edittext or spinner somehow i managed to post the edittext values to webservice but m unable to post the spinner value. anyone plz help me on this..</p><p>Thanx,Goutham </p>","591715","","","","","2011-02-21 10:11:44","how to post the edittext n spinner values to webservice if either one is visible","<android>","1","0","","",""
"5064535","1","","","2011-02-21 09:59:04","0","8141","<p>I want to change the content of a tab?when tha tab is created i set the content of the tab by setContent() method. But if I click again, I want to change the content that means change to another activity.</p><p>I used setOnTabChangedListener() method, but I am not sure about how to set the content to another intent?</p><pre><code> Resources res = getResources(); TabHost tabHost=getTabHost(); tabHost.addTab(tabHost.newTabSpec(""tab1"").setIndicator(""HOME"").setContent(new Intent(getBaseContext(),homeGroup.class))); tabHost.addTab(tabHost.newTabSpec(""tab2"").setIndicator(""ABOUT US"").setContent(new Intent(getBaseContext(),aboutusGroup.class))); tabHost.setCurrentTab(0); tabHost.setOnTabChangedListener(new OnTabChangeListener() {       @Override     public void onTabChanged(String tabId)     {        //here i want to set the content of each tab to another intent               // for 'tab1', change to home.class               // for 'tab2', change to aboutus.class     //how to set these?                     } });</code></pre><p>Please help me..Thank you.. </p>","523058","","","","","2014-04-11 11:19:36","android : Dynamically changing the content of tab","<android><tabs>","2","0","","",""
"5064576","1","5087255","","2011-02-21 10:04:18","4","3967","<p>In my app, the user has to enter a phone number in an <code>EditText</code> field using the following format:</p><blockquote>  <p>1(515)555-5555</p></blockquote><p>I don't want the user to type ""("", "")"", or ""-"" while entering the number; I want these characters to be added automatically.</p><p>For example, suppose the user typed <code>1</code> -- the parenthesis after ""1"" should be added automatically, so that ""1("" would be displayed. And I would like to have similar functionality while deleting.</p><p>I have tried to set text in the <code>afterTextChanged</code> method of <code>onTextWatcher</code> interface, but it is not working; instead it's causing an error. Any help will be greatly appreciated.</p>","562099","","121493","","2011-02-22 19:38:16","2013-08-29 12:34:01","Automatically format phone number in EditText","<android><formatting><edittext><phone-number><android-edittext>","3","1","","",""
"5064577","1","5064613","","2011-02-21 10:04:26","6","3658","<p>How diferent is Java used in Android apps development from Java used to develop regular desktop applications? Can I use the skills acquired by developing Java Android applications in Java EE web development?</p><p>What is Java ME all about ?</p>","335997","","472792","","2012-07-04 08:22:31","2013-07-23 06:54:34","Java , Android , Java EE","<java><android><java-ee>","4","1","1","",""
"5064639","1","","","2011-02-21 10:11:14","0","136","<p>HI am creating view and added to the linearlayout, when i clicked an item in the row ,i need to know which row am clicked ,how can i done this ?</p><p>Am trying to listener for a textview in the row ,when the row clicked i need to know which row am clicked. NB SetonItemClickListener is not applicable to textview</p>","487219","","487219","","2011-02-21 12:55:41","2011-02-21 12:55:41","Android View inflating","<android>","1","2","","",""
"5064646","1","","","2011-02-21 10:11:29","2","2314","<p>Hey experts, actually it's a pretty simple question...just don't know about the answer.</p><p>I have an Android app, running a WebView that loads a certain page, also part of the app.</p><p>At a given moment, i want to call a javascript function inside the WebView page, but i wanna do this outside the onPageFinished event.</p><p>Is that possible? Any ideas?</p><p>Thanks in advance.</p>","562228","","","","","2011-04-07 21:10:58","Android: Injecting Javascript into a Webview outside the onPageFinished Event","<android>","1","0","1","",""
"5064715","1","5064755","","2011-02-21 10:18:24","0","699","<p>I don't know what this is called, but it is something like syncing android application and a Web server. Examples are RSS Feeds and Weather Forecast</p><p>Does anyone know the concept behind developing application? I mean how do you sync the Android phone with a web server. Is there any programming needed in the server side and the client side(Android)</p><p>Are there any programming books that tackles this subject? Thanks.</p>","626365","","","","","2011-02-21 10:24:47","Syncing Android and Server","<java><android>","2","0","","",""
"5064761","1","","","2011-02-21 10:22:59","0","1576","<p>I'm trying to build an android app with connection to our SQL Server. I have downloaded the jTDS JDBC Driver. I have an jar file and have to copy it to my application's classpath. But where is that? I have copied to my workspace in the project directory where the file "".classpath"" is. But it seems not to work.... everytime if I'm at the code where I load the class with </p><pre><code>Class.forName(""net.sourceforge.jtds.jdbc.Driver"");</code></pre><p>it says: </p><blockquote>  <p>The source attachment does not contain the source for the file ClassLoader.class. You can change the source attachment by clicking Change Attachmend Source below""</p></blockquote><p>Any ideas? I'm new to java AND android...</p>","626370","","13302","","2013-11-18 21:35:26","2013-11-18 21:35:26","Android + SQL Server + jTDS","<java><android><sql-server>","1","0","","",""
"5064807","1","5064863","","2011-02-21 10:28:12","1","3887","<p>if we has a some items in the spinner means (like below) how shall we add extra items while run time</p><p>here is code:</p><pre><code>    String[] Items = {                ""Alarm"",                ""Office"",                ""Meeting"",                ""Party"",                ""Lunch"",                ""Breakfast"",                ""Supper"",                ""Home"",                ""Private"",                ""Outdoor"",                ""Family"",                ""Friends"",                ""Others""        };    Spinner s1;</code></pre><p>and</p><pre><code>  s1 = (Spinner) findViewById(R.id.spinner);   ArrayAdapter&lt;String&gt; adapter  = new ArrayAdapter&lt;String&gt;(            this,android.R.layout.simple_spinner_item,Items);    adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);    s1.setAdapter(adapter);    s1.setOnItemSelectedListener(new OnItemSelectedListener()    {        public void onItemSelected(AdapterView&lt;?&gt; arg0,         View arg1, int arg2, long arg3)         {            int index = s1.getSelectedItemPosition();            Toast.makeText(getBaseContext(),                 ""You have selected item : "" + Items[index],                 Toast.LENGTH_SHORT).show();             if (index==12)            {                EditText edit = (EditText) findViewById(R.id.edittext);                Button add=(Button) findViewById(R.id.add);                edit.setVisibility(View.VISIBLE);                add.setVisibility(View.VISIBLE);         }            else            {                EditText edit = (EditText) findViewById(R.id.edittext);                Button add=(Button) findViewById(R.id.add);                edit.setVisibility(View.GONE);                add.setVisibility(View.GONE);            }        }        public void onNothingSelected(AdapterView&lt;?&gt; arg0) {}    });  }</code></pre><p>In it if select the ""other"" means we ve to add extra items in spinner list..</p><p>thank you,</p>","565106","","","","","2011-02-21 10:36:01","How to add more items at run time in spinner","<android><spinner>","2","0","","",""
"5064840","1","5839113","","2011-02-21 10:31:25","0","1268","<p>I am undable to find Collada to OpenGL ES data converter like something that gives me vertices, normals, textures etc. for direct use in OpenGL ES from Collada file for the model I want to import into OpenGL ES Android application. The only thing I find are references to Khronos.org website. Does any one know if some game library or any other library out there has such a converter that I could use for my application?</p>","574122","","","","","2011-04-30 02:45:42","Collada to OpenGL ES data converted for Android?","<android><opengl-es><collada>","1","0","","",""
"5064870","1","5064984","","2011-02-21 10:34:36","1","1344","<p>I'm faced with the task to write a driver for Android (OS 2.3 and 2.4) to interface with a sensor chip over either SPI or I2C.</p><p>The device is intended to be used in Android smart phones eventually, based on either the Intel Medfield or the Qualcomm 8 series platforms.</p><p>I assume that I don't have to worry about actually writing the SPI or I2C driver myself, right? Do you know of any current SPI or I2C drivers for Android I could use?</p><p>I will also need find a hardware development kit which allows me to access the SPI or I2C bus. Do you have a recommendation where I could find a suitable kit, which is representative of the hardware typically found in a current Android smart phone?</p>","454406","","","","","2011-02-21 10:59:47","Android hardware dev kits?","<android><i2c><spi><android-hardware>","1","0","","",""
"5064874","1","","","2011-02-21 10:35:00","3","641","<p>I'm using a custom dialog style to remove the white border. To achieve this, I created a custom style inheriting from Theme.Dialog, and set it in the dialog constructor. When not setting any style (I guess it takes Theme.Dialog as default), the dialog is centered both horizontally and vertically, but when I use my style, which just override android:windowBackground, my dialog is not centered anymore, so it seems that the style is not inherited...</p><p>Anybody can help?</p><p>Thanks!</p><p>My style:</p><pre><code>&lt;resources&gt;&lt;style    name=""Theme_Dialog_Translucent""    parent=""@android:style/Theme.Dialog""&gt;    &lt;item name=""android:windowBackground""&gt;@color/transparent&lt;/item&gt;        &lt;/style&gt;&lt;/resources&gt;</code></pre><p>My class:</p><pre><code>public class CustomDialog extends Dialog implements OnClickListener {    Button okButton;    public CustomDialog(Context context) {              //super(context); //if I use that the dialog is centered        super(context, R.style.Theme_Dialog_Translucent);        requestWindowFeature(Window.FEATURE_NO_TITLE);              setContentView(R.layout.custom_dialog);        okButton = (Button) findViewById(R.id.button_ok);        okButton.setOnClickListener(this);    }    ...}</code></pre><p>My 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:id=""@+id/confirmation""    android:orientation=""vertical""    android:background=""@drawable/dialog_background""    android:layout_width=""279dp""    android:layout_height=""130dp""   &gt;    &lt;TextView android:id=""@+id/dialog_title""        android:text=""@string/dialog_title""        android:textColor=""#FFF""    android:layout_height=""wrap_content""    android:layout_width=""match_parent""/&gt;    &lt;TextView android:id=""@+id/dialog_text""        android:text=""@string/dialog_text""        android:textColor=""#FFF""    android:layout_height=""wrap_content""    android:layout_width=""match_parent""/&gt;    &lt;LinearLayout android:id=""@+id/confirmation""    android:orientation=""horizontal""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    &gt;        &lt;Button android:id=""@+id/button_ok""            android:background=""@drawable/button_ok""        android:layout_width=""128dp""        android:layout_height=""43dp""        android:text=""ok""        android:textColor=""#FFFFFF""            /&gt;    &lt;Button android:layout_width=""128dp""        android:id=""@+id/button_cancel""        android:layout_height=""43dp""        android:background=""@drawable/button_cancel""        android:text=""cancel""        android:textColor=""#FFFFFF""    /&gt;&lt;/LinearLayout&gt;&lt;/LinearLayout&gt;</code></pre>","326849","","326849","","2011-02-21 16:11:08","2011-02-21 16:11:08","Issue with inherited style in Android","<android><inheritance><coding-style>","0","1","1","",""
"5064875","1","5064967","","2011-02-21 10:35:04","2","229","<p><img src=""http://i.stack.imgur.com/ES2DW.png"" alt=""enter image description here""></p><p>How can we show this dialler in our application to initiate a call</p>","548218","","","","","2011-02-21 14:46:44","How can we show this UI in our application","<android><android-layout>","3","0","","",""
"5064952","1","","","2011-02-21 10:41:31","6","19370","<p>im currently porting a database manager to android and due to performance reasons i liketo update only propertys that have been modified. Im trying to do this with the addTextChangedListener in order to add modified entrys to a List, but my Program never enters any of its methods.</p><pre><code>EditText Et = (EditText) Editors.get(Prop.Name);Et.addTextChangedListener(new TextWatcher() {    @Override    public void afterTextChanged(Editable s) {        // TODO Auto-generated method stub    }    @Override    public void beforeTextChanged(CharSequence s, int start, int count, int after) {        // TODO Auto-generated method stub    }    @Override    public void onTextChanged(CharSequence s, int start, int before, int count) {        // TODO Auto-generated method stub        if(Prop.GetType() == Property.PROPTYPE.num) {            float f = Float.parseFloat(s.toString());            Prop.FromString(f);        }        else {            Prop.FromString(s.toString());        }        propertiesToUpdate.add(Prop);});Et.setText(Prop.ToString());</code></pre>","626399","","318465","","2011-02-21 11:07:19","2012-07-17 10:46:08","Android EditText and addTextChangedListener","<android>","1","3","2","",""
"5064993","1","5065085","","2011-02-21 10:46:29","3","958","<p>I want to save some info regarding a trial version an application.</p><p>I want this info to be persistent in order to detect if the user removed the application and installed it again after the trial expiry.</p><p>what is the best place to store such info</p><p>thanks</p>","235123","","","","","2011-05-11 15:56:25","Android: saving info for trial application","<android>","3","0","1","",""
"5065037","1","","","2011-02-21 10:50:22","0","220","<p>I use my application to upload the video in server and it was stored in appropriate folder in server, i need to show the list of video from remote server folder and allow the user to streaming the video.Is there any sample is there?</p>","555806","","","","","2011-02-21 10:56:40","Android Video listing from remote server?","<android><android-listview>","2","0","","",""
"5065077","1","5134962","","2011-02-21 10:55:18","2","1118","<p><img src=""http://farm3.anhso.net/upload/20110221/12/o/anhso-121531_example.jpg"" alt=""""></p><p>Here is the examples, when you drag A or B , the size of rectangle will be changed</p><p>How can i do it?</p>","617801","","569101","","2013-07-04 11:53:29","2013-07-04 11:53:29","Change size of rectangle by dragging its corners in Android?","<android><image><crop>","1","7","3","",""
"5065096","1","5066046","","2011-02-21 10:56:33","3","458","<p>is there anyway to load a class from differen application ? </p><p>for example, I have two application and one of them has SomeExample class file. and I want to load it and use from another application. </p><p>I try to use, Class.forName. but this function throws ""ClassNotFoundExpetion"". </p>","167288","","","","","2012-12-06 23:36:05","how to load class from one another application in android","<java><android><classloader>","2","0","1","",""
"5065125","1","5067413","","2011-02-21 10:59:57","0","444","<p>When I use MediaPlayer to play video in an Activity that themed as a dialog or with the windowIsFloating property I get a shadow overlaying the video (the dialog background shadow). Why? And how do I get rid of it?I guess it has something to do with the SufaceViews nature of having a z-order behind the window and punching holes in front of it.</p><p>The reason why i use the windowIsFloating property is that i need to have the previous activity paused to resume it as fast as possible. I know it can be closed by the OS then as well. But that's OK since it seams that most of the time I don't have to reinitialize the activity.</p><p>Or are there any other way to keep my previous activity in a paused state(like when using dialog) while starting my second activity?</p>","125030","","","","","2011-02-21 14:55:58","Using MediaPlayer on a windowIsFloating activity gives shaddow overlaying the video","<android><activity><themes><media-player>","1","0","","",""
"5065160","1","5065264","","2011-02-21 11:03:29","1","3660","<p><img src=""http://i.stack.imgur.com/hqYfy.png"" alt=""enter image description here"">I need to design the blow given UI using a list view</p><pre><code> I have to xml  conf.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""       android:paddingLeft=""5dp""    android:paddingRight=""5dp""&gt;   &lt;TextView              android:layout_width=""fill_parent""               android:layout_height=""wrap_content""              android:paddingTop=""15dp""               android:gravity=""center""                android:textColor=""#FFFFFF""            android:text=""""&gt;           &lt;/TextView&gt;        &lt;ListView android:id=""@+id/ListView01""        android:layout_height=""wrap_content""      android:layout_width=""fill_parent""&gt;      &lt;/ListView&gt;                        &lt;TextView             android:id=""@+id/TextViewEmpty""             android:layout_width=""fill_parent""               android:layout_height=""fill_parent""              android:paddingTop=""10dp""               android:gravity=""center""              android:textColor=""#FFFFFF""              android:typeface=""sans""            android:text=""No Entries available""&gt;           &lt;/TextView&gt;                         &lt;/LinearLayout&gt;</code></pre><p>conf1.xml  for the List View</p><pre><code>     &lt;?xml version=""1.0"" encoding=""utf-8""?&gt;</code></pre><p></p><pre><code>   &lt;LinearLayout    android:id=""@+id/layout1""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:orientation=""horizontal""     &gt;&lt;TableRow android:id=""@+id/ConfRow"" android:layout_width=""wrap_content""    android:layout_height=""wrap_content"" android:orientation=""horizontal""&gt;    &lt;ImageView     android:id=""@+id/imgPicture1""      android:layout_width=""wrap_content""     android:layout_height=""50dp""    android:src=""@drawable/conf_line""&gt;    &lt;/ImageView&gt;&lt;/TableRow&gt;  &lt;LinearLayout    android:id=""@+id/layout1""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:orientation=""vertical""     &gt;    &lt;TextView android:text=""@+id/TextView02"" android:id=""@+id/TextView02""        android:layout_width=""wrap_content"" android:layout_height=""wrap_content""        android:layout_marginLeft=""10dp"" android:textColor=""#FFFFFF""        android:textAppearance=""?android:attr/textAppearanceMedium""&gt;&lt;/TextView&gt;    &lt;TextView android:text=""@+id/TextView04"" android:id=""@+id/TextView04""        android:layout_width=""wrap_content"" android:layout_height=""wrap_content""        android:layout_marginLeft=""10dp"" android:textColor=""#FFFFFF""        android:textAppearance=""?android:attr/textAppearanceSmall""&gt;&lt;/TextView&gt;&lt;/LinearLayout&gt;</code></pre><p></p><p></p><p>But the expected out put is not the same as the given image layout..Pls Help</p>","548218","","","","","2011-09-25 17:31:17","How can we design the List View layout","<android><android-layout>","1","0","1","",""
"5065161","1","5065804","","2011-02-21 11:03:30","0","109","<p>i am a beginner in android.now i am familiar with layout concept.i can add different layer in android.Now i want to know how can i divide the emulator into two or more parts.just like &lt; frameset > in html.i want to perform edit or refresh one part, without disturbing other part.Somebody told me that it is done by multilayer concept.But i didn't see any multilayer concept in anywhere .when i am trying to search "" multilayer concept in android"", it always lead to layout concept. So somebody told me how can i perform this.</p>","607853","","","","","2011-02-21 12:50:51","android application","<android><html>","2","0","","",""
"5065166","1","5065216","","2011-02-21 11:03:59","-1","569","<p>I'm beginner in Java Android developing. I'm using Eclipse SDK 3.6.1 version. I'm trying to do a simple calculator. I have one problem how to input a fractional number? There is my code:</p><pre><code>@Overridepublic void onClick(View view) {  switch (view.getId()) {           case R.id.btnNum0Id:     case R.id.btnNum1Id:     case R.id.btnNum2Id:     case R.id.btnNum3Id:     case R.id.btnNum4Id:     case R.id.btnNum5Id:     case R.id.btnNum6Id:     case R.id.btnNum7Id:     case R.id.btnNum8Id:     case R.id.btnNum9Id:        String inDigit = ((Button)view).getText().toString();         if (inStr.equals(""0"")) {             inStr = inDigit;            } else {           inStr += inDigit;           }        tekstas.setText(inStr);        if (Operator == '=') {           rezult = 0;           Operator = ' ';        }        break;                 case R.id.btnAddId:        aritmetika();        Operator = '+';        break;     case R.id.btnSubId:         aritmetika();        Operator = '-';        break;     case R.id.btnMulId:         aritmetika();        Operator = '*';        break;     case R.id.btnDivId:         aritmetika();        Operator = '/';        break;     case R.id.btnSqrtId:         aritmetika();         Operator = 'a';         break;     case R.id.btnEqualId:         aritmetika();        Operator = '=';        break;     case R.id.dot:         aritmetika();        Operator = '.';        break;       case R.id.btnClearId:           rezult = 0;        inStr = ""0"";        Operator = ' ';        tekstas.setText(""0"");        break;  }   } private void aritmetika() {  int inNum = Integer.parseInt(inStr);  if (Operator == ' ') {     rezult = inNum;  } else if (Operator == '+') {     rezult += inNum;  } else if (Operator == '-') {     rezult -= inNum;  } else if (Operator == '*') {     rezult *= inNum;  } else if (Operator == '/') {     rezult /= inNum;  } else if (Operator == 'a') {                   rezult = (float)Math.sqrt(rezult);               } else if (Operator == '.') {      String rezult2 = inStr+'.';           //need fractional number  } else if (Operator == '=') {     // tolesnis veiksmas  }  tekstas.setText(String.valueOf(rezult));   }}</code></pre><p>I'm thinking how to make a fractional number.    </p>","572853","","50049","","2011-02-21 11:34:22","2011-02-24 16:01:41","How to input a fractional number?","<android><input><numbers><fractions>","2","2","0","",""
"5065176","1","5065252","","2011-02-21 11:05:09","0","2478","<p>I want to implement Alarm in Android.</p>","475349","","300797","","2014-03-31 10:47:34","2014-03-31 10:47:34","implement alarm manager in android","<android>","2","1","2","2014-03-31 11:18:09",""
"5065245","1","5066038","","2011-02-21 11:11:59","0","294","<p>Can i use my API google Map in many Smartphone Android ? or other say</p><p>Can i use my API google Map in Commercial and publicity my applications ?</p><p><strong>_ _ _ _ in fact, i have an API Google Map to load Map(Google Map) and i developper something in this Map.<br> _ _ _ Now, i would like to publicity my application or commercialize this application ? in FRANCE, ITALY</strong></p><p>Thanks very much !</p>","536480","","536480","","2011-02-21 13:09:16","2011-02-21 13:09:16","API google Map with many Smartphones Android","<android><google-maps>","2","2","","",""
"5065262","1","","","2011-02-21 11:14:02","0","610","<p>In my PreferenceCategory the textview does not change its height when the text becomes too long. It just breaks the line and looks weird, as the size is not changed... I have also tried ellipsizing, but without success... is there a way to get a preferencecategory-view to change its size or if not to ellipsize its content?</p>","626439","","","","","2011-02-22 15:17:33","PreferenceCategory - line breaks or ellipsizing","<android><android-preferences>","1","0","","",""
"5065303","1","","","2011-02-21 11:19:13","1","1303","<p>I know this has been asked before but I haven't managed to find a really clear answer yet - <br/>I'm trying to implement an API within an Android app. In order to make the initial connection, I need to talk to an HTTPS URL, identifying myself with a personal X509 certificate and key. <br/>Doing this in ""desktop"" Java is easy as I just reference the files. Has anyone tried this on Android? How do you get the certificate onto the device? How did you get the code to read that and make the connection. <br/>I have looked at the X509 certificate classes, and the SSLSocketFactory, but I am very very new to even Java and do not fully understand it - can someone help me please - a pointer or a code snippet would be very welcome. <br/>Many thanks <br/>Don</p>","626444","","","","","2011-02-21 11:28:01","Using personal X509 certificate to connect to SSL protected API in Android app?","<java><android><ssl><certificate><x509>","1","1","","",""
"5065329","1","","","2011-02-21 11:21:53","0","1378","<p>Hi I am trying to get multiple values from the Android voice recognition, not just the best one.</p><p>I think I have to add one more flag, but I am not used to the android way of doing things.So far this is what I have: </p><p>(thanks)</p><pre><code>private OnClickListener mSpeakListener = new OnClickListener(){         public void onClick(View v){        if (v.getId() == R.id.speech) {            bar.setVisibility(View.VISIBLE);            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,0);}/*** Handle the results from the recognition activity.*/ protected void onActivityResult(int requestCode, int resultCode, Intent data) {   if (requestCode == 0 &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);       StringBuilder sb = new StringBuilder();       for(String match: matches){           sb.append(match + "", "");       }       questionTextBox.setText(sb.toString());       Log.d(TAG,""Focus on Button"");       okButton.requestFocus();              }   super.onActivityResult(requestCode, resultCode, data);</code></pre><p>}</p>","505162","","","","","2011-08-03 18:20:09","Multiple results for Voice Recognition in Android","<android>","3","0","","",""
"5065331","1","","","2011-02-21 11:22:01","0","5150","<p>I have one horizontal scroll view in that there are images if user scroll and further images are available than I need to display right side right arrow to indicate user to scroll it again and see other images.</p><p>Thanks in advance.</p>","500420","","","","","2011-06-29 13:15:37","Horizontal Scroll view left right arrow display problem?","<android><android-layout>","1","1","2","",""
"5065334","1","5349100","","2011-02-21 11:22:07","3","2042","<p>I want to make an android app which can stream video to the web. I know how to record a video in android but don't know how to stream it to the web. I don't want to store this video to the sd card of the phone but I want it to be stored on the web. For that purpose I am planning to use asp.net web service.</p>","461537","","","","","2012-04-03 10:04:38","Stream video to web in android","<android><video-streaming><video-capture>","1","0","4","",""
"5065339","1","","","2011-02-21 11:23:05","34","34757","<p>I am loading a listview from Http server, 20 at a time ,<strong>At the end of Listview I a want to load next 20 data from server</strong> and this process will continue till data ends in server ,I used class that extend BaseAdapter to populate first 20 data .what should i do??</p>","593523","","96780","","2013-08-29 16:48:37","2013-12-17 08:44:42","Android Dynamically load Listview at scroll end?","<android>","6","0","20","",""
"5065345","1","","","2011-02-21 11:23:53","0","795","<p>We are currently developing an Android Game using opengles. We are now trying to support different resolutions, however, when allowing for large resolutions, the moto droid we are testing on seems to lag at it's native resolution (800x400). We have the frames locked at 30 fps, and when we check, our game only takes about 15-20 ms to do it's updating and drawing on the droid, however, there is sometimes 30-60 ms that elapses between calls to ondrawframe. My Galaxy S device doesn't have this problem, and when we put the resolution down on the motorola droid it seems perfectly fine. </p><p>We've investigated the issue and have found people with what seems to have been the exact same issue but no one could offer a solution. Other games on the market that seem to use opengles run fine on the moto droid.</p><p>Is there something we're missing? Something we need to call or do to? There seems like there should be no reason for there to be 30-60 ms between calls to ondrawframe, especially when the native resolution (800x400) isn't leaps and bounds larger than the default of 533x320, or whatever it is that it goes to when not allowing for large screens, so it seems ridiculous for it to be because of a buffer swap. The lag even happens when near nothing is being drawn to screen, so it's not because we're drawing too much.</p><p>Any enlightenment or help as to how to fix this would be great.</p>","626451","","","","","2011-02-22 18:22:01","Android OpenGLES - Lag between calls to OnDrawFrame on Moto Droid at large resolution","<android><opengl-es>","1","6","","",""
"5065408","1","5065565","","2011-02-21 11:31:16","2","1453","<p>I'm developping my first Android App. I need to execute a command in a shell as the root user so I've introduced this code in my App:</p><pre><code>process = Runtime.getRuntime().exec(""su"");</code></pre><p>Then I obtain an output stream to the process and I use it to execute the command:</p><pre><code>os = new DataOutputStream(process.getOutputStream());os.writeBytes(""tcpdump\n"");</code></pre><p>Then I obtain an input stream which I want to use for displaying the results of the process:</p><pre><code>is = new DataInputStream(process.getInputStream());</code></pre><p>I would like to bind the obtained DataInputStream to a TextView in the layout so the text that it displays gets updated in real time as the process goes on showing results.</p><p>I've been searching trought the java.io API for android and I can't find an easy way to do this. I've been thinking in running a thread with a loop which continously checks if there is new data in the input stream and then copy it to the TextView but this seems a crappy solution.</p><p>I would thank you if anyone knows a way to do this.</p>","626459","","477754","","2011-02-21 11:51:31","2013-02-16 21:27:53","How to bind the standard output of a process to a TextView","<android><process><textview><inputstream>","4","0","","",""
"5065448","1","5066000","","2011-02-21 11:35:38","0","438","<p>Is it possible to intercept outgoing emails from Android? I have tried with content provider by using ContentObserver but still no luck.</p><p>this is my code.</p><pre><code>    final String AUTHORITY_PLUS_MESSAGES = ""content://gmail-ls/messages/"";    String[] gmailAccounts = getGmailAccount(this.getApplicationContext());    String firstEmailAddress = gmailAccounts[0];    Handler handler = new Handler();    ContentResolver resolver = getContentResolver();    ContentObserver observer = new GmailObserver(handler, resolver, firstEmailAddress);    Uri uri = Uri.parse(AUTHORITY_PLUS_MESSAGES + firstEmailAddress + ""/"");    resolver.registerContentObserver(uri, Boolean.TRUE, observer);class GmailObserver extends ContentObserver { public void onChange(final boolean bSelfChange) {        super.onChange(bSelfChange);      Log.d(TAG, ""***** onChange"");      // here I am getting lots of calls but not sure how to deal with outgoing messages .. }}</code></pre>","192901","","436641","","2011-09-18 04:36:35","2011-09-18 04:36:59","stop outgoing gmail emails from android","<android><gmail>","1","0","","",""
"5065450","1","","","2011-02-21 11:35:56","0","4782","<p>I am trying to run Android Application.When i install the application on android stimulator Its showing error in the console </p><pre><code>[2011-02-21 16:37:44 - TFLAPPv1] Installation error: INSTALL_FAILED_MISSING_SHARED_LIBRARY[2011-02-21 16:37:44 - TFLAPPv1] Please check logcat output for more details.[2011-02-21 16:37:44 - TFLAPPv1] Launch canceled!</code></pre><p>Plz help</p><p>Thanks in advanceTushar</p>","475349","","620858","","2011-02-21 11:54:01","2014-04-18 23:40:26","application not installing on android simulator","<android>","1","6","1","",""
"5065451","1","","","2011-02-21 11:36:03","0","2491","<p>While am compiling the program with the below code, an error is occurring. it says getLayoutInflater ( ) is undefined. Could anyone please help me to resolve it asap.</p><pre><code> final LayoutInflater inflater = getLayoutInflater ( ); </code></pre><p>Thanks in advance.</p>","617510","","12113","","2011-12-05 14:43:18","2011-12-05 14:43:18","Error resolving getLayoutInflater ","<android>","2","3","","",""
"5065471","1","5071256","","2011-02-21 11:38:15","0","1224","<p>Hi  is it possible to change the text of a shape? I have:</p><pre><code>levelFraction = new Text(0, 300, mFont, ""text"", HorizontalAlign.CENTER);</code></pre><p>then I add it to the scene:</p><pre><code>scene.getTopLayer().addEntity(levelFraction);</code></pre><p>but I don't see any method to change the text at runtime. Something like:</p><pre><code>levelFraction.setText(...);</code></pre><p>Is that possible?</p>","295525","","295525","","2011-02-21 19:28:33","2012-05-10 04:16:19","Change text on shape","<android><text><shape><andengine>","3","5","1","",""
"5065646","1","","","2011-02-21 11:58:43","0","789","<p>I have some video files.I need to show every video file as a ImageView .On that Image view i need to set first frame of the video as a image.How to do this?</p>","548435","","","","","2011-03-16 14:24:36","How to get the First frame from Video file?","<android>","1","0","1","",""
"5065661","1","5065926","","2011-02-21 12:00:50","2","278","<p>i just can't find it anywhere, so i'd appreciate and help on this :=)</p><p>I read about it, and it should be possible, for instance, </p><p>I want to set a Dollar price for an App@ 3,99 USD,while the price in Euros is just 2,49 (about) €</p><p>So that the values fit, and there isn't something like 3,74 USD ;=) (maybe it frightens some customers ;=P)</p><p>Would be great if anyone could tell me where to set this in the Android Developer Console?</p><p>Thanks a lot,best regards,Mike</p>","371749","","","","","2011-02-21 12:30:12","Publisher, how to set different prices for different regions (USD, €, etc..)","<android><console><publish>","1","0","","",""
"5065671","1","5065942","","2011-02-21 12:02:29","0","179","<p>i created an xml file web.xml</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;AbsoluteLayout 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:layout_height=""300dip"" android:layout_width=""fill_parent"" android:id=""@+id/WebView"" android:layout_x=""0dip"" android:layout_y=""0dip""&gt;&lt;/WebView&gt;&lt;/AbsoluteLayout&gt;</code></pre><p>and web.java</p><pre><code> package com.geoo; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.net.URI; 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 android.app.Activity; import android.os.Bundle; import android.util.Log; import android.view.View; import android.webkit.WebView;public class tarif extends Activity {private static final String LOG_TAG = ""Log : "";private final String mimeType = ""text/html"";private final String encoding = ""utf-8"";private String pageWeb;private WebView webView1;private String url=""http://www.google.fr"";webView1 = (WebView) findViewById(R.id.WebView);public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.web);    try {        //on récupère le code HTML associé à l'URL que l'on a indiqué dans l'EditText            pageWeb = tarif.getPage(url);            //on charge les données récupérées dans le WebView            webView1.loadData(pageWeb, mimeType, encoding);    } catch (ClientProtocolException e) {        e.printStackTrace();    } catch (IOException e) {        e.printStackTrace();    }}public static String getPage(String url) throws ClientProtocolException, IOException{    StringBuffer stringBuffer = new StringBuffer("""");    BufferedReader bufferedReader = null;    try{        //Création d'un DefaultHttpClient et un HttpGet permettant d'effectuer une requête HTTP de type GET        HttpClient httpClient = new DefaultHttpClient();        HttpGet httpGet = new HttpGet();        //Création de l'URI et on l'affecte au HttpGet        URI uri = new URI(url);        httpGet.setURI(uri);        //Execution du client HTTP avec le HttpGet        HttpResponse httpResponse = httpClient.execute(httpGet);        //On récupère la réponse dans un InputStream        InputStream inputStream = httpResponse.getEntity().getContent();        //On crée un bufferedReader pour pouvoir stocker le résultat dans un string        bufferedReader = new BufferedReader(new InputStreamReader(inputStream));        //On lit ligne à ligne le bufferedReader pour le stocker dans le stringBuffer        String ligneCodeHTML = bufferedReader.readLine();        while (ligneCodeHTML != null){            stringBuffer.append(ligneCodeHTML);            stringBuffer.append(""\n"");            ligneCodeHTML = bufferedReader.readLine();        }    }catch (Exception e){        Log.e(LOG_TAG, e.getMessage());    }finally{        //Dans tous les cas on ferme le bufferedReader s'il n'est pas null        if (bufferedReader != null){            try{                bufferedReader.close();            }catch(IOException e){                Log.e(LOG_TAG, e.getMessage());            }        }    }    //On retourne le stringBuffer    return stringBuffer.toString();}}</code></pre><p>My problem in line</p><pre><code>webView1 = (WebView) findViewById(R.id.WebView);</code></pre><p>I don't inderstand what is the problem, why eclipse make an error?Thank you</p>","616263","","578594","","2011-02-21 12:28:12","2011-02-21 12:31:38","add a navigator to my application","<android>","1","1","0","",""
"5065722","1","5065773","","2011-02-21 12:07:23","19","20068","<p>I would like to put a border around my listview that is a few pixes wide.  I want it to to go around the entire listview piece.  How can I do this? thanks</p>","602260","","","","","2014-01-17 11:28:36","How do you put a border around a ListView?","<android><listview><layout>","4","0","3","",""
"5065749","1","","","2011-02-21 12:10:25","0","159","<p>I am trying to use a custom view for my application.   When I run the program it gives me an error something like this</p><pre><code> java.lang.RuntimeException: Unable to start activity ComponentInfo{com.game.subgame/com.game.subgame.BoardActivity}:   android.view.InflateException: Binary XML file line #6: Error inflating class com.game.brainer.Board</code></pre><p>Not sure what I am missing here.</p><p>What I want to do is - use the Board view class in my BoardActivity Activity.</p><p>Can someone please help me out here ?</p><p>Thanks,Alok.</p><p>//-- BoardActivity.java---</p><pre><code>public class BoardActivity extends Activity{    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        Board boardView = new Board(this);        //setContentView(boardView);   // This works fine but i want to use the board.xml        setContentView(R.layout.board); }}</code></pre><p>//-- Board.java ---</p><pre><code> public class Board extends View {    int _height;    int _width;    Bitmap _bitmap;    Canvas _canvas;    Paint _paint;    public Board(Context context) {        super(context);        // TODO Auto-generated constructor stub        _paint = new Paint();        _paint.setColor(Color.RED);        _paint.setStyle(Paint.Style.STROKE);        _paint.setStrokeWidth(10);    }    public Board(Context context, AttributeSet atts) {        super(context, atts);        // Is there any problem here ??      }     protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec){        //super.onMeasure(widthMeasureSpec, heightMeasureSpec);        _height = View.MeasureSpec.getSize(heightMeasureSpec) ;        _width = View.MeasureSpec.getSize(widthMeasureSpec) ;        setMeasuredDimension(_width, _height);        _bitmap = Bitmap.createBitmap(_width, _height, Bitmap.Config.ARGB_8888);        _canvas = new Canvas(_bitmap);         }    @Override    protected void onDraw(Canvas canvas) {        canvas.drawBitmap(_bitmap, 0, 0, _paint);        //button = (Button)findViewById(R.id.matchImage);    }}</code></pre><p>//---  board.xml ---------  </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;com.game.brainer.Board android:id=""@+id/board""        android:layout_width=""fill_parent""         android:layout_height=""fill_parent""         android:layout_weight=""1""  /&gt;   &lt;Button android:textSize=""50sp""         android:layout_height=""wrap_content""         android:text=""Button"" android:id=""@+id/matchImage""         android:layout_width=""wrap_content""/&gt;&lt;/LinearLayout&gt;</code></pre>","626490","","573700","","2011-02-21 12:28:08","2011-02-21 12:28:08","problem with the custom ui","<android>","0","5","","",""
"5065828","1","","","2011-02-21 12:17:51","1","8263","<p>I want to change the menu item background beacuse I use black icons, but on some phones the default color of background is black or other dark color. I tried <a href=""http://www.android10.org/index.php/forums/43-view-layout-a-resource/195-customizing-the-options-menu-background"" rel=""nofollow"">this solution</a> and it's worked but there was a little problen with it:I have ten items and that's why I have a ""More"" item to show other options, but if I choose the More item (which is got the custom background) and after that I press back button, the item will be in the default state, default colors. What is the solution? Thanks!</p>","626545","","","","","2011-12-12 14:07:54","Android menu item background","<android><menuitem><background-color>","4","0","1","",""
"5065875","1","5066149","","2011-02-21 12:23:58","1","1427","<p>In my WebView I'm loading YouTube official website:<a href=""http://m.youtube.com/index?desktop_uri=%2F&amp;gl=US#/"" rel=""nofollow"">http://m.youtube.com/index?desktop_uri=%2F&amp;gl=US#/</a></p><p>I want the user to be able to choose a video and simply watch it. The WebView doesn't do it so I thought that maybe I should run an intent to youtube app. First, I had to export the videoID from the link.</p><p>I tried this code, but it doesn't match the link..:</p><pre><code>public class BrowserClient extends WebViewClient {            @Override        public boolean shouldOverrideUrlLoading(WebView view, String url) {                   //Check if YouTube video link            Log.d(""WBC"", ""loading link: "" + url);            String youTubeLink = ""http://m.youtube.com/index?desktop_uri=%2F&amp;gl=US#/watch?xl=xl_blazer&amp;v="";            if (url.startsWith(youTubeLink)){                      Log.d(""WBC"", ""This is a YouTube link: "" + url);                 view.getContext().startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(String.format(""http://www.youtube.com/v/%s"", url.substring(youTubeLink.length(),url.length())))));                  return true;            }            return super.shouldOverrideUrlLoading(view, url);        }}</code></pre><p>Any help?</p>","178016","","","","","2011-02-21 12:48:04","Video at YouTube mobile website in WebView doesn't work - Android","<android><youtube><webview>","1","0","","",""
"5065955","1","5067390","","2011-02-21 12:32:19","0","1231","<p>When a spinner comes up, it usually has a value preselected. If the users explicitly selects another item, my onClickItem handler is getting called.  But i did not find a way to detect when the user wants to keep the the currently selected list_item as is?  How is the user supposed to exit such a spinner when they like the current value?  Could you add a close button or something to just let them exit without having to reselect the already selected item to exit?  Also if they do reselect same item, how do you detect this?  I don't think my handlers are getting called for this.  </p><p>To be clear I need to know two things:</p><p>1) when user want to keep current value how do they exit the spinner?  Is it by reselecting the already selected item. If this is the case, how do I detect this in code so I can close out the dialog?</p><p>2) are there any other options for letting user close out a spinner without having them reselect the already selected value? for example providing a dialog close button?  Would like to know how others are handling this.  Thanks</p>","602260","","","","","2011-03-01 06:41:18","Android Spinner: How to catch when user exits spinner leaving selected value as-is?","<android><spinner>","1","1","","",""
"5065968","1","5069380","","2011-02-21 12:33:31","0","1504","<p>I am using AES encryption in my Android app, where the data is coming as stream. Sometime the data stream contains data as big as 8MB. I cannot create a byte array for 8MB in Android, it will kill all other apps for creating such a big heap. So I decided to use byte array buffer and encrypt small chunks of data at a time. But the data is getting corrupted</p><pre><code>Key key = generateKey();Cipher c = Cipher.getInstance(ALGORITHM);c.init(mode, key);while(all bytes are read){byte[] encValue = c.update(valueToEnc);}</code></pre><p>I even tried calling c.doFinal() on my last chunk but even that didn't help. Can anyone direct me to a good tutorial on how to encrypt or decrypt a stream in Java?</p>","473655","","","","","2011-02-21 17:51:49","java AES Encryption for a data stream","<android><encryption>","1","0","2","",""
"5065971","1","5297812","","2011-02-21 12:34:03","-1","502","<p>I have a separate <code>C#</code> program which sends data to any IP-Address I specify in it. The data is encoded in a way that I can decode it again (<code>UTF-8</code>) and sent through an <code>UDPClient</code>. I've set up this program to send the data to a port on my machine which I forward to the <code>Android Emulator</code>. In my application I have a DatagramSocket set on this port, but my receive call doesn't return any data to me...</p><p>I know for sure that data is sent, when I debug the <code>C#</code> program on the send statement, I see it actually sends data away... I suspect it is something in my Socket settings, but I don't know what...</p><pre><code>private void updateUDPSocket(String IpAddress, String IpPort){    Inet4Address ownIpAddress = null;    int ownIpPort = 0;    /*     *  Try to recover the correct Inet4Address &amp; Port.     *  Catch all possible exceptions as well.     */    try{        ownIpAddress = (Inet4Address) Inet4Address.getByName(IpAddress);        ownIpPort = Integer.parseInt(IpPort);    } catch (UnknownHostException uhe){        uhe.printStackTrace();    } catch (NumberFormatException nfe){        nfe.printStackTrace();    }    // Check to see if the current socket is already initialised.    if(mUDPSocket != null){        // If so, close &amp; nullify it.        mUDPSocket.close();        mUDPSocket = null;    }    // Create a new socket &amp; catch the possible exception.    try{        mUDPSocket = new DatagramSocket(ownIpPort, ownIpAddress);        mUDPSocket.setSoTimeout(TIME_OUT_IN_MILLIS);    } catch (SocketException se){        se.printStackTrace();    }    // Log current set address &amp; port.    Log.d(TAG, ""UDPSocket set to address:"" +        mUDPSocket.getLocalAddress() + "":"" + mUDPSocket.getLocalPort());}</code></pre><p>The IP-Address I pass here is either <code>0.0.0.0</code> (in case of the emulator) or the IP-Address recovered from the <code>WifiManager</code> (in case of a mobile device).It doesn't fail in setting the Socket, but per haps I am using the wrong address?</p><p>The only output I get from the receive method is the error message of the receive getting timed out...</p>","603059","","","","","2011-03-14 11:15:14","What am I doing wrong? My Socket won't receive data send to it","<android><networking><android-emulator><udp>","1","0","","",""
"5065982","1","","","2011-02-21 12:34:48","6","23133","<p>This is referring to coding a website.</p><p>I can add a link to, for example, 'navigon://' on a website that, in iOS devices, will open up the Navigon app if it is installed.</p><p>Is there a similar simple method to open an app from a website (assuming it's installed) in Android?</p><p>Thanks</p>","626566","","","","","2012-03-05 10:34:59","Android Custom URL to open App like in iOS","<android><html><ios>","2","0","4","",""
"5066087","1","5066271","","2011-02-21 12:42:36","1","986","<p>I created an xml file contains a webview.</p><p>I hope to load <a href=""http://www.google.com"" rel=""nofollow"">http://www.google.com</a> in this webview</p><p>How can I do it?</p>","616263","","127880","","2013-02-17 06:50:36","2013-02-17 06:50:36","load a website in webview","<android>","3","1","0","",""
"5066102","1","5264570","","2011-02-21 12:43:40","4","1011","<p>I'm using a Google API MapView in my Android application and I've discovered it often runs into this error when I scroll around and zoom the map. They tend to happen quite quickly (20seconds of using the maps) so I believe it will be a problem. Below is my stacktrace. I'm developing on the HTC Desire which has 24MB memory allowance.</p><p>Any ideas or settings I can do to reduce the frequency of these errors? </p><pre><code>java.lang.OutOfMemoryError: bitmap size exceeds VM budget    at android.graphics.Bitmap.nativeCreate(Native Method)    at android.graphics.Bitmap.createBitmap(Bitmap.java:574)    at com.google.android.maps.ZoomHelper.createSnapshot(ZoomHelper.java:444)    at com.google.android.maps.ZoomHelper.doZoom(ZoomHelper.java:151)    at com.google.android.maps.ZoomHelper.doZoom(ZoomHelper.java:140)    at com.google.android.maps.MapView.doZoom(MapView.java:1478)    at com.google.android.maps.MapView.doZoom(MapView.java:1487)    at com.google.android.maps.MapView$6.onZoom(MapView.java:1442)    at android.widget.ZoomButtonsController$3.onClick(ZoomButtonsController.java:268)    at android.view.View.performClick(View.java:2408)    at android.view.View$PerformClick.run(View.java:8817)    at android.os.Handler.handleCallback(Handler.java:587)    at android.os.Handler.dispatchMessage(Handler.java:92)    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)debug.heap native: allocated 10.63MB of 11.01MB (385.98KB free)debug.memory: allocated: 17.95MB of 24.00MB (13.50MB free)</code></pre><p>This is my Overlay. I has about 50 items in it displaying a png image 96x96 with some transparency (6KB in file size).</p><pre><code>public class StationItemizedOverlay extends ItemizedOverlay&lt;OverlayItem&gt;{    private ArrayList&lt;OverlayItem&gt; mOverlays = new ArrayList&lt;OverlayItem&gt;();    private ArrayList&lt;Location&gt; locations = new ArrayList&lt;Location&gt;();    private Context mContext;    public StationItemizedOverlay(Drawable defaultMarker, Context context)    {        super(boundCenterBottom(defaultMarker));        this.mContext = context;    }    /**     * Add a range of locations to this overlay     *      * @param locations The locations to add     */    public void addRange(List&lt;Location&gt; locations)    {        for (Location l : locations)        {            addOne(l);        }        populate();    }    /**     * Add a location to this overlay     *      * @param location The location     */    public void add(Location location)    {        addOne(location);        populate();    }    /**     * Remove a location from this overlay     * @param location The location to remove     */    public void remove(Location location)    {        int position = locations.indexOf(location);        if (position &gt;= 0)        {            mOverlays.remove(position);            locations.remove(position);            populate();        }    }    private void addOne(Location location)    {        locations.add(location);        int lat = location.getMicroLatitude();        int lon = location.getMicroLongitude();        GeoPoint point = new GeoPoint(lat, lon);        OverlayItem item = new OverlayItem(point, location.getRealName(), location.getRealName());        mOverlays.add(item);    }    @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;    }    @Override    protected OverlayItem createItem(int i)    {        return mOverlays.get(i);    }    @Override    public int size()    {        return mOverlays.size();    }}</code></pre><p>This is my MapActivityClass</p><pre><code>public class StationFinder extends MapActivity{    IUIInterface dataInterface = UIInterfaceFactory.getInterface();    MapView mapView;    List&lt;Overlay&gt; mapOverlays;    Drawable drawable;    StationItemizedOverlay trainItemizedOverlay;    @Override    protected void onCreate(Bundle savedInstanceState)    {        super.onCreate(savedInstanceState);        setContentView(R.layout.ui_station_finder);        mapView = (MapView) findViewById(R.id.stationFinderUI_mapview);        mapView.setBuiltInZoomControls(true);        mapOverlays = mapView.getOverlays();        drawable = getResources().getDrawable(R.drawable.dash_train_btn_default);        trainItemizedOverlay = new StationItemizedOverlay(drawable, this);        myMapController = mapView.getController();        myMapController.setZoom(8); // zoom level selected from google map .com        // center this location on northern ireland        centerLocation(Settings.getNorthernIrelandCenter().getGeoPoint());        mapOverlays.add(trainItemizedOverlay);        // add data to the adapters only whenever the data is loaded        if (!dataInterface.isDataLoaded())        {            // data is not loaded            // so make a listener for the data loaded event            dataLoadedListener = new IEventListener()            {                public void action(Object optionalData)                {                    // the event has been triggered                    // register this function to run in the UI thread of the application                    runOnUiThread(new Runnable()                    {                        public void run()                        {                            dataLoaded();                        }                    });                }            };            // register the listener for data loaded events            dataInterface.registerDataLoaded(dataLoadedListener);            // call the data loaded function now incase the data has since been loaded by             // the application between registering for the event            if (dataInterface.isDataLoaded())            {                dataLoaded();            }        }        else        {            // data already loaded so run immediately            dataLoaded();        }    }    IEventListener dataLoadedListener = null;    boolean isDataLoaded = false;    private void dataLoaded()    {        // make sure this function is only called once        if (isDataLoaded)            return;        isDataLoaded = true;        // IMPORTANT STUFF GOES HERE        trainItemizedOverlay.addRange(dataInterface.getAllLocations());        // clean up the data load listener        if (dataLoadedListener != null)        {            dataInterface.removeDataLoaded(dataLoadedListener);            dataLoadedListener = null;        }    }    private MapController myMapController;    private void centerLocation(GeoPoint center)    {        myMapController.animateTo(center);        myMapController.setCenter(center);    };    @Override    protected boolean isRouteDisplayed()    {        return false;    }</code></pre>","243203","","243203","","2011-02-21 13:15:58","2011-03-10 19:10:45","Google API MapView OutOfMemoryError Problems","<android><google-maps><out-of-memory>","2","1","1","",""
"5066129","1","","","2011-02-21 12:46:04","4","2306","<p>Does anyone manage to get relevant advertisement from AdMob server when setting keywords or search query ? My application runs on Android and I manage to retrieve ads from the AdMob server.</p><p>I try several solutions but they do not seem to work.</p><hr><p><strong>Solution 1:</strong> use the methods <code>setKeywords( String keywords )</code> or <code>setSearchQuery( String searchQuery )</code> from the AdView class and then, call <code>requestFreshAd()</code>. When a request is currently in progress, a call to <code>requestFreshAd()</code> generate the following message in log : </p><blockquote>  <p><em>""WARN/AdMobSDK(2541): Ignoring requestFreshAd() because we are  requesting an ad right now already.""</em></p></blockquote><p>.</p><p>Thus, I try to call <code>requestFreshAd()</code> when no request are in progress but it doesn't work anymore.</p><hr><p><strong>Solution 2:</strong> In the XML layout, use the attributes <code>myapp:keywords=""myKeywords""</code> on the AdView element. This attributes is previously declared in the attrs.xml file.</p>","590392","","17413","","2011-04-04 12:41:56","2011-04-14 07:33:53","AdMob API and keywords","<android><search><keyword><admob><advertising>","1","0","","",""
"5066176","1","","","2011-02-21 12:50:24","3","1041","<p>I am trying to create an application for monitoring incoming SMS messages, and logging an entry. For this, I create one activity class to start launching and one broadcast receiver class. </p><p>In manifest file, I declare <code>uses-permission</code> and <code>receiver</code>. Then I debug and run the application on emulator (AVD 5554). After that, I send SMS using DDBS on the same AVD. Unfortunately, activity screen appeared without error but no log message is on LogCat.</p><p>Is there anything I miss in the steps? Plus I used startActivity() in the code.</p>","623439","","592174","","2011-02-21 13:10:16","2011-02-28 21:15:27","Reading incoming SMS messages in Android","<android><android-intent>","1","3","3","",""
"5066220","1","5066231","","2011-02-21 12:55:10","1","2905","<p>I have a <code>ListActivity</code> that displays a list of search results I grab from a webservice off the internet. I parse the XML I receive into an <code>ArrayList&lt;MyObjects&gt;</code> which I then bind to a <code>ListView</code> using my own adapter (as in <code>MyObjectAdapter</code> extends <code>ArrayAdapter&lt;MyObject&gt;</code>).</p><p>So then I want the user to be able to click on one of the items in the list. Each item has an identifier which will then be put into an intent and sent to a new activity (which then triggers a new webservice request based on this, downloads the rest of the data). But I don't know how to get this one property of the <code>MyObject</code> that was selected.</p><p>Here's the <code>onListItemClick()</code> method as it stands:</p><pre><code>@Overrideprotected void onListItemClick(ListView l, View v, int position, long id) {  super.onListItemClick(l, v, position, id);  String myObjectId;  // I want to get this out of the selected MyObject class here  Intent i = new Intent(this, ViewObject.class);  i.putExtra(""identifier_key"", myObjectId);  startActivityForResult(i, ACTIVITY_VIEW);}</code></pre>","315386","","244296","","2011-02-21 12:59:30","2011-02-21 12:59:47","Get specific item property on onListItemClick() using custom ArrayAdapter<>","<android>","2","0","0","",""
"5066363","1","","","2011-02-21 13:12:32","1","1508","<p>I want to encrypt JSON string and then send it to web server. For encryption I am using AES algorithm.my JSON string is like :  </p><pre><code>String pJSON = ""{\""UserName\"":\""abc\"",\""Password\"":\""123456789\""}"";</code></pre><p>any idea ??</p>","","Nimit ","512958","","2011-02-21 13:23:11","2011-02-23 12:12:46","Encryption JSON String","<android>","3","0","1","",""
"5066437","1","6776290","","2011-02-21 13:19:33","1","1100","<p>I want to make Activity like this using GridView.And this Activity have only one scrollbar include all text &amp; gridview.</p><p>for it, using scrollview.</p><pre><code>&lt;ScrollView&gt;android:layout_width=""fill_parent""android:layout_height=""fill_parent""&lt;LinearLayoutandroid:orientation=""vertical""android:layout_width=""fill_parent""android:layout_height=""wrap_content""&gt;&lt;TextView  android:layout_width=""fill_parent""   android:layout_height=""wrap_content""/&gt;&lt;GridView  android:layout_width=""fill_parent""   android:layout_height=""wrap_content""/&gt;&lt;TextView  android:layout_width=""fill_parent""   android:layout_height=""wrap_content""/&gt;&lt;GridView  android:layout_width=""fill_parent""   android:layout_height=""wrap_content""/&gt;&lt;/LinearLayout&gt;&lt;/ScrollView&gt;</code></pre><p>I wrote xml and class like attached using ScrollView to have only one scroll.GridView has <code>android:layout_height=""fill_parent""</code>, but just visible one row.And each GridView has scroll.Same result layout_height was changed to wrap_content.</p><p>Is it bug? or Do I have some mistake? or Is it impossible?Thanks.</p>","622829","","545691","","2011-02-21 13:49:31","2011-07-21 12:48:15","How to include Multiple GridView in a Activity(use ScrollView), just displayed one row?","<android><android-widget><android-layout>","1","0","","",""
"5066484","1","","","2011-02-21 13:23:37","0","2173","<p>I want to download android 2.2 froyo source code, but actually here <a href=""http://android.git.kernel.org/"" rel=""nofollow"">http://android.git.kernel.org/</a> is available android 2.3 gingerbread. How can I switch to previous version?  </p>","626651","","","","","2011-02-21 13:27:13","Where to download Android 2.2 Froyo source code?","<android><android-2.2-froyo>","1","2","","",""
"5066515","1","5068199","","2011-02-21 13:26:58","1","235","<p>I am looking to create an app where users can download a map to their phone before they go to a specific place (in case there is no 3G signal there) and then use GPS to take specific routes that will have been marked on the maps.</p><p>I have noticed GoogleMaps 5 has just been released that enables caching. Is this something I would be able to use or can you not incorporate google maps 5 into another app.</p><p>I am very new to Android and am not quite sure what can and can't be done as yet so 'm sorry if this is a really silly question?</p><p>Thanks for any help!</p><p>Bex</p>","390501","","130929","","2011-02-21 15:23:18","2011-02-21 16:05:13","Caching maps within an android app","<android>","1","0","0","",""
"5066518","1","","","2011-02-21 13:27:04","0","546","<p>HI! I've having som troubles with my GPS-app, android 2.2. My App doesnt respond, ""force close"" itself about 2 seconds after I opened it. Under is the code for .java file, manifest.xml and main.xml</p><p>Java file: </p><pre><code>package no.local.android;import android.app.Activity;import android.net.Uri;import android.os.Bundle;import android.content.Context;import android.content.Intent;import android.location.Location;import android.location.LocationManager;import android.util.Log;import android.view.View;import android.view.View.OnClickListener;import android.widget.*;public class Localizer extends Activity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);                          //henter mainlayout fra xml        LocationManager locationManager;                                //objekt fra pakken Location.                   String context = Context.LOCATION_SERVICE;        locationManager = (LocationManager)getSystemService(context);   //henter lokasjonen oppdateringer        if(locationManager == null) {                                   //skjekker om objektet returnerer null før det taes i bruk            Log.d(""Testing"", ""locationManager returnerer null"");        //om så, si ifra til debuggeren, LogCat.        }        else {                                                          // ellers kan man hente siste kjente lokasjon            //String provider = LocationManager.GPS_PROVIDER;            //Location location = locationManager.getLastKnownLocation(""gps"");            //updateWithNewLocation(location);                          //funksjonskall slik at man kan få vite eksakt bredde- og lengdegrad.         }}    private void updateWithNewLocation(Location sted) {        String latitudeText;        TextView lokText;        lokText = (TextView)findViewById(R.id.lokText);         //henter fra xml        if(sted != null) {            double lat = sted.getLatitude();                //henter latitude            double lngtit = sted.getLongitude();            //og longtitude            latitudeText = ""Breddegrad:"" + lat + ""Lengdegrad"" + lngtit;         }        else {            latitudeText = ""Kunne ikke finne lokasjonen din"";        }        lokText.setText(""Din nåværende lokasjon er:\t"" + latitudeText);        Button call = (Button)findViewById(R.id.call);        call.setOnClickListener(emerList);    }    private OnClickListener emerList = new OnClickListener() {        @Override        public void onClick(View v) {            Intent call = new Intent(Intent.ACTION_DIAL, Uri.parse(""tel:48601619""));            startActivity(call);        }};}</code></pre><p>Manifest.xml</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;</code></pre><p>    </p><pre><code>&lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;    &lt;activity android:name="".Localizer""              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-permission android:name=""android.permission.ACCESS_FINE_LOCATION"" /&gt;&lt;uses-permission android:name=""android.permission.INTERNET"" /&gt;</code></pre><p></p><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;TextView      android=""@+id/lokText""    android:layout_width=""fill_parent""     android:layout_height=""wrap_content""     android:text=""@string/hello"" /&gt;&lt;uses-permission android:name=""android.permission.INTERNET"" /&gt;&lt;Button android:id=""@+id/call""            android:layout_width=""200px""             android:layout_height=""wrap_content""            android:text=""Ring nødnummer""            android:layout_gravity=""center_vertical|center_horizontal|center"" /&gt; &lt;/LinearLayout&gt;</code></pre>","626656","","229745","","2011-02-21 14:19:58","2011-02-21 14:19:58","GPS problems, android 2.2","<android><gps>","0","3","","",""
"5066522","1","6755713","","2011-02-21 13:27:25","4","1083","<p>I'd like to switch from using MP3 encoded audio files to AAC+ for voice sound files stored inside an Android app. This will make the install size smaller. </p><p>A problem I encountered is that AAC+ support was broken in the Froyo release of Android:<a href=""http://code.google.com/p/android/issues/detail?id=9308"" rel=""nofollow"">http://code.google.com/p/android/issues/detail?id=9308</a></p><p>It was later fixed:<a href=""http://android.git.kernel.org/?p=platform/frameworks/base.git;a=commit;h=16263d9f8cc01392c2f3678b381ce897647c8c81"" rel=""nofollow"">http://android.git.kernel.org/?p=platform/frameworks/base.git;a=commit;h=16263d9f8cc01392c2f3678b381ce897647c8c81</a></p><p>The Pandora FAQ apparently confirmed some phones were updated over the air, but warned about other phones:</p><blockquote>  <p>Why am I experiencing audio issues on Froyo?</p>    <p>If you have upgraded to Froyo (Android 2.2), you may notice audio-quality issues while listening   to Pandora. The Android team is aware of this issue with AAC+ audio and has released a fix, which   is gradually being rolled out on the various Android handsets.</p>    <p>Currently the Sprint HTC EVO and the Google Nexus One have OTA Android OS updates that   incorporate this AAC+ audio fix.</p>    <p>If you have a different handset than the two mentioned, please contact the support team for your   handset if you have any further questions about this issue.</p></blockquote><p>Have all Froyo phones been updated to include this fix? Or are there some carriers/manufacturers not bothering? Such is very common with Android, as they claim testing updates is too expensive.</p><p>My Flurry metrics are showing Android 2.2 at 33.2%, 2.2.1 at 12.2%, 2.2.2 at 0.1%. So if the fix only came with a version number change, it isn't out to most Froyo phones.</p>","244521","","244521","","2011-02-21 13:40:27","2011-07-20 00:29:47","Has AAC+ support been fixed on all Android phones?","<android><encoding><audio><compatibility><fragmentation>","1","0","0","",""
"5066616","1","5066776","","2011-02-21 13:35:51","0","720","<p>My problem is that i've a tabhost with two tabs.The first is a listview and the second only have two textviews.</p><p>What i want is when i click on an item in the listview on tab one, the array position id (int) should be sent to tab/class two, where there is an array who fetches a text by the position id that was sent.</p><p>The switching of tabs is done, but i fail everytime i try to send the position-id.</p><p>This is how i send it:</p><p>TAB ONE:</p><pre><code>//This function is called when i click a listitempublic void setDetails(String Text, long arr_id){        Detail detail = new Detail();        detail.setDetail(); // right now i don't send the parameters because it wont even work with or without it.    }</code></pre><p>TAB TWO:</p><pre><code>TextView descr;TextView title;public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.detail);    descr = (TextView)findViewById(R.id.desc);    title = (TextView)findViewById(R.id.title);}public void setDetailText(String Text){    descr.setText(Text);}public void setDetailTitle(String Text){    title.setText(Text);}public void setDetail(){    this.setDetailTitle(""example text"");    this.setDetailText(""example text2"");}</code></pre><p>I want to set the text on tab two BEFORE it switch to tab two.This works if i use SetDetail() and setDetailTitle() in the same tab/class, but not in another.</p><p>I've googled my ass off, please help me </p>","522247","","","","","2011-02-21 13:52:28","TextView setText from another class","<java><android>","1","0","1","",""
"5066624","1","5066791","","2011-02-21 13:36:37","0","2109","<p>This is my ListView structure and element :</p><pre><code>     // Get a cursor with all phones    Cursor c = getContentResolver().query(Phones.CONTENT_URI, null, null, null, ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME);    startManagingCursor(c);    /** ----Display the Contacts on the device----- */    ListAdapter adapter = new SimpleCursorAdapter(this,            android.R.layout.simple_list_item_2, c,                     new String[] { Phones.NAME, Phones.NUMBER },                     new int[] { android.R.id.text1, android.R.id.text2 });    setListAdapter(adapter);</code></pre><p>and my implementation of the setOnItemClickListener is as follows:</p><pre><code>/** ----Defining the ItemOnClickListener for the displayed List---- */    final ListView contactlistview = getListView();    contactlistview.setTextFilterEnabled(true);    contactlistview.setOnItemClickListener(new OnItemClickListener() {        public void onItemClick(AdapterView&lt;?&gt; parent, View view,                int position, long id) {            Log.d(TAG, String.valueOf(position));            // When clicked, show a toast with the TextView text            Toast.makeText(getApplicationContext(),                    contactlistview.getItemAtPosition(position).toString(),                    Toast.LENGTH_SHORT).show();            Log.d(TAG, contactlistview.getItemAtPosition(position).toString());        }    });</code></pre><p>and finally got the ListView as :</p><p><img src=""http://i.stack.imgur.com/UUdvv.png"" alt=""ListView Output""></p><p>and when i clicked on any of the item i get the Toast Displaying the Following:<img src=""http://i.stack.imgur.com/iJTpH.png"" alt=""Toast Displays""></p><p>but i want my toast to display the contact name of the selected item </p><p>can u pls help me with the code :)</p><p>sorry for the inconvenience :)</p><p>THANKS :) :)</p>","601142","","457982","","2011-02-23 04:59:37","2011-02-23 04:59:37","ListView items with two rows","<android><eclipse><listview><onclick>","1","0","","",""
"5066644","1","","","2011-02-21 13:38:41","1","288","<p>I'm having a problem with htc's flash lite player on a htc desire hd phone. Even when it had adobe flash player installed, the webview still used the htc flash lite player which crashed even on a simple youtube video.</p><p>I'm using this to check flash:</p><pre><code>        PackageManager pm = context.getPackageManager();        ApplicationInfo ai = pm.getApplicationInfo(""com.adobe.flashplayer"", 0);        Log.d(""Flash version Installed: "" + pm.getPackageInfo(""com.adobe.flashplayer"", 0).versionName);        if (ai != null){            Log.d(""flash present...OK"");        }        ApplicationInfo ai2 = pm.getApplicationInfo(""com.htc.flashliteplugin"", 0);        if (ai2 != null){            Log.d(""flash lite present..disabling flash"");            return false;        }        return true;</code></pre><p>And also:</p><pre><code>if(aboveCode){       webview.getSettings().setPluginsEnabled(true);}</code></pre><p>So right now, I had to disable flash entirely if flash lite was present. Any ideas or solutions to this problem?I'm avare that there are new <a href=""http://developer.android.com/reference/android/webkit/WebSettings.html#setPluginState%28android.webkit.WebSettings.PluginState%29"" rel=""nofollow"">methods</a> in newer api levels that might help, but I would not like to increase api level on something as stupid as this.</p>","373248","","","","","2011-02-21 13:38:41","HTC flashlite player crash","<android><webview>","0","1","","",""
"5066650","1","","","2011-02-21 13:39:18","1","286","<p>Since I am new to java programming, I need a bit of help with this. I stuck on this one issue and can't continue until I get this to work.</p><p>I am trying to make a string from that includes a preference int. I saved the data and can display the int (just sample code):  </p><pre><code>SharedPreferences prefs=PreferenceManager        .getDefaultSharedPreferences(this);    list.setText(prefs.getString(""list"", ""22""));</code></pre><p>now, I have a xml parser  that is pulling a url correctly as a static string:</p><p><code>public static String feedUrl = String.format(""http://www.freshpointmarketing.com/iphone/objects/XML/AND.php?ID=%d"", 22);</code></p><p>Works great...</p><p>now my issue......</p><p>I need to have the preference ""int"" become the variable in the string, thus making it not static.</p><pre><code>static SharedPreferences prefs=PreferenceManager.getDefaultSharedPreferences(this);static int myVariable = prefs.getInt(""list1"", 22);public static String feedUrl = String.format(""http://www.freshpointmarketing.com/iphone/objects/XML/AND.php?ID=%d"", myVariable);</code></pre><p>If I take out all static references, I get an error on this:</p><pre><code>    private void loadFeed(ParserType type){    try{        FeedParser parser = FeedParserFactory.getParser(type);        long start = System.currentTimeMillis();        messages = parser.parse();        long duration = System.currentTimeMillis() - start;        Log.i(""AndroidNews"", ""Parser duration="" + duration);        String xml = writeXml();        Log.i(""AndroidNews"", xml);        List&lt;String&gt; titles = new ArrayList&lt;String&gt;(messages.size());        for (Message msg : messages){            titles.add(msg.getTitle());        }        ArrayAdapter&lt;String&gt; adapter =             new ArrayAdapter&lt;String&gt;(this, R.layout.row,titles);        this.setListAdapter(adapter);    } catch (Throwable t){        Log.e(""AndroidNews"",t.getMessage(),t);    }}</code></pre><p>thanks</p>","626679","","21234","","2011-02-21 13:44:19","2011-02-21 15:21:53","ANDROID SAX Parser issue","<android><saxparser>","1","0","","",""
"5066748","1","","","2011-02-21 13:48:59","0","854","<p>I try this to add some data to ""global variables"". Class ""Conection"" without window in void</p><pre><code>for (int in = 7; in &lt; arAll.length; in++) {        if (arAll[in].toString().endsWith(""/"")) {            ((MyApplication) this.getApplication()).setPath(arAll[in]                    .toString());        } else {            ((MyApplication) this.getApplication()).setFile(arAll[in]                    .toString());        }</code></pre><p>MyApplication getter's and setter's:</p><pre><code>private ArrayList&lt;String&gt; file = new ArrayList&lt;String&gt;();private ArrayList&lt;String&gt; path = new ArrayList&lt;String&gt;();private ArrayList&lt;String&gt; all = new ArrayList&lt;String&gt;();public void removeAll() {    this.file.clear();    this.path.clear();    this.all.clear();}public int len() {    return this.all.size();}public String getStrbyId (int i) {    return this.all.get(i).toString();}public ArrayList&lt;String&gt; getFile() {    return this.file;}public void setFile(String file) {    this.file.add(file);    setAll(file);    Log.v("""",file);}public ArrayList&lt;String&gt; getPath() {    return this.path;}public void setPath(String path) {    this.path.add(path);    setAll(path);    Log.v("""",path);}public ArrayList&lt;String&gt; getAll() {    Log.v("""",String.valueOf(len()));    return this.all;}private void setAll(String all) {    this.all.add(all);}</code></pre><p>In manifest  <code>&lt;application android:name=""MyApplication""</code></p><p>When I try to execute first void, I have an error.</p>","625565","","1108213","","2012-03-18 17:37:10","2012-03-18 17:40:46","Android global varables, getter, setter, error,","<java><android><global-variables>","1","4","1","",""
"5066766","1","","","2011-02-21 13:51:37","2","1196","<p>I have written a small card game. I now want to animate few things like taking a card from a deck and moving it to ""open cards pool"". I could achieve this by using translate (below code). But the problem is whenever a new card is taken and moved, the ""open cards pool"" looks empty. How can i possibly show the last open card in ""open cards pool:? Is there a flag or something to retain the image at its original place while it is being animated?</p><pre><code>&lt;translate    android:fromXDelta=""-100%""    android:toXDelta=""0%""    android:fromYDelta=""0%""    android:toYDelta=""0%""    android:duration=""1000""    android:zAdjustment=""top"" /&gt;</code></pre>","626701","","211160","","2012-10-08 03:31:11","2013-11-29 00:18:06","Android Card Game Animation","<java><android><animation><playing-cards>","1","1","","",""
"5066775","1","","","2011-02-21 13:52:27","0","6824","<p>I am new to Android, so please excuse if it is asked before!</p><p>I am playing with some camera code (found online) and I want to show/hide some buttons on screen. When the user touches the screen, I want it to capture the image. </p><p>My setup:</p><p>1.Main Activity:</p><pre><code>public class CameraDemo extends Activity {/** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main_inuse);        preview = new Preview(this);        ((FrameLayout) findViewById(R.id.preview)).addView(preview);... ...  // rest of the code that captures the image when a button is pressed.// the button is defined in main.xml with button id ButtonClicked}</code></pre><p>2.The preview class looks like this:</p><pre><code>class Preview extends SurfaceView implements SurfaceHolder.Callback {    SurfaceHolder mHolder;    public Camera camera;    Preview(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);}</code></pre><p>My question is,</p><ol><li><p>How can I add touch functionality so that the user can touch the preview (say for a second, or just touch quickly) and something happens ? (Say image is saved)</p></li><li><p>And a button will appear on the surface say a ""Next"" button, for example?</p></li></ol>","626664","","56338","","2011-02-21 14:05:57","2013-07-22 01:33:25","How to add a touch listener to a surface view?","<android>","1","0","","",""
"5066965","1","5067055","","2011-02-21 14:10:18","2","331","<p>I am working on a project in Android now that involves parsing XML from a local file.</p><p>I have done XML work extensiely in flex and have become used to the power and flexibility of E4X and it's capabilities. I wonder now if I can do something similar in android or will I be forced to parse the XML manually?</p><p>Thanks</p>","353674","","","","","2011-02-22 02:58:25","Android, XML parsing similar to E4X?","<android><xml><e4x>","2","2","","",""
"5067008","1","5067065","","2011-02-21 14:13:51","1","6000","<p>I've just written a short Android app which stores userdata in the phone-side sqlite database. </p><p>What I'd like to be able to do is to add this to an online database (I currently have a mysql database with my webhosts, but if there's any easier way then I'm open to suggestions), but it'll be subject to condition (Such as if a certain value doesn't already exist). I'd also like to be able to get data from this online database too to be added to the sqlite database on the phone.</p><p>I've had a look around and people seem to suggest using php as a go-between for that, but is that the easiest way? there aren't any mysql helper classes that could just interface directly or anything?</p><p>Newbie question I know, but the project was to teach myself how Android works so getting stuck in is the way to go..</p><p>Cheers!</p>","530501","","","","","2011-02-21 14:18:43","Android - reading/writing to online mysql database","<android><mysql><sqlite>","1","0","1","",""
"5067215","1","5067632","","2011-02-21 14:36:17","1","433","<p>The activity in the manifest is singleTask. The onNewIntent method is called when the activity is called again. I do intialize the Textviews and other views in my onCreate but sometimes the app crashes in onNewIntent where I do not initialize any variables and directly use the method of that view. For eg, setText method of TextView. Sometimes it throws NullPointerException and do not know why does it do so. In other screen where I have done the same thing it never does that.</p><p>Do I need to instantiate the variables again in onNewIntent? </p>","261566","","","","","2011-02-21 15:14:16","Do I need to reinitialize the variables in onNewIntent in Android?","<android><instantiation>","1","1","","",""
"5067236","1","","","2011-02-21 14:38:27","0","1911","<p>I'm trying to set up a bluetooth connection with a simple hardware (<a href=""http://www.secu4.com/sites/secu4/pages/upload/99_pdf/BrochureSecu4_HauteDef.pdf"" rel=""nofollow"">description here</a>)The problem is every time a try to connect the Bluetooth socket, I have this IOException : Device or resource busy.</p><p>Any idea ?</p><p>(I can't post printscreen of the log because I don't have 10 reputation points...)</p><p>Here is my bluetooth code part :</p><pre><code>/** * This thread runs while listening for incoming connections. It behaves * like a server-side client. It runs until a connection is accepted (or * until cancelled). */private class AcceptThread extends Thread {    // The local server socket    private final BluetoothServerSocket mmServerSocket;    public AcceptThread() {        BluetoothServerSocket tmp = null;        // Create a new listening server socket        try {            tmp = mAdapter.listenUsingRfcommWithServiceRecord(NAME, MY_UUID);        } catch (IOException e) {            Log.e(TAG, ""listen() failed"", e);        }        mmServerSocket = tmp;    }    public void run() {        if (D) Log.d(TAG, ""BEGIN mAcceptThread"" + this);        setName(""AcceptThread"");        BluetoothSocket socket = null;        // Listen to the server socket if we're not connected        while (mState != STATE_CONNECTED) {            try {                // This is a blocking call and will only return on a                // successful connection or an exception                socket = mmServerSocket.accept();            } catch (IOException e) {                Log.e(TAG, ""accept() failed"", e);                break;            }            // If a connection was accepted            if (socket != null) {                synchronized (BluetoothConnectionService.this) {                    switch (mState) {                    case STATE_LISTEN:                    case STATE_CONNECTING:                        // Situation normal. Start the connected thread.                        connected(socket, socket.getRemoteDevice());                        break;                    case STATE_NONE:                    case STATE_CONNECTED:                        // Either not ready or already connected. Terminate                        // new socket.                        try {                            socket.close();                        } catch (IOException e) {                            Log.e(TAG, ""Could not close unwanted socket"", e);                        }                        break;                    }                }            }        }        if (D) Log.i(TAG, ""END mAcceptThread"");    }    public void cancel() {        if (D) Log.d(TAG, ""cancel "" + this);        try {            mmServerSocket.close();        } catch (Exception e) {            Log.e(TAG, ""close() of server failed"", e);        }    }}/** * This thread runs while attempting to make an outgoing connection with a * device. It runs straight through; the connection either succeeds or * fails. */private class ConnectThread extends Thread {    private final BluetoothSocket mmSocket;    private final BluetoothDevice mmDevice;    public ConnectThread(BluetoothDevice device) {        mmDevice = device;        // Get a BluetoothSocket for a connection with the        // given BluetoothDevice                    resetConnection();        try {//              connection = device.createRfcommSocketToServiceRecord(MY_UUID);                Method m = mmDevice.getClass().getMethod(""createRfcommSocket"",new Class[] { int.class });                connection = (BluetoothSocket) m.invoke(mmDevice, 1);                Log.i(TAG, ""createRfcommSocket"");//              Utils.pause(100);            } catch (Exception e) {                Log.e(TAG, ""create() failed"", e);            }            mmSocket = connection;        }        public void run() {            if(D) Log.i(TAG, ""BEGIN mConnectThread on Device : "" + mmDevice);            setName(""ConnectThread"");            if (mmSocket != null) {                // Always cancel discovery because it will slow down a connection                    mAdapter.cancelDiscovery();                // Make a connection to the BluetoothSocket                try {                    // This is a blocking call and will only return on a                    // successful connection or an exception                    if(D) Log.i(TAG, ""start Bluetooth socket connection"");                    mmSocket.connect();                } catch (Exception e1) {                    Log.e(TAG, ""connect failed"", e1);                    connectionFailed();                    // Close the socket                    try {                        mmSocket.close();                    } catch (IOException e2) {                        Log.e(TAG,""unable to close() socket during connection failure"",e2);                    }                    // Start the service over to restart listening mode                    if(D) Log.i(TAG, ""restart connection"");                    BluetoothConnectionService.this.start();                    if(D) Log.i(TAG, ""return"");                    return;                }                // Reset the ConnectThread because we're done                if(D) Log.i(TAG, ""Reset the ConnectThread"");                synchronized (BluetoothConnectionService.this) {                    mConnectThread = null;                }                // Start the connected thread                if(D) Log.i(TAG, ""The device is considered as connected, call connected thread"");                connected(mmSocket, mmDevice);            } else {                Log.i(TAG, ""connection fail"");                connectionFailed();                BluetoothConnectionService.this.start();            }        }        public void cancel() {            try {                if (mmSocket != null) {                    mmSocket.close();                }            } catch (IOException e) {                Log.e(TAG, ""close() of connect socket failed"", e);            }        }    }/** * This thread runs during a connection with a remote device. It handles all * incoming and outgoing transmissions. */private class ConnectedThread extends Thread {    private final BluetoothSocket mmSocket;    private final DataInputStream mmInStream;    private final OutputStream mmOutStream;    public ConnectedThread(BluetoothSocket socket) {        if(D) Log.d(TAG, ""create ConnectedThread"");        mmSocket = socket;        // Get the BluetoothSocket input and output streams        try {            tmpIn = socket.getInputStream();            tmpOut = socket.getOutputStream();            isConnected = true;        } catch (IOException e) {            Log.e(TAG, ""Input and Output sockets not created"", e);            isConnected = false;        }        mmInStream = new DataInputStream(tmpIn);        mmOutStream = tmpOut;    }    public void run() {        if(D) Log.i(TAG, ""BEGIN mConnectedThread"");        while (isConnected) {            Utils.pause(5);            isConnected = checkConnection();        }    }    /**     * Check if the connection is still alive     *      * @return true or false     */    private boolean checkConnection() {        synchronized (mmInStream) {            try {                int len = mmInStream.available();                if (len &gt; 0) {// Checks the available amount                    byte b[] = new byte[len];                    mmInStream.readFully(b, 0, len);                    mHandler.obtainMessage(MESSAGE_READ, len, -1, b)                            .sendToTarget();                }                return true;            } catch (IOException ioe) {                Log.e(TAG, ""disconnected"", ioe);                connectionLost();                return false; // Connection is lost.            }        }    }    /**     * 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(MESSAGE_WRITE, -1, -1, buffer).sendToTarget();            // mmOutStream.flush();        } catch (IOException e) {            Log.e(TAG, ""Exception during write"", e);            connectionFailed();        }    }    public void cancel() {        try {            mmSocket.close();            Utils.pause(1000);        } catch (IOException e) {            Log.e(TAG, ""close() of connect socket failed"", e);        }    }}</code></pre>","626748","","","","","2011-02-21 14:38:27","Android Bluetooth socket IOException : Device or resource busy","<android><sockets><exception><connection><bluetooth>","0","3","0","",""
"5067315","1","5067451","","2011-02-21 14:46:46","0","219","<p>i've an app that records audio samples. once a recording has been made it is stored on sdcard under reversme.pcm. i then can enter a filename and the app creates a file under that name and copies the contents of reveseme.pcm to the new file under the new filename. the problem i'm having is the new file is twice the size of the original, and when i try to play it there is no sound. i've run it through audacity and there is no sound data there. the file size is exactly twice as big though. any ideas? here some code 'code'</p><pre><code>File tempFile = new File(Environment.getExternalStorageDirectory().                          getAbsolutePath() + ""/""+""reverseme.pcm"");                  File saveFile = new File(Environment.getExternalStorageDirectory().                          getAbsolutePath() + ""/""+fileNameToSave);                  short[] tempArray = new short[(int)tempFile.length()];                  Log.i(""tempfile length = "", """"+tempFile.length());                  Log.i(""tempArray length = "", """"+tempArray.length);                  try {                    // Create a DataInputStream to read the audio data back from the saved file.                    InputStream is = new FileInputStream(tempFile);                    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[musicLength-1-i] = dis.readShort();                      tempArray[i] = dis.readShort();                    i++;                    }                    dis.close();                    Log.i(""tempArray length after read = "", """"+tempArray.length);                    // Create a DataOuputStream to write the temp array into the saved file.                    FileOutputStream os = new FileOutputStream(saveFile);                    BufferedOutputStream bos = new BufferedOutputStream(os);                    DataOutputStream dos = new DataOutputStream(bos);                  Log.i(""tempArray length before writing to sdcard = "", """"+tempArray.length);                    for (int c = 0; c &lt; tempArray.length; c++){                    dos.writeShort(tempArray[i]);                    }                    Log.i(""tempfile length after writing to sdcard = "", """"+tempArray.length);                    dos.close();                    } catch (Exception e) {                    e.printStackTrace();                    }                  return true;                }                return false;            }        });    }}</code></pre>","532462","","","","","2011-02-21 14:58:41","android array contents twice the size when written to a file?","<android><file-io>","1","0","","",""
"5067337","1","5068171","","2011-02-21 14:49:09","0","2137","<p>I am calling takePicture() on my camera object while showing a preview of what is being taken using a surfaceView. I want to be able to call takePicture() without the preview screen freezing with a snapshot of what has just been taken. How can I disable this and keep the preview running in the background?</p>","400406","","","","","2011-06-07 08:36:32","Disable Camera Snapshot after calling Camera.takePicture Android","<android><camera><preview><android-camera>","2","0","","",""
"5067461","1","","","2011-02-21 14:59:25","2","5112","<p>I am trying to develop a simple android map application. the code runs fine as long as i am extending ""Activity"". The moment i change it to ""MapActivity"", do the necessary imports and run the emulator again. My app fails to start. I have searched a lot, but there seems to be no answer for this problem. Please suggest what to do?</p>","626798","","","","","2014-04-04 14:34:48","Somehow my activity can not extend MapActivity, why?","<android>","6","3","1","",""
"5067584","1","5067606","","2011-02-21 15:09:24","0","586","<p>I'm working on a stopwatch style app that might be running for hours at a time. While debugging, I ran it overnight on my phone only to find that the app was released sometime during the night, and found in the morning it was not running like I'd hoped it would be. </p><p>In order to be more efficient, I keep track of what time the stopwatch was started and I only update the display while the app is visible. <code>onPause()</code> my timer thread (the one updating my UI) suspends and <code>onResume()</code> I resume the thread. This means while my app is backgrounded, nothing is happening and it gets flagged to be closed when left on for a long period of time.</p><p>In hopes of my app becoming more persistent, can I just put up an Ongoing Notification while the stopwatch is ticking?</p><p>Some may say that if my app isn't doing anything then it should close. As true as that appears to be, it's inherently keeping track of time. Even if that means it's not actively doing anything, it's waiting for the user to stop keeping track of time. I do not want the ongoing notification to simply keep my app alive, but also to remind the user that they're monitoring time with it.</p><p>If an Ongoing Notification won't keep my app persistent, what light-weight alternatives do I have?</p>","160527","","","","","2011-02-21 15:11:43","Will an Ongoing Notification keep my app alive?","<android><android-notifications>","1","1","","",""
"5067641","1","5082843","","2011-02-21 15:15:20","3","4279","<p>I'd like to clear selected items when the total came to three items selected, I am doing as follows but is not working ...</p><pre><code>        AlertDialog.Builder builder = new AlertDialog.Builder(this);        builder.setTitle(getResources().getText(R.string.escolhaArquivosBaixados));                 builder.setMultiChoiceItems(items, selected, new DialogInterface.OnMultiChoiceClickListener() {            @Override            public void onClick(DialogInterface dialog, int which, boolean isChecked) {                //                                  int count = 0;                                  for(int i = 1; i &lt; selected.length; i++){                    //                    if (selected[i]){                        count++;                    }                    if (count == 3){                        //enter here but nothing happens                        ((AlertDialog) dialog).getListView().setItemChecked(which, false);                           break;                    }                }                               }        });</code></pre>","532567","","","","","2011-02-22 19:23:52","How uncheck items in AlertDialog (setMultiChoiceItems)?","<java><android>","2","0","0","",""
"5067657","1","5098516","","2011-02-21 15:16:30","12","8535","<p>I came across code at </p><h1>HelloGallery Example</h1><p><strong>ImageAdapter.java</strong> - <a href=""http://developer.android.com/resources/tutorials/views/hello-gallery.html"">http://developer.android.com/resources/tutorials/views/hello-gallery.html</a></p><pre><code>TypedArray a = obtainStyledAttributes(R.styleable.HelloGallery);mGalleryItemBackground = a.getResourceId(        R.styleable.HelloGallery_android_galleryItemBackground, 0);a.recycle();</code></pre><hr><p><strong>attrs.xml</strong> - <a href=""http://developer.android.com/resources/tutorials/views/hello-gallery.html"">http://developer.android.com/resources/tutorials/views/hello-gallery.html</a></p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;resources&gt;    &lt;declare-styleable name=""HelloGallery""&gt;        &lt;attr name=""android:galleryItemBackground"" /&gt;    &lt;/declare-styleable&gt;&lt;/resources&gt;</code></pre><p>and also code at :</p><h1>Snake Game Example</h1><p><strong>TileView.java</strong> - <a href=""http://developer.android.com/resources/samples/Snake/src/com/example/android/snake/TileView.html"">http://developer.android.com/resources/samples/Snake/src/com/example/android/snake/TileView.html</a></p><pre><code>TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.TileView);mTileSize = a.getInt(R.styleable.TileView_tileSize, 12);a.recycle();</code></pre><hr><p><strong>attrs.html</strong> - <a href=""http://developer.android.com/resources/samples/Snake/res/values/attrs.html"">http://developer.android.com/resources/samples/Snake/res/values/attrs.html</a></p><pre><code>&lt;resources&gt;  &lt;declare-styleable name=""TileView""&gt;    &lt;attr name=""tileSize"" format=""integer"" /&gt;  &lt;/declare-styleable&gt;&lt;/resources&gt;</code></pre><hr><ol><li>May I know why they need to get the integer value from XML? Why don't they just code <code>mGalleryItemBackground = 0;</code> and <code>mTileSize = 12;</code>? My guess is that, they want to able to change something without touching Java code. But, I do not see any value being specified explicitly in the XML file itself. <strong>A code example to demonstrate the purpose of TypedArray and context.obtainStyledAttributes is very much appreicated.</strong></li><li>Both are trying to read an integer. Why one of the example is using <code>getResourceId</code> technique, another is using <code>getInt</code> technique?</li><li>I refer to <a href=""http://developer.android.com/reference/android/content/res/TypedArray.html"">TypedArray JavaDoc</a>, but I can hardly understand what <code>recycle</code> does?</li></ol><blockquote>  <p>Give back a previously retrieved  StyledAttributes, for later re-use.</p></blockquote>","72437","","72437","","2011-02-24 15:40:01","2011-02-24 15:40:01","Usage of TypedArray in Android Application","<android>","2","0","5","",""
"5067675","1","","","2011-02-21 15:18:07","9","21294","<p>I noticed today that when I created my first AVD </p><pre><code>android create avd --target 2 --name my_avd</code></pre><p>that the default location was not in my Eclipse or SDK homes but rather in c:\Documents and Settings\username.android\avd</p><p>How can I edit this path???  The last thing I want is my AVD in a location like that.  Code is shared between Linux and Windows based developers and opening the project (because of settings in Run | Run Configurations | Target) causes errors because the AVD(s) cannot be found.  </p><p>Again, how can I edit where an AVD is stored?  Windows | Preferences | Android doesn't have anything either.</p><p>Thanks!!!</p>","494294","","","","","2013-06-27 07:46:51","How do I change the default location of an Android AVD?","<android><android-emulator>","2","0","","",""
"5067677","1","5071696","","2011-02-21 15:18:24","1","4075","<p>I keep getting NullPointerException errors when I try to populate an <code>ImageSwitcher</code> with a resource. It is called using a <code>WeakReference</code> from within an <code>AsyncTask</code>, during the <code>onPreExecute()</code>:</p><pre><code>if (imageSwitcherReference != null) {                ImageSwitcher imageSwitcher = imageSwitcherReference.get();                if (imageSwitcher != null) {                    imageSwitcher.setImageResource(R.drawable.receta_nofoto);                }            }</code></pre><p>Here's the pre stacktrace:</p><pre><code>02-21 16:13:10.639: ERROR/AndroidRuntime(4274): java.lang.NullPointerException02-21 16:13:10.639: ERROR/AndroidRuntime(4274):     at android.widget.ImageSwitcher.setImageResource(ImageSwitcher.java:41)02-21 16:13:10.639: ERROR/AndroidRuntime(4274):     at com.paravegetarianos.motores.DescargadorImagenes.onPreExecute(DescargadorImagenes.java:90)02-21 16:13:10.639: ERROR/AndroidRuntime(4274):     at android.os.AsyncTask.execute(AsyncTask.java:391)02-21 16:13:10.639: ERROR/AndroidRuntime(4274):     at com.paravegetarianos.FotosGaleria.seleccionarImagen(FotosGaleria.java:57)02-21 16:13:10.639: ERROR/AndroidRuntime(4274):     at com.paravegetarianos.FotosGaleria.access$0(FotosGaleria.java:53)02-21 16:13:10.639: ERROR/AndroidRuntime(4274):     at com.paravegetarianos.FotosGaleria$1.onItemSelected(FotosGaleria.java:43)02-21 16:13:10.639: ERROR/AndroidRuntime(4274):     at android.widget.AdapterView.fireOnSelected(AdapterView.java:864)02-21 16:13:10.639: ERROR/AndroidRuntime(4274):     at android.widget.AdapterView.access$200(AdapterView.java:42)02-21 16:13:10.639: ERROR/AndroidRuntime(4274):     at android.widget.AdapterView$SelectionNotifier.run(AdapterView.java:830)02-21 16:13:10.639: ERROR/AndroidRuntime(4274):     at android.os.Handler.handleCallback(Handler.java:587)02-21 16:13:10.639: ERROR/AndroidRuntime(4274):     at android.os.Handler.dispatchMessage(Handler.java:92)02-21 16:13:10.639: ERROR/AndroidRuntime(4274):     at android.os.Looper.loop(Looper.java:123)02-21 16:13:10.639: ERROR/AndroidRuntime(4274):     at android.app.ActivityThread.main(ActivityThread.java:4627)02-21 16:13:10.639: ERROR/AndroidRuntime(4274):     at java.lang.reflect.Method.invokeNative(Native Method)02-21 16:13:10.639: ERROR/AndroidRuntime(4274):     at java.lang.reflect.Method.invoke(Method.java:521)02-21 16:13:10.639: ERROR/AndroidRuntime(4274):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:858)02-21 16:13:10.639: ERROR/AndroidRuntime(4274):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)02-21 16:13:10.639: ERROR/AndroidRuntime(4274):     at dalvik.system.NativeStart.main(Native Method)</code></pre><p>It also turns into a NullPointerException when trying to set the Drawable with a BitmapDrawable I created just a second before.</p><pre><code>if (imageSwitcherReference != null) {                ImageSwitcher imageSwitcher = imageSwitcherReference.get();                if (imageSwitcher != null) {                    BitmapDrawable bm = new BitmapDrawable(result);                    imageSwitcher.setImageDrawable(bm);                }            }</code></pre><p>Where result is a Bitmap caught in the <code>onPostExecute()</code> step. The moment I call the AsyncTask is when onItemSelectedListener(), when building a Gallery:</p><pre><code>    galeria.setOnItemSelectedListener(new OnItemSelectedListener() {        @Override        public void onItemSelected(AdapterView&lt;?&gt; arg0, View arg1,                int arg2, long arg3) {            seleccionarImagen(arg2);        }        @Override        public void onNothingSelected(AdapterView&lt;?&gt; arg0) {            seleccionarImagen(0);        }    });</code></pre><p>where galeria is the Gallery, and <code>seleccionarImagen(int)</code> gets the image index and calls the AsyncTask.</p><p>And here's the post stacktrace (after commenting the error line):</p><pre><code>02-21 16:04:42.849: ERROR/AndroidRuntime(4201): FATAL EXCEPTION: main02-21 16:04:42.849: ERROR/AndroidRuntime(4201): java.lang.NullPointerException02-21 16:04:42.849: ERROR/AndroidRuntime(4201):     at android.widget.ImageSwitcher.setImageDrawable(ImageSwitcher.java:55)02-21 16:04:42.849: ERROR/AndroidRuntime(4201):     at com.paravegetarianos.motores.DescargadorImagenes.onPostExecute(DescargadorImagenes.java:66)02-21 16:04:42.849: ERROR/AndroidRuntime(4201):     at com.paravegetarianos.motores.DescargadorImagenes.onPostExecute(DescargadorImagenes.java:1)02-21 16:04:42.849: ERROR/AndroidRuntime(4201):     at android.os.AsyncTask.finish(AsyncTask.java:417)02-21 16:04:42.849: ERROR/AndroidRuntime(4201):     at android.os.AsyncTask.access$300(AsyncTask.java:127)02-21 16:04:42.849: ERROR/AndroidRuntime(4201):     at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:429)02-21 16:04:42.849: ERROR/AndroidRuntime(4201):     at android.os.Handler.dispatchMessage(Handler.java:99)02-21 16:04:42.849: ERROR/AndroidRuntime(4201):     at android.os.Looper.loop(Looper.java:123)02-21 16:04:42.849: ERROR/AndroidRuntime(4201):     at android.app.ActivityThread.main(ActivityThread.java:4627)02-21 16:04:42.849: ERROR/AndroidRuntime(4201):     at java.lang.reflect.Method.invokeNative(Native Method)02-21 16:04:42.849: ERROR/AndroidRuntime(4201):     at java.lang.reflect.Method.invoke(Method.java:521)02-21 16:04:42.849: ERROR/AndroidRuntime(4201):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:858)02-21 16:04:42.849: ERROR/AndroidRuntime(4201):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)02-21 16:04:42.849: ERROR/AndroidRuntime(4201):     at dalvik.system.NativeStart.main(Native Method)</code></pre><p>Can you find any (I bet it will be a really stupid and obvious mistake) problem with this code? Thanks to all.</p><p>PS: The error lines (66 and 90) are where setImageDrawable and setImageResource are called. If you think that more code is needed, please tell me and I'll append it.</p>","616225","","616225","","2013-03-06 10:00:46","2013-03-06 10:00:46","NullPointerException when setImageDrawable and setImageResource in an ImageSwitcher","<android><nullpointerexception>","1","0","","",""
"5067681","1","5072731","","2011-02-21 15:18:59","13","2975","<p>As a Java developer I've become accustomed to having dependency injection available in applications.  For Android though, I am especially wary of performance.  What are the performance implications for using Guice in an Android app?  I assume there is some overhead, but is it significant enough that I should avoid using Guice?</p><p>My use of it would likely just be to inject a few shared objects into various activities.</p>","605331","","13792","","2011-02-21 16:26:21","2013-11-09 22:26:36","Guice Performance on Android","<java><android><dependency-injection><guice>","3","3","2","",""
"5067717","1","5068036","","2011-02-21 15:22:49","2","173","<p>I'd like to find some examples, of how to implement a scrollable tab bar as found in the htc's desk clock app as seen below</p><p><img src=""http://i.stack.imgur.com/2qzDW.jpg"" alt=""Widget""></p><p>Not sure what I should be looking for though? What's it called?</p>","564045","","564045","","2011-02-21 15:33:31","2011-02-21 15:49:41","Desk clock scrollable tab bar - what's it called?","<java><android><widget>","1","0","1","",""
"5067797","1","5068082","","2011-02-21 15:29:07","0","548","<p>i am trying to perform an action where i can access and tag images stored in the sd-card from my application based on certain actions. i would like to know the best way to temporary store the image path or the images, so that the application always remembers the set tagged images when ever it gets restarted(so the user does not have to do it all over again) and the images are still available on the sdcard when the application gets deleted or uninstalled. </p><p>should i use a content provider or the applications cache?.. Any other solution is highly appreciated. </p>","479908","","","","","2011-02-21 15:54:25","Content Providers or Application Cache directory for storing image path","<android>","1","0","","",""
"5067930","1","5068223","","2011-02-21 15:41:25","0","937","<p>HiI am developing a contact based application in that i want get the email id from the contacts to my application</p><p>I am developing the application for android 1.6</p><p>Please any on help me to do that.Thanks in advance</p>","609050","","","","","2011-02-21 16:07:26","How to get the email id from contacts in android 1.6?","<android><contacts>","2","1","1","",""
"5068068","1","5071491","","2011-02-21 15:53:14","2","1908","<p>Some .wav file I cant play with soundpool. i cant hear anything. Some file plays just fine. Why?</p><p>code </p><pre><code>    AudioManager mgr = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);    int streamVolume = mgr.getStreamVolume(AudioManager.STREAM_MUSIC);    soundPool.play(soundPoolMap.get(sound), streamVolume, streamVolume, 1, 0, 1f);</code></pre>","472537","","","","","2011-02-21 21:30:11","Android Cant play some wav file with soundpool?","<android><audio>","1","4","","",""
"5068108","1","","","2011-02-21 15:56:56","1","2902","<p>What I want to do it's to show the crop box, but with a maximum size. Something like that:</p><pre><code>    Intent intent = new Intent();    intent.setType(""image/*"");    intent.putExtra(""crop"", ""true"");    intent.putExtra(""max-width"", 30);    intent.putExtra(""max-height"", 30);    intent.setAction(Intent.ACTION_GET_CONTENT);    startActivityForResult(Intent.createChooser(intent,            ""Select Picture""), IMAGE_SELECTED);</code></pre>","569855","","","","","2013-06-06 07:49:04","Select and crop with a maximum size in android","<android><image><android-intent><crop>","2","1","1","",""
"5068115","1","5068164","","2011-02-21 15:57:22","2","4328","<p>Im using the ""SharedPreferences"" in my app to retain the ability to save/retrieve string values from multiple edittext boxes, and thats working just fine. I also have a Spinner in my activity with a string-array for it's usable values. But I am unclear on how to write the spinners selection to the SharedPreferences, then read the SharedPreferences later to retireve and set it's value.</p><p>Here is the configuration I have for the edittext's:</p><p>-Button to activate save values to SharedPreferences-</p><pre><code>public void buttonSaveSendClick(View view) {    SharedPreferences.Editor editor = getPreferences(0).edit();    EditText editTextCallId = (EditText) findViewById(R.id.editTextCallId);    editor.putString(""editTextCallIdtext"", editTextCallId.getText().toString());    editor.putInt(""selection-startCallId"", editTextCallId.getSelectionStart());    editor.putInt(""selection-endCallId"", editTextCallId.getSelectionEnd());    editor.commit();}</code></pre><p>-Button to activate restore last saved values from SharedPreferences-</p><pre><code>public void buttonRestoreLastClick(View view) {    SharedPreferences prefs = getPreferences(0);     EditText editTextCallId = (EditText) findViewById(R.id.editTextCallId);    String editTextCallIdtextrestored = prefs.getString(""editTextCallIdtext"", null);    editTextCallId.setText(editTextCallIdtextrestored, EditText.BufferType.EDITABLE);    int selectionStartCallId = prefs.getInt(""selection-startCallId"", -1);    int selectionEndCallId = prefs.getInt(""selection-endCallId"", -1);    editTextCallId.setSelection(selectionStartCallId, selectionEndCallId);}</code></pre><p>Any suggestions on how to construct the collection of the spinner's selected value in the first button (save)?  Then how to return that saved value to the spinners view on press of the ""restore"" button?</p>","621597","","621597","","2011-02-21 16:09:27","2012-01-30 02:03:39","Spinner Selection - Save to SharedPreferences, then Retrieve","<android>","1","0","2","",""
"5068251","1","6492478","","2011-02-21 16:09:05","20","12107","<p>I'm developing apps for Android and using Proguard to obfuscate the code.</p><p>Currently i'm using ProGuard configurations:</p><pre><code>-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</code></pre><p>To maintain custom components names that are used on layouts XML:</p><pre><code>-keep public class custom.components.**</code></pre><p>To remove debug logs:</p><pre><code>-assumenosideeffects class android.util.Log {    public static *** d(...);    public static *** v(...);}</code></pre><p>To avoid changing names of methods invoked on layout's onClick:</p><pre><code>-keepclassmembers class * { public void onClickButton1(android.view.View); public void onClickButton2(android.view.View); public void onClickButton3(android.view.View);}-keepclasseswithmembernames class * {    native &lt;methods&gt;;}-keepclasseswithmembernames class * {    public &lt;init&gt;(android.content.Context, android.util.AttributeSet);}-keepclasseswithmembernames class * {    public &lt;init&gt;(android.content.Context, android.util.AttributeSet, int);}-keepclassmembers enum * {    public static **[] values();    public static ** valueOf(java.lang.String);}-keep class * implements android.os.Parcelable {  public static final android.os.Parcelable$Creator *;}</code></pre><p>The question is (are): </p><p>Are any other tags recommended? Why and what for?</p><p>It's possible to make a comment on a proguard.cfg file? I would like to have it with comments for what some lines are doing so that other developers don't have doubts about why i added.</p><p>Also in proguard, is it possible to maintain the comment header of a file (with the copyright)? If it's not, or it's not a good policy where should i add the copyright? </p>","327011","","","","","2014-01-23 12:13:10","Android: What are the recommended configurations for Proguard?","<android><proguard>","3","0","23","",""
"5068284","1","5068472","","2011-02-21 16:11:51","4","4735","<p>I'm trying to cache Drawable objects that are included in a listview:</p><p>I have the following inside the Adapter:</p><pre><code>private final ImageThreadloader imageloader=new ImageThreadloader();public View getView(int position, View convertView, ViewGroup parent)    {        View row=convertView;        ViewWrapper wrapper=null;        Activity activity=(Activity)getContext();        RssItem item=getItem(position);        if (row == null) {            LayoutInflater inflater=activity.getLayoutInflater();            row=inflater.inflate(R.layout.row,null);            wrapper=new ViewWrapper(row);            row.setTag(wrapper);        }        else        {            wrapper=(ViewWrapper)row.getTag();        }        wrapper.getTitle().setText(item.getTitle());        String cleaned=item.getDescription().replaceAll(""\\&lt;.*?\\&gt;"", """");        int Long=cleaned.length();        if (Long&lt;=100)        {            wrapper.getDescription().setText(cleaned);        }        else wrapper.getDescription().setText(cleaned.substring(0, 50)+""..."");        String laurl=item.getImageUrl();        if (laurl!="""")         {             imageloader.loadImage(laurl, (ImageView)wrapper.getImage());        }        else         {            wrapper.getImage().setImageResource(R.drawable.icon);        }        return row;    }    static class ViewWrapper {        private View base;        private TextView title=null;        private TextView description=null;        private ImageView icono=null;        ViewWrapper (View base) {            this.base=base;        }        public TextView getTitle() {            if (title==null) {                title=(TextView)base.findViewById(R.id.TitleText);            }            return title;        }        public TextView getDescription() {            if (description==null) {                description=(TextView)base.findViewById(R.id.DescriptionText);            }            return description;        }        public ImageView getImage() {            if (icono==null) {                icono=(ImageView)base.findViewById(R.id.ImageIcon);            }            return icono;        }           }</code></pre><p>And the class ImageThreadLoad is as the following:</p><pre><code>public class ImageThreadloader  {    public void loadImage(String imageurl,ImageView imageview)     {            DrawableDownLoaderTask imagetask= new DrawableDownLoaderTask(imageview);                        imagetask.execute(imageurl);    }    public static Drawable loadImageFromUrl(String url) {        InputStream inputStream;        try {            inputStream = new URL(url).openStream();        } catch (IOException e) {            throw new RuntimeException(e);        }        return Drawable.createFromStream(inputStream, ""src"");    }    class DrawableDownLoaderTask extends AsyncTask&lt;String, Void, Drawable&gt; {        private String url;        private final WeakReference&lt;ImageView&gt; imageviewreference;              public DrawableDownLoaderTask(ImageView imageview) {            imageviewreference=new WeakReference&lt;ImageView&gt;(imageview);        }        @Override        protected Drawable doInBackground(String... params)        {            url=params[0];            Drawable drawable=loadImageFromUrl(url);            return drawable;        }        @Override        protected void onPostExecute(Drawable drawable)        {            if (isCancelled())             {                drawable=null;            }            if (imageviewreference!=null)            {                ImageView imageview=imageviewreference.get();                if (imageview!=null)                {                    imageview.setImageDrawable(drawable);                }            }        }    }}</code></pre><p>Works perfectly but it has some delay if I scroll the listview quickly. I have read several tutorials and the solution is always the same: to cache.</p><p>SO I have tried the following (changing the class that load the image in a separate thread):</p><pre><code>private final HashMap &lt;String, SoftReference &lt;Drawable&gt;&gt; imagecache= new HashMap &lt;String, SoftReference&lt;Drawable&gt;&gt;();    public void loadImage(String imageurl,ImageView imageview)     {        if (imagecache.containsKey(imageurl))        {            SoftReference&lt;Drawable&gt; drawable= imagecache.get(imageurl);            imageview.setImageDrawable(drawable.get());        }        else        {               DrawableDownLoaderTask imagetask= new DrawableDownLoaderTask(imageview);            imagetask.execute(imageurl);        }    }    class DrawableDownLoaderTask extends AsyncTask&lt;String, Void, Drawable&gt; {        private String url;        private final WeakReference&lt;ImageView&gt; imageviewreference;              public DrawableDownLoaderTask(ImageView imageview) {            imageviewreference=new WeakReference&lt;ImageView&gt;(imageview);        }        @Override        protected Drawable doInBackground(String... params)        {            url=params[0];            Drawable drawable=loadImageFromUrl(url);            if (drawable!=null) imagecache.put(url, new SoftReference&lt;Drawable&gt;(drawable));            return drawable;        }        @Override        protected void onPostExecute(Drawable drawable)        {            ImageView imageview=imageviewreference.get();            imageview.setImageDrawable(drawable);        }    }</code></pre><p>Every seems to work fine but when i scroll images start to disapperar in some rows.Something wrong?Any tool to help me to solve this issues?</p><p>Thanks in advance</p>","557518","","","","","2013-04-20 19:34:50","android: caching drawable elements for performance","<android><image><caching><listview>","1","0","4","",""
"5068305","1","","","2011-02-21 16:13:24","3","2291","<p>I get an error when I try set a value for property with name >= 32 characters</p><pre><code>adb shell setprop 01234567890123456789012345678901 VALUE</code></pre><p>Error:    </p><pre><code>could not set property</code></pre><p>This works fine</p><pre><code>adb shell setprop 0123456789012345678901234567890 VALUEadb shell getprop 0123456789012345678901234567890VALUE</code></pre><p>Is there any way to set properties with longer names?</p>","62192","","","","","2011-02-21 16:57:51","How can I overcome the property length limitation of the ""adb shell setprop""","<android><properties>","1","0","1","",""
"5068315","1","5098988","","2011-02-21 16:14:24","2","778","<p>I've getting a real problem trying to deal with multi-touch events. Basically I need to detect if someone has released a finger while touching the screen elsewhere.</p><p>According to <a href=""http://stackoverflow.com/questions/4268426/android-difference-between-action-up-and-action-pointer-up"">this</a> previously answered question, I should be using MotionEvent.ACTION_POINTER_UP MotionEvent.ACTION_UP.</p><p>As far as I can tell, the following code should tell me if a finger has been lifted:</p><pre><code>    int action = event.getActionMasked();    mCurUp = ( action == MotionEvent.ACTION_UP ) || ( action == MotionEvent.ACTION_POINTER_UP );</code></pre><p>What I am seeing in practice, is that this works <em>some</em> of the time. If I am really careful I can hold my left finger on the screen and lift my right finger and no events are fired at all! Usually at some point my left finger will wobble, generating a *ACTION_MOVE* event. At this point it generates an event (262) which I think correlates to *ACTION_POINTER_UP*</p><p>So I'm wondering if any other folks have seen this, and I also suspect it might be the notoriously poor touchscreen on my HTC Desire causing this. Or perhaps I am doing something fundamentally wrong. Does anyone have some tested code that can <em>reliably</em> detect lifting either finger from the touchscreen?</p>","465286","","465286","","2011-02-22 00:10:28","2012-06-27 18:55:51","Android multi-touch headaches","<android><touchscreen>","2","0","","",""
"5068349","1","","","2011-02-21 16:17:11","1","1784","<p>I'm very newbie in Android world and I have to write an streaming video quality checker application on Android. I have to use the native StageFright media framework to play videos. As far as I understand there is an native API of render statistics, but I need advice how I can get it. Thank you.</p>","626919","","","","","2012-11-27 19:49:13","How can I get rendered frames statistics (drawn/dropped) from StageFright Media Framework?","<android><video><stagefright>","2","0","","",""
"5068379","1","5068436","","2011-02-21 16:20:11","0","831","<p>I'm trying to take an image, optimize it as a 65% jpeg and save it to the phones storage.The code below is working fine for me on my nexus one, but is returning a null pointer exception on the last line.</p><p>Any idea what I'm doing wrong?Thanks</p><pre><code>// image passed in from cameraBitmap bm = BitmapFactory.decodeFile(selectedImagePath, opts);// create outputFileOutputStream fileOutputStream = null;// create filename &amp; directoryString nameFile = ""ms"" + String.valueOf(System.currentTimeMillis())+ "".jpg"";String directory = ""/DCIM/MySeats/"";// try creating the directories if they don't already exist         File file = new File(Environment.getExternalStorageDirectory(),directory);file.mkdirs();// prep outputfileOutputStream = new FileOutputStream(Environment.getExternalStorageDirectory().toString()+ directory + nameFile);optimizedImagePath = Environment.getExternalStorageDirectory().toString()+ directory + nameFile;// write file through a buffered streamBufferedOutputStream bos = new BufferedOutputStream(fileOutputStream);// This line causes a null pointer exception on some phones?// What am I missing?bm.compress(CompressFormat.JPEG, 65, bos);</code></pre>","401183","","","","","2011-02-21 18:22:52","android: nullpointer when saving images","<android><nullpointerexception><fileoutputstream>","2","3","","",""
"5068610","1","","","2011-02-21 16:39:51","3","1993","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/541966/android-how-do-i-do-a-lazy-load-of-images-in-listview"">Android - How do I do a lazy load of images in ListView</a>  </p></blockquote><p>I have been trying to figure this out for a few days but I can't seem to wrap my mind around the process. My app access a number of images from a server. As of now, it is setup to load 1 image at a time and display it. When the user hits the next button, the next image is then loaded and displayed. But the loading time is a little too long. What can be done to improve the load time of the next image?</p><p>I have been playing around with threads and AsyncTask. My idea was to keep the previous and next images in memory too. When the user hits next, I do the following:</p><pre><code>prevImage = currentImage;currentImage = nextImage;nextImage = getBitmapfromURL(urlPath);</code></pre><p>And the nextImage is actually executed in the AsyncTask or Thread. My problem with this is if the user hits the next button before that thread is completed (which simply shows a blank image). So I'm not sure if that's the way to go. Is there another way to improve the load time of these images? Any ideas would be appreciated.</p>","469194","","","","","2011-04-30 10:51:26","How to handle Loading Images in Android","<android><download><bitmap>","1","5","","2012-05-22 12:30:54",""
"5068648","1","","","2011-02-21 16:43:49","0","191","<p>I have a TabHost->LinearLayout->Framelayout (all with the attribute android:layout_width=""fill_parent"")</p><p>In turn, the view contained in the FrameLayout is such that: ScrollView->HorizontalScrollView->TableLayout ,again all of them with the attribute android:layout_width=""fill_parent"".</p><p>So why when I go landscape the view uses about 60% of the screen's width ?</p><p>Maybe such hierarchy of objects is not recommended ?</p><p>Thanks in advance.</p>","253944","","253944","","2011-02-21 17:07:31","2012-02-23 04:45:24","View width problem when going landscape","<android><view><width><landscape>","1","2","","",""
"5068668","1","6172078","","2011-02-21 16:45:26","5","7998","<p>Friends,</p><p>I am trying to write a application which use checkbox in ExpandableListView, I got a problem here which is maintaining checkbox state of the application, I got the example from <a href=""http://mylifewithandroid.blogspot.com/2010/02/expandable-lists-and-check-boxes.html"">here</a> , my problem is maintaining checked state of the checkboxes, whenever I check one of the checkboxes and Expand the List, the checkboxes do not have the checked state where they supposed to have. I have try to maintain by adding ArrayList to store the position of the store and reload the position in getChildView() but still not achieve what I want to do. here is my code </p><pre><code>public class ElistCBox extends ExpandableListActivity {    private static final String LOG_TAG = ""ElistCBox"";    ArrayList&lt;String &gt; chkState = new ArrayList&lt;String&gt;();    static final String colors[] = {""grey"",""blue"",""yellow"",""red""};    static final String shades[][] ={ { ""lightgrey"",""#D3D3D3"",""dimgray"",""#696969"", ""sgi &gt;gray 92"",""#EAEAEA""},        { ""dodgerblue 2"",""#1C86EE"",""steelblue &gt;2"",""#5CACEE"",""powderblue"",""#B0E0E6""},        { ""yellow 1"",""#FFFF00"", ""gold 1"",""#FFD700"",""darkgoldenrod 1"","" #FFB90F"" },        {""indianred 1"",""#FF6A6A"", ""firebrick 1"",""#FF3030"", ""maroon"",""#800000"" } };    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle icicle)    {        super.onCreate(icicle);        setContentView(R.layout.main);         SimpleExpandableListAdapter expListAdapter = new SimpleExpandableListAdapter(             this,            createGroupList(),            R.layout.group_row, new String[] { ""colorName"" },            new int[] { R.id.childname }, createChildList(),            R.layout.child_row,            new String[] { ""shadeName"", ""rgb"" },            new int[] { R.id.childname, R.id.rgb }        ) {             @Override public View getChildView(final int groupPosition, final int childPosition, boolean isLastChild, View convertView, ViewGroup parent)            {                final View v = super.getChildView(groupPosition, childPosition, isLastChild, convertView, parent);                final CheckBox chkColor = (CheckBox)v.findViewById(R.id.check1);                if(chkState.contains(groupPosition+"",""+childPosition)){                    chkColor.setChecked(true);                }else{                    chkColor.setChecked(false);                }                chkColor.setOnClickListener(new OnClickListener() {                    @Override                    public void onClick(View v) {                        Log.e(""Checkbox Onclick Listener"", Integer.toString(groupPosition) + "" - "" + Integer.toString(childPosition));                    }                });                chkColor.setOnCheckedChangeListener(new OnCheckedChangeListener() {                    @Override                    public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {                        Log.e(""Checkbox check change Listener"", Integer.toString(groupPosition) + "" - "" + Integer.toString(childPosition));                        if(chkColor.isChecked()){                            chkState.add(groupPosition+"",""+childPosition);                        } else {                            chkState.remove(groupPosition+"",""+childPosition);                         }                    }                });                return super.getChildView(groupPosition, childPosition, isLastChild, convertView, parent);            }        };        setListAdapter( expListAdapter );    }    public void onContentChanged  () {        super.onContentChanged();        Log.e( LOG_TAG, ""onContentChanged"" );    }    public boolean onChildClick(            ExpandableListView parent,             View v,             int groupPosition,            int childPosition,            long id) {        Log.e( LOG_TAG, ""onChildClick: ""+childPosition );        CheckBox cb = (CheckBox)v.findViewById( R.id.check1 );        if( cb != null )        cb.toggle();        return false;    }    public void  onGroupExpand  (int groupPosition) {        Log.e( LOG_TAG,""onGroupExpand: ""+groupPosition );    }    private List createGroupList() {        ArrayList result = new ArrayList();        for( int i = 0 ; i &lt; colors.length ; ++i ) {            HashMap m = new HashMap();            m.put( ""colorName"",colors[i] );            result.add( m );        }        return (List)result;     }    private List createChildList() {        ArrayList result = new ArrayList();        for( int i = 0 ; i &lt; shades.length ; ++i ) {            ArrayList secList = new ArrayList();            for( int n = 0 ; n &lt; shades[i].length; n += 2 ) {                HashMap child = new HashMap();                child.put( ""shadeName"", shades[i][n] );                child.put( ""rgb"", shades[i][n+1] ); secList.add( child );            }            result.add( secList );        }         return result;    }}</code></pre>","488553","","329993","","2011-03-24 20:34:31","2014-01-22 20:45:26","Android ExpandableListView with Checkbox, Controlling checked state","<android><checkbox><expandablelistview>","3","1","","",""
"5068711","1","5069259","","2011-02-21 16:48:30","2","3022","<p>how can i display pound and euro symbol in TextView?</p><p>need help!</p><p>Thanks.</p>","309990","","","","","2011-02-21 17:37:38","how we can display pound and euro symbol in android TextView?","<android>","1","0","2","",""
"5068741","1","7040737","","2011-02-21 16:51:02","3","237","<p>Say you have a view that is a circle or a balloon and you want have two layers of onClick or onTap capturing.</p><p>For example a mapView with a balloon over top. </p><p>The image has transparency to it on the left and right of the spike. Does anyone know of a way to cut out this transparency to not absorb the onClick and let it pass through to the mapview instead?</p>","568508","","","","","2011-08-12 13:26:08","Cut out transparency of a view to not capture onclick?","<android>","1","0","","",""
"5068783","1","5070820","","2011-02-21 16:54:29","1","488","<p>When I got an incoming call then I have to <strong>immediately</strong> interrupt my long running thread. I want to use Thread.interrupt() method to do that.</p><p>Reference says:</p><pre><code>Threads blocked in an I/O operation of an InterruptibleChannel will have their interrupt status set and receive an ClosedByInterruptException. Also, the channel will be closed.</code></pre><p>In my thread I'm downloading a file via HTTP, so I want to use InterruptibleChannel in order to immediately stop downloading. Could you give me some source code, how to download a file using InterruptibleChannel?</p><p>this solution is not okay for me, because Thread.interrupt() doesn't interrupt blocking IO:</p><pre><code>while ((length = httpIn.read(buffer)) &gt; 0) {       if(Thread.interrupted())          ....       else       {            fileOut.write(buffer, 0, length);            fileSize += length;       }}</code></pre>","413505","","","","","2011-02-21 20:18:33","how to download file using interruptiblechannel? (NIO)","<java><android>","1","1","","",""
"5069008","1","5069052","","2011-02-21 17:14:04","8","16464","<p>Which is the best way to have a multilanguage app?Should I create a set of strings written in my language and then use an google api that translates online on-the-fly? Any code example? And, how to get the language of the user and how to pass this information to the api?</p>","489146","","1401895","","2013-03-27 13:57:47","2013-03-27 13:57:47","multilanguage app: best way?","<android><localization><android-resources>","4","2","6","2012-08-05 13:26:24",""
"5069105","1","","","2011-02-21 17:22:52","1","948","<p>I have a linear layout and an associated activity.  In my view there is an edit box and a bunch of buttons.  When i start the application, focus goes immediately to the edit box and the soft keyboard comes up.  Is there a way to avoid this so that it just comes up with nothing selected and no soft keyboard popping up?  I have tried findViewById().clearFocus() and requestFocus() on different views, but nothing seems to work.</p>","306517","","","","","2011-02-21 17:31:07","change what item has focus on startup","<android><layout><view><focus>","1","0","","",""
"5069270","1","5069812","","2011-02-21 17:39:11","1","404","<p>I was working on video player, where I get frames as bitmaps. Just wondering how can I stream the bitmaps continuously without using while loop. Are there any samples?</p>","574911","","574911","","2011-02-23 20:06:57","2011-02-23 20:06:57","rendering bitmaps using canvas","<android><bitmap><android-ndk><android-video-player>","1","1","","",""
"5069387","1","5069441","","2011-02-21 17:52:27","1","1572","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/4203447/how-to-add-jar-file-to-android-application"">how to add jar file to android application?</a>  </p></blockquote><p>I am new to Android development. I have ksoap2.jar file. I want to add it to my existing android project. I using command line android to create the project and ant to build it.</p><p>In which folder I should put this jar file and how to use it?</p><p>Thanks</p>","461537","","","","","2011-02-21 18:06:03","Adding jar library to android project","<android>","1","0","","2012-05-18 11:52:44",""
"5069463","1","","","2011-02-21 18:00:04","7","2516","<p>I have made an app using JQtouch, Jquery, and PhoneGap. When you type in a form's field, the entire page scrolls up or down each time you enter a character. I have searched everywhere for solutions but cannot find one. There was a similar problem here: <a href=""https://github.com/jquery/jquery-mobile/issues/638"">https://github.com/jquery/jquery-mobile/issues/638</a>but his solution did not solve my issue. </p><p>Does anyone have an idea why the page would scroll up and down with each added character in a textbox? Because the page is so small, it scrolls up and down quickly making it very annoying.</p>","627086","","173077","","2011-02-21 20:29:08","2013-02-03 15:44:18","Screen Scrolls while typing Using JQTouch in an Android PhoneGap app?","<jquery><android><phonegap><jqtouch>","4","2","0","",""
"5069595","1","","","2011-02-21 18:12:29","3","197","<p>I want to parse the data from RSS Feed that is password protected.. If i try to parse the data its throwing ""File not found Exception""</p><p>Here is my code:</p><pre><code>try {                DBF = DocumentBuilderFactory.newInstance();                DB = DBF.newDocumentBuilder();                url_val = new URL(""http://admin:admin@dev.quaddeals.com/university-of-illinois/androids/city.rss"");            } catch (MalformedURLException e) {                // TODO Auto-generated catch block                e.printStackTrace();            }                try {                    dom = DB.parse(url_val.openConnection().getInputStream());                } catch (SAXException e) {                    // TODO Auto-generated catch block                    e.printStackTrace();                } catch (IOException e) {                    // TODO Auto-generated catch block                    e.printStackTrace();                }                elt = dom.getDocumentElement();                NodeList items = elt.getElementsByTagName(""item"");                for (int i = 0; i &lt; items.getLength(); i++) {                    Node item = items.item(i);                    NodeList properties = item.getChildNodes();                    for (int j = 0; j &lt; properties.getLength(); j++) {                        Node property = properties.item(j);                        String name = property.getNodeName();                        if (name.equalsIgnoreCase(""title"")) {                            cityTitle = property.getFirstChild().getNodeValue();                                                        }                        if (name.equalsIgnoreCase(""id"")) {                            cityId = property.getFirstChild().getNodeValue();                        }                    }                    title.add(cityTitle);                    id.add(cityId);                }                   VALUE1 = new String[title.size()];                    Iterator&lt;String&gt; itc = title.iterator();                    while (itc.hasNext()) {                        l1++;                        VALUE1[l1] = itc.next().toString();                                     }                    VALUE2 = new String[id.size()];                    Iterator&lt;String&gt; it1c = id.iterator();                    while (it1c.hasNext()) {                        m1++;                        VALUE2[m1] = it1c.next().toString();                    }        } catch (Exception e) {        }</code></pre><p>My Log Cat shows Error as follows:</p><p>02-21 23:20:48.893: WARN/System.err(19206): java.io.FileNotFoundException: <a href=""http://dev.quaddeals.com/university-of-illinois/androids/city.rss"" rel=""nofollow"">http://dev.quaddeals.com/university-of-illinois/androids/city.rss</a></p><p>02-21 23:20:48.893: WARN/System.err(19206):     at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1064)</p><p>02-21 23:20:48.893: WARN/System.err(19206):     at com.fsp.quaddeals.DealCities$SelectDataTask_Deals.doInBackground(DealCities.java:341)</p><p>02-21 23:20:48.893: WARN/System.err(19206):     at com.fsp.quaddeals.DealCities$SelectDataTask_Deals.doInBackground(DealCities.java:1)</p><hr><p>If i enter this URL  <a href=""http://admin%3aadmin@dev.quaddeals.com/university-of-illinois/androids/city.rss"" rel=""nofollow"">Link</a></p><p>in Browser it will ask for the authentication after that it will Redirected to the Orginal RSS FEED where my Parsing data exists...</p><p>I want to parse the data in the this page.. How can i access this password protected page and parse the data?</p><p>Whether Android Supports SSL connections..</p><p>Please help me.. Thanks in Advance..</p>","555221","","","","","2011-02-21 18:12:29","Need help in accesing Authenticated URl in Android","<android>","0","0","1","",""
"5069614","1","5069833","","2011-02-21 18:15:03","3","2732","<p>after spending 2 solid days searching for an answer, I would like to ask for help about the following behaviour.</p><p>I'm trying to code a simple tabhost application on Android, with a layout per activity.I've designed my layout so that the tabwidget appears at the bottom of the screen.</p><p>On the first tab, I'm trying to insert a simple 2 lines ListView. My problem is that the ListView is well on the bottom, but half of it is hidden behind the tabwidget. I would like to understand how to make my ListView to be displayed just above the tabwidget.</p><p>Here is my main.xml : </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;RelativeLayout        android:layout_height=""fill_parent""        android:layout_width=""fill_parent""&gt;       &lt;FrameLayout            android:id=""@android:id/tabcontent""            android:layout_width=""fill_parent""            android:layout_height=""fill_parent""            android:padding=""5dp"" /&gt;       &lt;TabWidget            android:id=""@android:id/tabs""            android:layout_alignParentBottom=""true""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content"" /&gt;    &lt;/RelativeLayout&gt;&lt;/TabHost&gt;</code></pre><p>Here is my main app class : </p><pre><code>public class TestTabWidget extends TabActivity {    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        Resources res = getResources(); // Resource object to get Drawables        TabHost tabHost = getTabHost();  // The activity TabHost        TabHost.TabSpec spec;  // Resusable TabSpec for each tab        Intent intent;  // Reusable Intent for each tab        intent = new Intent().setClass(this, AActivity.class);        spec = tabHost.newTabSpec(""artists"").setIndicator(""Tab A"",                          res.getDrawable(R.drawable.ic_tab_a))                      .setContent(intent);        tabHost.addTab(spec);        tabHost.setCurrentTab(0);    }}</code></pre><p>Here is my Activity code : </p><pre><code>public class AActivity extends Activity {ListView lvListe;    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.a_layout);        lvListe = (ListView)findViewById(R.id.lvListe);        lvListe.setBackgroundResource(R.layout.tables);        String[] listeStrings = {""Value 1"",""Value 2""};        lvListe.setAdapter(new ArrayAdapter&lt;String&gt;(this, android.R.layout.simple_list_item_1,listeStrings));    }}</code></pre><p>Here is my layout for the activity : </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;ListView           android:id=""@+id/lvListe""          android:layout_height=""wrap_content""          android:layout_width=""wrap_content""          android:layout_alignParentBottom=""true"" /&gt;&lt;/RelativeLayout&gt;</code></pre><p>Thanks to anyone keen to help me I'm just going nuts....</p><p>Adam</p>","627099","","627099","","2011-02-21 18:25:30","2011-02-21 18:36:32","Tabwidget overlaps with my activity content","<android><overlap><tabwidget>","1","0","1","",""
"5069694","1","5070362","","2011-02-21 18:23:43","0","4593","<p>I know how to pass a variable from one activity to another using global variables.</p><p>e.g.In one.java:</p><pre><code>   GlobalVars.setColour(0);</code></pre><p>In two.java:</p><pre><code> if (GlobalVars.getColour() == 0) ...</code></pre><p>GlobalVariables.java:</p><pre><code> private static int colour2;    public static int getColour() {        return colour2;    }    public static void setColour(int colour) {        colour2 = colour;    }</code></pre><p>What if i have an array in one.java and i need it in another class?</p><pre><code> ArrayList&lt;String&gt; myArr = new ArrayList&lt;String&gt;();</code></pre><p>myArr is uploaded with contacts from the phone book of the phone, so it is dynamic. I need it to upload a ListView with its elements in a custom dialog class. How to pass it to another activity/dialog? </p>","571648","","","","","2011-02-23 19:51:24","Android array as global variable","<android><arrays><global-variables>","4","2","1","",""
"5069699","1","5082343","","2011-02-21 18:24:04","3","1366","<p>I would like to have following:- number keyboard should be displayed first- but it should be possible to change to text keyboard and to type some letters.</p><p>I've asked almost the same question and accepted an answer.<a href=""http://stackoverflow.com/questions/4931494/inputtype-of-edittext-in-android"">InputType of EditText in Android</a></p><p>But now I found some strange behaviour, setting <strong>InputType</strong> to <strong>Number</strong>: it is possible to change keyboard to text type, but it's impossible to type some text.</p><p>Any Ideas, why does it happen_</p><p>Does anybody know how to use <strong>TYPE_MASK_CLASS</strong> as input type?</p><p>Thank you</p>","408780","","408780","","2011-02-21 22:17:25","2011-02-22 18:37:32","InputType of EditText in Android","<android><keyboard><edittext>","1","0","0","",""
"5069765","1","5070157","","2011-02-21 18:30:35","2","2012","<p>I'd like to open a html-page in a webview and make it auto-scroll downwards automatically in accordance with an interval set through a timer.</p><p>Although below example is for desktop, this link should give you an idea what I want to achieve (enable autoscrolling in the upper right part of the page):</p><p><a href=""http://tabs.ultimate-guitar.com/b/bruce_springsteen/the_river_crd.htm"" rel=""nofollow"">example</a></p><p>First I thought about opening a webpage and then use some kind of code which would simulate/trigger DPAD-down (or Arrow-down). In Windows Mobile, I believe there was something called SendKeys but I couldn't find something similar in the Android-SDK (except for a test-SDK which I doubt I could use for publishing my app in AndroidMarket) so I guess the way mentioned above is not possible.</p><p>Another solution could perhaps be a java-script but the webpages are not created by me so I can't insert any anchor.</p><p>However, I noted that Webview has some methods called PageDown (and PageUp) which could also be a solution but I am afraid a PageDown would be too much for scrolling the way I want. I want the scrolling to be slow and smooth, more like a line at a time.</p><p>Do you have any ideas how I could implement this? I'd really appreciate your help. </p>","45402","","","","","2014-01-27 07:02:13","+Android Webview - how to autoscroll a page?","<java><android><webview><scroll>","1","0","1","",""
"5069798","1","5069920","","2011-02-21 18:33:09","0","592","<p>I'm developing an Android 2.2 application.</p><p>I have a linearlayout with a textview, a button and an ImageView.</p><p>I want to set this imageview outside of the screen and set an animation to move it from left to right.</p><p>I want to simulate a ship moving from left to right. The user will see it appears from left side of the screen and disappears from right side.</p><p>I know I can use AbsoluteLayout to set a layout_x for ImageView, but I don't want to set layout_x and layout_y for the others views (textview and button), because they are centred on the screen.</p>","68571","","","","","2011-02-21 18:45:19","Set an ImageView outside the screen with a LinearLayout","<android><imageview><android-linearlayout><android-2.2-froyo><absolutelayout>","1","3","","",""
"5069800","1","","","2011-02-21 18:33:30","2","922","<p>Any android experts could shed some light why this method could hang?</p><p>When I pause the thread and look at the stack:</p><pre><code>Thread [&lt;13&gt; Thread-15] (Suspended) DexFile.openDexFile(String, String, int) line: not available [native method]    DexFile.&lt;init&gt;(String, String, int) line: 105   DexFile.loadDex(String, String, int) line: 144  Method.invokeNative(Object, Object[], Class, Class[], Class, int, boolean) line: not available [native method]  Method.invoke(Object, Object...) line: 521  </code></pre><p>...you can see it is hanging in the native method DexFile.openDexFile, it never returns.</p><p>This is causing serious problems for an application we are writing. It happens randomly and so suggests a race condition of some sort between several threads but I connect detect and deadlocks and plus I would expect the native method to return me something, even an exception would be nice!!</p><p>Thanks in advance</p><p>I am using Android 2.2 Nexus One Device, I am deploying the application from eclipse to the device. To be sure I totally uninstall the application and re-power the device and I still see the above problem randomly.</p><p>UPDATE: I retried on an Android 2.3.3 emulator (API 10) and have the same problem. I am now convinced there is a major bug here. I have created a simple test case to show the problem. Basically I add a single dexified jar to the assets folder of an android project. On startup I copy this file to the application data area. I then kick off x threads and within each thread load this dexified jar file using DexFile.loadDex but giving a different output file name for the generated optimized dex file. If you pick x to be say 30 threads you are almost guaranteed to see several threads hang.</p><p>Just to be sure I repeated the test where each thread is given it's own unique dexified jar file. Same problem occurs.</p><p>The only LogCat output I see that may give a hint to what is going wrong:</p><p>02-23 11:59:23.097: DEBUG/dalvikvm(12598): DexOpt: sleeping on flock(/data/dalvik-cache/system@framework@core.jar@classes.dex)02-23 11:59:23.138: DEBUG/dalvikvm(12602): DexOpt: sleeping on flock(/data/dalvik-cache/system@framework@core.jar@classes.dex)02-23 11:59:23.357: DEBUG/dalvikvm(12602): DexOpt: sleeping on flock(/data/dalvik-cache/system@framework@framework.jar@classes.dex)02-23 11:59:23.419: DEBUG/dalvikvm(12598): DexOpt: sleeping on flock(/data/dalvik-cache/system@framework@framework.jar@classes.dex)02-23 11:59:23.528: DEBUG/dalvikvm(12608): DexOpt: sleeping on flock(/data/dalvik-cache/system@framework@core.jar@classes.dex)02-23 11:59:23.577: DEBUG/dalvikvm(12598): DexOpt: sleeping on flock(/data/dalvik-cache/system@framework@services.jar@classes.dex)02-23 11:59:23.698: DEBUG/dalvikvm(12606): DexOpt: sleeping on flock(/data/dalvik-cache/system@framework@core.jar@classes.dex)</p><p>The other interesting thing is, as an example I have a dexified jar file</p><p>myjar.jar   (size 5031)</p><p>Each thread that opens this dex file creates a file </p><p>myjar.jarX.dex (where X is a unique integer for each thread) (size 4152)</p><p>The threads that do not complete the DexFile.loadDex call have still managed to create a myjar.jarX.dex file but the file is of size 3496</p><p>I believe there is some form a race condition deep down in the Dalvik native code. This is a big showstopper for us. Any suggestions how best to proceed?</p>","508047","","508047","","2011-02-23 12:27:38","2011-02-23 12:27:38","DexFile.loadDex hangs","<android><dalvik><dex>","0","0","","",""
"5069901","1","","","2011-02-21 18:43:45","1","3973","<p>I tried to override the default WebChromeClient in order to get give my application's WebView the ability to open new windows. For this, as instructed in the manual, I'm overriding the 'onCreateWindow' method of WebChromeClient wherein I do the following simple logic.</p><pre><code>    public boolean onCreateWindow (WebView view, boolean dialog, boolean userGesture, Message resultMsg) {        ((WebView.WebViewTransport) resultMsg.obj).setWebView(myWebView);        Log.d(""webviewdemo"", ""from the chrome client"");        resultMsg.sendToTarget();         return true;    }</code></pre><p>But this results in the above mentioned segmentation fault. I did some search &amp; found that it's already reported at <a href=""http://code.google.com/p/android/issues/detail?id=11655"" rel=""nofollow"">http://code.google.com/p/android/issues/detail?id=11655</a>. I don't see any updates to that issue after that. Does somebody know the status of the same? </p><p>Thanks,Ashok.</p>","627137","","","","","2013-01-07 02:12:21","Overriding Android WebChromeClient's onCreateWindow method results in SIGSEGV","<android><webchromeclient>","1","0","","",""
"5069913","1","","","2011-02-21 18:44:51","2","1503","<p>I have an app and a music in all activity of my appi would like that, when user press button home, the sound stops like all game that you can download from android marketHow i can do that?When user press home button a new intent is fired but android framework prevents to catch the main intent so i can't use a broadcast receiver with this action  One solution is to stop music onPause and i restart onResume but in this solution the user hear a second pause when switching from one activity to the next, is not goodI search this solution on many forum but unsuccessfully</p><p>P.S. 1 - the android framework don't allow to catch the home key onKeyDown event2 - the android framework don't allow to catch the intent launched when user press on home button </p>","626920","","","","","2011-02-21 18:51:09","android - how i can stop sound when home button is pressed","<android><button><home>","1","0","","",""
"5069919","1","5079450","","2011-02-21 18:45:16","6","1367","<p>I've searched through android's open source code as much as I could and I haven't been able to find the implementation to the actual downloading via the DownloadManager in the 2.3 SDK. I have found the <a href=""http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/2.3.1_r1/android/app/DownloadManager.java#DownloadManager"">source for the DownloadManager</a> and the <a href=""http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/2.3.1_r1/android/provider/Downloads.java#Downloads"">source for a download class that has constants to interact with the ContentProvider</a> but I haven't been able to find the source for the <code>ContentProvider</code>.</p><p>I'm wanting to find this so that I can know a good way to implement a download of my own, since I'll be using a lesser version than 2.3 for my app.</p><p>Thanks.</p>","375490","","176769","","2011-02-21 18:49:57","2014-03-15 19:16:50","Where can I find DownloadManager's ContentProvider implementation","<android><download><content><provider><manager>","1","0","2","",""
"5069960","1","5070668","","2011-02-21 18:50:23","2","521","<p>Edit: <a href=""http://pastebin.com/YqBcQDvU"" rel=""nofollow"">here's</a> the source on PasteBin. I feel like I might need to just redesign the entire Service.. :(</p><p>I'm the developer of <a href=""https://market.android.com/details?id=com.cryclops.ringpack&amp;feature=search_result"" rel=""nofollow"">RingPack</a>. The basic idea is that there is a Service launched in the background that takes care of switching the ringtone out for the user. I'm having issues with losing my reference to an ArrayList within the Service. I think I may be misunderstanding how the lifecycle works. My intent was for it to be started whenever the user selects a pack from the Activity.</p><p><code>Intent i = new Intent(RingActivity.this, RingService.class);                    i.putExtra(RingService.ACTION, RingService.PACK_SET);                    i.putExtra(RingService.PASSED_PACK, currentPackId);                    RingActivity.this.startService(i);</code></p><p>I tell the Service to set the Default Notification Tone to the first tone of the pack corresponding to ""currentPackId"".</p><p>When the user wants to turn off RingPack, the disabling is done like so:</p><p><code>Intent i = new Intent(RingActivity.this, RingService.class);                    RingActivity.this.stopService(i);</code></p><p><code>Toast.makeText(RingActivity.this.getBaseContext(), RingActivity.this.getString(R.string.ringPackDisabled), Toast.LENGTH_SHORT).show();</code></p><p>So the Service's onCreate looks like so:</p><pre><code>public void onCreate() {db = new DbManager(this);db.open();vib = (Vibrator) getSystemService(VIBRATOR_SERVICE);IntentFilter intentFilter = new IntentFilter(Intent.ACTION_TIME_TICK);registerReceiver(tReceiver, intentFilter);timeTick = 0;//figure out the widget's statusSharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getBaseContext());widgetEnabled = prefs.getBoolean(WIDGET_ALIVE, false);//save the ringtone for playing for the widgetUri u = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);r = RingtoneManager.getRingtone(this.getBaseContext(), u);playAfterSet = false;super.onCreate();}</code></pre><p>Then it passes it off to onStartCommand, which returns START_NOT_STICKY (since I will be creating and destroying the Service manually), who passes it off to handleStart().</p><pre><code>@Override private void handleStart(Intent intent) {     final Intent i = intent;if (isSdOk()) {    int action = i.getIntExtra(ACTION, -1);    if (action != -1) {        if (action == PACK_SET) {            playAfterSet = true;            Thread packSetThread = new Thread() {                @Override                public void run() {                    int passedPackId = i.getIntExtra(PASSED_PACK, -1);                    //we were passed the id                    if (passedPackId != -1) {                        checkPrefs();                        if (!enabled)                            initControl(passedPackId);                        else                            setPack(passedPackId);                        packSetHandler.sendEmptyMessage(0);                    }                }            };            packSetThread.start();        }        else if (action == NEXT_TONE) {            checkPrefs();            swapTone();        }        else if (action == PLAY_TONE) {            playCurrentTone();        }        else if (action == WIDGET_STATUS) {            widgetEnabled = intent.getBooleanExtra(WIDGET_ALIVE, false);            if (toneName != null)                RingWidget.update(getBaseContext(), toneName);        }    }}}</code></pre><p>The isSdOk() method just checks if the SD card is mounted, since the ringtones are stored on it. initControl() just saves the user's default ringtone, so that we can give it back when they disable us. The setPack() method looks like this:</p><pre><code>private void setPack(int packId) {//save the current pack id in the prefs for restartingSharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(RingService.this.getBaseContext());SharedPreferences.Editor editor = prefs.edit();editor.putInt(SAVED_PACKID, packId);editor.commit();//get the info we need to work with this pack//it's path on the SD//build the tones ArrayList to work fromgrabPath(packId);if (tones == null)    tones = new ArrayList&lt;Integer&gt;();else    tones.clear();mapTones(packId);currIndex = 0;setNotificationTone(tones.get(currIndex));}</code></pre><p>The tones ArrayList is what I've been losing. This is where it is initialized. It holds the ids of all the enabled ringtones within a pack. The NullPointerException I've been seeing is in swapTone():</p><pre><code>private void swapTone() {//lockedif (lockPref)    return;//shuffle onelse if (shufflePref) {    int randIndex = currIndex;    while (randIndex == currIndex)        randIndex = (int) Math.floor(Math.random() * tones.size());    currIndex = randIndex;}//shuffle offelse {    if (currIndex != (tones.size() - 1))        currIndex++;    else        currIndex = 0;}setNotificationTone(tones.get(currIndex));}</code></pre><p>They way I intended it work is for swapTone() to never be called if setPack() hasn't already. Again, my users keep getting this error, but I can't reproduce it myself. Any help would be greatly appreciated. I apologize for the code wall, but I am very confused. Perhaps I'm not using the concept of a Service correctly?</p>","466453","","466453","","2011-02-21 18:58:36","2011-02-21 20:03:23","Android Service Losing an ArrayList","<android><nullpointerexception><android-service><android-lifecycle>","1","0","","",""
"5069999","1","5070067","","2011-02-21 18:55:30","4","6285","<p>I am trying to manage a simple list in an Android application. The contents of the list are maintained in a SQLite database. When the user selects and holds on a specific row, a context menu appears with a ""Delete"" option. When they select ""Delete"", the row is deleted from the database, but the view does not refresh. When I back out of the application and get back in, the appropriate row has been removed. So, I know the row is deleted, it's just the ListView that doesn't refresh.</p><p>Here are the relevant bits of code...</p><p>In the onCreate method...</p><pre><code>SQLiteDatabase db = tasks.getReadableDatabase();Cursor cursor = db.query(TABLE_NAME,     new String[] { _ID, TITLE, DETAILS, },     null, null, null, null, TITLE + "" DESC"");startManagingCursor(cursor);ListView lv = (ListView) findViewById(R.id.list);lv.setAdapter(new SimpleCursorAdapter(this,     android.R.layout.simple_list_item_1,    cursor,    new String[] {TITLE},    new int[] { android.R.id.text1}));</code></pre><p>In the onContextItemSelected method...</p><pre><code>switch(item.getItemId()) {case 0:    SQLiteDatabase db = tasks.getWritableDatabase();    ListView lv = (ListView) findViewById(R.id.list);    SimpleCursorAdapter adapter = (SimpleCursorAdapter) lv.getAdapter();    db.delete(TABLE_NAME, ""_ID=?"", new String[] {adapter.getCursor().getString(0)});    adapter.notifyDataSetChanged(); // Not working, clears screen and doesn't reload    return true;}return super.onContextItemSelected(item);</code></pre><p>What am I missing?</p><p>Thanks!</p>","207975","","","","","2012-04-04 03:32:23","How do I refresh my ListView after the database changes?","<android><sqlite>","1","0","2","",""
"5070093","1","","","2011-02-21 19:07:19","0","1503","<p>not sure if others are experiencing this issue in the apps-for-android Sample Applications, but the Radar sample app PNG files are all bad...the Eclipse editor says: ""libpng error: Not a PNG file""</p><p>I've also checked these PNG files on a couple of different PC's and none of the graphic programs can open or render the PNG files:</p><p>blip.png</p><p>ic_menu_metric.png</p><p>ic_menu_standar.png</p><p>icon.png</p><p>Here's the link to the sample app source for Radar, on the Google web site:<a href=""http://code.google.com/p/apps-for-android/source/browse/#svn%2Ftrunk%2FRadar%2Fres%2Fdrawable"" rel=""nofollow"">http://code.google.com/p/apps-for-android/source/browse/#svn%2Ftrunk%2FRadar%2Fres%2Fdrawable</a></p><p><strong>Update:</strong> rummaging around on the web, it appears that perhaps my Google Chrome browser is downloading/transfer everything in ASCII mode, rather than binary format...hmmmm...I'll try FireFox. </p><p>Well, it wasn't a browser thing...it appears that right-clicking on the PNG file on the Google app source folders, and doing a file-save-as is the wrong way to get these particular files.  What I found that worked is to click the png file so could see the change-log screen, then there is a 'file info' section that shows a raw file link, and that file link download would finally render properly.</p>","506234","","342745","","2011-10-13 19:16:33","2011-10-13 19:16:33","Android sample app Radar, all the PNG files are bad?...no get the raw file","<android>","2","0","","",""
"5070309","1","","","2011-02-21 19:27:14","2","4429","<p>I am developing an app in Android, and the emulator is not connecting to my localhost.I have researched the issue and found some ideas but nothing seems to be working. </p><p>Below is the code i have been using:,</p><pre><code>HttpClient httpclient = new DefaultHttpClient();HttpPost httpPost = new HttpPost(""http://10.0.2.2/YES_BUTTON.php"");httpclient.execute(httpPost);</code></pre><p>I have also tried a connection using ""http://10.0.2.2:3128/YES_BUTTON.php"";</p><p>The code would run a php file, but nothing happens, I have also checked the server access log and no connection was ever made with the Apache server from the emulator.</p><p>This is my first time building an app, and was wondering if there was something I haven't done, do I need to map the emulator port with the 3128 port on Apache, disable the firewall? I am developing the app on a laptop,with the Apache Server on the laptop also, so everything is being done on the same machine. Is there anything I havent done that needs to be done?</p>","627189","","776765","","2011-06-22 18:39:44","2012-10-23 11:35:29","Android Emulator not connecting with localhost Apache","<android><apache><connection><emulator>","1","2","","",""
"5070326","1","","","2011-02-21 19:29:05","1","244","<p>I would like to open an activity which in turns uses startActivityForResult window and opens, let us assume, 5 activities. So in the UI I would like it to display using the format present in the attached screen shot format.</p><p>See the attached honeycomb picture, I would like the 5 square to represent each activity that is linked to the main activity. </p><p>Is it possible in HoneyComb? What is the view name that I should be using?<img src=""http://i.stack.imgur.com/C6moS.jpg"" alt=""enter image description here""></p>","402637","","750987","","2011-05-29 06:44:16","2011-05-29 06:44:16","HoneyComb activity preview showing 5 activities in one screen","<android><android-3.0-honeycomb>","1","0","","",""
"5070367","1","","","2011-02-21 19:33:09","0","105","<p>I've read through all of the android documentation that I can find but I'm still not clear on whether a button can be added to an application for an android device somewhere outside of an options/context menu. It seems like all of the menu buttons are only accessible either from a tab bar at the bottom or the menu button on the device. Is this correct? </p>","627200","","","","","2011-02-21 23:29:39","Can I create a menu button somewhere other than the options menu in android?","<android><interface><button><menu><user>","1","0","","",""
"5070377","1","","","2011-02-21 19:34:11","0","277","<p>My development team and I, are working on an application that uses a sql database, we try to transfer a database from our application to a server using tcp sockets, we made some research about sockets, the server program is written on java language using netbeans, and the application is written on eclipse.</p><p>We made several conectivity tests between the application and server programs, using the android emulator, we tried to made it local (running both programs on the same computer) and the server conects with the application, but it doesn´t receive all packages, it receives aproximately 2Kb (we want to transfer a 25Kb file), the same happens when we run the server on other computer in the same network, we made some tests using wireshark to capture all the packagesincoming from the application to the server and viceversa, we´ve noticed that the server receives all the data, but first it receives a 2Kb packet, after that server application receives an end ack, and then, the application receives the missing packages, and then discards them.</p><p>We also made some conectivity tests using a coby kyros tablet instead of the emulator, and we have no problem, the application running on the tablet, sends all the data, and the server receives it.</p><p>We want know if there are an error on the emulator, and how to solve it.</p><p>Please help us or send us yout feedback</p>","627202","","","","","2011-02-21 20:00:25","Problems transfering data between an application and a server using TCP sockets [Android]","<android>","1","0","","",""
"5070413","1","5091749","","2011-02-21 19:38:00","2","1633","<p>I have a widget (AppWidgetProvider) and i want to know if there is a way to support multiple clicks.Example: </p><p>1)If is the first click on the widget, then the ImageButton of the widget changes (for example, changes the color).</p><p>2)If is the second time, then open an Activity.</p><p>-- There is some way to handle click events inside AppWidgetProvider?</p><p>My code:</p><pre><code>public class MyWidgetProvider extends AppWidgetProvider{    @Override    public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {        final int N = appWidgetIds.length;        for (int i=0; i&lt;N; i++) {            int appWidgetId = appWidgetIds[i];                Intent intent = new Intent(context, MyActivity.class);            PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, intent, 0);            RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.control_widget);            views.setOnClickPendingIntent(R.id.asdf, pendingIntent);             appWidgetManager.updateAppWidget(appWidgetId, views);        }        }}</code></pre><p>My widget is working fine. When i click the ImageButton(R.id.asdf), it goes to the activity MyActivity.</p><p>Id like to know how can i handle click events on my widget to make a different action (example: change the color of the ImageButton) instead of go to some activity. Is there some other way to some click handle besides setOnClickPendingIntent()?</p>","616032","","616032","","2011-02-21 20:22:42","2011-12-06 16:39:11","Widget double click","<android>","5","2","2","",""
"5070492","1","5074275","","2011-02-21 19:45:50","8","8341","<p>I am able to display a map for a specific area with the drawable icon showing the exact location. The problem is I don't see any text next to the marker like you do with google maps. It looked like either the title or snippet text you send to the OverlayItem would display but that is not the case.</p><p>I haven't found any example online that shows how to put some kind of text next to the drawable icon at my location... does anyone have an example ?</p><p>I originally followed the Google MapView tutorial, but ""Code Magician"" has a much better version of it:<a href=""https://codemagician.wordpress.com/2010/05/06/android-google-mapview-tutorial-done-right/"">https://codemagician.wordpress.com/2010/05/06/android-google-mapview-tutorial-done-right/</a></p><p>(Unfortunately without a text label next to the icon on the map)</p>","550471","","","","","2012-04-14 13:37:04","Text not displaying on MapView Overlay","<android><text><overlay><android-mapview><drawable>","2","0","8","",""
"5070512","1","","","2011-02-21 19:47:57","0","730","<p>I'm making an https connection to my webserver. Haven't changed anything server-side, or client-side. Today, on an android 9 device (the nexus S), all my connections started throwing this exception. Same app works ok on my nexus 1 and other test devices + emulator. I'm not sure what's going on here, anyone else seeing this? I'm not doing any custom https work:</p><pre><code>javax.net.ssl.SSLProtocolException: Read error: ssl=0x3100a0: Failure in SSL library, usually a protocol errorat org.apache.harmony.xnet.provider.jsse.NativeCrypto.SSL_read(Native Method)at org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl$SSLInputStream.read(OpenSSLSocketImpl.java:786)at org.apache.http.impl.io.AbstractSessionInputBuffer.fillBuffer(AbstractSessionInputBuffer.java:103)at org.apache.http.impl.io.AbstractSessionInputBuffer.readLine(AbstractSessionInputBuffer.java:191)at org.apache.http.impl.conn.DefaultResponseParser.parseHead(DefaultResponseParser.java:82)at org.apache.http.impl.io.AbstractMessageParser.parse(AbstractMessageParser.java:174)at org.apache.http.impl.AbstractHttpClientConnection.receiveResponseHeader(AbstractHttpClientConnection.java:179)at org.apache.http.impl.conn.DefaultClientConnection.receiveResponseHeader(DefaultClientConnection.java:235)at org.apache.http.impl.conn.AbstractClientConnAdapter.receiveResponseHeader(AbstractClientConnAdapter.java:259)at org.apache.http.protocol.HttpRequestExecutor.doReceiveResponse(HttpRequestExecutor.java:279)at org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:121)at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:410)at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:555)at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:487)at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:465)</code></pre><p>Thanks</p>","291701","","","","","2011-08-10 16:26:37","Started getting ssl exceptions on my nexus S (android 9), ok on other devices","<android>","1","1","","",""
"5070594","1","5070680","","2011-02-21 19:56:35","0","538","<p>I'm making my first official application to put on the market and i was wondering would over 120 new activities  be too many if I'm only using them to pull text? If so is there a way I could turn  MysecondActivity to a giant if or switch statement?This is the example I found in a book I changed up case 0: I'm going to change up the rest be similar to case 0 once i get an answer.</p><p>Thank you in advance and sorry for messy code and writing</p><pre><code>         AndroidManifest.xml       &lt;activity android:name="".MySecondActivity"" /&gt;        ListActivityExample.java        import android.app.ListActivity;        import android.app.SearchManager;        import android.content.Intent;        import android.net.Uri;        import android.os.Bundle;        import android.view.View;        import android.widget.AdapterView;        import android.widget.ArrayAdapter;        import android.widget.ListView;        import android.widget.AdapterView.OnItemClickListener;    public class ListActivityExample extends ListActivity{        static final String[] ACTIVITY_CHOICES = new String[] {            ""Open new Actvity"",            ""Open Contacts"",            ""Open Phone Dialer Example"",            ""Search Google Example"",            ""Start Voice Command""        };        final String searchTerms = ""superman"";        protected void onCreate(Bundle savedInstanceState){            super.onCreate(savedInstanceState);            setListAdapter(new ArrayAdapter&lt;String&gt;(this,                    android.R.layout.simple_list_item_1, ACTIVITY_CHOICES));            getListView().setChoiceMode(ListView.CHOICE_MODE_SINGLE);            getListView().setTextFilterEnabled(true);            getListView().setOnItemClickListener(new OnItemClickListener()            {                @Override                public void onItemClick(AdapterView&lt;?&gt; arg0, View arg1,                    int arg2, long arg3){                switch(arg2) {                 case 0: //opens new screen                {Intent intent = new Intent(ListActivityExample.this,MySecondActivity.class);                            startActivity(intent);                        break;}                    case 1: //opens phone dialer and fills in the given number                        {                        startActivity(new Intent(Intent.ACTION_VIEW,                                Uri.parse(""content://contacts/people/"")));                        break;}                    case 2:                                    {                          startActivity(new Intent(Intent.ACTION_VIEW,                                Uri.parse(""tel:12125551212"")));                         break;}                    case 3: //                        {                        Intent intent1= new Intent(Intent.ACTION_WEB_SEARCH);                        intent1.putExtra(SearchManager.QUERY, searchTerms);                        startActivity(intent1);                        break;}                    case 4: //                         {startActivity(new                                        Intent(Intent.ACTION_VOICE_COMMAND));                        break;}                        default: break;                    }                }            });        }        }    MySecondActivity.java    mport android.app.Activity;    import android.os.Bundle;    import android.widget.TextView;    public class MySecondActivity extends Activity {         @Override        public void onCreate(Bundle savedInstanceState) {             super.onCreate(savedInstanceState);             TextView tv = new TextView(this);             tv.setText(""text here"");             setContentView(tv);             }    }</code></pre>","616599","","2724626","","2013-11-30 10:19:06","2013-11-30 10:19:06","Will big android Activity wiriting cause any effect to my App","<android><switch-statement><android-intent>","1","0","","",""
"5070618","1","5070743","","2011-02-21 19:59:02","1","5872","<p>I created a custom dialog and I'd like to start a new activity when OK is clicked. How can I get the context to set it as first argument of my Intent constructor?</p><p>Thanks</p><p><em>EDIT</em></p><p>I can create the intent using getContext(), but I can't call startActivity. Shall I pass the activity calling the dialog to the dialog's constructor? Is it the usual way to start an activity by clicking a dialog?</p><pre><code>public class CustomDialog extends Dialog implements OnClickListener {    Button okButton, cancelButton;    public CustomDialog(Context context) {              super(context);             setContentView(R.layout.custom_dialog);        okButton = (Button) findViewById(R.id.button_ok);        okButton.setOnClickListener(this);        cancelButton = (Button) findViewById(R.id.button_cancel);        cancelButton.setOnClickListener(this);    }    @Override    public void onClick(View v) {               if (v == cancelButton)            dismiss();        else {            Intent i = new Intent(getContext(), ItemSelection.class);            startActivity(i); //The method startActivity(Intent) is undefined for the type CustomDialog        }    }}</code></pre>","326849","","326849","","2011-02-21 20:24:59","2014-02-12 11:01:06","How to start an activity from a dialog in Android","<android><dialog><context>","5","0","","",""
"5070657","1","","","2011-02-21 20:02:31","0","436","<p>I'm trying to get a text scrolling by terminal like effect for an application I'm writing.  The problem is that the textview only updates after all the text has been added.  </p><p>How can I get it so it updates every line?</p>","445342","","372239","","2014-01-04 15:41:47","2014-01-04 15:41:47","Terminal Like Scrolling Text Android","<android><text><scrolling><terminal>","1","0","","",""
"5070830","1","5070922","","2011-02-21 20:20:16","23","73089","<p>My <code>Android</code> app needs to populate the <code>List-view</code> using the data from an <code>Array-list</code>. I have trouble doing this. Can someone please help me with the code?</p>","601142","","1693859","","2014-02-12 11:19:23","2014-03-30 22:10:41","Populating a ListView using ArrayList?","<android><listview><arraylist>","3","0","13","",""
"5070856","1","5071328","","2011-02-21 20:22:00","3","5167","<p>When I set up my <code>CheckedTextView</code>, it has no <code>CheckBox</code>. Here is the xml code for it:</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""        &gt;    &lt;CheckedTextView            android:id=""@+id/checkedtext""            android:layout_width=""wrap_content""             android:layout_height=""wrap_content""            android:layout_alignParentLeft=""true""            android:checked=""false""            android:textSize=""25dp""            android:textColor=""#FFFFFF""            android:checkMark=""@android:attr/checkMark""            /&gt;&lt;/RelativeLayout&gt;</code></pre>","560096","","","","","2012-04-13 00:37:22","CheckBox doesn't appear in CheckedTextView","<android><xml><checkbox><relativelayout><checkedtextview>","2","0","","",""
"5070885","1","","","2011-02-21 20:25:23","1","1329","<p>I have a view that's contained inside a TabHost's FrameLayout. How can I programmatically tell the TabHost to reload the same view that's requesting it ? Something like ""reset"" in html.</p><p>Thanks</p>","253944","","","","","2011-02-21 20:48:51","Signal TabHost to reload view","<android><view><reload>","1","0","","",""
"5070899","1","","","2011-02-21 20:26:43","6","1455","<p>I have asked this on android platform, but did not receive a reply.I have referred to this thread, but could not find what post he was referring to (<a href=""http://stackoverflow.com/questions/2610995/dynamically-generating-dalvik-bytecode-into-a-running-dalvik-android-application"">Dynamically Generating Dalvik Bytecode into a running Dalvik/Android application</a>)</p><p>Also, This issue was raised(<a href=""http://code.google.com/p/android/issues/detail?id=6322"" rel=""nofollow"">http://code.google.com/p/android/issues/detail?id=6322</a>)</p><p>So, my question is,</p><ol><li>has there been any progress in this regard?</li><li>Is it possible to inject new bytecode into a class that is being loaded?</li><li>if so, any pointers to the same?</li></ol><p>Cheers.Earlence</p>","627260","","573432","","2011-04-15 19:26:14","2014-01-28 10:51:12","bytecode injection on dalvik","<android><bytecode><injection><dalvik>","2","0","3","",""
"5070972","1","","","2011-02-21 20:35:16","4","1228","<p>I have an app that needs to play a sound, and it needs to set the volume at 100% ALWAYS (it's an alarm sound). I use this piece of code:</p><pre><code>// First I set the volume to 100%AudioManager mAudioManager = (AudioManager) getSystemService(AUDIO_SERVICE);int maxVolume = mAudioManager.getStreamMaxVolume(AudioManager.STREAM_MUSIC);mAudioManager.setStreamVolume(AudioManager.STREAM_MUSIC, maxVolume, AudioManager.FLAG_REMOVE_SOUND_AND_VIBRATE);// Now I play the soundMediaPlayer mp = MediaPlayer.create(this, R.raw.alarm_sound);mp.setLooping(true);mp.prepare();mp.start();</code></pre><p>It works like I want: if the ""Multimedia Volume"" is 0%, it is set to 100% and my sound is played. The problem is that if another app is playing a sound (like the Music app in background), that volume is set to 100% too. So it plays my sound and other apps sounds together at 100%.</p><p><strong>I want my app to stop all multimedia sounds of other apps to listen only mine.</strong> Is it possible?</p>","311881","","491044","","2012-06-23 09:53:55","2013-02-17 19:19:47","How to stop other apps sounds?","<android><audio><volume><android-audiomanager>","1","2","1","",""
"5070973","1","5071241","","2011-02-21 20:35:22","1","125","<p>What is the best way to detect if a user has network service when a user has entered the London Underground?</p><p>I've tried the following;</p><pre><code>ConnectivityManager conMgr = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);if(conMgr.getNetworkInfo(0).isAvailable() || conMgr.getNetworkInfo(1).isAvailable()){    // Application online}</code></pre><p>I've also tried getting the network level, but this seems to return the last level before the tube has entered the underground.</p><p>Any suggestions gratefully appreciated. </p>","553462","","","","","2011-02-21 21:03:06","Network detection when on the London Underground","<java><android><networking><wifi><offline>","1","2","1","",""
"5071017","1","5071045","","2011-02-21 20:40:27","2","2529","<p>Hi I have implemented a google map with projection points so when i click a point it opens up a balloon showing some information relating to it. I have used this  <a href=""https://github.com/jgilfelt/android-mapviewballoons"" rel=""nofollow"">github</a> resource which makes it quite easier (thanks to Paul Sasik for guidance). What i want is when i click on each baloon it should open up a new Activity, I have tried implementing that in its onTap method but the problem is that i cant startActivity in a class that is extended from a framelayout class. So here is my code :</p><pre><code>public class CouponMapView extends MapActivity{@Overridepublic void onCreate(Bundle savedInstanceState) {               ItemizedOverlay itemizedoverlay = new ItemizedOverlay(drawable, mapView);               //all the mapoverlay code goes here...........               //this part works fine.            }    }</code></pre><p><em><strong>//----Class ItemizedOverlay in which im calling startActivity-----</em></strong></p><pre><code>public class ItemizedOverlay extends BalloonItemizedOverlay&lt;OverlayItem&gt; {    private ArrayList&lt;OverlayItem&gt; overlays = new ArrayList&lt;OverlayItem&gt;();    private Context context;    private int id;    public ItemizedOverlay(Drawable defaultMarker, MapView mapView) {        super(boundCenter(defaultMarker), mapView);        context = mapView.getContext();    }    public void addOverlay(OverlayItem overlay) {        overlays.add(overlay);        populate();    }    @Override    protected OverlayItem createItem(int i) {        return overlays.get(i);    }    @Override    public int size() {        return overlays.size();    }    @Override    protected boolean onBalloonTap(int index) {//---I cant call startActivity here as this class is not inhereted from Activity its //extended from a class that is extended from FrameLayout that you will find if you scroll down.        SubActivity sub = new SubActivity();        sub.startCustomActivity();        return true;    }}</code></pre><p><em><strong>//--To start a new activity and to call startActivity method i have to create a new class and extends it from Activity...</em></strong></p><pre><code>public class SubActivity extends Activity {    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);    }    public void startCustomActivity(){        Intent Details = new Intent(getBaseContext(), Tab.class);        Details.putExtra(""Id"", 1327);        startActivity(Details);    }}</code></pre><p><strong>Output:</strong>cant paste image directly the link is this<a href=""http://stackoverflow.com/questions/4923422/mapview-show-overlay-details-when-clicked"">mapView show overlay details when clicked</a></p><p>The image above is similar to what i am getting so when i click on the overlay this should startup a new intent activity where i want to show some details.</p><p>But when i click on it i get these errors. I am not sure if i am doing it the right way. I am calling the subActivity class when the image is clicked.</p><pre><code>02-21 19:21:44.769: ERROR/AndroidRuntime(462): FATAL EXCEPTION: main02-21 19:21:44.769: ERROR/AndroidRuntime(462): java.lang.NullPointerException02-21 19:21:44.769: ERROR/AndroidRuntime(462):     at android.content.ComponentName.&lt;init&gt;(ComponentName.java:75)02-21 19:21:44.769: ERROR/AndroidRuntime(462):     at android.content.Intent.&lt;init&gt;(Intent.java:2678)02-21 19:21:44.769: ERROR/AndroidRuntime(462):     at com.vouchacha.mvc.mapview.SubActivity.startCustomActivity(SubActivity.java:17)02-21 19:21:44.769: ERROR/AndroidRuntime(462):     at com.vouchacha.mvc.mapview.ItemizedOverlay.onBalloonTap(ItemizedOverlay.java:52)02-21 19:21:44.769: ERROR/AndroidRuntime(462):     at com.vouchacha.mvc.mapview.BalloonItemizedOverlay$1.onTouch(BalloonItemizedOverlay.java:177)02-21 19:21:44.769: ERROR/AndroidRuntime(462):     at android.view.View.dispatchTouchEvent(View.java:3762)02-21 19:21:44.769: ERROR/AndroidRuntime(462):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:897)02-21 19:21:44.769: ERROR/AndroidRuntime(462):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:936)02-21 19:21:44.769: ERROR/AndroidRuntime(462):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:936)02-21 19:21:44.769: ERROR/AndroidRuntime(462):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:936)02-21 19:21:44.769: ERROR/AndroidRuntime(462):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:936)02-21 19:21:44.769: ERROR/AndroidRuntime(462):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:936)02-21 19:21:44.769: ERROR/AndroidRuntime(462):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:936)02-21 19:21:44.769: ERROR/AndroidRuntime(462):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:936)02-21 19:21:44.769: ERROR/AndroidRuntime(462):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:936)02-21 19:21:44.769: ERROR/AndroidRuntime(462):     at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1671)</code></pre>","606669","","","","","2011-02-21 20:57:57","Mapview start new activity when a baloonOverlay is clicked","<android>","2","0","1","",""
"5071134","1","","","2011-02-21 20:51:00","0","16","<p>I'm really having hard time with this one. I would like to place 4 ImageSwitchers in the following layout. </p><p>1 2</p><p>3 4</p><p>but everything I try to code seems either to fail or not produce the desired results (I'm trying to use RelativeLayout (not table!))</p><p>Any ideas? Thanks.</p><p>Eden</p>","568689","","","","","2011-02-21 20:51:00","How to place 4 ImageSwitchers on a view","<android><android-layout>","0","2","","",""
"5071275","1","5075970","","2011-02-21 21:05:57","0","1492","<p>I'd like to show two different activities at the same time on the screen. I was under the impression that one may achieve it using <code>ActivityGroup</code>. Is that so?</p><h2>UPDATE</h2><p>I tried it this way:</p><pre><code>layout = (ListView) findViewById(R.id.wrapper_layout);LocalActivityManager mgr = getLocalActivityManager();Intent intent = new Intent(this, BenchMarker.class);Window w = mgr.startActivity(""BenchMarkerA"", intent);View wd = w != null ? w.getDecorView() : null;if(wd != null) {    layout.addView(wd);}</code></pre><p>But got a <code>NullPointerException</code> thrown by <code>ActivityThread.performLaunchActivity()</code></p>","348183","","348183","","2012-02-20 14:34:33","2012-02-20 14:34:33","Can I use Activity Group to show two activities at the same time in Android?","<android><activity><activitygroup>","1","0","1","",""
"5071282","1","5071398","","2011-02-21 21:07:02","2","418","<p>I have built a widget that contains an ImageButton. </p><p>How can I access the imagebutton from an AppWidgetProvider and add an click listener on it (to change the color of the button, for example)? </p><p>In an Activity I would just use findViewById() and setOnClickListener(), but I can't do that in the AppWidgetProvider.</p>","616032","","","","","2011-02-21 21:19:30","Accessing elements of a widget from the AppWidgetProvider","<android>","1","0","","",""
"5071302","1","5071582","","2011-02-21 21:09:09","1","362","<p>I am having difficulty finding out why the following line of code is generating a 'Force Close' in my Android Application:</p><pre><code>    fact = myArray[randfact.nextInt(myArray.length)];</code></pre><p>I have an arracy of interesting facts - just a Siring Array.  It's defined in a file called array.xml and it has the name <code>myArray</code>.</p><p>The actual code snippet to generate the random fact is:</p><pre><code>Random randfact = new Random();fact = myArray[randfact.nextInt(myArray.length)];</code></pre><p>where <code>fact</code> is of type string and I define <code>myArray</code> as an <code>Array</code> of <code>Strings</code> PRIOR to the above two lines of code:</p><pre><code>String fact;    String[] myArray;</code></pre><p>I believe the culprit is:  </p><pre><code>fact = myArray[randfact.nextInt(myArray.length)];</code></pre><p>because when I comment out the line as such:</p><pre><code>//fact = myArray[randfact.nextInt(myArray.length)];</code></pre><p>my Application no longer generates a 'Force Close'. Does anyone notice anything? I can't seem to find it!!!</p>","615525","","512958","","2011-02-21 22:02:22","2011-02-21 22:02:22","Random Int Function Generating Application Force Close","<android>","4","0","","",""
"5071414","1","5072138","","2011-02-21 21:21:09","4","5153","<p>Hello helpful stackoverflow members,</p><p>I'm trying to accomplish what seems to be a simple layout in an android activity, but I can't seem to get it working using just wrap_content and fill_parent/match_parent.</p><p>Picture to give a basic idea of the problem:<a href=""http://i89.photobucket.com/albums/k207/cephron/Layout_quandary.png"" rel=""nofollow"">http://i89.photobucket.com/albums/k207/cephron/Layout_quandary.png</a></p><p>In a vertical LinearLayout, I have an ImageView of top of a child layout containing buttons and stuff.I'd like to get the ImageView to be expanded to make the image as large as possible (ie. fill the screen width) without taking any more vertical space than necessary to achieve this (ie. I want the ImageView to be touching the top of the screen, with the buttons and stuff touching the bottom of the image).I can't get this to happen using wrap_content and fill_parent, and all my messing around with gravity didn't seem to change anything. I had to include weights just to ensure that the image didn't crowd everything else entirely off the screen.</p><p>I would love to post proper code, but - noob that I am - I've wasted about 20 minutes trying to get it to work with Stackoverflow's code formatter, and parts of it wouldn't show up.</p><p>So, here's my code, sufficiently mangled that it doesn't get recognized by whatever was selectively removing parts of it:</p><pre><code>[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_horizontal""]    [ImageView android:id=""@+id/door_detail_video_frame""    android:src=""@drawable/door_closed_256""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:layout_weight=""1""/]    [LinearLayout android:id=""@+id/door_detail_control_area""    android:orientation=""horizontal""    android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:layout_weight=""0""]        [ImageView android:id=""@+id/door_detail_status_frame""        android:src=""@drawable/door_closed_locked_67""        android:layout_width=""wrap_content""        android:layout_height=""fill_parent""/]        [LinearLayout android:layout_height=""wrap_content""        android:orientation=""vertical""        android:layout_width=""fill_parent""]            [Button android:id=""@+id/door_detail_override_button""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""            android:text=""@string/door_detail_override_button_text""/]            [Button android:id=""@+id/door_detail_camera_button""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""            android:text=""@string/door_detail_camera_button_text""/]        [/LinearLayout]    [/LinearLayout][/LinearLayout]</code></pre><p>I <em>believe</em> the only relevant parts are the first LinearLayout and ImageView, but the stuff in the nested layouts (corresponding to the ""buttons and stuff"") is included for completeness.</p><p>Is there a way to achieve the desired layout formatting?</p><p>Thanks in advance for any help!</p>","600615","","","","","2011-02-22 17:42:12","Android Layout - expanding ImageView to fill width, but no larger?","<android><android-layout>","1","1","4","",""
"5071598","1","5071688","","2011-02-21 21:42:59","1","1305","<p>What's the best way to have a status bar notification persist when the phone is turned off and on again? The only solution I can think of is to create the notification in a Service which starts in response to the <code>BOOT_COMPLETED_ACTION</code> Intent.</p>","385478","","","","","2011-02-21 21:51:40","Android: make notification persist across phone reboot","<android><service><notifications><reboot>","1","0","1","",""
"5071743","1","7193546","","2011-02-21 21:58:31","28","35495","<p>I'd like to make a view in my Android app that flips between multiple views on a swipe/fling.  I'd like it to behave more or less like the Android Launcher behaves when flipping between views.  In particular,</p><ol><li>It should flip views on swipe.</li><li>Generally a swipe will flip between one view and the next. It should not fling across all of the views.</li><li>If you swipe slowly, you should see the views dragging as you're swiping, eg. the way the Launcher does it.</li></ol><p>I tried using a ViewFlipper with a GestureOverlayView as per Romain Guy's <a href=""http://android-developers.blogspot.com/2009/10/gestures-on-android-16.html"">blog post here</a>, but there's no indicator to the user as they're swiping.  This makes discoverability difficult, which is presumably why Launcher does it the way they do.</p><p>I tried using a Gallery object, but when I swipe from left to right, there's a certain amount of momentum that flings the users through all the views rather than just taking them to the next view.</p><p>Is there a good way to accomplish what I'm trying to do?</p>","82156","","82156","","2011-02-21 22:21:37","2014-02-10 22:52:17","How to make an Android view that flips between views on swipe/fling","<android><gesture>","4","2","21","",""
"5071795","1","","","2011-02-21 22:05:39","1","520","<p>I need a grid view, and inside each box, in the grid, I need to insert buttons and check box.What are my options?--> I could not insert buttons + checkboxes  by using gridView --> I tried drawing in canvas, got the grid, but couldnot insert buttons...Any suggestions??</p><p>Thanks in Advance!</p>","625670","","","","","2011-08-23 06:23:14","Android: How to make, buttons and checkbox inside each box in a grid?","<android>","1","0","","",""
"5071834","1","","","2011-02-21 22:10:36","0","134","<p>my app is like cycle .  first a activity starts. then b . this goes on like c,d and again a.   How can I know that a is run by what ? is a normal app starting or have made an intent it run ?</p>","627376","","","","","2011-02-21 22:30:34","How can I define what make start activity?","<java><android><activity><android-intent><content>","2","0","","",""
"5071843","1","","","2011-02-21 22:12:33","5","2142","<p>I have a pair of adjacent views in an Android application. I'd like to give the user the ability to drag a widget to change the relative size of the two views within a larger container.  If SlidingDrawer let the user pin the drawer wherever they wanted, that'd likely get me what I want.</p><p>My Google 'fu is failing me.  I can't find a single example of this anywhere.</p><p>Thanks!</p>","53571","","","","","2011-03-02 21:28:46","Drag to dynamically resize a pair of adjacent layouts on Android","<android><layout><resize>","1","0","","",""
"5071952","1","5165334","","2011-02-21 22:23:36","4","3941","<p>Is there a way to add callbacks in OpenGL ES similar to what DirectX has? I'm trying to profile the GPU performance, so I'm trying to figure out how long it took to execute certain parts of the GPU.</p><p>Ideally, I ""push"" a marker/callback, then call a bunch of GL draw calls, then push another marker, and then find out how many milliseconds passed inbetween those two markers a frame later.</p><p>(Any other ways to profile GPU performance would be helpful too.)</p>","345717","","345717","","2011-03-01 23:42:56","2011-06-20 14:36:20","GPU Profiling and callbacks in OpenGL ES","<android><opengl-es><profiling><opengl-es-2.0>","3","4","3","",""
"5072083","1","","","2011-02-21 22:36:59","1","153","<p>I need to identify how much time the webservices took in an android application.</p><p>I have an android application consuming SOAP webservices, but it takes a while to display the output.</p><p>There is fiddler to test web pages, similarly do we have something for anroid to test &amp; can we see the same output in web page at the same time?</p><p>Thanks.</p>","441664","","","","","2011-02-22 01:30:59","Monitoring an android application","<android><web-services>","1","1","","",""
"5072159","1","5098915","","2011-02-21 22:45:50","0","153","<p>Well, this is a long shot. Some coworkers and I are trying to <a href=""http://wiki.cyanogenmod.com/index.php?title=Compile_CyanogenMod_for_Dream_%26_Sapphire"" rel=""nofollow"">compile Cyanogenmod 2.1 (eclair) from source</a> (yes, the wiki has instructions for 6.x, but it is quite similar to the instructions for 5.x). We're currently trying to sync the git repository using ""repo sync"". However, some files are missing, and we get this error:</p><pre><code>error: revision eclair in CyanogenMod/android_external_webkit not found</code></pre><p>We've tried requesting help on the <a href=""http://forum.cyanogenmod.com"" rel=""nofollow"">Cyanogenmod forums</a>, but so far we've received no response. This has become a rather pressing issue. Does anyone have any suggestions as to how we could compile the eclair branch?</p><p>(Again, this is a long shot, but if anyone has any ideas I would really appreciate it!)</p>","341654","","","","","2011-02-24 00:05:49","Compilation Errors when Compiling Cyanogenmod 2.1","<android><git><compilation><cyanogenmod>","1","0","","",""
"5072163","1","","","2011-02-21 22:46:18","0","375","<p>I have worked on developing an android app for mobile platform in past. Now I need to create an android app for the the TV platform. I am new to the TV part . Any useful links/information would help.</p><p>Thanks</p>","423639","","","","","2012-11-14 11:34:57","to create an android app for tv","<android>","1","0","","",""
"5072315","1","5072388","","2011-02-21 23:06:46","2","1128","<p>I would like to add a ""Help"" screen to my app using the options menu, and have it include a button to ""Returen"" back to the original view.</p><p>I have the written the ""onOptionsItemSelected"" routine(or is it a method?) using ""swithch &amp; case"" to check for which menu button was pressed. When the ""help"" button is pressed, I would like a new view to pop up showing the text I have typed in myhelp.xml file located in the R.layout folder. The myHelp.xml file includes a button named ""quithelp"" to return the user back to the main program (or is it the class?)  </p><p>I don't understand two things: how to switch to the myhelp.xml view when the menu button is pressed, and how to return back to the main menu when the ""Return"" button is pressed.</p><p>I've experimented with LayoutInflator, getLayoutInflator,setFeatureInt based on some poor examples I found on the net, and now I'm just simply confused as to how best do such a simple task.</p>","493998","","","","","2011-02-21 23:16:41","Changing views for a help screen","<android>","1","0","","",""
"5072451","1","5072647","","2011-02-21 23:25:05","5","3022","<p>I see all the examples of AlarmManager being set by an Activity.</p><p>My question is this:If my application sets a recurring AlarmManager, does that persist even after the application that started is is closed and removed from memory?</p><p>If not, how do I start an AlarmManager at a lower level that is started by Android at boot up and if it ever fails or dies or throws an exception is restarted without the user having to do anything?</p><p>Lastly, if the action I wish for the BroadcastReceiver to undertake has no visual components, do I still have to create a separate Activity for it? In my case I want there to be a background uploader that wakes up and looks into a folder and if it sees files in that folder, sends them off to the server.  I don't need any feedback to the user.  </p><p>So, my ideal would be to have a magical, OS based AlarmManager that calls an IntentService which just handles the uploading, but I'm unclear on how to get such an AlarmManager running in the first place.</p><p>TIA</p>","59947","","59947","","2011-02-21 23:33:21","2011-04-15 12:13:15","Clarification of AlarmManager behavior in Android","<android><alarmmanager>","2","1","4","",""
"5072469","1","5072908","","2011-02-21 23:28:08","0","2128","<p>I just read <a href=""http://www.ozdroid.com/#!BLOG/2010/12/19/How_to_make_a_local_Service_and_bind_to_it_in_Android"" rel=""nofollow"">http://www.ozdroid.com/#!BLOG/2010/12/19/How_to_make_a_local_Service_and_bind_to_it_in_Android</a> about how there can be memory leaks when binding to a local service...</p><p>I am currently implementing binding to a local service using the following code.</p><p>In the service I have:</p><pre><code>private final Binder binder=new LocalBinder();public class LocalBinder extends Binder implements IStreamCommander {        public void registerPlayer(IStreamListener callback) {            theUI=callback;        }        public void removePlayer(IStreamListener callback) {            theUI=null;        }        public void play(Station NowP) {            playURL(NowP);        }        public void stop() {            stopIt();        }    }</code></pre><p>Where IStreamCommander is defined:</p><pre><code>public interface IStreamCommander { void registerPlayer(IStreamListener callback); void removePlayer(IStreamListener callback); void play(Station SongID); void stop();}</code></pre><p>and IStreamListener is defined:</p><pre><code>public interface IStreamListener { void updateUI(String msg, int buttons);}</code></pre><p>I then have this in the activity:</p><pre><code>this.bindService(startedSvc, svcConn, 0);</code></pre><p>and</p><pre><code>private ServiceConnection svcConn = new ServiceConnection() {    public void onServiceConnected(ComponentName className, IBinder binder) {        service = (IStreamCommander) binder;    }    public void onServiceDisconnected(ComponentName className) {        service = null;    }};</code></pre><p>So am I leaking memory, or is this okay?</p>","312499","","","","","2011-02-22 00:42:34","Android Binder Leaks","<android><service>","1","1","1","",""
"5072535","1","5072586","","2011-02-21 23:39:18","8","8649","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/3014089/maintain-save-restore-scroll-position-when-returning-to-a-listview"">Maintain/Save/Restore scroll position when returning to a ListView</a>  </p></blockquote><p>The user views a listview of items, they move to an activity that shows detail for one item, and then hit Back and return to the list activity but I want the list to reflect its prior scroll position.</p><p>Should I store the scroll position as a member variable on the activity in onPause or is there a better way?</p>","477415","","","","","2012-03-18 18:11:15","How to retain Android ListView scroll position when returning to an activity?","<android>","1","0","4","2012-12-21 00:16:26",""
"5072576","1","5073067","","2011-02-21 23:46:50","3","530","<p>I just released my first app for Android and I am getting reports that the app will not install on some devices (seems to be mostly Droid in fact) due to ""unknown error 18"". Searching Google return a lot of forum post. It is a very well documented error and there are ways around it for the user (<a href=""http://notboring.org/devblog/2011/02/android-market-error-18-when-updatinginstalling-apps/"" rel=""nofollow"">linky</a>).</p><p>As a developer is there any thing I can do to prevent this error instead of changing installLocation in the manifest?</p>","3610","","","","","2011-02-22 01:09:23","App install gives ""unknown error 18"" (Android)","<android><install>","1","0","","",""
"5072749","1","5072911","","2011-02-22 00:15:49","2","2377","<pre><code>BufferedReader hl  = new BufferedReader(new InputStreamReader(getResources().openRawResource(R.raw.lines)));                while(hl.ready()){                    showLines.append(hl.readLine()+""\n"");                    showLines.invalidate();                    Thread.sleep(10);                }</code></pre><p>That is my code but it is not redrawing when I tell it to.  It is supposed to redraw after every line that is added to textview, but it still only redraws at the end?  Can someone please help me, I can't figure it out.</p>","445342","","","","","2011-02-22 01:54:41","Invalidate is not redrawing the screen. Android","<android><scrolling><textview><redraw><invalidate>","2","0","","",""
"5072805","1","","","2011-02-22 00:23:40","1","394","<p>I really see no reason to use the single signon feature because the Facebook app is just so fragile on Android anyway that it doesn't work a lot of times.</p><p>With the above said, do I need to generate and register the hash key with Facebook if I'll have the user login via the WebView login interface anyway?</p>","450407","","","","","2011-02-22 02:49:04","Hash key for Facebook SDK if not using Single Signon?","<android><facebook><hash><login><key>","1","0","","",""
"5072874","1","7727256","","2011-02-22 00:36:06","8","6053","<p>I'm trying to clone an Android project using Eclipse, the Android SDK, and the Mercurial plug-in.  I can successfully clone it by doing this:  File -> New -> Project -> Clone Existing Mercurial Repository</p><p>But the problems start when Eclipse does not seem to recognize that it is an Android project.  I can then right-click on the project and:  Android Tools -> Convert to Android Project  but I don't get to select any build preferences and the source folder icon doesn't get identified as a package.  I try to add a new package but Eclipse says the folder is not a Java source folder.</p><p>I feel like there is either something wrong with the repository, the way I am cloning it, or that Eclipse/Mercurial/Android SDK don't work well together.</p><p>Obviously, I'm a complete greenhorn at this and any help/patience is appreciated.  Links to useful tutorials are welcome since none that I've found deal with this particular set of tools.</p>","31676","","","","","2012-06-29 10:43:20","How to properly clone an Android project using Eclipse and Mercurial","<android><eclipse><mercurial>","6","1","3","",""
"5072898","1","","","2011-02-22 00:39:59","0","1154","<p>I am using the following code to encrypt byte data on android device.  I used the AES256 algorithm on IPHone. But unfortunately, the data is not getting decrypted properly between IPhone and Android. It works between IPhone-IPhone or Android-Android.</p><p>Any suggestions?</p><pre><code>public static SecretKeySpec getSecretKeySpec(String passphrase, String algorithm, int kgenbit)throws Exception {                     byte[] salt = {                       (byte)0xA9, (byte)0x87, (byte)0xC8, (byte)0x32,                       (byte)0x56, (byte)0xA5, (byte)0xE3, (byte)0xB2                   };                   // Iteration count                   int iterationCount = 1024;                   KeySpec keySpec = new PBEKeySpec(passphrase.toCharArray(), salt, iterationCount);                   SecretKey secretKey = SecretKeyFactory.getInstance(""PBEWithMD5AndDES"").generateSecret(keySpec);                   MessageDigest md = MessageDigest.getInstance(""MD5"");                   md.update(secretKey.getEncoded());                   md.update(salt);                   for(int i = 1; i &lt; iterationCount; i++)                   md.update(md.digest());                   byte[] keyBytes = md.digest();                   skeyspec = new SecretKeySpec(keyBytes, algorithm);                   return skeyspec;             }    public static byte[] encrypt(byte[] voicedata, int len)throws Exception{          Cipher cipher = Cipher.getInstance(skeyspec.getAlgorithm());          cipher.init(Cipher.ENCRYPT_MODE, skeyspec);          byte[] encrypted = cipher.doFinal(voicedata, 0, len);          return encrypted;    }</code></pre>","627493","","","","","2011-02-22 00:45:30","AES256 algorithm with interoperability between IPhone and Android","<iphone><android><encryption><aes>","1","0","0","",""
"5073013","1","5604556","","2011-02-22 00:59:11","4","1807","<p>I need help figuring out the best, cross-browser compatible way to ""SAVE"" user input and STORE them locally(offline mod) AND on a server(online).  Program will be used by Android and iOS. </p><p>I want to know the best way to track user progress while the device is online OR offline. </p><p>Hello I have been researching AJAX, JSON, XMLHttpRequest, REST, Java, and HTML5 (specifically, localStorage).</p><p><strong>The scenario: (Read a book online/offline, save page progress)</strong></p><ol><li><p>A user logs in to a Web Service and the Web Service allows the user to download an ""html webpage book"" (view with HTML5 browser).</p></li><li><p>After every page turn, a REST API uses a GET request to post the Progress data to a Web Server. Simultaneously, a JSON string is created and saved in a file on the server. (let's say ""ProgressData.txt"")</p></li><li><p>In the background, a separate ""copy"" of ProgressData.txt is saved LOCALLY on the mobile device. The user then leaves the internet connection and continues to read the HTML Book.</p></li><li><p>When the user regains connectivity, the ProgressData.txt is uploaded to the server using a REST API where it will update the old server file with the NEW .txt file with all of the user ProgressData.</p></li></ol><p><strong>Possible solutions:</strong></p><p>HTML5 localStorage solution looks good. jQuery even simplifies it:<a href=""http://plugins.jquery.com/project/html5Storage"" rel=""nofollow"">http://plugins.jquery.com/project/html5Storage</a></p><p>Straight Javascript looks good for Server-Side storage, however it doesn't have access to a mobile device's physical hard-drive, thus preventing any kind of offline saving.</p><p>Java applets look possible.  Plus not sure how Java runs with Android/iOS. </p><p>I don't want to have to run a localhost(PHP/Apache/Python) from a mobiledevice every time the user goes offline, however that may be where the solution lies. I did stumble on this powerful tool: <a href=""http://couchdb.apache.org/"" rel=""nofollow"">http://couchdb.apache.org/</a></p><p><strong>Question:</strong></p><p>I need to know the best way to track user progress while the device is online OR offline.  What is the best way to do this?</p>","627523","","445131","","2013-03-29 13:18:39","2013-03-29 13:18:39","How to save/load data Online(Store data with AJAX and JSON) and Offline (locally)","<android><ios><load><save><offline>","4","4","1","",""
"5073072","1","","","2011-02-22 01:11:37","0","116","<p>I just imported the Android tutorial solution Notepadv3.  I wanted to see it run.</p><p>As usual, I'm greeted with the inability to resolve R.  </p><p>I searched for an import R line and see none.</p><p>I edited a line and saved. I closed and opened the application.</p><p>What do I do??</p><p>This seems to happen on every project.</p><p>(I have tried this with Eclipse Ganymede under Ubuntu 9.1 and Eclipse Helios under Windows 7.)</p>","627538","","143305","","2011-02-22 01:14:25","2011-02-22 03:10:08","R.* error in Notepadv3","<android><eclipse>","3","0","","",""
"5073124","1","5073594","","2011-02-22 01:23:16","2","510","<p>this should be real quick. Currently I have this code to write an image to an output stream and upload it to a server:</p><pre><code>        OutputStream os = connection.getOutputStream();        BufferedInputStream fis = new BufferedInputStream(new FileInputStream(file));        int totalBytes = fis.available();        for(int i = 0; i &lt; totalBytes; i++) {            os.write(fis.read());        }</code></pre><p>Etc. (I know that for loop for writing the data is super basic, I'm gonna make it a bit better in the future I'm just trying to get things working at a basic level here).</p><p>Anyways, as you can see I'm writing a file to the stream and sending it out, this works just fine. My problem is, I have no way as of yet to transmit the proper file name as well. On the php end I just set it to a generic timestamp file name, and I don't want to use the default image name on the phone either, the image uploaded will include the user's name who uploaded, including a timestamp which I can add on the php end just fine. I just need to know how to include something like a namevaluepair which has the user's name in it, so on the php side the filename can include that string. Thanks!</p><p>edit: dont know why i was saying data, its just an output stream...</p>","588758","","588758","","2011-02-22 01:49:53","2011-02-22 03:05:02","Writing a filename to a OutputStream when uploading to php server so the file will be named properly","<php><android><file-upload>","1","1","","",""
"5073237","1","","","2011-02-22 01:46:56","0","458","<p>I've been mucking around in OpenGL on Android for a while and feel like I've been able to figure a lot of things out. I've been working from the book ""Hello, Android!"" and the Android port of the NeHe 3D world tutorial. The fun part is that both differ a bit in implementation, so piecing something together from both has been loads of fun. The thing is, the HA tutorial has you build a spinning cube and uses very large int values. The cube is basically 65536x65536. Shrinking these values shrinks the cube considerably. However, the NeHe port uses much smaller floats. The height of the little world is only 6.0, yet the perspective from the camera makes it look like you're about 1.0-2.0 units tall. I've compared and contrasted the two like mad to try and find out how this was done, but I've come up empty. I can tell that the NeHe code does not normal anything while the HA code does. It applies a glNormal3f function to take the larger values down to 1,0,0, for example, then builds with TRIANGLE_STRIP, which appears to be a quick way to pump a lot of geometry in a short time. Being an OpenGL newbie, I can't say for sure if this is why or if this just makes it easier to draw and apply textures later. It's probably unrelated, but the NeHe tutorial feeds the vertex/texture buffers in as GL_FLOAT while the HA feeds them as GL_FIXED. Changing the latter to the former results in a lot of ugly planing.</p><p>I've mucked around with the viewport and translatef (which as put me in the spinning cube), but I can't seem to figure out how each manages perspective vs the size of the polygons around it. Can anyone shed some light on this? Thanks.</p>","604932","","44729","","2011-02-22 03:08:56","2011-02-22 03:13:37","OpenGL and perspective vs polygon/model size","<android><opengl-es><camera><perspective>","1","1","","",""
"5073265","1","","","2011-02-22 01:54:00","2","703","<p>I've got an absolute layout. In that layout is a custom view that takes up the left 3rd of the screen. I put a button in the layout that I want to cause the custom view to slide on and off of the screen. I've tried using animation resources (translates... ""slidein"" and ""slideout"") and the function startAnimation on the custom view, but I can't get the behavior I am looking for.</p><p>OK... I start with the custom view visible and in onCreate I find the view and animate it off screen using my slideout animation. That works fine. I figured out that I need to set ""fillAfter"" in the animation so that the custom view stays off screen.</p><p>Now, when I press my button I want to cause the custom view to slide back on the screen, so I trigger my slidein animation using startAnimation again but with slidein. BUT... that causes the view to first jump back to its original position AND THEN slide to the right... causing it to finish in the middle of the screen.</p><p>How do I get the animation to use the view's current position as the animation starting position, not its original position?</p><p>Thanks</p>","627570","","","","","2012-02-24 01:57:07","Struggling with view animations","<android><android-layout>","2","1","","",""
"5073286","1","5074358","","2011-02-22 01:57:57","1","10681","<p>I have a RelativeLayout that I want to contain 4 concentric circles (a radar effect, if you will).  I'd like to be able to hide and display the RelativeLayout, so I'm wondering how exactly to use Canvas and Paint to draw a circle to the RelativeLayout.  If someone could explain the lifecycle of how it works, that would be very helpful.  Right now I've got:</p><pre><code>setContentView(R.layout.applayout);myRelLayout = (RelativeLayout) findViewById(R.id.RLRadar);Canvas canvas = new Canvas();Paint circlePaint = new Paint(Paint.ANTI_ALIAS_FLAG);circlePaint.setColor(0xFF000000);circlePaint.setStyle(Style.STROKE);canvas.drawCircle((float) centerX, (float) centerY, (float) (maxRadius / 4), circlePaint);</code></pre><p>Am I on the right track?  Do I need to convert the canvas to some sort of ImageView and add that to the RelativeLayout?  Or am I completely off base here?</p><p>Thanks for any help!</p><p>Edit: Here's the working code.</p><pre><code>// Add the radar to the RadarRLPicture picture = new Picture();Canvas canvas = picture.beginRecording(screenWidth, screenHeight);// Draw on the canvasPaint circlePaint = new Paint(Paint.ANTI_ALIAS_FLAG);circlePaint.setColor(0xFF000000);circlePaint.setStyle(Style.STROKE);circlePaint.setStrokeWidth((float) 5.0);canvas.drawCircle((float) centerX, (float) centerY, (float) (maxRadius / 4), circlePaint);canvas.drawCircle((float) centerX, (float) centerY, (float) ((3 * maxRadius) / 4), circlePaint);canvas.drawCircle((float) centerX, (float) centerY, (float) (maxRadius / 2), circlePaint);canvas.drawCircle((float) centerX, (float) centerY, (float) (maxRadius), circlePaint);      picture.endRecording();</code></pre>","255394","","255394","","2011-02-23 04:45:28","2011-02-23 04:45:28","Android: Drawing a basic circle outline to a RelativeLayout","<android><canvas><android-layout><paint>","2","0","2","",""
"5073606","1","","","2011-02-22 03:07:33","0","667","<p>How to convert a string like ""R.drawable.online"" into a path, which can represent an image?What should I do for this?</p>","615842","","881229","","2014-02-14 21:13:45","2014-02-14 21:13:45","How to convert a string into a path","<android>","2","0","","",""
"5073617","1","5074180","","2011-02-22 03:10:28","1","1978","<p>How can I make it possible that when someone slides their finger into or over a button, the button acts as if it were getting pushed?</p><p>An example of what i'm looking for would be a keyboard app. Where you slide your fingers over all the keys to play sounds.</p>","577244","","","","","2011-02-22 04:58:59","Slide finger into buttons android","<java><android><touch><multi-touch>","1","0","","",""
"5073630","1","5080083","","2011-02-22 03:13:57","1","733","<p>So I'm writing an app for a specific area where the user really doesn't need to see the full address.  I want to turn a textview into a map address link, but don't want to have to explicitly type the full address.</p><p>Pretty simple, I only want to display the address number and street name, but leave the city, state, and zip out.  Does anyone know how I can do this?  Here's a chunk of my code.</p><pre><code>textView.setText(towedVehicle.getAddress());Linkify.addLinks(textView, Linkify.MAP_ADDRESSES);</code></pre>","546489","","","","","2011-02-22 21:10:10","Android linkify an address without displaying the full address","<android><android-layout>","2","2","","",""
"5073751","1","","","2011-02-22 03:39:37","0","563","<p>I am looking for a way to create a Image GAllery for a web application for smartphone using CSS and Javascript but still using the same hand gestures that people find when using the the galley widget, the fling or swing.</p><p>Does anyone have any idea?</p>","389076","","","","","2011-03-10 16:05:46","Android Web App Image gallery using Hand gestures","<javascript><android><css>","1","1","","",""
"5073795","1","5118566","","2011-02-22 03:47:30","6","5121","<p>This is my code,</p><pre><code>private String memSize(String path){    StatFs stat = new StatFs(path);    long blockSize = stat.getBlockSize();    long availableBlocks = stat.getAvailableBlocks();    long freeBlocks = stat.getFreeBlocks();    long countBlocks = stat.getBlockCount();    String fileSize = Formatter.formatFileSize(this, availableBlocks * blockSize);    String maxSize = Formatter.formatFileSize(this, countBlocks * blockSize);    String info = path.toString()                    + ""\nblockSize : "" + Long.toString(blockSize)                    + ""\navailableBlocks : "" + Long.toString(availableBlocks)                    + ""\nfreeBlocks : "" + Long.toString(freeBlocks)                    + ""\nreservedBlocks : "" + Long.toString(freeBlocks - availableBlocks)                    + ""\ncountBlocks : "" + Long.toString(countBlocks)                    + ""\nspace : "" + fileSize + "" / "" + maxSize                    + ""\n\n"";    return info;}</code></pre><p>I test my function with path <code>/data</code> and <code>/sdcard</code> and it works<br>But when path is <code>/</code> (I understand it is root path), this is result.</p><ul><li>blockSize: 4096</li><li>availableBlocks: 0</li><li>freeBlocks: 0 </li><li>reservedBlocks: 0</li><li>countBlocks: 0 </li><li>space: 0.00B / 0.00B</li></ul><p>I think root path is SuperUser area. May need some permission to access.<br>My phone is already rooted. Could you show me what I should do next step ?  </p><p>Thank you.</p><p><strong>References</strong>  </p><ul><li><a href=""http://developer.android.com/reference/android/os/StatFs.html"" rel=""nofollow"">http://developer.android.com/reference/android/os/StatFs.html</a></li><li><a href=""http://stackoverflow.com/questions/2652935/android-internal-phone-storage"">android internal phone storage</a></li></ul>","466693","","","","","2011-02-25 14:46:58","How to know internal memory size in android?","<android><storage>","1","0","4","",""
"5073857","1","5073913","","2011-02-22 04:04:50","0","386","<p>I'm building what is essentially a character map. The user would invoke it as a popup dialog, and after touching a desired character, it would be inserted into the current editor, <strong>which is in another application</strong>. What I want is essentially a ""send keys"" type of behavior.</p><p>Is there a way to do this without becoming an Input Method? If I have to become an Input Method, can it be used alongside normal keyboards, or does it have to replace them?</p><p>Also, if the API doesn't let you do that, I'm okay requiring root for this, though I'd prefer not to.</p><p>Thanks!</p>","170431","","170431","","2011-02-22 04:41:19","2011-02-22 04:41:19","In Android, how do I insert text into the textbox the user is currently using?","<android>","1","0","","",""
"5073881","1","","","2011-02-22 04:09:25","0","179","<p>Hello Guys i want to create a simple android activity  which will have only one imageview in center and user can zoom and scale the image accordingly by touch and drag.</p><p>Actually i can zoom the image but can't drag the zoomed image to reposition it at some other place of the screen.</p><p>can u please help me to do so as I m new to android.I can't find any tutorial where I can do both task in same activity.</p>","395661","","395661","","2011-02-22 04:37:56","2011-02-22 04:37:56","How to Zooming and Translating zoomed Image from one position to other in a Android Activity?","<android>","1","5","","",""
"5073901","1","","","2011-02-22 04:13:05","0","68","<p>I need to know how to develop database driven application, i have three tables. how to put data in database and how to report them?</p>","627678","","","","","2011-02-22 04:17:31","Android programming using eclipse,","<android>","1","2","","",""
"5073959","1","5074379","","2011-02-22 04:23:47","1","4834","<p>Is there anything wrong with sending a broadcast in a broadcast receiver?</p>","312499","","","","","2013-06-10 14:43:43","sendBroadcast in a BroadcastReceiver","<android>","1","0","1","",""
"5073968","1","","","2011-02-22 04:26:32","0","2296","<p>I would like to play a streaming URL in an android app. I have checked out the MediaPlayer but it's not working. My possible extensions are m3u, pls, asx, and ram.</p><p>Any help will be appreciated.</p>","627700","","","","","2013-01-15 16:17:20","How can I play a streaming URL in an android app?","<android><streaming><media-player>","2","2","","",""
"5074049","1","","","2011-02-22 04:37:25","1","638","<p>I have an activity A that does some network I/O inside a thread. During that I/O, I want to be able to proceed to a different activity B and get the results of that thread inside B. Is there a way to post to a Handler from A to B?</p>","239383","","","","","2011-02-22 04:52:24","How to post results to a Handler in a different activity in Android?","<android><handler>","2","0","0","",""
"5074137","1","5114883","","2011-02-22 04:52:13","1","359","<p>in my application, user downloads any ebook format file from the web site and i need to handle that downloaded file in my code for the purpose of -Enable the user to view the ebook in a android device. </p><ol><li>how to get control of a file after downloaded in to sdcard</li><li>how to change its file extension and file content</li></ol>","617302","","21234","","2011-02-25 08:37:42","2011-04-05 03:14:06","after downloading a file in android where it will be stored?","<android>","1","0","","",""
"5074150","1","","","2011-02-22 04:54:33","3","2437","<p>I have to build an Android application which shows a list of pdf files. These pdf files should be secured, in other words - the user of the app should not be able to get a copy of the pdf content by any means (copy/cut/print...etc). My questions now are</p><ol><li>How should I ship the content of the pdf file along with .apk file. </li><li>If we send the content of the file in a diff format (raw/byte code), how should I convert the file back to pdf and where should I place the file on the installed machine such that it is secure.</li></ol><p>FYI, I will be locking down current version of Adobe Redaer as the pdf viewer to view the pdf files as it doesn't allow copy/paste/print. </p><p>This is the first Android app that I am developing. So, I'm a kind of Android newbie. Any help would be greatly appreciated. </p><p>Thanks,Navin</p>","623134","","249690","","2011-02-22 15:57:45","2011-02-25 04:38:04","Pdf files as part of Android .apk","<android><security><pdf><install>","2","3","","",""
"5074171","1","5074350","","2011-02-22 04:57:15","1","76","<p>I'm useing a listView to list some webpages.  I'd like to have the webpage open when it's clicked on in the listView.</p><p>I'm trying to get some of the ""text"" from the list item sent to the uri for opening the webpage.  I hope this makes sence to everyone.</p><p>I'm just learning so any help would be great.</p><p>Something like this?</p><pre><code>Uri uri =Uri.parse(***text form list item selected***)</code></pre><p>Thanks,-Nick</p>","615383","","","","","2011-02-22 05:24:52","Help with listView and sending text","<android><listview>","1","1","1","",""
"5074178","1","5076514","","2011-02-22 04:58:39","2","474","<p>friends. I want draw MapOverlay like as PopUp Menu same as in this image. How I can do this.<img src=""http://i.stack.imgur.com/9Pwi2.png"" alt="" PopUp in MapOverlay""></p>","624069","","","","","2011-02-22 09:46:38","MapOverlay like as PopUp","<android>","2","0","","",""
"5074240","1","","","2011-02-22 05:06:32","0","1093","<p>please anyone guide me for the steps to consider to avoid rejection of android applications at app store </p>","627735","","535871","","2011-02-22 05:08:00","2011-02-22 05:15:37","Android app rejection reasons","<android><google-play>","2","0","","2011-12-04 18:18:59",""
"5074282","1","5074312","","2011-02-22 05:12:41","0","271","<p>when I am going to develop an android application. For better performance of my application what are necessary steps. In another word how to optimize my codes and .xml files, in best way. And what are steps to remember when I am going to use huge set of variables. </p><p>Thank you!</p>","550966","","","","","2011-02-22 05:17:39","Optimization of UI (.xml files) and java codes in android","<android>","1","0","","",""
"5074335","1","5074367","","2011-02-22 05:22:03","0","707","<p>I am currently developing an Android game that is similar to a classic arcade space shooter. Thus far I have almost everything finished, but my code is not quite to my liking and I am trying to find out how to improve it.</p><p>The problem I am having is with enemies and other objects entering the screen.</p><p>Currently I am using a Runnable object that I pass to a thread, and in this Runnable is an array of all of the distances that will trigger new enemies to come in from the top or sides of the screen. In the run() method, I check the time and if the System.uptimeMillis() is greater than or equal to an element in my array, I fire another method that uses a switch statement to determine the event to run.</p><p>This is all becoming quite a hassle to manage and that is why I was wondering if anybody know of a more efficient and neater way to manager the queued enemies.</p><p>Also, my array I create is of 200-some objects and once they are off the screen I was nulling them. Obviously this was firing of the GC too often for a well-performing game. Is it best just to reuse enemies that are destroyed or go off screen? Or is there a better way for this as well? (I am just ensuring that my program is the best it can be before it ventures into the wilds of the Market)</p><p>Thank you in advance,</p><p>-Roflha</p>","615199","","615199","","2011-02-22 05:36:24","2011-02-22 05:36:24","Android Game Development - Level progression methods","<android><space><spawning><arcade>","1","0","1","",""
"5074372","1","5074877","","2011-02-22 05:28:32","1","187","<p>I need to turn a App / Widget Service off when a user isn't on their homescreen and on / update when they are. Is that possible?</p>","620335","","","","","2011-02-22 06:37:14","Turn off a Android Service when the user is not on the their home screen!","<android>","1","0","0","",""
"5074422","1","","","2011-02-22 05:35:35","0","2201","<p>I am trying to add a button below a <code>GridView</code> . I tried using <code>RelativeLayout</code> and <code>LinearLayout</code> as well. But button does not appear. The  height of the <code>GridView</code> is also <code>""wrap_content""</code>. The button appears behind the <code>GridView</code>. </p><p>How do place it below the grid ?</p><p>The following is my layout that doesnt work</p><p></p><pre><code>      &lt;GridView android:id = ""@+id/galleryGridView"" android:layout_width = ""wrap_content"" android:layout_height = ""wrap_content""        android:padding = ""1dip"" android:verticalSpacing = ""1dip"" android:horizontalSpacing = ""1dip"" android:columnWidth = ""90dip""        android:paddingBottom = ""1dip"" android:numColumns = ""auto_fit"" android:stretchMode = ""columnWidth"" android:gravity = ""center""/&gt;      &lt;Button android:id = ""@+id/loadMoreButton"" android:layout_width = ""fill_parent"" android:layout_height = ""fill_parent""         android:text = ""Load More"" android:layout_below = ""@id/galleryGridView""/&gt;</code></pre><p></p>","612680","","612680","","2011-02-22 10:13:38","2011-03-15 14:52:00","Adding the button below a GridView ","<android>","2","1","","",""
"5074425","1","5074473","","2011-02-22 05:35:42","0","65","<p>i am trying to add a checkbox to the contacts list. how do i add a checkbox to every row in a list and retrieve those checked values.?? </p>","627760","","750987","","2011-05-28 12:48:19","2011-05-28 12:48:19","Adding acheckbox to every row in a list","<android><android-listview>","1","0","","",""
"5074492","1","","","2011-02-22 05:46:50","0","1620","<p>How can I open a folder navagation in my Android apps. I dont want to use any third party app like AndExplorer or ASTRO.I want a button in my app and when click on it,a particular folder may be (""/sdcard/mywebfolder"") should upen and user then can browser its content.</p><p>Please help me to accomplish it.</p><p>ThanksParvendra</p>","479007","","","","","2011-02-22 05:51:12","how to open a folder navigation when button clicked in Android App?","<android><file><explorer>","1","0","","",""
"5074532","1","","","2011-02-22 05:51:39","1","2339","<p>I am working on json parser. In json response some values contains boolean or null values, then how to check whether it is boolean or null?  For example :   user = false  or user = null . At the time of parsing it gives exception as ""user is not jsonobject"".</p><pre><code>JSONObject json = new JSONObject(query);JSONObject info = json.getJSONObject(""info"");JSONObject user = info.getJSONObject(""user"");</code></pre><p>Thanks,Vishakha.</p>","613002","","205930","","2011-02-22 05:53:49","2014-01-04 08:28:06","how to check whether jsonobject contains boolean or null value?","<android><json>","4","0","","",""
"5074597","1","","","2011-02-22 06:00:08","0","1320","<p>I am getting a orange highlight color in the GridView, when i press it. As I have specified the padding, this highlight appears in that area.</p><p>Can somebody please help me to know, how to avoid it?</p><p>I have used OnKeyDown event for the GridView, but call does not comes to that. As such the adapter provides images for the region which is left without the padding.</p>","607948","","","","","2011-03-16 10:04:01","Getting orange highlight color in the padding space of gridView on click","<android><android-layout>","1","0","0","",""
"5074619","1","7497851","","2011-02-22 06:03:21","4","2653","<p>I want to send an email in HTML format like as below image.How can I do this?Please help me.Thanks in advance...!</p><p><img src=""http://i.stack.imgur.com/qEogL.png"" alt=""One""></p>","624069","","624069","","2013-09-23 11:00:04","2013-09-23 11:00:04","Send E-mail in HTML format","<android><html><android-intent>","2","0","1","",""
"5074630","1","5074708","","2011-02-22 06:04:59","0","126","<p>i have created an app and when i was checking it with my device it shows the following error</p><p>[2011-02-22 11:30:37 - Chapter05] Failed to upload Chapter.apk on device 'HT96WKF01291'[2011-02-22 11:30:37 - Chapter05] java.io.IOException: Unable to open sync connection![2011-02-22 11:30:37 - Chapter05] Launch canceled!</p><p>What it refers, pls help me in solving this issue</p>","596364","","","","","2011-02-22 06:22:05","run time error in android devices","<java><android>","3","1","","",""
"5074651","1","","","2011-02-22 06:06:57","4","5088","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/139944/where-can-one-find-free-software-icons-images"">Where can one find free software icons / images?</a>  </p></blockquote><p>Is there a specialized site online that lets you download free icons for mobile apps? I am looking for world flags, up, down, save, revert, next, play, stop, etc.</p><p>I am looking for these icon sets in many different colors, and in 2 or 3 sizes: 32x32, 64x64.</p><p><strong>Edit:</strong><br>The answers so far are all good sites, but to accept the answer I need a small set with the about 50 to 70 common icons in many different colors and in 2 or 3 different sizes, for low, mid and high definition devices. </p>","489146","","75204","","2011-02-24 17:56:00","2012-05-18 06:31:25","Free icons for mobile applications","<iphone><android><blackberry><windows-mobile><icons>","7","4","12","2012-05-18 12:52:57",""
"5074695","1","","","2011-02-22 06:13:46","6","7056","<p>How to merge 2 Android apps into bundle so that when I install the bundle both the app are installed? I want to merge 2 APKs into a single bundle so that I can upload it on Android Market and when somebody installs it on the device then both the apps should installed on the device.</p>","479007","","313758","","2011-09-09 02:40:36","2012-03-31 03:29:49","How to merge two APK into single so that both apps can be installed at the same time","<android>","1","0","5","",""
"5074769","1","8470980","","2011-02-22 06:23:04","2","1257","<p>I have translated a project in CyanogenMod (the Email app) to Hebrew by adding a values-he folder, and compiled the entire repository (make). I have made sure that the full languages make file includes the <em>Hebrew</em> language.</p><p>However, when I loaded the update zip to the phone and switched the language to Hebrew, I still received the English strings. I'm pretty sure I am missing a step.</p><p>Any idea, please?</p><p>EDIT: Again, my phone supports Hebrew - as evident by other applications that do switch locale according to the values-he folder content. It's just for the Email application that it doesn't work.</p>","609444","","609444","","2011-03-08 06:50:58","2011-12-12 07:08:16","CyanogenMod: Translate a Project","<android><localization><translation><cyanogenmod>","3","0","1","",""
"5074844","1","","","2011-02-22 06:32:51","0","47","<p>Is it possible to represent dimensions for layout_width or layout_height in percentage for button in android?? if not is there any alternative so that the effect will be same???</p>","622630","","","","","2011-02-22 07:03:27","Question related to button in android","<android>","3","0","","",""
"5074855","1","","","2011-02-22 06:34:37","6","942","<p>Am using gridview to display an image and a textview. </p><p>After implementing this, </p><p>1) some times the alignment seems to be dancing while moving the gridivew2) Some times the gridview get disappeared.</p><p>Can u plz advise how to resolve it ?</p><p>Thanks in advance.</p>","617510","","","","","2011-05-19 10:23:35","Gridview disappear?","<android>","2","1","1","",""
"5074949","1","5074970","","2011-02-22 06:45:33","0","831","<p>I have a mapview in my app. My requirement is each time when I scroll through the map, I have to fetch the current center point of the map. How can I achieve it?</p>","504162","","","","","2011-09-09 04:42:11","Fetch map center when i scroll through the map in android","<android>","2","0","1","",""
"5074952","1","","","2011-02-22 06:45:54","0","674","<p>After a few days of having my own app run on my phone I start getting this error when requseting a friend list from Facebook: ""error validating access token""</p><p>I'm using the Facebook SDK with the single signon turned off ( just using the WebView login ).</p><p>When I logoff and then log back in - everything is fine again.</p><p>What does one do about this error and where does it come from?</p>","450407","","","","","2011-03-31 13:36:26","Getting ""error validating access token"" error using Facebook SDK","<android><facebook><sdk><token>","1","0","","",""
"5074975","1","","","2011-02-22 06:49:13","0","422","<p>I am trying external font in my application but Application crash automatically.</p><p>I am using the code</p><p>Typeface face; </p><pre><code>face = Typeface.createFromAsset(getAssets(), ""font.otf""); textview.setTypeface(face); </code></pre><p>its working but if i switch this activity more frequently then it crashes..</p><p>Give me solution....</p><p>Please help me...</p>","627880","","634025","","2012-01-02 18:51:35","2012-12-22 15:55:49","On using external font in android my Application closes autometically","<android><typeface>","1","1","","",""
"5075014","1","5075082","","2011-02-22 06:54:30","0","267","<p>I am still learning the ins and outs of Android development.  I am playing around with the Notepad tutorial application to try and get different behavior.</p><p>Right now, I want to have the application do the following in the NoteEdit activity:</p><p>1) If the Back button is pressed, current state is ignored; basically, it's like an implicit cancel, and you are taken back to the list.</p><p>2) If the Home button is pressed, it takes you to the home page as normal.  However, if you open the application again, it should go back into the NoteEdit activity in the same state as when you left (IE, if you were partway through an edit, for example).</p><p>I removed the ""saveState"" stuff from onPause, because I don't want to store to the DB unless ""Confirm"" is pressed (instead, I moved the call to saveState to the confirm button).  By doing this, hitting ""Back"" basically throws out your changes, which is what I want.  However, going Home and coming back also throws out your changes, though it does remain in the NoteEdit activity.  Both ""Back"" and ""Home"" cause the onPause message to trigger, and both cause onResume to trigger (either from clicking on the item in the ""Back"" case, or by going back into the app in the ""Home"" case).</p><p>Is there a way to have these two events handle saving the state differently?  Is it possible to have the Home button store the state (temporarily), while not having the Back button do it?</p><p>Thanks in advance!</p>","627834","","","","","2011-02-22 07:02:37","Different state storage behavior for ""Back"" vs ""Home""","<android><activity><state>","1","0","","",""
"5075093","1","","","2011-02-22 07:04:26","0","191","<p>Am using grid view in my application. i want set alternate color for the each row.. consider the grid view has 10 rows means odd row should contain red color and even row should contain green color.</p><p>Is it possible ? IF so plz advise me!!Thanks in advance.</p>","617510","","","","","2011-03-01 15:15:38","Background color for agrid view?","<android>","1","0","","",""
"5075111","1","","","2011-02-22 07:05:57","1","2536","<p>I am getting a value from webservice. I am parsing the value and adding it to <code>arraylist</code> while adding array list.</p><p>I am getting out of memory error in arraylist. Can anybody tell how to avoid this? </p><p>I read that one way to avoid out of memory error using increase heap size, but I don't how to do this - Can anybody tell how to do? Is there anyother way to avoid out of memory error?</p>","426344","","92837","","2011-06-02 11:09:21","2011-07-07 17:09:59","How to increase heap memory in android","<android>","2","1","","",""
"5075121","1","5075357","","2011-02-22 07:07:38","1","3572","<p>i faced this problem when trying to assign a character into an array of text view</p><p>counter is a count which i got from reading the number of characters i have in a text file</p><pre><code>            TextView[] tv = new TextView[counter];        for (int i = 0; i &lt; counter; i++)        {            tv[i].setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));             tv[i].setText(singleText[i]);             setContentView(tv[i]);         }</code></pre><p>after this, when i try to run the application i the application just force closes.. i have no idea on how to debug it</p><p>my application would need to set 1 character into 1 text view</p>","578198","","","","","2011-02-22 07:38:28","setting an array of text into an array of textview","<android>","2","2","1","",""
"5075191","1","","","2011-02-22 07:17:44","3","523","<p>i wan to run a single testcase with different parameters.in javait possible through junit4 and code is like this </p><pre><code>package com.android.test;import static org.junit.Assert.assertEquals;import java.util.Arrays;import java.util.Collection;import org.junit.Test;import org.junit.runner.RunWith;import org.junit.runners.Parameterized;import org.junit.runners.Parameterized.Parameters;@RunWith(Parameterized.class)public class ParameterizedTestExample {    private int number;    private int number2;    private int result;    private functioncall coun;    //constructor takes parameters from array    public ParameterizedTestExample(int number, int number2,            int result1) {        this.number = number;        this.number2 = number2;        this.result = result1;        coun = new functioncall();    }    //array with parameters    @Parameters    public static Collection&lt;Object[]&gt; data() {        Object[][] data = new Object[][] { { 1, 4, 5 }, { 2, 7, 9 },                { 3, 7, 10 }, { 4, 9, 13 } };        return Arrays.asList(data);    }    //running our test        @Test    public void testCounter() {        assertEquals(""Result add x y"", result, coun.calculateSum(this.number,  this.number2), 0);    }}</code></pre><p>Now my question is can we Run the same with android testcases where we have deal with context.</p><p>when i try to run the code using android junit.it gives me error NoClassDefinationFound.</p>","357200","","290629","","2011-02-22 11:32:37","2011-02-22 11:32:37","android:junit running Parameterized testcases","<android><junit><parameterized>","0","2","","",""
"5075271","1","5075472","","2011-02-22 07:27:23","1","137","<p>We have a SVN set up across many developers. i am trying to import the project into Eclipse and i am getting the following error</p><p><a href=""http://variable3.com/files/screenshots/2011-02-22_1255.png"" rel=""nofollow"">http://variable3.com/files/screenshots/2011-02-22_1255.png</a></p><p><img src=""http://i.stack.imgur.com/HhklB.png"" alt=""error""></p>","155196","","","","","2011-02-22 08:14:12","Importing Android Project","<android><import><project>","2","1","","",""
"5075332","1","5075574","","2011-02-22 07:34:49","3","905","<p>I have an Blackberry library written using JAVA as well Blackberry(RIM) specific API's. I would like to port the same library in to Android platform without making any code changes and make it run. </p><p>Here i am looking for the best way to achieve it</p><p>Any cross compiler/cross framework is available for making my Blackberry run on Android platform.Thinking this would make my job easy ;)</p><p>Please share your inputs on this.Thanks in advance.</p>","566772","","566772","","2011-02-22 08:48:18","2011-05-13 09:19:17","Porting blackberry application code in to Android platform","<java><android><blackberry><cross-platform><multiplatform>","4","0","","",""
"5075346","1","5075607","","2011-02-22 07:36:21","-1","1520","<p>my activity stops unexpectedly as soon as i run the app in the emulator. What am i doing wrong? Below is my code from the main activity and my android manifest:</p><pre><code>package android.Database;import android.app.Activity;import android.content.Intent;import android.database.sqlite.SQLiteDatabase;import android.os.Bundle;import android.view.Menu;import android.view.MenuItem;public class projectsDatabase extends Activity {    /** Called when the activity is first created. */    SQLiteDatabase myDB = null;    final static String MY_DB_NAME =""projectsDatabase"";    final static String MY_DB_TABLE = ""projects"";    static final int MENU_PROJECTS = 1;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        onCreateDBAndDBTabled();        setContentView(R.layout.main);    }    private void onCreateDBAndDBTabled(){        myDB = this.openOrCreateDatabase(MY_DB_NAME, MODE_PRIVATE, null);        myDB.execSQL(""CREATE TABLE IF NOT EXISTS "" + MY_DB_TABLE                + "" ( _id integer primary key_autoincrement,""+                 ""Name varchar(100),""+                 ""Comment varchar(128),""+                 ""BookingDetails varchar(255),""+                 ""Project-Kind integer(3))""                +"""");         }    public boolean onCreateOptionsMenu(Menu menu) {          super.onCreateOptionsMenu(menu);            menu.add(0, MENU_PROJECTS, 0, R.string.menuProjects)            .setShortcut('1', 'f')            .setIcon(R.drawable.icon);             return true;          }    public boolean onOptionsItemSelected(MenuItem item){          switch (item.getItemId()) {          case MENU_PROJECTS:            Intent iProjects= new Intent(this, projects.class);            startActivity(iProjects);            return true;          }          return false;        }}</code></pre><p></p><pre><code>    &lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;        &lt;activity android:name="".projectsDatabase""                  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="".projects""&gt;&lt;/activity&gt;        &lt;activity android:name="".projects_New""&gt;&lt;/activity&gt;    &lt;/application&gt;&lt;/manifest&gt;</code></pre><p>--------------------------------EDIT-------------------------------------------------------</p><p>here is my LogCat output:</p><pre><code>02-22 08:48:01.999: DEBUG/AndroidRuntime(819): &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;02-22 08:48:02.009: DEBUG/AndroidRuntime(819): CheckJNI is ON02-22 08:48:02.229: DEBUG/AndroidRuntime(819): --- registering native functions ---02-22 08:48:02.239: INFO/jdwp(819): received file descriptor 23 from ADB02-22 08:48:02.969: DEBUG/AndroidRuntime(819): Shutting down VM02-22 08:48:02.979: DEBUG/dalvikvm(819): DestroyJavaVM waiting for non-daemon threads to exit02-22 08:48:02.979: DEBUG/dalvikvm(819): DestroyJavaVM shutting VM down02-22 08:48:02.989: DEBUG/dalvikvm(819): HeapWorker thread shutting down02-22 08:48:02.989: DEBUG/dalvikvm(819): HeapWorker thread has shut down02-22 08:48:02.999: DEBUG/jdwp(819): JDWP shutting down net...02-22 08:48:02.999: DEBUG/jdwp(819): +++ peer disconnected02-22 08:48:02.999: INFO/dalvikvm(819): Debugger has detached; object registry had 1 entries02-22 08:48:03.009: DEBUG/dalvikvm(819): VM cleaning up02-22 08:48:03.019: DEBUG/dalvikvm(819): LinearAlloc 0x0 used 629804 of 4194304 (15%)02-22 08:48:03.479: DEBUG/AndroidRuntime(829): &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;02-22 08:48:03.479: DEBUG/AndroidRuntime(829): CheckJNI is ON02-22 08:48:03.689: DEBUG/AndroidRuntime(829): --- registering native functions ---02-22 08:48:03.699: INFO/jdwp(829): received file descriptor 23 from ADB02-22 08:48:04.439: INFO/ActivityManager(559): Starting activity: Intent { action=android.intent.action.MAIN categories={android.intent.category.LAUNCHER} flags=0x10000000 comp={android.Database/android.Database.projectsDatabase} }02-22 08:48:04.449: DEBUG/AndroidRuntime(829): Shutting down VM02-22 08:48:04.459: DEBUG/dalvikvm(829): DestroyJavaVM waiting for non-daemon threads to exit02-22 08:48:04.469: DEBUG/dalvikvm(829): DestroyJavaVM shutting VM down02-22 08:48:04.469: DEBUG/dalvikvm(829): HeapWorker thread shutting down02-22 08:48:04.469: DEBUG/dalvikvm(829): HeapWorker thread has shut down02-22 08:48:04.479: DEBUG/jdwp(829): JDWP shutting down net...02-22 08:48:04.479: DEBUG/jdwp(829): +++ peer disconnected02-22 08:48:04.479: INFO/dalvikvm(829): Debugger has detached; object registry had 1 entries02-22 08:48:04.489: DEBUG/dalvikvm(829): VM cleaning up02-22 08:48:04.509: DEBUG/dalvikvm(829): LinearAlloc 0x0 used 639228 of 4194304 (15%)</code></pre><p>--------------------------------------Edit 2-----------------------------------------------here is 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;TextView      android:layout_width=""fill_parent""     android:layout_height=""wrap_content""     android:text=""@string/hello""    /&gt;&lt;/LinearLayout&gt;</code></pre>","582674","","101258","","2011-10-03 14:29:27","2011-10-03 14:29:27","app android ""app has stopped unexpectedly. please try again""","<android>","3","4","","",""
"5075525","1","","","2011-02-22 07:59:15","1","630","<ol><li>How can I implement a board for a board game on Android, with the board having clickable cells and movable pieces in it? </li><li>Can I use map editors like TiLed? How?</li></ol>","627920","","1351522","","2012-05-06 00:26:59","2012-05-06 00:26:59","Implementation of the board in an Android board game","<android>","1","0","","",""
"5075582","1","5075635","","2011-02-22 08:09:06","1","2096","<p>I know we can trigger an <code>Intent.ACTION_SEND</code> intent to send email. But according to the official api docs, we can't specify ""from address"" sending an email(EXTRA_EMAIL->to address). So is it possible to specify the from address? if possible, then how?</p><p>Thanks in advance.~bow</p>","525413","","473070","","2011-02-22 08:12:14","2011-02-22 08:41:47","send email via Intent with specified from address","<android><email><android-intent>","1","2","","",""
"5075672","1","5075768","","2011-02-22 08:22:18","0","59","<pre><code>public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.full_image);    ImageView image = (ImageView) findViewById(R.id.imageView1);    Bitmap bMap = BitmapFactory.decodeStream(R.drawable.sample_1);    image.setImageBitmap(bMap);}</code></pre><p>Although the link is made I am unable to display the image.</p>","617356","","40342","","2011-02-22 08:25:56","2011-02-22 08:31:31","I am getting an error in my code","<android>","1","0","1","",""
"5075687","1","5075747","","2011-02-22 08:23:44","1","1391","<p>Say, if I don't call <code>super.onPause</code> in a override method from superclass <code>Activity</code>, I would get an error when <code>onPause()</code> is called. But errors don't show up when I have no <code>super.XXX</code> calls in methods (<code>onCreate</code>, <code>onStartCommand</code>, ...) of a class derived from <code>Service</code>.</p><p>So on what conditions should I call <code>super.XXX</code> in a override method?</p>","325313","","40342","","2011-02-22 08:27:37","2011-02-22 08:58:08","Do I need to call ""super.XXX"" whenever I override a method?","<java><android><override>","4","0","","",""
"5075691","1","","","2011-02-22 08:24:19","0","180","<p>max limit of AlertDialog can be shown on top of single Activity;</p><p>using following code :</p><pre><code>AlertDialog.Builder dialog = new AlertDialog.Builder(context);dialog.setTitle(""title"");dialog.setMessage(""msg"");dialog.setPositiveButton(R.string.ok, null);dialog.show();</code></pre>","526359","","1228","","2013-09-04 15:36:11","2013-09-04 15:36:11","max limit of AlertDialog can be shown","<android><alertdialog><limits>","0","3","1","",""
"5075720","1","5075796","","2011-02-22 08:27:20","1","905","<p>I have a database with different results in my database in my Android project. I want to fetch these results and show them in a tablelayout. In the tablelayout I want to add a row for each result, and write the column ""date"" on one textview, and the ""result"" on the second textview. Both textviews are on the same row. I fetch the data and store it in a cursor. </p><p>My question is: How do I use the cursor and add a row depending on how much data there is in my database?</p><p>Right now I try to add a row for each row in the cursor like this: </p><pre><code>TableLayout tl = (TableLayout)findViewById(R.id.table_layout2);     TableRow tr = new TableRow(this);     tr.setLayoutParams(new LayoutParams(                             LayoutParams.FILL_PARENT,                             LayoutParams.WRAP_CONTENT));             TextView mTvDate = new TextView(this);             TextView mTvResult = new TextView(this);             int x=0;             for(int i=0;i&lt;c.getCount();i++){             mTvDate.setText(date[x]);             mTvResult.setText(""""+nocorrect[x]+"" av ""+ noqs[x] +"" (""+ proc[x]+ ""%)"");             mTvDate.setLayoutParams(new LayoutParams(                             LayoutParams.FILL_PARENT,                             LayoutParams.WRAP_CONTENT));             mTvResult.setLayoutParams(new LayoutParams(                             LayoutParams.FILL_PARENT,                             LayoutParams.WRAP_CONTENT));             tr.addView(mTvDate);             tr.addView(mTvResult);     tl.addView(tr,new TableLayout.LayoutParams(            LayoutParams.FILL_PARENT,             LayoutParams.WRAP_CONTENT));             }</code></pre><p>But I think I need to create a NEW tablerow, cause I get this error message: </p><pre><code>02-22 09:22:17.543: ERROR/AndroidRuntime(333): Caused by: java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first.</code></pre><p>But I don't want to remove it, I want to add more. Any ideas? Thanks!</p>","455479","","","","","2011-02-22 08:34:59","How can I add extra TableRows to my TableLayout depending on cursor?","<android><cursor><tablelayout>","1","0","","",""
"5075773","1","5075853","","2011-02-22 08:32:09","1","535","<p>I'm dealing with the ""Low memory: no more background process"" problem.My activity is at background and killed when the situation occurs.</p><p>I'm trying to save and load the instance state to solve it.</p><p>But since it doesn't happen every time.How should I test my activity with this situation?</p><p>Thanks!</p>","428022","","","","","2011-02-22 08:42:33","How to emulate the process of a background activity is killed by the system because of low memory on Android?","<android><memory><process><activity>","1","0","","",""
"5075774","1","","","2011-02-22 08:32:11","0","1261","<p>I have a ListView with items that contain an ImageView and an EditText. When I touch EditText, it gets focus, virtual keyboard appears and when suggestions appear above the keyboard, EditText loses focus (and suggestions disappear).</p><p>This happens on Android 2.3 (emulator and HTC Hero), and was reported on another non-2.3 device (probably Galaxy S with 2.2). HTC Hero with 2.2 and 2.1 roms don't have this problem...</p><p>Any ideas how to get rid of such behavior?</p><p><strong>EDIT:</strong></p><p>If I override onSizeChanged of ListView without calling super.onSizeChanged, focus is not lost (but a lot of other bugs is introduced...)</p>","133648","","157882","","2011-10-23 14:13:55","2012-12-03 20:03:45","Word suggestions make EditText lose focus","<android><focus><textinput><autosuggest>","2","0","","",""
"5075911","1","","","2011-02-22 08:50:42","1","1855","<p>I want to learn to develop cross platform mobile/smart phone apps. I would like to go with Mosync because I am a C++ programmer but I am still unsure about some aspects of mosync.</p><ul><li><p>So can Mosync create apps for IPhone (from looking at the site, its table says it can but its image shows the IPhone grayed out which makes me think that IPhone compatibility is still in development or testing?).</p></li><li><p>Can Mosync work with GPS on Android &amp; IPhone platforms?</p></li><li><p>Is it easy(not difficult) to compile &amp; run(port) applications to Android &amp; Iphone?</p></li><li><p>Are there any drawbacks you have discovered with mosync or any limitations you have discovered with mosync?</p></li><li><p>Is it free to develop a commercial app for Iphone &amp; android using mosync? Or do I have to buy Mosyncs subscription to make money off my app?</p></li></ul>","593747","","593747","","2011-02-22 09:25:09","2012-10-20 09:44:22","First timer wants to do it with Mosync","<iphone><android><mobile>","3","1","1","",""
"5075971","1","","","2011-02-22 08:55:36","0","40","<p>I am just starting to develop with Android and it seems to be complicated to read a database from an existing sqlite file and show it in a ListView. I have tried for a few days and looked at a lot of examples but I am stumped.</p><p>My database is simple. I have 3 tables and I am only interested in a particular one.This table has 2 columns.</p><p>What should I do and what is the step?</p>","625139","","513838","","2011-06-29 13:11:58","2011-06-29 13:11:58","Trouble with my Database in Android","<android><sqlite>","0","2","","",""
"5075973","1","","","2011-02-22 08:55:43","3","3100","<p>Can we make use of default browser instead of the WebView browserIs there ny API for the default browser.....</p><p>or we have to compulsory create our own browser through WebView</p>","627987","","104117","","2011-02-22 09:03:17","2013-12-10 06:59:30","How to open default browser","<android><browser>","3","0","2","",""
"5075975","1","10476845","","2011-02-22 08:55:55","5","1035","<p>i want to implement pattern locking in my app, so that user has to draw a pattern before using the application.</p><p>Can anyone suggest me how to do that?</p>","152867","","","","","2012-05-07 05:33:16","Pattern Locking in android","<android>","2","3","2","",""
"5075991","1","5076326","","2011-02-22 08:57:15","0","237","<p>I'd like to use activities that are not bundled with my app. How could I do that? Using intents or something? I am sure it must be simple.</p><h2>UPDATE</h2><p>The main problem is that I can't actually do this:</p><pre><code>new Intent(this, SomeExternalActivity.class))</code></pre><p>because I can't import the class (it's an external app). Something similar, using a string or something.</p><p>Thanks a lot!</p><h2>UPDATE</h2><p>This one doesn't work either:</p><pre><code>new Intent(this, Class.forName(""com.somepackage.SomeExternalActivity"");</code></pre>","348183","","348183","","2011-02-22 09:12:27","2011-05-27 09:25:47","Android: How do I use activities provided from other apps?","<android><activity>","3","1","","",""
"5075996","1","","","2011-02-22 08:57:36","0","174","<p>I'm developing an Android application. I'm also working with OpenGL graphics.</p><p>I have a sphere drawn on the screen and I want to let user move it when he touches over it.  If he touches outside the sphere nothing happens.</p><p>How can I detect when user touches over sphere?</p>","555653","","44729","","2011-02-22 14:02:45","2011-02-22 14:02:45","identify wheteher the user touched sphere or not","<android><opengl-es>","1","0","","",""
"5076084","1","5076162","","2011-02-22 09:04:35","0","164","<p>I am trying to generate a ListView with a header with the data a receive during runtime. In the constructor of my ListAdapter which extends an ArrayAdapter I am doing the following:</p><pre><code>textViews = new TextView[tableHeaders.size()];    for (int index = 0; index &lt; tableHeaders.size(); index++) {        textViews[index] = new TextView(context);        textViews[index].setWidth((((TableHeaderValues) tableHeaders        .elementAt(index)).getHeaderWidth() * width) / 100);        textViews[index].setSingleLine();        linearLayout.addView(textViews[index]);    } </code></pre><p>In my getview() method I set the text for each of the text view and I return the LinearLayout. However my output does not display all the rows. Supposing I have 3 rows, it displays only the second row and the other two rows are not visible. What could be the possible reason? Can someone kindly suggest me a better way of doing this.</p>","533690","","366904","","2011-02-22 09:14:39","2011-02-22 09:14:39","Dyncamically generating a List View with header","<android>","1","0","","",""
"5076119","1","","","2011-02-22 09:07:02","13","4172","<p>In the latest two weeks, without releasing an update to my app, I have started getting a bunch of reports with corrupted databases. Below is the stacktrace. Android cannot open the database, and neither could the sqlite-manager program on my computer. However, the SQLite manager-addon to firefox could open it. After running the command ""compact database"", the database was fixed and I could open it in android. Is there any way I could do something like this within my app? The big problem is that I cannot even attempt to open the database, because newer versions of Android will immediately delete and replace the database, as you can see in the stacktrace below. Can PRAGMA Statements somehow be executed without opening the database?</p><p>Regards,</p><pre><code>02-22 09:55:20.245: ERROR/Database(5382): CREATE TABLE android_metadata failed02-22 09:55:20.245: ERROR/Database(5382): Failed to setLocale() when constructing, closing the database02-22 09:55:20.245: ERROR/Database(5382): android.database.sqlite.SQLiteDatabaseCorruptException: database disk image is malformed02-22 09:55:20.245: ERROR/Database(5382):     at android.database.sqlite.SQLiteDatabase.native_setLocale(Native Method)02-22 09:55:20.245: ERROR/Database(5382):     at android.database.sqlite.SQLiteDatabase.setLocale(SQLiteDatabase.java:1950)02-22 09:55:20.245: ERROR/Database(5382):     at android.database.sqlite.SQLiteDatabase.&lt;init&gt;(SQLiteDatabase.java:1818)02-22 09:55:20.245: ERROR/Database(5382):     at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:817)02-22 09:55:20.245: ERROR/Database(5382):     at android.database.sqlite.SQLiteDatabase.openOrCreateDatabase(SQLiteDatabase.java:851)02-22 09:55:20.245: ERROR/Database(5382):     at android.database.sqlite.SQLiteDatabase.openOrCreateDatabase(SQLiteDatabase.java:844)02-22 09:55:20.245: ERROR/Database(5382):     at android.app.ContextImpl.openOrCreateDatabase(ContextImpl.java:540)02-22 09:55:20.245: ERROR/Database(5382):     at android.content.ContextWrapper.openOrCreateDatabase(ContextWrapper.java:203)02-22 09:55:20.245: ERROR/Database(5382): Deleting and re-creating corrupt database /mnt/sdcard/myapp/backup.sqlite02-22 09:55:20.245: ERROR/Database(5382): android.database.sqlite.SQLiteDatabaseCorruptException: database disk image is malformed02-22 09:55:20.245: ERROR/Database(5382):     at android.database.sqlite.SQLiteDatabase.native_setLocale(Native Method)02-22 09:55:20.245: ERROR/Database(5382):     at android.database.sqlite.SQLiteDatabase.setLocale(SQLiteDatabase.java:1950)02-22 09:55:20.245: ERROR/Database(5382):     at android.database.sqlite.SQLiteDatabase.&lt;init&gt;(SQLiteDatabase.java:1818)02-22 09:55:20.245: ERROR/Database(5382):     at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:817)02-22 09:55:20.245: ERROR/Database(5382):     at android.database.sqlite.SQLiteDatabase.openOrCreateDatabase(SQLiteDatabase.java:851)02-22 09:55:20.245: ERROR/Database(5382):     at android.database.sqlite.SQLiteDatabase.openOrCreateDatabase(SQLiteDatabase.java:844)02-22 09:55:20.245: ERROR/Database(5382):     at android.app.ContextImpl.openOrCreateDatabase(ContextImpl.java:540)02-22 09:55:20.245: ERROR/Database(5382):     at android.content.ContextWrapper.openOrCreateDatabase(ContextWrapper.java:203)</code></pre><p>Edit: I manager to open the database like this:</p><pre><code>db = SQLiteDatabase.openDatabase(database, null, SQLiteDatabase.NO_LOCALIZED_COLLATORS);</code></pre><p>But when I run this:</p><pre><code>String sqlQuery = ""pragma integrity_check"";db.execSQL(sqlQuery);</code></pre><p>I get this:</p><pre><code>ERROR/AndroidRuntime(9144): Caused by: android.database.sqlite.SQLiteDatabaseCorruptException: database disk image is malformed: pragma integrity_check</code></pre><p>Edit2: I have realized that vacuuming the database fixes the issue. But if I vacuum from inside my app, with exeSQL(""vacuum""), it does not help. Why is this? :'(</p>","249871","","249871","","2011-02-22 11:03:44","2011-10-14 09:01:20","Android database corrupt, but can open in SQLite Manager. Recoverable?","<android><database><sqlite><corruption><pragma>","3","0","3","",""
"5076120","1","5564431","","2011-02-22 09:07:33","1","550","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/4944321/stream-an-audio-pls-in-android"">Stream an audio .pls in android</a>  </p></blockquote><p>I am working in Android application My question is that i  get one url from the .pls file. Now how can i stream that URL and play music from it.ThankYou</p>","627753","","","","","2011-04-06 09:49:34","stream the url in android","<android>","1","1","","2011-04-07 04:35:06",""
"5076165","1","","","2011-02-22 09:12:57","8","12276","<p>can i send local notifications  on Android, as i can in iPhone?</p>","606596","","658369","","2011-03-18 10:34:47","2011-03-18 10:34:47","Local Notifications in Android?","<android><notifications><local>","1","0","4","",""
"5076183","1","5076497","","2011-02-22 09:14:37","1","4888","<p>how can we import a project's package into an android project?</p>","620787","","","","","2011-02-22 09:45:19","how to import a project's package into an android project?","<android>","1","0","","",""
"5076202","1","","","2011-02-22 09:16:12","-2","735","<p>In android development, is it possible to store values into an array. I want to store id's into an array. Any help is appreciated</p>","396543","","","","","2011-02-22 09:24:07","Store values into an array Android","<android>","1","1","1","",""
"5076410","1","5076533","","2011-02-22 09:37:20","5","3539","<p>I want to do something when the mobile device is closing, but I don't know what is the method; could you tell me how to detect if mobile device is shutting down?<br /> I know the method about mobile restart <code>android.intent.action.BOOT_COMPLETED</code>, but I cannot find similar power off.</p>","233618","","1051783","","2013-11-13 15:26:36","2013-11-13 15:26:36","how to know device is power off","<android>","1","0","1","",""
"5076436","1","5076499","","2011-02-22 09:39:46","3","101","<p>my application consists of &lt; 10 activities, which cover the wizard part. Each of these activities should collect user data and save the current status, which should be resumed, if the application is unexpectedly terminated.</p><p>Now, as the collected data seems to be 'private', the <a href=""http://developer.android.com/guide/topics/data/data-storage.html"" rel=""nofollow"">Dev Guide</a> suggests three possibilities to save data:</p><ol><li><p><strong>Shared Preferences</strong><br />Seems appropriate for my purpose; key/value would be perfectly fine for my kind of data</p></li><li><p><strong>Internal Storage</strong><br />Imo an I/O on every intent is an overkill</p></li><li><p><strong>SQLite Database</strong><br />Fine, too</p></li></ol><p>The thing I'm curious about now, is this the right approach to choose a home for my data? Are there any guidelines or best practices concerning storage on Android devices?</p>","284472","","","","","2011-02-22 09:45:39","Which is the right place to store data for a wizard-like application?","<android><architecture><storage>","1","0","1","",""
"5076485","1","5076756","","2011-02-22 09:44:40","0","842","<p>I am using an activity to capture imagei want to start a finish my activity on picture takenon capture button i write following code</p><pre><code>btnCapture.setOnClickListener(new OnClickListener() {            @Override            public void onClick(View v) {                preview.camera.takePicture(shutterCallback, rawCallback,                        jpegCallback);                CameraActivity.this.finish();            }        });</code></pre><p>but my activity is not responding after adding </p><p>CameraActivity.this.finish()</p><p>Help will be appreciated</p>","609765","","","","","2011-02-22 10:10:17","how to finish activity after picture taken by camera","<android>","1","0","","",""
"5076552","1","","","2011-02-22 09:50:13","5","2904","<p>I have created a toggle button in android and I have used a selector to change the background that switches between the on and off backgrounds.</p><p>My problem is how to make the background remain in the state it will be clicked, for example, if I press on ""on"", the background should remain in ""on"" background state, but in my case as soon as I stop pressing the button, it reverts to the original background.</p><p>Does anyone has any idea how to implement it?</p><p>Here is my selector file:</p><pre><code>&lt;selector xmlns:android=""http://schemas.android.com/apk/res/android""&gt;    &lt;item android:drawable=""@drawable/off"" /&gt; &lt;!-- default --&gt;    &lt;item android:state_pressed=""true"" android:drawable=""@drawable/on"" /&gt; &lt;!-- on state --&gt;       &lt;item android:state_focused=""false"" android:drawable=""@drawable/off"" /&gt; &lt;!-- off state --&gt;&lt;/selector&gt;</code></pre>","613071","","114066","","2012-04-13 10:14:54","2014-03-19 16:44:27","iphone switch like button for android","<android>","4","2","","",""
"5076556","1","5082053","","2011-02-22 09:50:29","6","6296","<p>I'm a new Android developer. I have tried to understand the use of Layout inflator from the documentation but have not been able to understand. what is the use of layout inflator in android?</p><p>What are the situations when one would have to use it?</p>","590849","","1338292","","2013-09-11 03:27:08","2013-09-16 14:09:08","what is the use of the layoutinflator?","<android><android-layout><android-inflate>","2","1","1","",""
"5076574","1","5076632","","2011-02-22 09:52:23","7","4629","<p>I am getting the following stack trace (below is a complete copy) , this gives me little or no indication as to where in a massive application it is when going wrong and user feedback is nothing beyond ""It crashed"".</p><p>Is there anything I can do to pinpoint this more ?</p><pre><code>java.lang.NullPointerException at android.widget.ArrayAdapter.getCount(ArrayAdapter.java:291)    at android.widget.AdapterView.checkFocus(AdapterView.java:689)    at android.widget.AdapterView$AdapterDataSetObserver.onInvalidated(AdapterView.java:813)    at android.database.DataSetObservable.notifyInvalidated(DataSetObservable.java:43)    at android.widget.BaseAdapter.notifyDataSetInvalidated(BaseAdapter.java:54)    at android.widget.ArrayAdapter$ArrayFilter.publishResults(ArrayAdapter.java:469)    at android.widget.Filter$ResultsHandler.handleMessage(Filter.java:282)    at android.os.Handler.dispatchMessage(Handler.java:99)    at android.os.Looper.loop(Looper.java:143)    at android.app.ActivityThread.main(ActivityThread.java:4701)    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>","507991","","318465","","2011-02-22 10:54:36","2013-06-20 08:07:39","Arrayadapter.getcount null point exception","<android><arrays>","2","0","1","",""
"5076620","1","5077522","","2011-02-22 09:56:28","0","318","<p>When I print the new java.util.Date() it prints this in Android </p><p>Thu Feb 22 05:30:00 Asia/Calcutta 2007</p><p>I need this to be print as Thu Feb 22 05:30:00 IST 2007</p><p>please help</p>","563735","","","","","2011-02-22 11:32:47","change TimeZone display type from new java.util.Date() in android","<android><timezone><format>","1","0","0","",""
"5076630","1","5078548","","2011-02-22 09:57:07","0","50","<p>i have a task: there are some data,but i want to delete it,so provides the user with options as 3 days ,5days ...to delete it. i want to use alarmmanager,but when the user close the device or modify the system time,the Timer will no longer accurately,how to avoid it .thank you</p>","233618","","","","","2011-02-22 13:10:16","about Timing execution","<android>","1","0","","",""
"5076636","1","","","2011-02-22 09:57:51","1","1102","<p>I am creating a dash board application. This is what it looks like:<br><img src=""http://i.stack.imgur.com/sX7co.png"" alt=""enter image description here""> </p><p>Now I will explain to you how it is working. When I am clicking the ""UP"" button the red hand moves up and stay in the 30. The ""DOWN"" button is used for down the hand from 30 to 0. The BUTTON5 is used for moving the hand from 0 (starting position) to 5. When I am clicking BUTTON10 it means it will move from 5 to 10. BUTTON-5 is used for down the hand from 10 to 5 and BUTTON0 is used for down the hand from 5 to 0.</p><p>This is my code:</p><pre><code>import android.app.Activity;import android.graphics.Bitmap;import android.graphics.BitmapFactory;import android.graphics.Matrix;import android.graphics.drawable.BitmapDrawable;import android.os.Bundle;import android.view.MotionEvent;import android.view.View;import android.view.View.OnClickListener;import android.view.animation.AccelerateInterpolator;import android.view.animation.Animation;import android.view.animation.AnimationUtils;import android.widget.Button;import android.widget.ImageView;public class dash1 extends Activity {    ImageView img, img1;    Animation an, an1, an2, an3, an4, an5;    Button bt, bt2, bt3, bt4, bt5, bt6;    /** Called when the activity is first created. */    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        img = (ImageView) findViewById(R.id.ImageView01);        final Bitmap bmp = BitmapFactory.decodeResource(getResources(),                R.drawable.minute);        final int w = bmp.getWidth();        final int h = bmp.getHeight();        final Matrix mat = new Matrix();        mat.postRotate(245);        Bitmap rtd = Bitmap.createBitmap(bmp, 0, 0, w, h, mat, true);        BitmapDrawable bmd = new BitmapDrawable(rtd);        img.setImageDrawable(bmd);        an = AnimationUtils.loadAnimation(this, R.anim.anim);        an1 = AnimationUtils.loadAnimation(this, R.anim.anim1);        an2 = AnimationUtils.loadAnimation(this, R.anim.anim2);        an3 = AnimationUtils.loadAnimation(this, R.anim.anim3);        an4 = AnimationUtils.loadAnimation(this, R.anim.anim4);        an5 = AnimationUtils.loadAnimation(this, R.anim.anim5);        bt = (Button) findViewById(R.id.Button01);        bt2 = (Button) findViewById(R.id.Button02);        bt3 = (Button) findViewById(R.id.Button03);        bt4 = (Button) findViewById(R.id.Button04);        bt5 = (Button) findViewById(R.id.Button05);        bt6 = (Button) findViewById(R.id.Button06);        bt.setOnClickListener(new View.OnClickListener() {            @Override            public void onClick(View v) {                // TODO Auto-generated method stub                an.setFillAfter(true);                img.startAnimation(an);            }        });        bt2.setOnClickListener(new View.OnClickListener() {            @Override            public void onClick(View v) {                // TODO Auto-generated method stub                img.startAnimation(an1);            }        });        bt3.setOnClickListener(new View.OnClickListener() {            @Override            public void onClick(View v) {                // TODO Auto-generated method stub                an2.setFillAfter(true);                img.startAnimation(an2);            }        });        bt4.setOnClickListener(new View.OnClickListener() {            @Override            public void onClick(View v) {                // TODO Auto-generated method stub                an3.setFillAfter(true);                img.startAnimation(an3);            }        });        bt5.setOnClickListener(new View.OnClickListener() {            @Override            public void onClick(View v) {                // TODO Auto-generated method stub                an2.setFillAfter(true);                img.startAnimation(an4);            }        });        bt6.setOnClickListener(new View.OnClickListener() {            @Override            public void onClick(View v) {                // TODO Auto-generated method stub                an5.setFillAfter(true);                img.startAnimation(an5);            }        });    }}</code></pre><p>Now I want to add a button ""+"" instead of button5 and button10 (for increment) and ""-"" for the button-5 and 0. How can I do the increment by a single button. I don't know how to do this. Here for rotating I am using animation. This is the xml code for rotation. Anybody know how to do this means just tell me.</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;set xmlns:android=""http://schemas.android.com/apk/res/android""    android:shareInterpolator=""false""&gt;    &lt;rotate android:toYScale=""0.0""         android:pivotX=""50%""         android:pivotY=""50%""         android:duration=""3599""         android:fromDegrees=""0""         android:toDegrees=""205""&gt;     &lt;/rotate&gt;&lt;/set&gt;</code></pre>","607853","","310001","","2011-02-22 10:20:10","2011-02-22 10:20:10","android animation through button","<android>","0","0","1","",""
"5076649","1","5076899","","2011-02-22 09:59:22","1","444","<p>I want to add views on click of button. My screen has a text view and an edit text and a ""Add More"" button. on the click of button another set of text view and edit text should get appended to the screen. I am also planning to add scroll view once the my screen grows longer. My Code snippet is as follows  </p><pre><code>   button.setOnClickListener(new OnClickListener() {          @Override      public void onClick(View v) {          text.setText(""hello how are you?"");  //this is just an example, I may want to add lot more here.    linearLayout.addView(text);      setContentView(linearLayout);          }  </code></pre><p>I know I am missing something very basic but I do not know what is that. :(<br>Please help.</p>","628090","","628090","","2011-02-22 10:18:59","2011-02-22 10:27:15","OnClick of Button more views should be added at runtime in the layout, but I am not able ot do that","<android><button><views><click>","2","0","","",""
"5076691","1","","","2011-02-22 10:04:05","38","21086","<p>Integrating Multiple Social networks into Android with a single common Framework or API or JAR</p><p><strong>For iPhone we have ShareKit, which integrates multiple sharing options in one framework.<a href=""http://www.getsharekit.com/"">http://www.getsharekit.com/</a></strong></p><p>For android i have no idea if something similar exists. I am building an application which shares information to social networks, like some posts and tweets. Its a simple game, where gamers publish updates about their achievements and levels.. etc.. I used Facebook and twitter APIs but they take up lots of memory and difficult to manage. Also i cannot handle them efficiently. Any help on how to integrate them would be appreciated.</p><p>I would like to have a few suggestions on this.. </p><p>Another Example seems PinkelStar</p><p><a href=""http://www.pinkelstar.com/"">http://www.pinkelstar.com/</a></p><p>Thanks</p>","568613","","236348","","2012-10-01 20:36:24","2013-07-31 08:50:07","Integrating FaceBook, Twitter, Social networks in Android","<android><facebook><twitter><social-networking>","9","5","25","",""
"5076716","1","","","2011-02-22 10:06:30","0","1060","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/64745/moving-to-android-from-j2me"">moving to android from j2me</a>  </p></blockquote><p>shall we reuse the j2me source code for android application.i have the j2me source code.is this easy to convert the j2me code to android code </p>","627783","","260990","","2011-02-22 10:10:46","2011-02-22 10:29:08","j2me to android","<android><java-me>","2","0","","2011-02-22 13:59:32",""
"5076730","1","","","2011-02-22 10:07:57","0","218","<p>how to detect discard button is pressed when sending email android</p>","533677","","","","","2011-02-22 13:08:57","how to detect discard button is pressed when sending email android","<android>","1","0","1","2011-12-27 16:27:01",""
"5076738","1","5076783","","2011-02-22 10:08:41","0","388","<p>Need some help. I have a table with some columns..like ""name"" , ""phone"" etc...How to chek, is there a name ""Jone"" or not ?Thanks !</p>","602011","","","","","2011-02-22 10:31:49","Android: SQLite find data","<android>","2","0","","",""
"5076769","1","","","2011-02-22 10:11:30","4","1190","<p>As far as I understood the official documentation about Widgets I am a little bit confused.</p><p>The ""standard"" way would be to define a <code>BroadcastReceiver</code> and define the update frequency in milliseconds - this way allows a minimum update interval of 30 minutes to save battery power. Sounds reasonable.</p><p>The ""manual"" way I found reading the Google documentation would be to handle the update of widgets yourself using the <code>AlarmManager</code>. Using this method higher update intervals are possible (though of course discouraged!) and it would be possible to use alarm types that do not wake up the device when asleep. (I assume the intent is sent any time after the event should trigger as soon as the device wakes up for some other reason - is that right??)</p><p>Now, I get confused by the following thought: widgets reside on home screens. Or at least that's the most common place they will be found. Android offers many pages (standard is 5 or 7) on home screens, so a Widget, even though placed there by the user, might not even be visible!</p><p>As long as the information a widget displays is just a <strong>very simple text</strong> (like the current time!) that could be calculated or derived without any delay whenever needed, <strong>I do not want any update frequency or even device wake-up intents when it is not visible!</strong><br><strong>But</strong> as long as the device is on, or more specific: <strong>as long as the screen is on AND the widget is visible</strong>, I want a lot of update events! Like a clock displaying the seconds needs an intent to redraw every second!</p><p>How can that be realized? How is the ""Android analog clock"" realized? Neither method A (""standard"") nor B (""manual"") give my high update frequency but only as long as the device is on and my widget is visible.</p><p>Can anybody give me a hint???</p>","273456","","","","","2011-02-22 13:03:45","Updating a widget only when device is on AND widget is visible on home screen","<android><android-widget><android-alarms>","1","0","3","",""
"5076798","1","","","2011-02-22 10:14:04","0","81","<p>I have created a series of listview in my app using a basic listview format as below, I am trying to add a border and a header to each of the listviews but whenever I try to add anything to the xml it force closes, I have tried textview framelayout nothing works, can anyone help with this?</p><pre><code>package com.ff.org.p;import android.app.ListActivity;import android.content.Intent;import android.net.Uri;import android.os.Bundle;import android.view.View;import android.widget.ArrayAdapter;import android.widget.ListView;import com.ff.org.R;import com.ff.org.prrums.Anforums;import com.ff.org.preps.Locare;public class Ar extends ListActivity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle icicle) {        super.onCreate(icicle);        // Create an array of Strings, that will be put to our ListActivity        String[] names = new String[] { ""Forums"", ""Visitor Info"", ""Travel"", ""History"", ""Live Text"" };        ListView lv = getListView();        lv.setBackgroundResource(R.drawable.background);        lv.setCacheColorHint(00000000);        this.setListAdapter(new ArrayAdapter&lt;String&gt;(this, R.layout.list_item, names));    }    // Get the item that was clicked    @Override    public void onListItemClick(ListView l, View v, int position, long id) {        if (position == 0) {            Intent intent = new Intent(this, Arsenforums.class);            startActivity(intent);        }        if (position == 1) {            String url = ""http://www.ide.com/nal/"";            Intent i = new Intent(Intent.ACTION_VIEW);            i.setData(Uri.parse(url));            startActivity(i);        } else if (position == 2) {            Intent intent = new Intent(this, Locarse.class);            startActivity(intent);        }    }}</code></pre><p>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:layout_width=""fill_parent""  android:layout_height=""fill_parent""  android:gravity=""center""  android:padding=""10dp""  android:textColor=""@color/black""  android:textSize=""21sp""&gt;&lt;/TextView&gt;</code></pre><p>Any one help with this</p>","445174","","310001","","2011-02-22 10:32:23","2011-02-22 10:32:23","Force close when I try to add items to xml","<java><android><eclipse>","1","0","","",""
"5076870","1","5470273","","2011-02-22 10:21:08","2","1597","<p>HI,</p><p>Anyone suggest some sample and idea to post the video data to server.I want to playback the video later as stream video from the server directly.Anyone suggest me how to upload the stream video to php server and playback it as stream video from server.</p>","555806","","","","","2011-05-22 11:18:03","Android Video Stream upload to php server?","<android><android-webview><android-video-player>","1","0","1","",""
"5076885","1","5091064","","2011-02-22 10:23:21","0","639","<p>how to extract WCF REST services server response by POST method in android client. I have done encryption on string , then send it to server, facing problem..</p><pre><code>JSONObject jObject = new JSONObject();            try {                HttpPost post = new HttpPost(url);                jObject.put(""jsonString"", eJSON);                jObject.put(""key"", cryptKey);                Log.i(""jason Object"", jObject.toString());                post.setHeader(""json"", jObject.toString());                StringEntity se = new StringEntity(jObject.toString());                se.setContentEncoding(new BasicHeader(HTTP.CONTENT_TYPE,                        ""application/json""));                post.setEntity(se);</code></pre>","","Nimit ","","","","2011-02-23 12:44:28","how to extract WCF REST services server response by POST method in android client","<android><wcf>","2","0","","",""
"5076914","1","","","2011-02-22 10:26:55","0","1627","<p>I want to display text vertically on <code>Canvas</code>.<br>Please help me.</p>","525175","","1079901","","2012-04-23 15:03:36","2013-08-27 08:57:26","write text vertically on canvas","<android><android-canvas>","3","2","","",""
"5076931","1","5118266","","2011-02-22 10:29:03","3","2475","<p>I want add a <code>ProgressBar</code> to each item of a <code>ListView</code> </p><p>I am adding adapter to the <code>ListView</code> like this</p><pre><code>RankAdapter adapter=new RankAdapter(model);list.setAdapter(adapter);</code></pre><p>The <code>RankAdapter</code> and <code>RankHolder</code> classes are as follows</p><pre><code>class RankAdapter extends CursorAdapter {    RankAdapter(Cursor c) {        super(RankNew.this, c);    }    @Override    public void bindView(View row, Context arg1, Cursor c) {        // TODO Auto-generated method stub        RankHolder holder = (RankHolder) row.getTag();        holder.populateForm(c, helper);    }    @Override    public View newView(Context ctxt, Cursor c, ViewGroup parent) {        LayoutInflater inflater = getLayoutInflater();        View row = inflater.inflate(R.layout.rankvalues, parent, false);        RankHolder holder = new RankHolder(row);        row.setTag(holder);        return row;    }}class RankHolder {    private TextView url = null;    private TextView googletext = null;    private TextView alexatext = null;    private View row = null;    RankHolder(View row) {        this.row = row;        url = (TextView) row.findViewById(R.id.newrankurl);        googletext = (TextView) row.findViewById(R.id.newrankgoogle);        alexatext = (TextView) row.findViewById(R.id.newrankalexa);    }    void populateForm(final Cursor c, final RankHelper helper) {        url.setText(helper.getUrl(c));        googletext.setText(helper.getGoogle(c));        alexatext.setText(helper.getAlexa(c));    }}</code></pre>","606559","","310001","","2011-02-22 10:38:49","2013-04-23 12:28:18","displaying a ProgressBar in an each item of a ListView","<android><listview><progress-bar>","2","1","1","",""
"5077020","1","","","2011-02-22 10:37:57","0","3410","<p>I am building a board game for the Android platform.</p><p>The game has a main screen with a row of buttons that the user uses to indicate how they want to play the game (1 player, 2 player, wi-fi, and network).</p><p>I would like the know the most effective way of displaying that a selection was chosen by switching images. I am currently using <code>ImageButton</code> objects to display these options. When the user selects a mode by clicking on it, the image that was there should be replaced by one that is darker. I know how to do this using <code>android:state_pressed</code> so that for the duration of the click, another image shows. However what I need is for the other image to replace the original once the button is clicked, not just while the click is held, until another button is clicked, at which point the button should revert to displaying the first image again. Can someone tell me how to do this please?</p>","628143","","310001","","2011-02-22 10:45:50","2013-07-05 16:08:04","How to make an android imagebutton object switch images","<android>","4","1","","",""
"5077071","1","5078566","","2011-02-22 10:43:51","0","453","<p>I am trying to copy a record from a sql lite database within a android application and then insert that same record into the same table but with two different ids in the first two columns. any ideas? </p><pre><code>    SQLiteDatabase db = dbs.getReadableDatabase();        String SQL = ""SELECT * FROM table_1 a "" +                ""join table_2 b on a.ID = b.ID "" +                ""where table1_Id = '""+Id+""' And"" +                ""table_2_ID = 'one'"";         Cursor cursor2 = db.rawQuery(SQL, null);         startManagingCursor(cursor2);        int m = cursor2.getColumnCount();        try{           while (cursor2.moveToNext()) {             for(int i=0; i&lt;m; i++){                String id1 = cursor2.getString(i);             }           }         }         catch(Exception e){}</code></pre>","569654","","135152","","2011-05-25 02:54:53","2011-05-25 02:55:35","sql lite, android - copy record into the same table","<android><sql><sqlite><sqlite3>","1","0","","",""
"5077080","1","","","2011-02-22 10:45:11","1","1775","<p>I want to detect if the request is coming from a mobile browser (i m using java/jsp)</p><p>Now when i access the page from my samsung mobile phone i get the user agent header as: - </p><p>SAMSUNG-GT-S5620/S5620DDJE1 SHP/VPP/R5 Dolfin/1.5 Nextreaming SMM-MMS/1.2.0 profile/MIDP-2.1 configuration/CLDC-1.1</p><p>should i check that the header contains iPhone,BlackBerry,Android,webOS,iPod,Samsung or there is some more simple way...</p><p>How can i make sure that the browser supports javascript and</p><p>by the way does mobile browsers suppport hashchange or anything js ""<strong>advanced</strong>""</p><p>If javascript is not supported by the mobile browser then i would like to redirect to some simple page with a single form...</p><p>or i have to make a simple page for mobile browser such that it runs well <strong>with or without</strong> js support</p><p>thanks</p>","245858","","173077","","2011-02-22 11:55:24","2013-01-13 13:01:36","detect mobile browser and javascript support","<javascript><android><mobile-website>","4","0","","",""
"5077092","1","","","2011-02-22 10:46:58","0","2563","<p>I try to connect to a REST webservice from my Android device and PUT some data there, but all I get is a GET result. Even my webserver insists it's a GET request. What is wrong with my code?</p><pre><code>DefaultHttpClient httpclient = new DefaultHttpClient();HttpPut httpPut = new HttpPut(url);httpPut.addHeader(""Content-Type"", ""application/xml; charset=utf-8"");httpPut.addHeader(""User-Agent"", ""Android"");HttpEntity entity = new StringEntity(data);httpPut.setEntity(entity);HttpResponse response = httpclient.execute(httpPut);HttpEntity input = response.getEntity();StringBuilder result = new StringBuilder();if (input != null) {    InputStream instream = input.getContent();    result = convertStreamToString(instream);    instream.close();}httpclient.getConnectionManager().shutdown();return result.toString();</code></pre>","628139","","","","","2011-07-28 20:02:47","Why my HttpPut sends a GET request from my Android?","<android><rest><put>","3","0","","",""
"5077176","1","5077289","","2011-02-22 10:55:34","2","230","<p>what should be the maximum memory can be used by an standard android app.</p>","617302","","991737","","2012-01-10 19:15:03","2012-01-10 19:15:03","standard memory coverage of android app","<android><memory><memory-management>","1","0","1","",""
"5077180","1","5077333","","2011-02-22 10:55:48","0","911","<p>i am using camera resource in my activitysome time activity does not respond and ask for force closehow can we release our resources on force close of activity</p>","609765","","","","","2012-12-19 11:35:45","How to release resources on force close of activity","<android>","2","3","","",""
"5077183","1","","","2011-02-22 10:56:05","1","334","<p>I am creating website on android.I want create html page,that swipe list of images.plz,help me!!!</p>","577501","","","","","2011-02-22 10:56:05","Swipe image in html","<android>","0","3","1","",""
"5077235","1","","","2011-02-22 11:01:28","0","475","<p>i am able to insert other contact informations like emails and phone numbers and all that but this setting custom ringtone for contact seems typical can anybody provide way to insert this?</p><p>i am following this method to insert other things<a href=""http://developer.android.com/reference/android/provider/ContactsContract.RawContacts.html"" rel=""nofollow"">http://developer.android.com/reference/android/provider/ContactsContract.RawContacts.html</a></p>","548208","","548208","","2011-02-23 04:28:03","2011-02-23 04:28:03","how can i set custom_ringtone while adding new contact?","<android><insert><contactscontract>","0","6","","",""
"5077244","1","5077500","","2011-02-22 11:02:28","2","2058","<p>I want to add my App to ""Share via"" Dialog. How can I do this?</p>","597624","","","","","2014-03-07 17:21:00","How can I add my Android App to Share Dialog?","<android><list><listener><share>","3","0","2","",""
"5077246","1","5077299","","2011-02-22 11:02:42","3","1284","<p>Every time I create an <code>Uri</code> object as new <code>Uri(""some uri"")</code> it says an Uri cannot instantiate. Is there any other solution?</p><pre><code>Uri u = new Uri(""content://contacts"");</code></pre>","628163","","467592","","2013-06-10 16:11:40","2013-06-10 16:11:40","Error creating Uri object","<java><android><uri>","1","0","","",""
"5077247","1","","","2011-02-22 11:02:45","0","4759","<p>I have used the following code to customize the background of options menu successfully.</p><pre><code>getLayoutInflater().setFactory(new Factory() {    @Override    public View onCreateView(String name, Context context, AttributeSet attrs) {        if (name.equalsIgnoreCase(""com.android.internal.view.menu.IconMenuItemView"")) {            try { // Ask our inflater to create the view                LayoutInflater f = getLayoutInflater();                final View view = f.createView(name, null, attrs);                /*                 * The background gets refreshed each time a new item is                 * added the options menu. So each time Android applies                 * the default background we need to set our own                 * background. This is done using a thread giving the                 * background change as runnable object                 */                new Handler().post(new Runnable() {                    public void run() {                        view.setBackgroundResource(R.drawable.blue_bg_pixel);                    }                });                return view;            }            catch (InflateException e) {            }            catch (ClassNotFoundException e) {            }        }        return null;    }});</code></pre><p>Now I have to customize menu size, text size/color. Anybody plz help me in this.</p><p>Thanks in advance.</p>","540638","","318465","","2011-02-22 11:18:17","2014-04-07 05:56:13","android: how to change Text size, color of Options Menu Items and options menu height and width","<android><options-menu>","1","1","","",""
"5077325","1","","","2011-02-22 11:11:24","2","983","<p>A company asked me if I am able to program an Android-App for their internal process but with small mobile-device-management capabilites. I'm aware of the ""enable manual apk-installation""-checkbox inside of the Android-Settings-Menu. I think it opens additional security holes if it is permanently checked.</p><p>So easiset way is to send a SMS with an URL to this APK, enable checkbox, install the update and disable checkbox manually. A lot to do, to update a program.</p><p>Coming from Windows Mobile and Symbian I was able to program a Facade.exe which starts a download and replaces some signed parts. The Application signing of Windows Mobile and Symbian allows this.</p><p>Is this possible with Android(not rooted)? I read some articles that it is possible to implement own Markets(like Amazon is doing it). Is it possible to use some of those APIs for the purpose of doing an auto-update. Where are thoes APIs, I am not able to find them.</p><p>Is this a solution:Programming a torch-app(there are thousands around), publishing it to the android market. But with a small button to activate the whole application with a secret password. Updates can be rolled out via android market functionality.</p><p>A complete MDM (mobile device management) is overkill.</p>","396558","","","","","2011-02-22 13:07:39","Implementing a small updater for own android application?","<android><apk><auto-update>","1","0","4","",""
"5077425","1","5077543","","2011-02-22 11:21:10","25","10412","<p>Is it possible to detect when the Done key of onScreen keyboard was pressed ?</p>","266272","","68805","","2011-02-22 11:24:22","2013-10-14 20:23:35","Android detect Done key press for OnScreen Keyboard","<android>","2","0","6","",""
"5077489","1","","","2011-02-22 11:28:38","0","427","<p>I am using the LVL provided by Google to use the Android Market Licensing Service.</p><p>I want to cache the server response but I do not want to use an obfuscated <code>SharedPreference</code> file to store license data because I have concerns about storing the key securely. I just want to be able to dump the encrypted response to a <code>SharedPreference</code> file so that nobody else can tamper with it. It is OK if they can view it.</p><p>Now, there are obviously some parameters that are not part of the server response. For example, the number of retries the app has made. I want to store that along with the response.</p><p>Is there any way I can append some custom data to the license request so that the server echos it back with the response after encrypting it? (Maybe as an extra field). </p><p>Will the server append any custom data I might send along with the request?</p>","341008","","341008","","2011-02-22 11:58:18","2011-04-27 20:55:29","Adding custom fields to license check requests using Android LVL","<android><licensing><android-lvl>","1","0","","",""
"5077498","1","5077521","","2011-02-22 11:29:44","0","673","<p>I am facing some unusual problem every now and then to solve I even formatted my system but all in vain, problem is when ever I open any xml file its says <strong>Missing theme</strong> and no graphical layout is rendered as in below image</p><p><img src=""http://i.stack.imgur.com/BBMvi.png"" alt=""enter image description here""></p>","517247","","","","","2011-02-22 11:40:50","Android eclipse problem","<android><eclipse>","1","6","","",""
"5077566","1","5094565","","2011-02-22 11:36:37","3","2322","<p>How far can we think of Platform Independent Mobile Applications ? The idea behind this question was - To use less efforts for building the same application for different platforms like Android , iOS , Symbian.</p><p>I had looked on some of the tools and got one <a href=""http://developer.openplug.com/"" rel=""nofollow"">Open Plug</a>. Will explore ASAP. What are your ideas on it ?</p><p><strong>EDIT :</strong>I then started exploring <a href=""http://phonegap.com/"" rel=""nofollow"">PhoneGap</a>. I found it good enough to build the apps using HTML,CSS,JS, we can include JQueryMobile and Sencha Touch as well. </p>","380277","","380277","","2012-04-30 05:10:14","2013-03-19 23:43:36","Platform Independent Mobile Applications","<iphone><android><ios><mobile><cross-platform>","3","6","4","2013-03-20 01:15:21",""
"5077719","1","5077833","","2011-02-22 11:51:28","0","561","<p>So my webservice returns a bunch of JSONObjects, which is turned into a string by my stringbuilder.</p><pre><code>[{""DateID"":""2011-02-01"",""DateName"":""februari 2011"",""IntName"":1102,""Consumption"":172,""Temperature"":null},{""DateID"":""2011-01-01"",""DateName"":""januari 2011"",""IntName"":1101,""Consumption"":316,""Temperature"":null}]</code></pre><p>How can I get this String to be iterable så I can get all the name/values inside? I've tried all the examples I found here but I only get the first objecxt or no object at all (since JSONObjects can't start with a '[' char).</p><p>Regards</p>","498112","","","","","2011-02-22 11:59:24","android, iterate over stringbuilder json?","<android><json><stringbuilder>","1","0","","",""
"5077792","1","5115981","","2011-02-22 11:56:44","0","1944","<p>I am trying to learn how to make a quiz to add to my app. I have done extensive searches and found that I will be using SQlite. Which I have seen how a database gets created from a couple of sites. But I was wondering if there was a better tutorial to this. I know that Appinventer has a quiz tutorial but putting blocks together does not show me the code snippets that I am using and therefor in the end I end up learning nothing but putting blocks together. Anyone have a tutorial on how to do a quiz basic question and answer and give a score at the end?</p><p>Or is there a way to see the underlying code to a project we build with appinventor?</p><p>after doing research I decided to go for basics as I get more skills. Here is what my research has yeilded so far. Am I going in the right direction?</p><pre><code>   int i = 0;TextView tv;  String[] Food = {""Ice Cream"", ""Bacon"", ""Cheese"", ""Sandwich""};   @Overrideprotected void onCreate(Bundle savedInstanceState) {    // TODO Auto-generated method stub    super.onCreate(savedInstanceState);    setContentView(R.layout.arraylay);    tv = (TextView) findViewById(R.id.tvView);            Button bt1 = (Button) findViewById(R.id.bt1);        bt1.setOnClickListener(new View.OnClickListener() {        @Override    public void onClick(View v) {    // TODO Auto-generated method stub    if (i &lt; Food.length){                                      tv.setText(Food[i]);            i++;        }        }    });</code></pre>","577265","","1228","","2013-09-09 18:18:40","2013-09-09 18:18:40","adding a quiz to app with sqlite","<android><sqlite>","1","3","","",""
"5077797","1","","","2011-02-22 11:57:00","1","228","<p>i have one doubt,we are creating the application with different version with api.my question is all android os supported device is support our application.is this possible?</p>","627783","","","","","2011-02-22 12:03:56","all version and api of application supported in all android os mobile device","<android>","1","0","2","",""
"5077806","1","","","2011-02-22 11:57:33","0","529","<p>I am facing lot problems in my webview based application on Android. Different Android devices (HTC Legend and Samsung Galaxy Tab) react differently to my JavaScript code. As an example, If I pass a String from Java code to JavaScript and I treat it as an Array in JavaScript (using split method) then it is treated as character Array for HTC Legend and Android Emulator. But reacts differently for Galaxy Tab. Please note that I have updated HTC Legend to Android 2.2, the OS which we have on Galaxy tab. So both are having same Android OS.</p><p>I want to know if anybody else is also facing problems with different JavaScript support for different Android devices? Any information regarding this will be of great help to me.Thank you</p>","628252","","","","","2011-02-22 12:12:50","Problem with JavaScript for different Android devices","<javascript><android><webview><android-webview>","1","0","","",""
"5077859","1","5078047","","2011-02-22 12:01:45","6","997","<p>How much of the core Java APIs are present in Android API? How proficient will I become in writing core Java applications by writing applications for Android phones?</p>","335997","","40342","","2013-05-24 07:34:36","2013-05-24 07:35:19","How much of the core Java APIs are present in Android API","<java><android>","4","1","","",""
"5077870","1","5079118","","2011-02-22 12:02:41","1","653","<p>How can I detect new line character from the text view in android?</p>","1004437","","1424450","","2012-07-07 20:01:15","2012-07-07 20:01:15","I want to detect new line from the text view.","<android>","1","0","","",""
"5077884","1","","","2011-02-22 12:04:34","1","299","<p>I need to display a <code>ListView</code> with some images, and I'm using the following code:</p><pre><code>    dataText = (TextView)findViewById(R.id.data);    dataText.setText(camping.stringIn + "" &gt;&gt; "" + camping.stringOut);    l = name.length;    ArrayList&lt;tipologia&gt; tipologieList=new ArrayList&lt;tipologia&gt;();    tipologia[] tip = new tipologia[l];    for (int i = 0; i &lt; l; i++)     {        int rand = new Random().nextInt(3);        availability[i] = String.format(""%d"", rand);        tip[i] = new tipologia(image[i]);    }                          for(int i=0; i&lt;tip.length; i++)     {        tipologieList.add(tip[i]);    }    ArrayList&lt;HashMap&lt;String, Object&gt;&gt; data=new ArrayList&lt;HashMap&lt;String,Object&gt;&gt;();    for(int i=0;i&lt;tipologieList.size();i++){        tipologia t = tipologieList.get(i);        HashMap&lt;String,Object&gt; tipologieMap = new HashMap&lt;String, Object&gt;();        tipologieMap.put(""image"", t.getImm());         data.add(tipologieMap);      }    String[] from={""image""};    int[] to={R.id.personImage};    SimpleAdapterMod adapter=new SimpleAdapterMod(            getApplicationContext(),            data,            R.layout.tipologia,            from,            to);    adapter.setViewBinder(new ViewBinder() {        public boolean setViewValue(View view, Object data,                String textRepresentation) {            if(data instanceof String &amp;&amp; view instanceof Immagine ){                                  ((Immagine)view).loadFromURL((String)data);                }                return true;            }                else{                    return false;                }        }    });</code></pre><p>I have a problem: in the list there's space for 4 rows, and when I scroll down it happens that the image of the fifth row is the same of the image of the first row and the subsequent images are wrong too.</p><p>Can someone tell me why?</p>","396133","","493939","","2012-06-01 12:50:14","2012-06-01 12:50:14","Problems with the ViewBinder","<android><android-listview><adapter><android-viewbinder>","1","1","1","",""
"5077914","1","","","2011-02-22 12:07:59","0","683","<pre><code>protected CharSequence[] _options = { ""English "", ""Thai"", ""German"", ""Italy"", ""Spain"", ""All languages"" };protected boolean[] _selections = new boolean[_options.length];@Overrideprotected Dialog onCreateDialog(int id) {    return new AlertDialog.Builder(this).setTitle(""Choose Language"")            .setMultiChoiceItems(_options, _selections, new DialogSelectionClickHandler())            .setPositiveButton(""OK"", new DialogButtonClickHandler()).create();}public class DialogSelectionClickHandler implements DialogInterface.OnMultiChoiceClickListener {    @Override    public void onClick(DialogInterface dialog, int clicked, boolean selected) {        Log.i(""ME"", _options[clicked] + "" selected: "" + selected);    }}public class DialogButtonClickHandler implements DialogInterface.OnClickListener {    @Override    public void onClick(DialogInterface dialog, int clicked) {        switch (clicked) {        case DialogInterface.BUTTON_POSITIVE:            printSelectedLanguage();            break;        }    }}protected void printSelectedLanguage() {    for (int i = 0; i &lt; _options.length; i++) {        db.open();        // Log.i( ""ME"", _options[ i ] + "" selected: "" + _selections[i] );        if (_selections[0] == true) {            db.setLang_Act(1, 1); // setLang_Act(long id_lang, long act)        }        db.close();    }}</code></pre><p>From the code above I want to set value 1 to field ""Lang_Act"" in database if checkbox one ( _selections[0] and id_lang =1 ) is selected.</p><p>But the problem is I have 5 languages (so have 5 id_lang) and I wonder how to check which checkbox is selected.</p><p>I try like this:</p><pre><code>if (_selections[0] == true) {    db.setLang_Act(1, 1);}else if (_selections[1] == true) {    db.setLang_Act(2, 1);}else if (_selections[2] == true) {    db.setLang_Act(3, 1);}else if (_selections[3] == true) {    db.setLang_Act(4, 1);}else if (_selections[4] == true) {    db.setLang_Act(5, 1);}else {    db.setLang_Act(1, 0);    db.setLang_Act(2, 0);    db.setLang_Act(3, 0);    db.setLang_Act(4, 0);    db.setLang_Act(5, 0);</code></pre><p>But it doesn't work and have no force close about checkbox.</p><p>I think it doesn't work because of function <code>setLang_Act(long id_lang, long act)</code>  (because I see in database field long act is doesn't change).</p><p>What should I do?</p><p>this is my logcat when select each checkbox</p><pre><code>02-22 19:01:29.812: INFO/MEooooo(471): English selected: true02-22 19:01:32.002: INFO/MEooooo(471): English selected: false02-22 19:01:33.071: INFO/MEooooo(471): English selected: true02-22 19:01:35.472: INFO/MEooooo(471): Thai selected: true02-22 19:01:37.081: INFO/MEooooo(471): Thai selected: false02-22 19:01:38.212: INFO/MEooooo(471): Thai selected: true02-22 19:01:39.312: INFO/MEooooo(471): German selected: true02-22 19:01:40.151: INFO/MEooooo(471): German selected: false02-22 19:01:41.502: INFO/MEooooo(471): German selected: true02-22 19:01:42.092: INFO/MEooooo(471): Italy selected: true02-22 19:01:44.201: INFO/MEooooo(471): Italy selected: false02-22 19:01:44.861: INFO/MEooooo(471): Italy selected: true02-22 19:01:46.281: INFO/MEooooo(471): Spain selected: true02-22 19:01:47.442: INFO/MEooooo(471): Spain selected: false02-22 19:01:49.393: INFO/MEooooo(471): Spain selected: true02-22 19:01:50.772: INFO/MEooooo(471): German selected: false</code></pre>","605358","","605358","","2011-02-22 15:29:54","2011-02-22 15:29:54","set value from check box into database","<android><checkbox>","0","2","0","",""
"5078008","1","","","2011-02-22 12:18:44","6","7742","<p>I discovered that the following HTML code does not work on Android (it will only use the default font: Droid Sans. On desktop it is working as expected.</p><pre><code>&lt;p style='font-family: ""Droid Sans"",sans-serif;'&gt;vând whisky ?i tequila, pre? fix.&lt;/p&gt;&lt;p style='font-family: ""Droid Sans Mono"",monospace;'&gt;vând whisky ?i tequila, pre? fix.&lt;/p&gt;&lt;p style='font-family: ""Droid Serif"",serif;'&gt;vând whisky ?i tequila, pre? fix.&lt;/p&gt;</code></pre>","99834","","","","","2014-03-23 08:05:41","Using CSS font-family to select Droid fonts not working on Android","<android><fonts><font-face><fontfamily>","2","0","1","",""
"5078041","1","5078839","","2011-02-22 12:22:32","6","23759","<p>i am using linear layout and frame  layout.In the linear layout i keep an image as background and in the frame layout i keep an imageView. In that imageView i give an image.Now i want to make the second image(that is in the imageView) transparent..how can i do this</p>","607853","","","","","2014-02-11 09:08:27","how can i make an image transparent in android","<android><transparency>","5","2","1","",""
"5078058","1","","","2011-02-22 12:24:27","4","6706","<p>I'm developping an app which constantly needs to show the results to the user in a TextView like some sort of log.</p><p>The app works nicely and it shows the results in the TextView but as long as it keeps running and adding lines the app gets slower and crashes because of the character lenght of the TextView.</p><p>I would like to know if the android API provides any way to force a TexView to automatically delete the oldest lines that were introduced in order to make room for the new ones.</p><p>Thanks.</p>","626459","","100957","","2011-02-22 12:53:33","2013-08-09 18:18:44","How to delete the old lines of a TextView","<android><delete><textview>","7","0","2","",""
"5078063","1","","","2011-02-22 12:24:39","0","1008","<p>I am trying to include a user define package in my application. I got full source code, pls find my directory structure below.  </p><p>Apps -> App1 -> src -> com -> abc -> def (def contains the java files)  </p><p>Apps -> App2 -> src -> com -> pqr -> xyz (xyz contains the java files)     </p><p>I have to use the classes present in def folder, so i did ""import com.abc.def"" in the java files in xyz folder, i am getting the ""package not found"" compilation error.<br>After googling i found that i need to set the CLASSPATH during compilation so tried using like this ""LOCAL_CLASSPATH := com.abc.def.*"" (without quotes). Again in the compilation i am getting the error ""No rule to make target"" for the LOCAL_CLASSPATH := com.abc.def.....</p><p>Not able to fix now, please help me for the same.</p><p>Thanks &amp; Regards,<br>SSuman185</p>","607625","","","","","2011-02-22 12:24:39","how to include class path in android.mk file?","<android>","0","2","","",""
"5078100","1","5078219","","2011-02-22 12:29:32","4","4610","<p>I need to read a binary file consisting of 4 byte integers (little endian) into a 2D array for my Android application. My current solution is the following:</p><pre><code>DataInputStream inp = null;try {    inp = new DataInputStream(new BufferedInputStream(new FileInputStream(procData), 32768));}catch (FileNotFoundException e) {    Log.e(TAG, ""File not found"");}int[][] test_data = new int[SIZE_X][SIZE_Y];byte[] buffer = new byte[4];ByteBuffer byteBuffer = ByteBuffer.allocate(4);for (int i=0; i &lt; SIZE_Y; i++) {    for (int j=0; j &lt; SIZE_X; j++) {        inp.read(buffer);        byteBuffer = ByteBuffer.wrap(buffer);        test_data[j][SIZE_Y - i - 1] = byteBuffer.order(ByteOrder.LITTLE_ENDIAN).getInt();    }}</code></pre><p>This is pretty slow for a 2k*2k array, it takes about 25 seconds.  I can see in the DDMS that the garbage collector is working overtime, so that is probably one reason for the slowness.</p><p>There has to be a more efficient way of using the ByteBuffer to read that file into the array, but I'm not seeing it at the moment. Any idea on how to speed this up?</p>","347857","","","","","2012-04-05 19:13:26","Fast reading of little endian integers from file","<java><android><performance><file-io><byte-order>","3","2","2","",""
"5078108","1","5078156","","2011-02-22 12:30:13","1","1668","<pre><code>    SQLiteDatabase db = dbs.getReadableDatabase();       String SQL = ""SELECT * FROM one a "" +                ""join two b on a.oneID = b.twoID "" +                ""where a.oneId = '""+Id+""' And where "" +                ""b.column2 = 'Inc'"";         Cursor cursor2 = db.rawQuery(SQL, null);         startManagingCursor(cursor2);</code></pre><p>How do i make this statement work? </p>","569654","","","","","2011-02-22 12:34:35","android how to do a select and where join statement","<android><sql><sqlite>","1","0","","",""
"5078129","1","5078199","","2011-02-22 12:32:34","2","1104","<p>I want to create a following kind of layout in android , rite now i have created with fixed height of listview which is causing a problem with different dimension of screens of mobiles.</p><p><img src=""http://i.stack.imgur.com/X4uov.png"" alt=""""></p><p>Initially when this screen appears a button will be at the bottom side only with empty listview and as an when the items will get added in a list view , it grows but button will remain steady at the bottom.</p><p>so far i have written following 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:orientation=""vertical""    android:layout_width=""match_parent""    android:layout_height=""match_parent""    &gt;   &lt;ImageView    android:id=""@+id/cText""     android:src=""@drawable/c_text""    android:visibility=""visible""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:layout_gravity=""center_horizontal""    android:layout_marginTop=""50dip""   /&gt;    &lt;ListView        android:id=""@android:id/list""        android:layout_width=""fill_parent""         android:layout_height=""wrap_content""            android:drawSelectorOnTop=""false""        /&gt;&lt;ImageButton        android:id=""@+id/cBtn""        android:layout_width=""150dip""        android:layout_height=""52dip""        android:src=""@drawable/preview""         android:layout_alignParentTop=""@+id/list""        android:layout_gravity=""center_horizontal""/&gt;&lt;/RelativeLayout&gt;</code></pre>","405383","","","","","2011-02-22 12:59:35","Flexible relativelayout with list and image button","<android><android-layout><relativelayout>","2","0","","",""
"5078173","1","5078249","","2011-02-22 12:36:11","2","966","<p>I am a Student..and right now trying to develop code for android..that shows nearby hospital locations to user's current location..i know how to get kml file for that..and know that i need to parse that file..to get different Placemark attribute value..but couldn't succeed ..so if any of my friends have small guide,tutorial,code,example regarding how to parse the kml file for fetching value of multiple placemark..please please let me know..</p><p>Thank You.</p>","626481","","","","","2011-02-22 12:42:46","android Help to get Multiple placemark location from kml","<android><parsing><location><kml>","1","0","1","",""
"5078203","1","5078277","","2011-02-22 12:38:09","3","3092","<p>How do I add a view in relative layout at runtime, so that it aligns itself at the Top of the parent. Say I am adding an EditText on clicking the button. Now this EditText should come in such a way that EditText comes above the Button. </p><p>here is an example of what I am doing.</p><pre><code>    button = new Button(this);  //here I am just checking if the button can come above the EditText    button.setText(""I am a button"");      params.addRule(RelativeLayout.BELOW, editText.getId());      params.addRule(RelativeLayout.ALIGN_PARENT_ABOVE);      relativeLayout.addView(button);  </code></pre><p>I am not able to make the alignment at all.Any clue is highly appreciated.Thanks in Advance.</p>","628090","","","","","2011-10-06 03:57:12","Aligning views at runtime in RelativeLayout","<android><relativelayout>","2","0","1","",""
"5078208","1","5078659","","2011-02-22 12:38:45","4","3978","<p>I have had users complaining of a ""duplicate provider authority"" error when trying to install my android application. I initially thought it might be an old version interfering with the new version, but they have never installed the app before. Any suggestions as to what might be causing this?</p><p>Thanks,Nathan</p>","364727","","","","","2013-07-02 01:45:45","android duplicate provider authority","<android><provider><android-contentprovider><authority>","1","0","","",""
"5078240","1","","","2011-02-22 12:41:15","1","912","<p>How can we use sprites to apply the image transformation in java/ android? I know we can use andEngine in android for this.</p><p>I need to apply mesh warping and produce a bulge effect using sprite.</p>","193545","","","","","2011-02-22 12:41:15","Image transformation using Sprite","<java><android><image-manipulation><sprite>","0","1","","",""
"5078268","1","","","2011-02-22 12:44:28","1","6158","<p>I have implemented simple database android application.In which I have displayed list of name and images.But if data is more then ten then table layout is not scrolling vertically.</p><p>Is it possible to implement vertical scrolling without using scrollview?If possible then please provide me some reference.</p><p>Thanks in advance.</p>","352707","","","","","2011-02-22 13:15:21","How to implement scrolling in TableLayout?","<android>","3","1","1","",""
"5078374","1","","","2011-02-22 12:55:45","1","550","<p>I use this to upload the video to php server, when i try to upload the image ,it was working fine, but when i tried to upload the Video the following error occur,</p><p><strong>""02-22 18:22:35.588: ERROR/dalvikvm-heap(780): Out of memory on a 14680278-byte allocation.""</strong></p><pre><code>      ***HttpURLConnection conn = null;          DataOutputStream dos = null;          DataInputStream inStream = null;           String exsistingFileName = ""/sdcard/Video/dance.wmv"";          // Is this the place are you doing something wrong.          String lineEnd = ""\r\n"";          String twoHyphens = ""--"";          String boundary =  ""*****"";          int bytesRead, bytesAvailable, bufferSize;          byte[] buffer;          int maxBufferSize = 1*1024*1024;          String responseFromServer = """";          String urlString = ""http://172.17.0.146/viddygo/upload.php"";          try          {           //------------------ CLIENT REQUEST          Log.e(""MediaPlayer"",""Inside second Method"");          FileInputStream fileInputStream = new FileInputStream(new File(exsistingFileName) );           // open a URL connection to the Servlet           URL url = new URL(urlString);           // Open a HTTP connection to the URL           conn = (HttpURLConnection) url.openConnection();           // Allow Inputs           conn.setDoInput(true);           // Allow Outputs           conn.setDoOutput(true);           // Don't use a cached copy.           conn.setUseCaches(false);           // Use a post method.           conn.setRequestMethod(""POST"");           conn.setRequestProperty(""Connection"", ""Keep-Alive"");           conn.setRequestProperty(""Content-Type"", ""multipart/form-data;boundary=""+boundary);           dos = new DataOutputStream( conn.getOutputStream() );           dos.writeBytes(twoHyphens + boundary + lineEnd);           dos.writeBytes(""Content-Disposition: form-data; name=\""uploadedfile\"";filename=\"""" + exsistingFileName +""\"""" + lineEnd);           dos.writeBytes(lineEnd);           Log.e(""MediaPlayer"",""Headers are written"");           // create a buffer of maximum size           bytesAvailable = fileInputStream.available();           bufferSize = Math.min(bytesAvailable, maxBufferSize);           buffer = new byte[bufferSize];           // read file and write it into form...           bytesRead = fileInputStream.read(buffer, 0, bufferSize);           while (bytesRead &gt; 0)           {            dos.write(buffer, 0, bufferSize);            bytesAvailable = fileInputStream.available();            bufferSize = Math.min(bytesAvailable, maxBufferSize);            bytesRead = fileInputStream.read(buffer, 0, bufferSize);           }           // send multipart form data necesssary after file data...           dos.writeBytes(lineEnd);           dos.writeBytes(twoHyphens + boundary + twoHyphens + lineEnd);           BufferedReader in = new BufferedReader(                        new InputStreamReader(                           conn.getInputStream()));                String inputLine;                while ((inputLine = in.readLine()) != null)                     tv.append(inputLine);           // close streams           Log.e(""MediaPlayer"",""File is written"");           fileInputStream.close();           dos.flush();           dos.close();          }          catch (MalformedURLException ex)          {               Log.e(""MediaPlayer"", ""error: "" + ex.getMessage(), ex);          }          catch (IOException ioe)          {               Log.e(""MediaPlayer"", ""error: "" + ioe.getMessage(), ioe);          }          //------------------ read the SERVER RESPONSE          try {                inStream = new DataInputStream ( conn.getInputStream() );                String str;                while (( str = inStream.readLine()) != null)                {                     Log.e(""MediaPlayer"",""Server Response""+str);                }                inStream.close();          }          catch (IOException ioex){               Log.e(""MediaPlayer"", ""error: "" + ioex.getMessage(), ioex);          }</code></pre><hr><p>can anyone suggest some idea to solve this.</p>","555806","","","","","2012-11-05 15:21:55","Android video upload error?","<android><android-video-player>","1","0","3","",""
"5078385","1","5078480","","2011-02-22 12:56:25","0","525","<p>&lt;  i tried this code to open music files from sdcard but now m getting null pointer exception  at openDirectory(""/sdcard""); can anyone help me here..   thnx ></p><pre><code>public class SdcardActivity extends ListActivity { private List&lt;String&gt; item = null; private List&lt;String&gt; path = null; private String root = ""/sdcard""; private TextView myPath;@Override public void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    // Intent intent=getIntent();    setContentView(R.layout.main);    myPath = (TextView)findViewById(R.id.path);    Log.d(""Contentprovider-onCreate"", ""root""+root);    try{        Log.d(""Contentprovider-onCreate"", ""root""+root);        openDirectory(""/sdcard"");    }catch (NullPointerException e) {        // TODO: handle exception        e.printStackTrace();    }    }public void openDirectory(String dirPath){    myPath.setText(""Location: "" +dirPath);    Log.d(""Contentprovider-getDir"", ""path"" +dirPath);    item = new ArrayList&lt;String&gt;();    path = new ArrayList&lt;String&gt;();    File f = new File(dirPath);    File[] files = f.listFiles();    if(!dirPath.equals(root))    {        item.add(root);        path.add(root);        item.add(""../"");        path.add(f.getParent());     }    for(int i=0; i &lt; files.length; i++)    {        File file = files[i];        path.add(file.getPath());        if(file.isDirectory())         item.add(file.getName() + ""/"");     else         item.add(file.getName());    }     ArrayAdapter&lt;String&gt; fileList =         new ArrayAdapter&lt;String&gt;(this, R.layout.row, item);    setListAdapter(fileList);    } @Overrideprotected void onListItemClick(ListView l, View v, int position, long id) {    //String p =(String) path.get(position);    File file = new File(path.get(position));    if (file.isDirectory())    {        if(file.canRead())            openDirectory(path.get(position));         else        {     new AlertDialog.Builder(this)            .setIcon(R.drawable.icon)            .setTitle(""["" + file.getName() + ""] folder can't be read!"")            .setPositiveButton(""OK"",                new DialogInterface.OnClickListener() {        public void onClick(DialogInterface dialog, int which){            // TODO Auto-generated method stub            dialog.dismiss();             }         }).show();        }         } else         {     Intent intent = new Intent();    intent.setAction(Intent.ACTION_VIEW);    Uri uri = Uri.parse(""file://"" + file.getPath());    String fname=file.getName();     if(fname.endsWith("".jpeg"")||fname.endsWith(""png"")||fname.endsWith("".gif""))    {          intent.setDataAndType(uri, ""image/*"");        startActivity(intent);    }    else if(fname.endsWith("".mp4"")||fname.endsWith("".3gp""))     {             intent.setDataAndType(uri, ""video/*"");        startActivity(intent);         }     else if(fname.endsWith("".mp3""))    {          intent.setDataAndType(uri, ""audio/*"");          startActivity(intent);            }     else           try {               EditText tv = (EditText)findViewById(R.id.tn);             StringBuilder text = new StringBuilder();              BufferedReader br = new BufferedReader(new FileReader(file));               String line;              while ((line = br.readLine()) != null) {                 text.append(line);                 text.append('\n');                 //Set the text                  tv.setText(text);                  }             }//try     catch (IOException e) {        //You'll need to add proper error handling here        }//catch    }   } }  </code></pre>","628144","","","","","2011-11-08 01:56:28","null pointer exception in SdcardActivity","<android>","2","0","","",""
"5078392","1","5078425","","2011-02-22 12:57:10","0","336","<p>Hey everyone, I cannot jump from my launch-activity to my second activity and i don't know why. this is the error i get:</p><pre><code>02-22 11:43:04.858: ERROR/AndroidRuntime(18335): java.lang.RuntimeException: Unable to start activity ComponentInfo{android.Database/android.Database.projects}: android.database.sqlite.SQLiteException: no such column: _id: , while compiling: SELECT  _id, Name, Comment, projects</code></pre><p>this is my launch-activity:</p><pre><code>package android.Database;import android.app.Activity;import android.content.Intent;import android.database.sqlite.SQLiteDatabase;import android.os.Bundle;import android.view.Menu;import android.view.MenuItem;public class projectsDatabase extends Activity {    /** Called when the activity is first created. */    SQLiteDatabase myDB = null;    final static String MY_DB_NAME =""projectsDatabase"";    final static String MY_DB_TABLE = ""projects"";    static final int MENU_PROJECTS = 1;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        onCreateDBAndDBTabled();        setContentView(R.layout.main);    }    private void onCreateDBAndDBTabled(){        myDB = this.openOrCreateDatabase(MY_DB_NAME, MODE_PRIVATE, null);        myDB.execSQL(""CREATE TABLE IF NOT EXISTS "" + MY_DB_TABLE                + "" ( _id integer primary key autoincrement,""+                 ""Name varchar(100),""+                 ""Comment varchar(128),""+                 ""BookingDetails varchar(255),""+                 ""ProjectKind integer(3))""                +"";"");         }    public boolean onCreateOptionsMenu(Menu menu) {          super.onCreateOptionsMenu(menu);            menu.add(0, MENU_PROJECTS, 0, R.string.menuProjects)            .setShortcut('1', 'f')            .setIcon(R.drawable.icon);             return true;          }    public boolean onOptionsItemSelected(MenuItem item){          switch (item.getItemId()) {          case MENU_PROJECTS:            Intent iProjects= new Intent(this, projects.class);            startActivity(iProjects);            return true;          }          return false;        }}</code></pre><p>and this is the actiity i want to start when the menu-button is clicked:</p><pre><code>package android.Database;import android.app.ListActivity;import android.content.Intent;import android.database.Cursor;import android.database.sqlite.SQLiteDatabase;import android.os.Bundle;import android.view.Menu;import android.view.MenuItem;import android.view.View;import android.widget.ListView;import android.widget.SimpleCursorAdapter;import android.widget.SimpleCursorAdapter.ViewBinder;import android.widget.TextView;public class projects extends ListActivity {        SQLiteDatabase myDB = null;        static final int MENU_NEW_PROJECT = 0;        public void onCreate(Bundle icicle){            super.onCreate(icicle);            myDB = this.openOrCreateDatabase(projectsDatabase.MY_DB_NAME, MODE_PRIVATE, null);            Cursor c = myDB.rawQuery(""SELECT  _id, ColumnName, ColumnComment, "" + projectsDatabase.MY_DB_TABLE + "";"", null);            startManagingCursor(c);                SimpleCursorAdapter adapter = new SimpleCursorAdapter (this,                        android.R.layout.simple_list_item_1,                        c,                        new String[] {""_id""},                        new int []{android.R.id.text1});                adapter.setViewBinder (new ViewBinder (){                    @Override                     public boolean setViewValue(View view, Cursor theCursor, int column){                        String ColumnName = theCursor.getString(1);//Name                        String ColumnComment = theCursor.getString(2);//Comment                        ((TextView)view).setText(ColumnName + "","" + ColumnComment);                        return true;                    }                });                this.setListAdapter(adapter);        }        @Override                protected void onListItemClick(ListView l, View v, int position, long _id){                            super.onListItemClick(l, v, position, _id);                            Intent i = new Intent(this, projects_New.class);                            i.putExtra(""_id"", _id);                this.startActivity(i);            }        public boolean onCreateOptionsMenu(Menu menu){            super.onCreateOptionsMenu(menu);                    menu.add(0, MENU_NEW_PROJECT, 0, R.string.menuNewProject)                .setShortcut('1', 'n')                .setIcon(android.R.drawable.ic_menu_add);            return true;            }        public boolean onOptionsItemSelected(MenuItem item){            switch (item.getItemId()){            case MENU_NEW_PROJECT:                Intent iProjects_New = new Intent (this, projects_New.class);                    startActivity (iProjects_New);                    return true;            }            return false;        }}</code></pre><p>I really hope you can help me out again ;)</p><p>--------------------------------------------Edit-------------------------------------------now i can save data but can't select anything from my listview... here is the code for my projects_new.class : </p><pre><code>package android.Database;import android.app.Activity;import android.database.Cursor;import android.database.sqlite.SQLiteDatabase;import android.os.Bundle;import android.view.Menu;import android.view.MenuItem;import android.widget.ArrayAdapter;import android.widget.EditText;import android.widget.Spinner;import android.widget.Toast;public class projects_New extends Activity{    SQLiteDatabase myDB = null;    static final int MENU_INSERT_PROJECT = 0;    static final int MENU_UPDATE_PROJECT = 0;    @Override        public void onCreate(Bundle savedInstanceState){            super.onCreate(savedInstanceState);            setContentView(R.layout.projects_new);            Spinner s1 = (Spinner) findViewById(R.id.cb_ProjectKind);            ArrayAdapter&lt;CharSequence&gt; adapter = ArrayAdapter.createFromResource(             this,            R.array.ProjectKind,            android.R.layout.simple_spinner_item);        adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);        s1.setAdapter(adapter);        if(getIntent().hasExtra(""_id"") == true){                long l = getIntent().getExtras().getLong(""_id"");                myDB = this.openOrCreateDatabase(projectsDatabase.MY_DB_NAME, MODE_PRIVATE, null);                Cursor myCursor = myDB.rawQuery(""SELECT _id, ColumnName, ColumnComment, ColumnBookingDetails, ColumnProjectKind FROM""                                                 + projectsDatabase.MY_DB_TABLE + ""WHERE _id = "" +l+ """", null);                startManagingCursor(myCursor);                int ColumnName = myCursor.getColumnIndex(""ColumnName"");                int ColumnComment = myCursor.getColumnIndex(""ColumnComment"");                int ColumnBookingDetails = myCursor.getColumnIndex(""ColumnBookingDetails"");                int ColumnProjectKind = myCursor.getColumnIndex(""ColumnProjectKind"");                myCursor.moveToFirst();                if (myCursor != null) {                    if(myCursor.isFirst()){                        EditText eName = (EditText)findViewById(R.id.ed_Name);                        eName.setText(myCursor.getString(ColumnName));                        EditText eComment = (EditText)findViewById(R.id.ed_Comment);                        eComment.setText(myCursor.getString(ColumnComment));                        EditText eBookingDetails = (EditText)findViewById(R.id.ed_BookingDetails);                        eBookingDetails.setText (myCursor.getString(ColumnBookingDetails));                        Spinner sProjectKind = (Spinner)findViewById(R.id.cb_ProjectKind);                        sProjectKind.setSelection(myCursor.getInt(ColumnProjectKind), true);                    }                }            }        }    public boolean onCreateOptionsMenu(Menu menu){        super.onCreateOptionsMenu(menu);        if(getIntent().hasExtra(""_id"")== true)        {            menu.add(0,MENU_UPDATE_PROJECT, 0, R.string.menuUpdate)            .setShortcut('1', 's')            .setIcon(android.R.drawable.ic_menu_save);        }        else        {            menu.add(0, MENU_INSERT_PROJECT, 0, R.string.menuInsert)            .setShortcut('1', 's')            .setIcon(android.R.drawable.ic_menu_save);        }        return true;    }    public boolean onOptionsItemSelected(MenuItem item){        switch (item.getItemId()){        case MENU_INSERT_PROJECT:            EditText Name = (EditText)findViewById(R.id.ed_Name);            EditText Comment = (EditText)findViewById(R.id.ed_Comment);            EditText BookingDetails = (EditText)findViewById(R.id.ed_BookingDetails);            Spinner ProjectKind = (Spinner)findViewById(R.id.cb_ProjectKind);            int i = ProjectKind.getSelectedItemPosition();            if(Name.length()!= 0)            {                myDB = this.openOrCreateDatabase(projectsDatabase.MY_DB_NAME, MODE_PRIVATE, null);                        if(getIntent().hasExtra(""id"")== true)//update                        {                            long l = getIntent().getExtras().getLong(""_id"");                            myDB.execSQL(""UPDATE ""+ projectsDatabase.MY_DB_TABLE+"" SET ""+                                    ""name = '""+Name.getText().toString()+""', ""+                                    ""Comment = '""+Comment.getText().toString()+""', ""+                                    ""BookingDetails ='""+BookingDetails.getText().toString()+""', ""+                                    ""ProjectKind ='""+i+""', ""+                                    ""WHERE _id = ""+l+"";"");                         }                        else //insert                        {                            myDB.execSQL(""INSERT INTO ""+ projectsDatabase.MY_DB_TABLE +""(Name, Comment, BookingDetails, ProjectKind)""                                                                                        +""VALUES ('""+Name.getText().toString()+""', ""+                                                                                        ""'""+Comment.getText().toString()+""', ""+                                                                                        ""'""+BookingDetails.getText().toString()+""', ""+                                                                                        ""'""+i+""')"");                        }                        finish();                        return true;            }            else            {                Toast toast = Toast.makeText(this, ""Please enter a name for this Project!"" , Toast.LENGTH_SHORT);                toast.show();            }        }        return false;    }}</code></pre><p>Thank you so much for all your effort and help :)</p>","582674","","582674","","2011-02-22 13:42:33","2011-02-22 13:42:33","can't jump from one activity to the next","<android><sqlite>","1","0","","",""
"5078552","1","5078817","","2011-02-22 13:10:33","0","928","<p>I am using android-facebook sdk to share to facebook. Sharing works fine. But, i don't need the caption in the feed to share. If i leave caption in json, it stil shows some arbitrary String. How can i solve it?.</p><p>Code i used to share. </p><pre><code>Bundle b = new Bundle();b.putString(""picture"", imageUrl);b.putString(""message"", imageDesc);b.putString(""description"",""Hai"" );b.putString(""name"",""Show us something Beautiful"");b.putString(""link"",bitly);</code></pre><p>If i give any caption it shows. The code with caption is </p><pre><code>Bundle b = new Bundle();b.putString(""picture"", imageUrl);b.putString(""caption"", ""image"");b.putString(""message"", imageDesc);b.putString(""description"",""Hai"" );b.putString(""name"",""Show us something Beautiful"");b.putString(""link"",bitly);</code></pre><p><strong>How can i remove caption?</strong></p>","2311189","","","","","2011-02-22 13:35:21","Android Facebook share issue?","<java><android><facebook>","1","0","1","",""
"5078649","1","","","2011-02-22 13:18:40","1","17568","<p>I just installed the Nfc Demo from google, but it doesn´t read the information from the Tag.-> It just provides some fakeTag information. Has anybody an idea, where I can change the sample to read from the nfc Tag? Or has somebody a working nfc demo for the nexus?</p><p>If we could bring a nfc demo to work, many people would have the possibility to develop a nfc demo on their own.</p><p>Best regardsAlexander</p>","621865","","","","","2012-11-25 23:10:02","Android Nfc Sample Demo - reads only fake information from the Tag","<android><sample><demo><nfc>","6","0","3","",""
"5078788","1","7842871","","2011-02-22 13:32:38","1","1179","<p>I am experiencing an incorrect rowid value with sqlite and fts3.</p><p>Basically, the first two rows are inserted and the rowId is 1 and 2respectively. The third insert however returns 4 instead of 3.</p><p>I dropped the following log message in my contentprovider wheninserting a row:</p><pre><code>SQLiteDatabase database =databaseHelper.getWritableDatabase();long rowId = database.insert(NOTES_TABLE, Note.NOTE, values);Log.d(""NoteProvider"", ""RowId inserted was "" + rowId);</code></pre><p>The output of that log message is:</p><pre><code>02-21 21:10:12.773: DEBUG/NoteProvider(2486): RowId inserted was 102-21 21:10:20.623: DEBUG/NoteProvider(2486): RowId inserted was 202-21 21:10:25.883: DEBUG/NoteProvider(2486): RowId inserted was 4</code></pre><p>So what happened to 3?</p><p>Also, I exported the sqlite database so I could look at in a SqLitebrowser and the content table shows 1, 2 and 3.</p><p>So 3 was created but 4 was returned.</p><p>I ran my testing up to 10, and the rowId was sequential afterwards,but still off by 1.</p><p>The database create script is:</p><pre><code>database.execSQL(""CREATE VIRTUAL TABLE "" + NOTES_TABLE + ""USING fts3 (""           + Note.TITLE + "", ""           + Note.NOTE + "", ""           + Note.CREATED_DATE + "", ""           + Note.MODIFIED_DATE + "");"");</code></pre><p>I am assuming I have done something horribly wrong, but cannot figureout what it is.Can anyone help me out?</p><p><strong>Edit 1:</strong><br>Did some more testing and have the same results on 2.3.1 and 2.1.<br>Although in 2.1 the ids when 1, 3 (skipped 2)</p><p><strong>Edit 2:</strong><br>Finally came up with a work around. However I think this is a pretty severe bug or something.What I ended up doing was selecting the max rowid from the table bumping up by 1 and then setting that value to the rowid on insert. Its a complete suck solution. A very dirty and cheap hack, but it is the only thing I get to work reliably. Anyway here is the code:</p><pre><code>SQLiteDatabase database = databaseHelper.getWritableDatabase();SQLiteStatement statement = database.compileStatement(""select ifnull(max(rowid), 0) as rowid from "" + NOTES_TABLE);long maxRowId = statement.simpleQueryForLong();Log.d(""NoteProvider"", ""Statement returned "" + maxRowId);long rowId = maxRowId + 1;values.put(""rowid"", rowId);database.insert(NOTES_TABLE, null, values);Log.d(""NoteProvider"", ""RowId inserted was "" + rowId);</code></pre><p><strong>Edit 3:</strong><br>Looks like another fellow was/is having this problem.<a href=""http://stackoverflow.com/questions/5011405/android-full-text-search-and-listadapter"">Android Full Text Search and ListAdapter</a></p>","257975","","257975","","2011-02-23 03:13:47","2011-10-20 22:07:35","Incorrect RowId with SQLite using FTS3 on Android 2.2","<android><sqlite><fts3>","2","1","2","",""
"5078808","1","5106807","","2011-02-22 13:34:47","10","8296","<p>I was trying to get the screen resolution of android phones,using this code</p><pre><code>    DisplayMetrics dm = new DisplayMetrics();    getWindowManager().getDefaultDisplay().getMetrics(dm);    str_ScreenSize = dm.widthPixels + "" x "" + dm.heightPixels;    str_ScreenSize = ""dd"" + "" x "" + dm.heightPixels;</code></pre><p>When i tried this code in my Galaxy S phone i got the screen resolution as  320x533 px, but in reality  the Galaxy S got a screen resolution of 480x800 px. So what's wrong with the code??</p><p>How can i get the actual screen resolution of a particular device??</p>","466474","","","","","2013-12-27 08:21:45","Android: Showing wrong screen resolution","<android><screen-resolution><android-screen>","6","2","6","",""
"5078875","1","","","2011-02-22 13:40:56","2","1706","<p>I have a asp.net Webservice which returns me XML. What should i use in Android and how to parse? </p>","627901","","","","","2012-12-25 16:42:09","Webservice Android","<asp.net><android>","2","5","","",""
"5079005","1","5079067","","2011-02-22 13:53:11","0","241","<p>if there possibility to access the caller tune in android. please provide any code available.</p><p>thanks in advance,teja</p>","460336","","","","","2011-02-22 13:58:04","is there possibility to acess the caller tune programmatically in android?","<android>","1","0","","",""
"5079186","1","5079289","","2011-02-22 14:09:29","3","1109","<p>I added the intent-filter to ApplicationManifest.xml to take my app to ""Share via"" Dialog:</p><pre><code>&lt;intent-filter&gt;    &lt;action android:name=""android.intent.action.SEND"" /&gt;    &lt;category android:name=""android.intent.category.DEFAULT"" /&gt;    &lt;data android:mimeType=""image/*"" /&gt;&lt;/intent-filter&gt;</code></pre><p>How can I handle the request from another app. </p><p>1 Is it possible to differentiate between directly app-start  and  sharing start?</p><p>2 How to get access to sharing data?</p>","597624","","597624","","2011-02-22 14:29:08","2011-02-22 14:29:08","How can I to handle the ""share via"" dialog request from other app?","<android><listener><handle><share><sharing>","2","1","3","",""
"5079204","1","","","2011-02-22 14:11:57","3","4141","<p>i'm trying to get a xml file but it seems to be cached.there's my code:</p><pre><code>URL url = new URL(""http://delibere.asl3.liguria.it/SVILUPPO/elenco_xml.asp?rand="" + new Random().nextInt()+""&amp;Oggetto="" + text +""&amp;TipoDocumento=""+tipoDocumento);HttpURLConnection urlConn = (HttpURLConnection) url.openConnection();urlConn.setDefaultUseCaches(false); urlConn.setAllowUserInteraction(true);urlConn.setDoInput(true);urlConn.setDoOutput(true);   urlConn.setUseCaches(false);urlConn.setRequestMethod(""GET"");urlConn.setRequestProperty(""Pragma"", ""no-cache"");urlConn.setRequestProperty(""Cache-Control"", ""no-cache"");urlConn.setRequestProperty(""Expires"", ""-1"");urlConn.setRequestProperty(""Content-type"", ""text/xml"");     urlConn.setRequestProperty(""Connection"",""Keep-Alive""); DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();DocumentBuilder db = dbf.newDocumentBuilder();InputStream is = new BufferedInputStream(url.openStream());Document doc = db.parse(is);doc.getDocumentElement().normalize();</code></pre><p>thanks!</p>","628453","","","","","2011-03-22 02:39:11","Why android HttpURLConnection cache the inputstream results?","<java><android><xml><caching><inputstream>","2","1","2","",""
"5079213","1","","","2011-02-22 14:13:05","2","897","<p>I'm developping an app which needs to run a command as root user so I use:</p><pre><code>process = Runtime.getRuntime().exec(""su"");</code></pre><p>Then I launch te process with:</p><pre><code>os = new DataOutputStream(process.getOutputStream());os.writeBytes(""tcpdump\n"");</code></pre><p>When I need the process to finish <code>os.writeBytes(""exit\n"");</code> doesn't work and <code>process.waitFor();</code> get's blocked and the process doesn't finish. I need to send Control-C to the process to stop it but I don't know how I could do it.</p><p>Thanks.</p>","626459","","","","","2013-01-20 22:00:07","Send Control-C to a process running trough Runtime.getRuntime().exec(""su"");","<android><exec><root><su><control-c>","2","0","","",""
"5079335","1","","","2011-02-22 14:24:30","6","5446","<p>I'm using the following script based on the tutorial <a href=""http://www.softwarepassion.com/android-series-download-files-with-progress-dialog/"">Android Series: Download files with Progress Dialog</a> to download multiple video files from the internet to the SD card. It displays a progress bar while the download is in progress.</p><pre><code>public class MyDownload extends Activity {public static final int DIALOG_DOWNLOAD_PROGRESS = 0;private Button startBtn;private ProgressDialog mProgressDialog;private String videoPath = ""http://my_site.com/test_videos/"";    private String[] fileNames = {""file1.mp4"",""file2.mp4""};private TextView tv;    /** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    startBtn = (Button)findViewById(R.id.startBtn);    startBtn.setOnClickListener(new OnClickListener(){        public void onClick(View v) {            startDownload();        }    });}private void startDownload() {          tv = (TextView) findViewById(R.id.TextView01);           if(checkExternalMedia()==true) {           File file = null;                           for(int i=0; i&lt;fileNames.length; i++) {                file = new File(""/sdcard/videos/""+fileNames[i]);                boolean exists = file.exists();                if(exists){                    tv.append(""\n\n""+fileNames[i]+"" already exists"");                    continue;                }                else {                    new DownloadFileAsync().execute(videoPath+fileNames[i],fileNames[i]);                               }                file = null;            }                       }                else {                  tv.append(""\n\nExternal Media is NOT readable/writable"");    }}@Overrideprotected Dialog onCreateDialog(int id) {    switch (id) {        case DIALOG_DOWNLOAD_PROGRESS:            mProgressDialog = new ProgressDialog(this);            mProgressDialog.setMessage(""Downloading files..."");            mProgressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);            mProgressDialog.setCancelable(false);            mProgressDialog.show();            return mProgressDialog;        default:            return null;    }}/** Method to check whether external media available and writable. */private boolean checkExternalMedia(){    boolean mExternalStorageAvailable = false;    boolean mExternalStorageWriteable = false;    boolean stat;    String state = Environment.getExternalStorageState();    if (Environment.MEDIA_MOUNTED.equals(state)) {        // Can read and write the media        mExternalStorageAvailable = mExternalStorageWriteable = true;        stat = true;    } else if (Environment.MEDIA_MOUNTED_READ_ONLY.equals(state)) {        // Can only read the media        mExternalStorageAvailable = true;        mExternalStorageWriteable = false;        stat = false;    } else {        // Can't read or write        mExternalStorageAvailable = mExternalStorageWriteable = false;        stat = false;    }              tv.append(""\n\nExternal Media: readable=""+mExternalStorageAvailable+"" writable=""+mExternalStorageWriteable);    return stat;}class DownloadFileAsync extends AsyncTask&lt;String, String, String&gt; {    @Override    protected void onPreExecute() {        super.onPreExecute();        showDialog(DIALOG_DOWNLOAD_PROGRESS);    }    @Override    protected String doInBackground(String... aurl) {        int count;        try {            URL url = new URL(aurl[0]);            URLConnection conexion = url.openConnection();            conexion.connect();            File root = android.os.Environment.getExternalStorageDirectory();            int lenghtOfFile = conexion.getContentLength();            Log.d(""ANDRO_ASYNC"", ""Lenght of file: "" + lenghtOfFile);            InputStream input = new BufferedInputStream(url.openStream());            OutputStream output = new FileOutputStream(root.getAbsolutePath() + ""/videos/"" + aurl[1]);            byte data[] = new byte[10485760];            long total = 0;            while ((count = input.read(data)) != -1) {                total += count;                publishProgress(""""+(int)((total*100)/lenghtOfFile));                output.write(data, 0, count);            }            output.flush();            output.close();            input.close();                  } catch (Exception e) {}        return null;    }    protected void onProgressUpdate(String... progress) {         Log.d(""ANDRO_ASYNC"",progress[0]);         mProgressDialog.setProgress(Integer.parseInt(progress[0]));    }    @Override    protected void onPostExecute(String unused) {        dismissDialog(DIALOG_DOWNLOAD_PROGRESS);        tv.append(""\n\nFile Download Completed!"");        sendBroadcast(new Intent(Intent.ACTION_MEDIA_MOUNTED, Uri.parse(""file://""+ Environment.getExternalStorageDirectory())));                }}</code></pre><p>}</p><p>This code works fine when the size of each video is less (around 300KB). But when the video size increases to 7-8 MB the application crashes. </p><p>However, if I try to download a single large file instead of</p><pre><code>private String[] fileNames = {""file1.mp4"",""file2.mp4""};</code></pre><p>this code works fine. Any thoughts ?</p>","622645","","622645","","2011-02-23 10:49:02","2012-02-15 06:01:55","Problem with downloading multiple files using AsyncTask","<android><memory-leaks><android-asynctask><out-of-memory>","3","2","2","",""
"5079478","1","","","2011-02-22 14:37:06","3","627","<p>I'm using reflection to invoke the AudioManager.startBluetoothSco() method. It has to be done via reflection since it only exists in 2.2 or higher SDK, but my app is build for min version of 2.0. If I just compile my app without using ProGuard, everything works fine -- the metod gets invoked properly in 2.2, and not at all in lower versions. But when I use ProGuard, it doesn't work at all. I assume that there is a KEEP satement in ProGuard config that'll fix this, but I can't figure out what it should be. Here are the 3 lines from my code:</p><pre><code>AudioManager am = (AudioManager) getSystemService(AUDIO_SERVICE);Method startBT = AudioManager.class.getMethod(""startBluetoothSco"");   startBT.invoke(am);</code></pre>","496854","","","","","2011-02-22 15:04:10","Using ProGuard with reflection for startBluetoothSCO() in an Android app","<android><reflection><bluetooth><proguard>","1","0","2","",""
"5079503","1","5088568","","2011-02-22 14:39:20","0","657","<p>In my Application I want to use the <code>AudioTrack</code> class to play back some sound I record. I record the audio via an <code>AudioRecord</code> object, read the object and then I want to play the recorded sound. However, the way I have it programmed now will result in an error in the <code>AudioTrack-JNI</code> which will say that ""Buffer direct access is not supported, can't record"".</p><p>The code looks like this:</p><pre><code>public class RecorderThread extends Thread{    private static AudioRecord mAudioRecorder;    private final int USE_MIC = MediaRecorder.AudioSource.MIC;    private static final int FREQUENCY = 8000;    private int mBuffSize, mChannel, mEncoding;    private byte[] mBuffer;    private Context mContext;    private volatile boolean mContinueLoop = true,                             mDataPresent = false,                             mProcessData = false;    private BroadcastReceiver mActionListener = new BroadcastReceiver(){        @Override        public void onReceive(Context context, Intent intent){            if(intent.getAction().equals(mContext.getString(R.string.STOP_THREAD))){                mContinueLoop = false;                Thread.currentThread().interrupt();            } else if(intent.getAction().equals(mContext.getString(R.string.START_RECORDING))){                mAudioRecorder.startRecording();            }  else if(intent.getAction().equals(mContext.getString(R.string.STOP_RECORDING))){                mAudioRecorder.stop();                mDataPresent = true;            }  else if(intent.getAction().equals(mContext.getString(R.string.PROCESS_DATA))){                if(mDataPresent){                    mProcessData = true;                    mDataPresent = false;                }            }          }    };    public RecorderThread(Context context){        mContext = context;        mChannel = AudioFormat.CHANNEL_IN_MONO;        mEncoding = AudioFormat.ENCODING_PCM_16BIT;        mBuffSize = AudioRecord.getMinBufferSize(FREQUENCY, mChannel, mEncoding);        mBuffer = new byte[FREQUENCY * 10];        mAudioRecorder = new AudioRecord(USE_MIC, FREQUENCY, mChannel, mEncoding, mBuffer.length);        IntentFilter filter = new IntentFilter();        filter.addAction(mContext.getString(R.string.START_RECORDING));        filter.addAction(mContext.getString(R.string.STOP_RECORDING));        filter.addAction(mContext.getString(R.string.PROCESS_DATA));        filter.addAction(mContext.getString(R.string.STOP_THREAD));        mContext.registerReceiver(mActionListener, filter);    }    @Override    public void run(){        while(mContinueLoop){            if(mProcessData){                // Process data.                ByteBuffer sampledData = ByteBuffer.wrap(mBuffer);                int readSamples = mAudioRecorder.read(sampledData, sampledData.limit());                processData(sampledData, readSamples);                mProcessData = false;            }            try{                Thread.sleep(100);            } catch(InterruptedException e){                e.printStackTrace();            }        }        mAudioRecorder.release();    }    private void processData(ByteBuffer sampledData, int readSamples) {        byte[] data = sampledData.array();        AudioTrack track = new AudioTrack(AudioManager.STREAM_MUSIC,                                          FREQUENCY,                                          AudioFormat.CHANNEL_OUT_MONO,                                          mEncoding,                                          data.length,                                          AudioTrack.MODE_STATIC);        if(track != null){            track.write(data, 0, data.length);            track.play();            track.release();        }    }}</code></pre><p>I've looked through the native code that is makes the <code>AudioTrack-JNI</code> (http://www.netmite.com/android/mydroid/1.6/frameworks/base/core/jni/android_media_AudioRecord.cpp), but this doesn't make it any clearer. The only times this error will pop up is when a buffer capacity &lt;= 0 or when the address to this buffer is null.</p><p>So yeah, I've got no idea on why this doesn't work... Anybody with a bit more experience might have... So please enlighten me? Thanks in advance...</p>","603059","","603059","","2011-02-22 14:50:42","2013-02-01 20:28:20","My application won't play my recorded sound","<java><android><jni>","3","1","","",""
"5079511","1","5090795","","2011-02-22 14:40:20","1","769","<p>I have a picture (bitmap) and I want to draw some shapes and rotatedtext on it.</p><p>This works fine as long as the picture doesn't get too large. However,when using a picture (2560 x 1920 pixels)taken with the build-incamera of my android 2.1 phone, the result is distorted.It looks like the rotation back, after drawing the rotated text, hasnot been completed. Also, the distortion point is not always the same,like it depends on the cpu usage.</p><p>You can see some resulting pictures here: <br/><a href=""http://dl.dropbox.com/u/4751612/Result1.png"" rel=""nofollow"">http://dl.dropbox.com/u/4751612/Result1.png</a> <br/><a href=""http://dl.dropbox.com/u/4751612/Result2.png"" rel=""nofollow"">http://dl.dropbox.com/u/4751612/Result2.png</a></p><p>The code is executed inside a AsyncTask. The strange this is that this code works fine in one Activity, but not in another. In both activities the AsyncTask is executed when a button is clicked.</p><p>These are some excerpts of the code I'm using.</p><pre><code>// Load the image from the MediaStorec = MediaStore.Images.Media.query(context.getContentResolver(),Uri.parse(drawing.fullImage), new String[] {MediaColumns.DATA});if (c != null &amp;&amp; c.moveToFirst()) {       imageFilePath = c.getString(0);       bitmap = ImageUtil.getBitmap(new File(imageFilePath), 10000);}c.close();// Create a canvas to draw ondrawingBitmap = Bitmap.createBitmap(bitmap.getWidth(),bitmap.getHeight(), Bitmap.Config.ARGB_8888);canvas = new Canvas(drawingBitmap);// Draw imagecanvas.drawBitmap(bitmap, 0, 0,MeasureFactory.getMeasurePaint(context));// calculate text widthrect = new Rect();paint.getTextBounds(text, 0, text.length(), rect);// Draw rotated textcanvas.save();canvas.rotate(-angle, centerPoint.x, centerPoint.y);canvas.drawText(text, centerPoint.x-Math.abs(rect.exactCenterX()),Math.abs(centerPoint.y-rect.exactCenterY()), paint);canvas.restore();// Upload the bitmap to the Media LibraryUri uri =getContentResolver().insert(MediaStore.Images.Media.EXTERNAL_CONTENT_URI,values);OutputStream outStream = getContentResolver().openOutputStream(uri);drawingBitmap.compress(Bitmap.CompressFormat.JPEG, 90, outStream);outStream.flush();outStream.close();</code></pre><p>Thanks in advance for any help.</p>","628487","","","","","2011-02-25 08:37:52","Android - Rotated text on a large bitmap","<android><text><bitmap><rotation><mediastore>","2","2","","",""
"5079631","1","5080589","","2011-02-22 14:50:18","0","3435","<p>I have a screen with two parts. I want the top one to be static and the lower one with a TableLayout to be scrollable. I have tried adding a ScrollView to the lower part of the screen, but when making the TableLayout scrollable the top part disappears. </p><p>How can I combine the top static part with a scrollable lower part? </p><pre><code>&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""vertical""    android:id=""@+id/LinearLayout01""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""horizontal""    android:layout_weight=""9""     android:layout_width=""fill_parent""    android:layout_height=""fill_parent""    android:background=""@drawable/title_shape""&gt;      &lt;Button         android:id=""@+id/btnBack""         android:text=""@string/titleCreateTest""        style=""@style/Bar_buttonBack""&gt;    &lt;/Button&gt;    &lt;TextView android:layout_weight=""6""         android:id=""@+id/titleFlashcard""         android:text=""@string/titleStatistic""         style=""@style/TitleStyle""&gt;    &lt;/TextView&gt; &lt;/LinearLayout&gt; &lt;ScrollView  android:id=""@+id/ScrollView1""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""&gt;&lt;LinearLayout xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""vertical""    android:id=""@+id/LinearLayout2""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""&gt;&lt;TableLayout     android:id=""@+id/table_layout""    style=""@style/TableLayoutStyle""&gt; &lt;TableRow      android:id=""@+id/table_row1""&gt;    &lt;TextView            android:id=""@+id/tv1""            android:text=""@string/tvRecord""             style=""@style/TableRowStyle""/&gt;    &lt;TextView            android:id=""@+id/tv1v""            style=""@style/TableRowStyleColumn2""/&gt;  &lt;/TableRow&gt;  &lt;View    style=""@style/TableRowSeparator""/&gt;     &lt;TableRow     android:id=""@+id/table_row2""&gt;        &lt;TextView            android:id=""@+id/tv2""            android:text=""@string/tvMedium""             style=""@style/TableRowStyle""/&gt;        &lt;TextView            android:id=""@+id/tv2v""            style=""@style/TableRowStyleColumn2""/&gt;    &lt;/TableRow&gt;      &lt;View    style=""@style/TableRowSeparator""/&gt;    &lt;TableRow    android:id=""@+id/table_row3""&gt;        &lt;TextView            android:id=""@+id/tv3""            android:text=""@string/tvWorst""             style=""@style/TableRowStyle""/&gt;        &lt;TextView            android:id=""@+id/tv3v""            style=""@style/TableRowStyleColumn2""/&gt;    &lt;/TableRow&gt;    &lt;/TableLayout&gt;    &lt;TableLayout     android:id=""@+id/table_layout2""    style=""@style/TableLayoutStyle""&gt;        &lt;TableRow          android:id=""@+id/table_row4""&gt;          &lt;TextView            android:id=""@+id/tvDate""            style=""@style/TableRowStyle""/&gt;            &lt;TextView            android:id=""@+id/tvResult""            style=""@style/TableRowStyleColumn2""/&gt;     &lt;/TableRow&gt;    &lt;View    android:id=""@+id/rowseparator""    style=""@style/TableRowSeparator""/&gt;&lt;/TableLayout&gt;&lt;/LinearLayout&gt;&lt;/ScrollView&gt;&lt;/LinearLayout&gt;</code></pre>","455479","","455479","","2011-02-22 15:17:19","2011-02-22 16:03:22","ScrollView only on part of the screen in Android","<android><scrollview>","1","4","1","",""
"5079641","1","","","2011-02-22 14:51:15","2","490","<p>I'm invoking the MediaStore.ACTION_IMAGE_CAPTURE intent with theMediaStore.EXTRA_OUTPUT extra so that it does save the image to thatfile.</p><p>On the onActivityResult I can check that the image is being saved inthe intended file, which is correct. The weird thing is that anyhow,the image is also saved in a file named something like""/sdcard/Pictures/Camera/1298041488657.jpg"" (epoch time in which theimage was taken).</p><p>I've checked the Camera app source (froyo-release branch) and I'm<em>almost</em> sure that the code path is correct and wouldn't have to savethe image, but I'm a noob and I'm not completly sure. AFAIK, the imagesaving process starts with this callback (comments are mine):</p><pre><code>private final class JpegPictureCallback implements PictureCallback {...   public void onPictureTaken(...){       ...       // This is where the image is passed back to the invoking activity.       mImageCapture.storeImage(jpegData, camera, mLocation);       ...       public void storeImage(final byte[] data,               android.hardware.Camera camera, Location loc) {           if (!mIsImageCaptureIntent) {      // Am i an intent?               int degree = storeImage(data, loc); // THIS SHOULD NOTBE CALLED WITHIN THE CAPTURE INTENT!!            .......      // An finally:       private int storeImage(byte[] data, Location loc) {           try {               long dateTaken = System.currentTimeMillis();               String title = createName(dateTaken);               String filename = title + "".jpg"";  // Eureka,timestamp filename!                ...</code></pre><p>So, I'm receiving the correct data, but it's also being saved in the""storeImage(data, loc);"" method call, which should not be called...</p><p>It'd not be a problem if I could get the newly created filename fromthe intent result data, but I can't. When I found this out, I foundabout 20 image files from my tests that I didn't know were on mysdcard :)</p><p>I'm getting this behavior both with my Nexus One with Froyo and myHuawei U8110 with Eclair.</p><p>Could please anyone enlight me?</p><p>Thanks a lot.</p>","411162","","411162","","2011-02-22 15:23:28","2011-02-22 15:23:28","Weird camera Intent behavior","<android><camera><android-intent>","0","0","1","",""
"5079667","1","5219187","","2011-02-22 14:52:56","0","2315","<p>I'm displaying a photo with a small scrollable TextView below it. On HTC Wildfire when I tap on the text and drag my finger across the screen, even outside the TextView, the text scrolls as it's supposed to. (Likewise, the default system 'all applications' screen also scrolls even if you drag your finger to the status bar.)</p><p>However, on HTC Desire when I drag my finger outside the TextView, the scrolling suddenly stops. This makes scrolling really difficult, because the TextView itself is relatively small.</p><p>How do I make the text scroll in the TextView even when the user drags his finger outside the TextView area?</p><p>This is my source:</p><pre><code>&lt;ScrollView    android:id=""@+id/scrollview""    android:layout_width=""match_parent""    android:layout_height=""wrap_content""    android:layout_gravity=""bottom""&gt;&lt;TextView     android:id=""@+id/captionbox""     android:layout_height=""wrap_content""     android:layout_width=""match_parent""    android:padding=""3dp""    android:maxLines=""6""    android:background=""@color/translucent""    android:scrollbars=""vertical""    android:scrollbarStyle=""insideInset""    android:layout_gravity=""bottom""    android:saveEnabled=""true""    android:text=""@string/captiontest""/&gt;&lt;/ScrollView&gt;</code></pre><p>In code, I call this method</p><pre><code>private void displayCaptionBox() {    TextView captionBox = (TextView) findViewById(R.id.captionbox);    captionBox.setMovementMethod(new ScrollingMovementMethod());}</code></pre>","338825","","338825","","2011-02-26 12:19:47","2011-03-07 11:35:52","TextView scrolling","<android><scroll><textview><scrollview>","1","0","","",""
"5079670","1","5079764","","2011-02-22 14:53:01","2","948","<p>I have several android constructs like custom dialog boxes, drag-and-drop implementations, and other standard classes that I use in multiple projects.  It seems both inefficient and bad practice to put a copy of each construct (each with its own set of resources and classes to maintain) into each project.  Now if I find a bug in these, I have to change it everywhere.</p><p>Good practice would dictate that I include that as a separate project, perhaps a jar library that my other projects can import.  This works fine for constructs that are purely java classes, but some of these things have android resources associated with them and I don't know if there is a way to include those in a jar in a way the android resource compiler will recognize.</p><p><strong>Is it even possible to build a jar with Android resources included (i.e. a custom dialog box with a custom background drawable or something)?If it is possible, how?</strong></p>","131871","","","","","2012-10-11 06:48:35","How to build a java code library for Android?","<java><android><jar>","2","0","1","",""
"5079700","1","5080383","","2011-02-22 14:55:18","1","364","<p>I have a ContentProvider named <em>GeneralDataProvider</em>. Which calls </p><pre><code>@Overridepublic boolean onCreate() {    mDatabaseOpenHelper = new DatabaseOpenHelper(getContext());    return true;}</code></pre><p>Which looks like:</p><pre><code>private static class DatabaseOpenHelper extends SQLiteOpenHelper {    DatabaseOpenHelper(Context context) {        super(context, DATABASE_NAME, null, DATABASE_VERSION);    }    @Override    public void onCreate(SQLiteDatabase db) {        Log.e(""DataBaseOpenHelper"", ""onCreate()"");        //The columns we'll include in the dictionary table        //db.execSQL(""CREATE TABLE general "" +         // .. and more    }}</code></pre><p><strong>The problem</strong></p><p>This works fine as long as I run managedQuery(...) inside an Activity, but when i try to execute the following code in a thread, I get a NullPointerException.</p><pre><code> public class SyncManager extends Thread {         @Override         public void run() {            mIntent = new Intent();            mIntent.setData(GeneralDataColumns.CONTENT_URI);            GeneralDataProvider generalProvider = new GeneralDataProvider();            mCursor = generalProvider.query(mIntent.getData(), GENERAL_PROJECTION, selection, null,            GeneralDataColumns.DEFAULT_SORT_ORDER);     } }</code></pre><p>Which is executed from my main activity as such</p><pre><code>    mSyncManager = new SyncManager();    mSyncManager.start();</code></pre><p>After digging deeper, it turns out that what causes the NullPointerException is the following line, inside GeneralDataProvider.query().</p><pre><code>       SQLiteDatabase db = mDatabaseOpenHelper.getReadableDatabase();</code></pre><p>Since mDatabaseOpenHelper is null.</p><p>Am I using my ContentProvider in an incorrect manner?</p><p>What I have tried:Added 'synchronized' to the query()-method inside my GeneralDataProvider</p>","628485","","628485","","2011-02-22 15:05:41","2011-02-22 15:48:40","Problems using SQLiteOpenHelper, returns null on create, possible Thread issue","<java><android>","1","0","","",""
"5079723","1","","","2011-02-22 14:56:23","2","468","<p>I have an object that can be a parent or child of other objects.  It is representative of a client.  It looks like this</p><pre><code>public class Site{    public int SiteId;    public List&lt;Site&gt; Children;    public Site Parent;}</code></pre><p>When <code>Parent</code> is null it is a top level or root object.  Not all objects have children. We impose no limit on how many levels down the sites can go. Our application is designed as such that Users and other data are tied to a particular site, whether it be a root or a child node anywhere in the tree.  For this reason I have to know the Site that the user is working with to pull back the correct data.</p><p>My question is what is the best way to allow a user to traverse this tree?  There are a lot of nodes, so returning everything is not going to be desired.  Rather than returning all the children in my model object right now, I am instead simply returning a boolean value noting if the site has children.  Then when the user clicks on that option, my plan was to go get the children of that node, and show them for selection.</p><p>I was thinking about using a <a href=""http://developer.android.com/resources/tutorials/views/hello-listview.html"" rel=""nofollow""><code>ListView</code></a> in a similar fashion as most settings menus with an arrow shown if their are options.  I also looked at a <a href=""http://developer.android.com/guide/topics/ui/menus.html"" rel=""nofollow""><code>Menu</code></a> but I'm just not sure the best way to do this.</p>","107455","","","","","2011-04-04 09:31:09","Android - best way to represent and traverse data in a tree structure","<android><listview><menu><tree><android-listview>","0","0","","",""
"5079740","1","5080111","","2011-02-22 14:57:34","0","471","<p>Progressing with Android learning, I have been introduced to the concept of data source abstraction via a content provider.</p><p>I noticed that content providers are accessed via URIs, which are hierarchical in nature.</p><p>We all know about the limitations of hierarchy, which is <em>one</em> of the reasons relational databases are so much more prevalent.</p><p>The ""problem"" is that <em>hierarchical</em> URIs are aiming to represent <em>relational</em> databases.</p><p>Isn't this, in essence, reducing the power and flexibility of relational databases other access methods (e.g. SQL)? Something like ""lossy compression""?</p><p>If not, what am I missing?</p>","418055","","418055","","2011-02-22 15:05:46","2011-02-22 15:28:02","Content Provider URI's hierarchical nature vs. Database's relational nature","<android><uri><android-contentprovider>","1","0","","",""
"5079748","1","5079801","","2011-02-22 14:58:01","3","2851","<p>I am trying to work through an android example given on the developers' page.It gives 2 ways of drawing on a canvas. The first way is to use a class called CustomDrawableView, which looks like this:</p><pre><code>public class CustomDrawableView extends View {private ShapeDrawable mDrawable;public CustomDrawableView(Context context) {super(context);int x = 10;int y = 10;int width = 300;int height = 50;mDrawable = new ShapeDrawable(new OvalShape());mDrawable.getPaint().setColor(0xff74AC23);mDrawable.setBounds(x, y, x + width, y + height);}protected void onDraw(Canvas canvas) {mDrawable.draw(canvas);}}</code></pre><p>This is then called by the main class:</p><pre><code>CustomDrawableView mCustomDrawableView;protected void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    mCustomDrawableView = new CustomDrawableView(this);        setContentView(mCustomDrawableView);}</code></pre><p>But then the tutorial says:</p><p>If you'd like to draw this custom drawable from the XML layout instead of from the Activity, then the CustomDrawable class must override the View(Context, AttributeSet) constructor, which is called when instantiating a View via inflation from XML. Then add a CustomDrawable element to the XML, like so:</p><pre><code>&lt;com.example.shapedrawable.CustomDrawableView   android:layout_width=""fill_parent""     android:layout_height=""wrap_content""     /&gt;</code></pre><p>I have successfully got the first example to run but I do not know what my code should look like if I want to adopt the second option. Presumably, I start with @Override View but then I am stuck.</p><p>The reason I want to do this is because I want to create a canvas that covers only part of the screen so I can fit buttons and text in the other part.</p>","590406","","297762","","2011-02-22 14:59:27","2011-02-23 11:02:10","How to draw using an xml layout in android","<android>","2","0","","",""
"5079868","1","","","2011-02-22 15:07:04","23","14051","<p>I have a requirement on my Android application that parts on the graphics should be customizable, by retrieving new colors and images from the server side. Some of these images are nine-patch images.</p><p>I can't find a way to create and display these nine-patch images (that have been retrieved over the network).</p><p>The nine-patch images are retrieved and kept in the application as Bitmaps. In order to create a <a href=""http://developer.android.com/reference/android/graphics/drawable/NinePatchDrawable.html"">NinePatchDrawable</a>, you either need the corresponding <a href=""http://developer.android.com/reference/android/graphics/NinePatch.html"">NinePatch</a> or the chunk (byte[]) of the NinePatch. The NinePatch can NOT be loaded from the Resources, since the images doesn't exist in /res/drawable/. Furthermore, in order to create the NinePatch, you need the chunk of the NinePatch. So, it all drills down to the chunk ... The question is then, how do one format/generate the chunk from an existing Bitmap (containing the NinePatch information)?</p><p>I've searched through the Android source code and the Web and I can't seem to find any examples of this. To make things worse, all decoding of a NinePatch resources seem to be done natively ... =(</p><p>Have anyone had any experiences with this kind of problem!? Any help is greatly appreciated!!!</p><p>I'm targeting API level 4, if that is of importance.</p><p>Thanks in advance!</p><p>Regards,Jacob</p>","573104","","","","","2013-06-03 05:56:48","Create a NinePatch/NinePatchDrawable in runtime","<android><networking><runtime><nine-patch>","5","0","17","",""
"5079986","1","5086879","","2011-02-22 15:16:52","16","21833","<p>Since Eclipse can run in Linux and this tablet has the new Honeycomb (Linux Kernel), can Eclipse IDE run in Android Honeycomb ?</p><p>I know that isn't pretty much comfortable coding in a tablet, but I'd want to use for UML modeling.</p>","383403","","750987","","2011-05-29 06:44:05","2013-12-09 09:22:54","Is possible install Eclipse IDE in a Galaxy Tab?","<android><eclipse><tablet><android-3.0-honeycomb><galaxy>","9","1","2","",""
"5080001","1","","","2011-02-22 15:18:16","1","1071","<p>Now look at that! I am having trouble with one of the simplest goals: updating a plain TextView with the value of a SeekBar.</p><p>This is my approach:</p><pre><code>    @Overridepublic void onProgressChanged(SeekBar seekBar, int progress,        boolean fromUser) {    if (fromUser) {        mInfoText.setText(mFunction.getUserFriendlyString(progress));    }}</code></pre><p>It basically works, but it kind of blocks the whole UI when I'm dragging. (Note: I tried both View.post() and Activity.runOnUiThread()).</p><p>Am I overlooking something?</p>","593529","","593529","","2011-02-22 15:23:43","2011-02-22 15:37:26","Updating a TextView with a SeekBar's value (ultra-slow)","<android><textview><seekbar>","2","0","","",""
"5080008","1","","","2011-02-22 15:18:49","0","969","<p>I have some text in a relative layout.I know that we can draw a border with curves using stroke and corner in a separate xml.Is there a way to apply gradient effect for the border constructed with the stroke? or is there any other way to draw a gradient border?</p><p>Thanks in advance.</p>","628543","","","","","2011-02-23 00:11:41","Gradient for border in Android","<android><border><gradient>","1","0","","",""
"5080022","1","5080952","","2011-02-22 15:20:18","0","947","<p>I've been looking for a way to create a 3d-shaded button in Android. That is, a standard button with no rounded corners so it is square, and some shading close to the edges so that each border is a different color.</p><p>I'd love to be able to set different stroke colors for each side but that doesn't seem possible.</p><p>How can I draw a different border color on each side (the border may be shaded with a gradient) and still support different button states?</p><p>Thanks!</p>","628558","","","","","2011-02-22 17:40:00","How to create a ""3d shaded"" button in Android?","<android><user-interface><graphics><button><android-layout>","1","0","","",""
"5080030","1","","","2011-02-22 15:20:56","0","2223","<p>We have a proxy server running in our institute which requires authentication. While I can run my browser in the emulator after providing the proxy settings, I cannot run any other application which requires internet connection. I am developing an app. and I would like to know if there is a way to provide proxy settings ( for my app, or all apps ) so that I can get google maps working. I know that there was a bug, but is that fixed by now or is there some hack which tries to overcome that problem? It would be of great help even if I can get a local solution i.e access google maps from my app, not necessary that all apps which require an internet connection run. </p>","628538","","","","","2011-02-22 16:23:37","Google maps not working on Android emulator behind proxy","<android><google-maps><proxy><android-emulator>","2","0","","",""
"5080033","1","","","2011-02-22 15:21:05","1","205","<p>Need to make a List that each line have Image and data (text) </p><p>what is the right way? with list of table row ? or it is possible with ListView?</p><p>thanks for your help </p>","625139","","","","","2011-02-22 15:35:32","Need to make a List","<android>","2","0","","2012-05-22 12:29:20",""
"5080117","1","5239164","","2011-02-22 15:28:29","3","992","<p>We are using <a href=""https://code.google.com/p/maven-android-plugin/"" rel=""nofollow"">Maven-Android-Plugin</a> to compile an Android project that uses a Library Project.</p><p>Because the plugin doesn't support yet the Library project type of package, We're using <a href=""https://code.google.com/p/maven-android-plugin/issues/detail?id=96"" rel=""nofollow"">this modification</a> of the plugin.</p><p>When compiling the main project We get this error:</p><pre><code>    [INFO] /home/win1frogtek/androidSDK/platform-tools/aapt [package, -m, -J, /home/win1frogtek/workspaceBranch/conoceTuTienda/target/generated-sources/gen, -M, /home/win1frogtek/workspaceBranch/conoceTuTienda/target/generated-sources/apklibs/libtek/AndroidManifest.xml, -S, /home/win1frogtek/workspaceBranch/conoceTuTienda/res, -S, /home/win1frogtek/workspaceBranch/conoceTuTienda/target/generated-sources/apklibs/libtek/res, --auto-add-overlay, -A, /home/win1frogtek/workspaceBranch/conoceTuTienda/assets, -I, /home/win1frogtek/androidSDK/platforms/android-4/android.jar][INFO] /home/win1frogtek/workspaceBranch/conoceTuTienda/res/layout/screen_play_home.xml:72: error: No resource identifier found for attribute 'maxPoints' in package 'org.frogtek.conoceTuTienda'[ERROR] Error when generating sources.org.apache.maven.plugin.MojoExecutionException:     at com.jayway.maven.plugins.android.phase01generatesources.GenerateSourcesMojo.generateRForManifest(GenerateSourcesMojo.java:455)    at com.jayway.maven.plugins.android.phase01generatesources.GenerateSourcesMojo.generateApklibR(GenerateSourcesMojo.java:410)    at com.jayway.maven.plugins.android.phase01generatesources.GenerateSourcesMojo.execute(GenerateSourcesMojo.java:135)    at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:556)    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:535)    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)    at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)    at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)    at java.lang.reflect.Method.invoke(Method.java:597)    at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)    at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)    at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)    at org.codehaus.classworlds.Launcher.main(Launcher.java:375)Caused by: com.jayway.maven.plugins.android.ExecutionException: ANDROID-040-001: Could not execute: Command = /bin/sh -c cd /home/win1frogtek/workspaceBranch/conoceTuTienda &amp;&amp; /home/win1frogtek/androidSDK/platform-tools/aapt package -m -J /home/win1frogtek/workspaceBranch/conoceTuTienda/target/generated-sources/gen -M /home/win1frogtek/workspaceBranch/conoceTuTienda/target/generated-sources/apklibs/libtek/AndroidManifest.xml -S /home/win1frogtek/workspaceBranch/conoceTuTienda/res -S /home/win1frogtek/workspaceBranch/conoceTuTienda/target/generated-sources/apklibs/libtek/res --auto-add-overlay -A /home/win1frogtek/workspaceBranch/conoceTuTienda/assets -I /home/win1frogtek/androidSDK/platforms/android-4/android.jar, Result = 1    at com.jayway.maven.plugins.android.CommandExecutor$Factory$1.executeCommand(CommandExecutor.java:186)    at com.jayway.maven.plugins.android.phase01generatesources.GenerateSourcesMojo.generateRForManifest(GenerateSourcesMojo.java:453)    ... 21 more</code></pre><p>We're using a custom widget, something like this:</p><ul><li>attrs.xml in the main project</li></ul><p><code>&lt;resources&gt;    &lt;declare-styleable name=""MedalWidget""&gt;        &lt;attr name=""maxPoints"" format=""integer"" /&gt;    &lt;/declare-styleable&gt;&lt;/resources&gt;</code></p><ul><li>any layout in the main project...</li></ul><p><code>&lt;org.frogtek.conoceTuTienda.widgets.MedalWidget android:id=""@+id/ct_manejas_medal""        android:layout_marginTop=""200px"" android:layout_marginLeft=""25px""        android:background=""@drawable/ct_play_medal_empty"" frogtek:maxPoints=""4""        android:layout_width=""wrap_content"" android:layout_height=""wrap_content""&gt;&lt;/org.frogtek.conoceTuTienda.widgets.MedalWidget&gt;</code></p><p>I've done some tests and changes and apparently is a plugin related problem, the same code without a dependecy to an apklib (package type for a Library Proejct) works just fine.</p><p>Can anybody help me with this? Some workaround or idea?</p><p>Thank you for any clue or help.</p><p>PD: I will post this to the developers group of the plugin too.</p>","338300","","","","","2011-03-08 22:28:43","No resource found in Android project using a Library Project","<android><maven-2><project><maven-plugin>","1","0","1","",""
"5080144","1","","","2011-02-22 15:30:07","1","1323","<p>I am attempting to pair my Galaxy Tab with my Toshiba win 7 x64 laptop. The pairing fails because the laptop needs a PIN. I never set a PIN, nor to my knowledge was provided with one when I got the device from Verizon. Also, the dialog that appears doesn't provide any place to enter one. </p><p>Anybody succeed in connecting their Galaxy Tab to their PC? How do I discover and set this mysterious bluetooth PIN?</p>","267257","","","","","2011-02-22 15:39:41","Samsung Galaxy Tab bluetooth PIN?","<android><bluetooth><tablet><galaxy>","1","1","","2011-02-22 15:54:56",""
"5080194","1","","","2011-02-22 15:33:41","1","1199","<p>HI, in Android when the clear button is pressed on the notification screen i want to capture that in my application and do some stuff. please help me in how to achieve this.</p>","628572","","","","","2011-02-22 16:08:42","how to capture the clear event when clear button is pressed in notification bar in android","<android>","2","0","1","",""
"5080199","1","","","2011-02-22 15:34:16","2","2088","<p>Hi I am implementing two mapview in different activities they both works, the scenario is there is one large mapview which contains some projection points so when a point is clicked it should open up a new activity filled with some details. So my second activity is a scrollview layout that contains a small mapview at bottom which works fine</p><p><strong>ISSUE</strong>: <em>but when i press back button and goes back to previous mapview i get some warnings and that mapview doesnt load anymore i get a half of the map screen with white background</em> </p><p>Main mapview: <a href=""http://stackoverflow.com/questions/4923422/mapview-show-overlay-details-when-clicked"">mapView show overlay details when clicked</a></p><p>so when i click on the balloon as shown in figure it opens up a new activity that also contains a mapview so when i press back button and gets back the main mapview(the one shown in figure above) cuts into half and i get these warnings:</p><pre><code>02-22 14:39:39.806: WARN/System.err(7823): java.lang.IllegalStateException: Connection pool shut down.02-22 14:39:39.806: WARN/System.err(7823):     at org.apache.http.impl.conn.tsccm.ConnPoolByRoute.getEntryBlocking(ConnPoolByRoute.java:284)02-22 14:39:39.806: WARN/System.err(7823):     at org.apache.http.impl.conn.tsccm.ConnPoolByRoute$1.getPoolEntry(ConnPoolByRoute.java:238)02-22 14:39:39.816: WARN/System.err(7823):     at org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager$1.getConnection(ThreadSafeClientConnManager.java:175)02-22 14:39:39.816: WARN/System.err(7823):     at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:325)02-22 14:39:39.816: WARN/System.err(7823):     at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:555)02-22 14:39:39.826: WARN/System.err(7823):     at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:487)02-22 14:39:39.826: WARN/System.err(7823):     at com.google.common.io.android.AndroidHttpClient.execute(Unknown Source)02-22 14:39:39.826: WARN/System.err(7823):     at com.google.common.io.android.GoogleHttpClient.executeWithoutRewriting(Unknown Source)02-22 14:39:39.836: WARN/System.err(7823):     at com.google.common.io.android.GoogleHttpClient.execute(Unknown Source)02-22 14:39:39.836: WARN/System.err(7823):     at com.google.common.io.android.GoogleHttpClient.execute(Unknown Source)02-22 14:39:39.836: WARN/System.err(7823):     at com.google.common.io.android.AndroidHttpConnectionFactory$AndroidGoogleHttpConnection.getResponse(Unknown Source)02-22 14:39:39.836: WARN/System.err(7823):     at com.google.common.io.android.AndroidHttpConnectionFactory$AndroidGoogleHttpConnection.openDataInputStream(Unknown Source)02-22 14:39:39.846: WARN/System.err(7823):     at com.google.googlenav.datarequest.DataRequestDispatcher.serviceRequests(Unknown Source)02-22 14:39:39.846: WARN/System.err(7823):     at com.google.googlenav.datarequest.DataRequestDispatcher$DispatcherServer.run(Unknown Source)02-22 14:39:39.846: WARN/System.err(7823):     at java.lang.Thread.run(Thread.java:1102)</code></pre><p>I found one post saying its not possible to implement two map view in an application, I found one solution here but didnt worked: <a href=""http://stackoverflow.com/questions/3379575/how-to-use-multiple-mapactivities-mapviews-per-android-application-process"">How to use multiple MapActivities/MapViews per Android application/process</a> </p><p>It says to start each mapview in different process as follows:</p><pre><code>&lt;activity android:name="".activity.directory.MapView1"" android:process="":MapView1""&gt;&lt;activity android:name="".activity.directory.MapView2"" android:process="":MapView2""&gt;</code></pre><p>The above solution didnt worked for me, my code is as under:</p><p><strong>MainMapView Class</strong></p><pre><code>public class CouponMapView extends MapActivity{    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.large_mapview);        mapView = (MapView) findViewById(R.id.mapview);       // mapView.setBuiltInZoomControls(true);        mapView.setStreetView(false);        mapView.setTraffic(false);       // layout = findViewById(R.id.)        List&lt;Overlay&gt; mapOverlays = mapView.getOverlays();        Drawable drawable = this.getResources().getDrawable(R.drawable.mappointer);        ItemizedOverlay itemizedoverlay = new ItemizedOverlay(drawable, mapView, getParent());        OverlayItem overlayitem;        GeoPoint point = null;        double lat;        double lng;        try{            tempData = dataArray.gettempData();                     for (int i = 0; i &lt; this.totalLimit; i++) {                lat = Double.parseDouble(tempData.get(i).getLatitude());                lng = Double.parseDouble(tempData.get(i).getLongitude());                point = new GeoPoint((int) (lat * 1E6),(int) (lng * 1E6));                overlayitem = new OverlayItem(point, tempData.get(i).getId()+"""", tempData.get(i).getInfo().getName());                itemizedoverlay.addOverlay(overlayitem);                itemizedoverlay.setBalloonBottomOffset(10);                mapOverlays.add(itemizedoverlay);            }        }catch(Exception e){        }        try{            final MapController mc = mapView.getController();            mc.animateTo(point);            mc.setZoom(16);        }catch(Exception e){        }    }    protected boolean isRouteDisplayed() {        // TfODO Auto-generated method stub        return false;    }}</code></pre><p><strong>IM calling onTap method of this class to start a new activity</strong></p><pre><code>public class ItemizedOverlay extends BalloonItemizedOverlay&lt;OverlayItem&gt; {    private ArrayList&lt;OverlayItem&gt; overlays = new ArrayList&lt;OverlayItem&gt;();    private Context context;    private Activity activity;    private int id;    public ItemizedOverlay(Drawable defaultMarker, MapView mapView, Activity activity) {        super(boundCenter(defaultMarker), mapView);        context = mapView.getContext();        this.activity = activity;    }    public void addOverlay(OverlayItem overlay) {        overlays.add(overlay);        populate();    }    @Override    protected OverlayItem createItem(int i) {        return overlays.get(i);    }    @Override    public int size() {        return overlays.size();    }    @Override    protected boolean onBalloonTap(int index) {        Intent Details = new Intent(context, Tab.class);        Details.putExtra(""Id"", 1327);        context.startActivity(Details);        return true;    }} </code></pre><p>The third class is the details class that contains another mapview implementation and is a simple linearlayout but includes a map. I dont think there is anything wrong with the above code but there must be something i am missing in the first class to refresh its view, though i have tried view.requestlayout/view.invalidate but they didnt work either</p>","606669","","","","","2011-02-22 16:39:49","Starting Multiple map activities","<android>","1","0","1","",""
"5080265","1","5108703","","2011-02-22 15:38:48","0","385","<p>I am having a really hard time installing ADT 9.0.0 for Eclipse (plain jane)3.6.1 on OSX 10.6.6</p><p>Here is what I've done:</p><ol><li>Installed Eclipse 3.6.1 to /Applications/eclipse</li><li>Updated Eclipse</li><li>Installed latest Android SDK to /Developer/SDKs/androidSDK</li><li>Ran ""tools/android update sdk"" - updated to latest a-ok</li><li>Followed instructions on official site to install ADT</li><li>Installing gets stuck on the following url:<a href=""http://www.eclipse.org/downloads/download.php?format=xmlfile=/releases/helios/201006230900/aggregate/protocol=httpcountryCode=ustimeZone=-5format=xml"" rel=""nofollow"">http://www.eclipse.org/downloads/download.php?format=xmlfile=/releases/helios/201006230900/aggregate/protocol=httpcountryCode=ustimeZone=-5format=xml</a></li></ol><p>I have tried with older versions of Eclipse and run into the sameissue.</p><p>It seems like the URL above works if you insert query string seperators:<a href=""http://www.eclipse.org/downloads/download.php?format=xmlfile=/releases/helios/201006230900/aggregate/?protocol=&amp;httpcountryCode=&amp;ustimeZone=-5&amp;format=xml"" rel=""nofollow"">http://www.eclipse.org/downloads/download.php?format=xmlfile=/releases/helios/201006230900/aggregate/?protocol=&amp;httpcountryCode=&amp;ustimeZone=-5&amp;format=xml</a></p><p>To confirm I am not bats$%t insane, I did find someone else who <a href=""http://groups.google.com/group/android-developers/browse_thread/thread/9a9521eb07c04660"" rel=""nofollow"">has exactly the same issue</a>, no responses to his query though.</p><p>Thanks for any help.</p><hr><pre><code>eclipse.buildId=M20100909-0800java.version=1.6.0_22java.vendor=Apple Inc.BootLoader constants: OS=macosx, ARCH=x86, WS=cocoa, NL=en_USFramework arguments:  -keyring /Users/xxxx/.eclipse_keyring -showlocationCommand-line arguments:  -os macosx -ws cocoa -arch x86 -keyring /Users/xxxx/.eclipse_keyring -showlocation</code></pre>","255051","","","","","2011-02-24 18:11:40","Problems installing ADT 9.0.0 on Eclipse 3.6.1 OSX 10.6.6","<android><eclipse><osx><adt>","2","1","","",""
"5080393","1","5081457","","2011-02-22 15:49:21","0","355","<p>My application makes its web service calls from an IntentService.  Each Intent is effectively a web service call that needs to take place.</p><p>As you know, an IntentService queues Intents; so only 1 web service call will be taking place at any given time.  This is actually desired behavior.</p><p>However, this does present a problem.  Suppose my app queues up 5 Intents in this IntentService.  Say the user ends up on a screen that maybe holds up the UI while some data is retrieved from a web service.  If the Intent for this web service is put on the back of the queue, it could be a long while before the web service is called, holding the user up for an unacceptable amount of time.</p><p>Since I can't inject Intents to the front of an IntentService's queue (as far as I know), I've decided to create a second IntentService for calls that require immediate execution.  Since I only want 1 call hitting my services at any given time, I've wrapped a mutex around the actual Http code.  So, in this case, the Intent would execute right away (because it's in a different IntentService), but loop on the mutex until whatever call in the other IntentService is finished.</p><p>This works good for me; I'm fine with all of it.</p><p>Here is my question:</p><p>Theoretically, the new IntentService could queue up, too. Because of the application workflow, this is unlikely to happen, but it's theoretically possible.  If this is the case, I'd like the new IntentService to finish before the original IntentService resumes again.  My idea for doing this is locking/unlocking a new mutex in the create and destroy methods of the new IntentService.  The same mutex will also be locked/unlocked at the beginning and end of the onHandleIntent method of the old IntentService.  However, I'm concerned about what ramifications locking a mutex in the create of an IntentService will have, holding up its creation (presumably, super.create will be called before the lock).  Will Intents still be able to queue up?  Are there any other pitfalls to doing this?</p>","406790","","","","","2011-02-22 17:15:39","Holding up IntentService creation","<android><service><synchronization><mutex>","1","0","","",""
"5080424","1","","","2011-02-22 15:51:49","3","8503","<p>I'm not sure this is even possible. I have this button:</p><pre><code>&lt;Button android:id=""@+id/b1"" android:layout_width=""wrap_content"" android:layout_height=""45px""android:drawableTop=""@drawable/buttontv""android:layout_weight=""1""android:background=""@null""android:textColor=""#ffffff""android:textSize=""9px""android:text=""TV""/&gt;</code></pre><p>And this button has this item xml:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;selectorxmlns:android=""http://schemas.android.com/apk/res/android""&gt;&lt;item android:state_focused=""true"" android:state_pressed=""false"" android:drawable=""@drawable/tv"" /&gt;&lt;item android:state_focused=""true"" android:state_pressed=""true"" android:drawable=""@drawable/tv_pressed"" /&gt;&lt;item android:state_focused=""false"" android:state_pressed=""true"" android:drawable=""@drawable/tv_pressed"" /&gt;&lt;item   android:drawable=""@drawable/tv"" /&gt;&lt;/selector&gt;</code></pre><p>And in my application I use this code for when clicking my button:</p><pre><code>            OnClickListener b1Listener = new OnClickListener(){                                 @Override                    public void onClick(View v) {   loadUrl(""http://example.org/""); v.setPressed(true); }            };            Button b1 = (Button) findViewById(R.id.b1);            b1.setOnClickListener(b1Listener);</code></pre><p>What I would like that when I have pressed the button, the drawableTop sets to one of the items with the @drawable/tv_pressed attribute value - and stays there (as in 'this is the currently active button').</p><p>I tried adding v.setPressed(true) in the onClick function (as this was all I could find with Google) but that didn't work.</p><p>Can this be done? Or is there a better alternative to what I'm trying to accomplish?</p>","486900","","","","","2013-04-25 12:41:05","Set the Button state and keep it after onClick","<android><button>","3","0","1","",""
"5080449","1","","","2011-02-22 15:53:37","2","189","<p>heya folks,is there a way to replace the content of tab set in </p><pre><code>public View createTabContent(String tag)</code></pre><p>or do i have to replace the Views content???</p>","626399","","","","","2011-02-22 16:02:30","replacing a tabs content","<android>","1","0","","",""
"5080500","1","5080595","","2011-02-22 15:57:15","6","2762","<p>In my app I need to download files from url locations. I want to display progress of the download in a dialogbox (or optionally in the notification area). I've come across several good resources on this subject (something like <a href=""http://progrnotes.blogspot.com/2010/09/c-android.html"" rel=""nofollow"">http://progrnotes.blogspot.com/2010/09/c-android.html</a>). Unfortunately, all the examples don't provide a clear indication on how to properly cancel a download per the user's request. So my question is actually quite simple:</p><p>Given an asynctask which downloads the file in the background (with httpclient) and displays a dialogbox with download progress and a cancel button, how do I can cancel the download and stop the background task when the button is pressed?</p><p>I know killing threads is generally not a good idea, so I will probably need to work with a 'cancel'-variable in my background thread. How do I communicate a stop signal from the button to the asynctask?</p><p>Regards,Ivo</p>","628557","","","","","2011-02-22 16:10:07","Cancelling file download with httpclient and asynctask","<android><httpclient><android-asynctask>","2","0","2","",""
"5080515","1","5085510","","2011-02-22 15:58:18","0","705","<p>I have a native <code>C</code> function (with <em>JNI</em> of course) that should callback a java method to display a dialog but this dialog is never displayed.</p><p>This is how this works:</p><ol><li>C code calls a java method</li><li>The java method logs something</li><li>Then it calls <code>showDialog(SOME_ID)</code></li><li>The <code>onCreateDialog(SOME_ID)</code> is called</li><li>The dialog is constructed using <code>AlertDialog.Builder</code></li><li>When I call <code>AlertDialog alert = builder.create()</code> the application just stops right there (without crashing or freezing) but <em>only</em> when this call starts from the C code.</li></ol><p>The code is as follows:</p><pre><code>@Overrideprotected Dialog onCreateDialog(int id) {    switch (id) {    case SOME_ID:        AlertDialog.Builder builder = new AlertDialog.Builder(this);        builder.setMessage(""Message"");        builder.setPositiveButton(...);        builder.setNegativeButton(...);        AlertDialog alert = builder.create();        System.out.println(""...Never called from JNI"");        return alert;    }    return null;}</code></pre><p>In <strong>6</strong> I mean that I log something before <em>and</em> after calling <code>builder.create()</code> but the log <strong>after</strong> the <code>create</code> method is never called so the method never returns and the dialog is never created. I have a button to trigger the dialog and, as expected, it works.</p><p>I did another test, I printed <code>getApplicationContext()</code> calling directly from <code>onCreate()</code> and from <code>onCreateDialog()</code> (called from C code) and it is the same, because one of the first things I thought was that the onCreateDialog() was being called from another Context or something.</p><p>Do you have any idea why the dialog is not displaying?</p>","75928","","","","","2011-02-22 23:57:11","Dialog not displaying when calling from JNI","<android><jni>","1","0","1","",""
"5080801","1","5081398","","2011-02-22 16:20:26","2","1222","<p>I still haven't quite got this ""Intent"" thing down when it comes to the details. What I'd like to do is to receive an intent when a certain email attachment is opened. The attachment will be a file that is actually an SQLite database with a structure specific to my app, and with a file extension that is also specific to my app.</p><p>What I've noticed in experimenting with this is that, when I send the file attachment from my PC (using Thunderbird), it is coded with a MIME type of ""application/octet-stream"". When I try to open this on my Android phone (using K-9 mail), it tells me that there is no app for ""application/octet-stream"".</p><p>So what do I do in my app to be recognized as a servicing app for this particular type of attachment, especially since I expect it's not a good idea to try to open anything with this MIME type.</p>","446874","","503900","","2011-02-22 17:18:16","2013-04-02 15:15:19","Android: Intent for receiving email attachment","<android><intentfilter><email-attachments>","1","2","1","",""
"5080884","1","5081010","","2011-02-22 16:26:46","0","377","<p>I have 2 unrelated questions in one so please bear with me.</p><p>I want to know if an Android device absolutely requires a simm card inorder to execute all things Location Based Services.</p><p>And ...</p><p>I would like friends of mine to download my samlpe app. Is there anyway to put my app online where friends can download and help me test and not put my beta-code on Market place?</p>","504612","","","","","2011-02-22 16:36:02","GPS hardware requirements and custom download link","<android><gps-time>","1","0","","",""
"5081096","1","5082393","","2011-02-22 16:43:09","0","482","<p>I need to do a query with 2 linked tables and 1 aggregate function.In my case, the query is working fine but it seems that it can't be used with an adapter (because of the aggregate function).</p><p>This is my function to get the query : </p><pre><code>    public Cursor recupererRecapParFichier(String argument) {    return db.rawQuery(""SELECT transactions._id as idT, utilisateurs._id as idU, SUM(transactions.montantTransaction) as total , utilisateurs.nomUtilisateur as nomU FROM transactions "" +            ""JOIN utilisateurs ON utilisateurs._id=transactions.idUtilisateurTransaction "" +            ""WHERE transactions.idUtilisateurTransaction="" + argument + "" GROUP BY utilisateurs.nomUtilisateur, transactions._id, utilisateurs._id""            , null);                                        }</code></pre><p>And now, how I get my cursor : </p><pre><code>    argument = Long.toString(listeFichiers.getSelectedItemId());    Cursor c = db.recupererRecapParFichier(argument);    startManagingCursor(c);</code></pre><p>Now, what can I do to put the data in my listView ? I've tried to use an adapter but there is a problem because of the aggregate function. </p><p>Thanks</p>","628698","","","","","2011-02-22 19:32:23","Query with 2 linked tables and 1 aggregate function (SUM) can't be used without adapter ?? (to be used in a listView)","<android><cursor><aggregate-functions><adapter>","2","0","","",""
"5081112","1","","","2011-02-22 16:44:10","0","157","<p>I have some really strange issue when changing orientation of my emulator. In my app I call activity named ""Setting"" from my main activity when an image button it clicked. here is the code for that:</p><pre><code>final ImageButton stbtn = (ImageButton) findViewById(R.id.stbtn);          stbtn.setOnClickListener(new OnClickListener() {               public void onClick(View v) {                  Intent stopn = new Intent(MyApp.this, Settings.class);                startActivity(stopn);            }          });</code></pre><p>Here is how I close Settings activity:</p><pre><code>@Override    public void onBackPressed() {        // do something on back.        finish();               return;    }@Override    protected void onPause(){       super.onPause();          saveSettings();    }</code></pre><p>and in my main activity I have surface view that update screen every second. I go to Settings screen to change settings and press back button to close it and then it goes to the main activity screen this works fine. Problem now is that when I change orientation when the app is on main screen it opens Settings activity back. Is it because I haven't closed activity properl or is it something else? Can anyone please help me with this? Thanks</p><p>Edit:</p><p>Here is the code for mainfest and activities</p><pre><code>&lt;manifest xmlns:android=""http://schemas.android.com/apk/res/android""      package=""com.example.myapp""      android:versionCode=""1""      android:versionName=""1.0""&gt;    &lt;application android:name="".myappApp"" android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;        &lt;activity android:name="".MyAlarm""                  android:theme=""@android:style/Theme.NoTitleBar.Fullscreen""                  android:configChanges=""orientation""                  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="".Settings"" android:label=""@string/app_name""&gt;        &lt;/activity&gt;    &lt;/application&gt;&lt;/manifest&gt; </code></pre><p>Main activity code:</p><pre><code>public class MyAlarm extends Activity {    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        getClockSettings();        HandView hndView = (HandView) findViewById(R.id.hndView);        clkapp = ((myappApp)getApplicationContext());        hndView.setStyle(clkapp.getClkStyle(), clkapp.isAnalog());        final ImageButton alrbtn = (ImageButton) findViewById(R.id.alrbtn);          alrbtn.setOnClickListener(new OnClickListener() {               public void onClick(View v) {               }          });          final ImageButton stbtn = (ImageButton) findViewById(R.id.stbtn);          stbtn.setOnClickListener(new OnClickListener() {               public void onClick(View v) {                  Intent stopn = new Intent(MyAlarm.this, Settings.class);                //stopn.setClassName(""com.example.myapp"", ""com.example.myapp.Settings"");                startActivity(stopn);            }          });        stbtn.setOnTouchListener(new OnTouchListener() {             @Override            public boolean onTouch(View v, MotionEvent event) {                v.requestFocusFromTouch();                Intent stopn = new Intent(MyAlarm.this, Settings.class);                   //stopn.setClassName(""com.example.myapp"", ""com.example.myapp.Settings"");                startActivity(stopn);                return true;            }         });            }    protected void getClockSettings() {        //getting setting from preferences    clkSettings = getSharedPreferences(PREFS_NAME, 0);              if (clkapp == null) clkapp = ((myappApp)getApplicationContext());        clkapp.clkSettings = clkSettings;        if (clkSettings == null) {            /*clk24 = false;            clkAnalogue = true;            dSec = true;            _clockStyle = ""Black"";*/            clkapp.set24Hr(false);            clkapp.setAnalog(true);            clkapp.setDisplaySec(true);            clkapp.setClkStyle(""Black"");        }        else {            /*clk24 = clkSettings.getBoolean(""24Hr"", false);            dSec = clkSettings.getBoolean(""dSecond"", true);            clkAnalogue = clkSettings.getBoolean(""ClkAnalogue"", true);            if (clkAnalogue) _clockStyle = clkSettings.getString(""ClkAnalogStyle"", ""Black"");            else _clockStyle = clkSettings.getString(""ClkAnalogStyle"", ""DigitalBlack"");*/            clkapp.set24Hr(clkSettings.getBoolean(""24Hr"", false));            clkapp.setAnalog(clkSettings.getBoolean(""ClkAnalogue"", true));            clkapp.setDisplaySec(clkSettings.getBoolean(""dSecond"", true));            if (clkapp.isAnalog()) clkapp.setClkStyle(clkSettings.getString(""ClkAnalogStyle"", ""Black""));            else clkapp.setClkStyle(clkSettings.getString(""ClkAnalogStyle"", ""DigitalBlack""));        }    }    public void onConfigurationChanged(Configuration newConfig) {          //ignore orientation change          super.onConfigurationChanged(newConfig);    }}</code></pre><p>Settings activity:</p><pre><code>public class Settings extends Activity {    //Your member variable declaration here    private RadioButton crbon;    private RadioButton blue;    private RadioButton bbl;    private RadioButton crbdig;    private RadioButton grndig;    private ToggleButton tb24;    private ToggleButton tbsec;    // Called when the activity is first created.    @Override    public void onCreate(Bundle savedInstanceState) {    //Your code here        super.onCreate(savedInstanceState);        setContentView(R.layout.settings);         myappApp clkapp = ((myappApp)getApplicationContext());        //RadioGroup rbgrp = (RadioGroup)findViewById(R.id.rbfacegrp);        crbon=(RadioButton)findViewById(R.id.radio_carbon);        blue=(RadioButton)findViewById(R.id.radio_blue);        bbl=(RadioButton)findViewById(R.id.radio_bbl);        crbdig=(RadioButton)findViewById(R.id.radio_crbdig);        grndig=(RadioButton)findViewById(R.id.radio_grndig);        tb24=(ToggleButton)findViewById(R.id.tbhr);        tbsec=(ToggleButton)findViewById(R.id.tbsec);        if(clkapp.getClkStyle().toLowerCase().equals(""black"")) {            crbon.setChecked(true);        }        else if(clkapp.getClkStyle().toLowerCase().equals(""blue"")) {            blue.setChecked(true);        }        else if(clkapp.getClkStyle().toLowerCase().equals(""bubble"")) {            bbl.setChecked(true);        }        else if(clkapp.getClkStyle().toLowerCase().equals(""digitalblack"")) {            crbdig.setChecked(true);        }        else if(clkapp.getClkStyle().toLowerCase().equals(""digitalgreen"")) {            grndig.setChecked(true);        }        tb24.setChecked(clkapp.is24Hr());        tbsec.setChecked(clkapp.isDisplaySec());    }    @Override    protected void onPause(){              super.onPause();          saveSettings();        //this.finish();           }    protected void saveSettings() {        boolean clkAna = true;        myappApp clkapp = ((myappApp)getApplicationContext());        SharedPreferences.Editor edt = clkapp.clkSettings.edit();        edt.putBoolean(""24Hr"", tb24.isChecked());        edt.putBoolean(""dSecond"", tbsec.isChecked());        clkapp.set24Hr(tb24.isChecked());        clkapp.setDisplaySec(tbsec.isChecked());        if (crbon.isChecked()) {            edt.putString(""ClkAnalogStyle"", ""Black"");            clkapp.setClkStyle(""Black"");            clkAna = true;        }        else if (blue.isChecked()) {            edt.putString(""ClkAnalogStyle"", ""Blue"");            clkapp.setClkStyle(""Blue"");            clkAna = true;        }        else if (bbl.isChecked()) {            edt.putString(""ClkAnalogStyle"", ""Bubble"");            clkapp.setClkStyle(""Bubble"");            clkAna = true;        }                   else if (crbdig.isChecked()) {            edt.putString(""ClkAnalogStyle"", ""DigitalBlack"");            clkapp.setClkStyle(""DigitalBlack"");            clkAna = false;        }        else if (grndig.isChecked()) {            edt.putString(""ClkAnalogStyle"", ""DigitalGreen"");            clkapp.setClkStyle(""DigitalGreen"");            clkAna = false;        }        clkapp.setAnalog(clkAna);        edt.putBoolean(""ClkAnalogue"", clkAna);        edt.commit();    }    @Override    public void onBackPressed() {        // do something on back.        finish();               return;    }}</code></pre>","603858","","603858","","2011-02-24 16:08:47","2011-02-24 16:08:47","Android orentation change weird problem","<android>","1","0","","",""
"5081145","1","5106419","","2011-02-22 16:48:13","10","6238","<p>I've written an android app that requires the use of the AccessibilityService.I know how to check to see if Accessibility is enabled or disabled on the phone, but I cannot work out a way to determine if my app has been specifically enabled within the accessibility menu.</p><p>I'm wanting to prompt the user if the AccessibilityService is not running, but can't find a good way of doing this.Is there any API methods that I might be missing that would let me know which accessibility services are enabled on the device?</p>","578374","","","","","2014-02-26 16:15:46","Android: How do you check if a particular AccessibilityService is enabled","<android><accessibility-api>","3","0","11","",""
"5081271","1","5081631","","2011-02-22 16:59:56","0","741","<p>We want to implement the following requirement for localization -</p><ol><li>The parameter values stored in strings.xml (and other language variants) need to refreshed periodically (almost daily). This is because of some dynamic texts that needs to be displayed based on the language. The entries in the strings.xml can be added, modified or deleted. The values are fetched periodically (based on defined refresh policy) from a backend api call.If my understanding is correct, then we cannot modify the strings.xml dynamically in the apk file.</li></ol><p>We are comtemplating 2 possible approaches -</p><ol><li><p>Make use of the device DB and load values from there (personally I dont like this approach very much as I am not able to predict the impact on performance. Any comments? )</p></li><li><p>Create a wrapper implementation to parse xml's and have these values stored in the specific xml. </p></li></ol><p>Depending upon the language selected parse the corresponding xml and use that to populate the map. The values are then fetched from this maps (in place of android Resource file)</p><p>If anybody who has faced similar issues, can you please provide your inputs and possible approach. If there is something default in Android api that I am missing and can be used in this situation ?</p><p>Looking forward to people's input on the above.</p>","628702","","424413","","2011-02-22 17:01:52","2011-02-22 17:30:25","How to dynamically modify localization values in android app","<android><localization><internationalization>","1","0","","",""
"5081452","1","5081535","","2011-02-22 17:14:52","0","1227","<p>in my options menu I have a function that can change the applications background. To do this, I start an Activity where the user can pick an image from his gallery.</p><p>Now to the problem: I want the <strong>gallery</strong> to be displayed in <strong>fullscreen-mode</strong>.</p><p>My AndroidManifest.xml contains </p><pre><code>&lt;application android:icon=""@drawable/icon""             android:theme=""@android:style/Theme.NoTitleBar.Fullscreen""             android:label=""@string/app_name""&gt;</code></pre><p>And I'm showing the gallery via</p><pre><code> Intent i = new Intent(Intent.ACTION_PICK, android.provider.MediaStore.Images.Media.INTERNAL_CONTENT_URI); i.setType(""image/*""); startActivityForResult(i, PICK_REQUEST);</code></pre><p>Does anybody have an idea how to do this?</p>","453895","","","","","2011-02-22 17:22:08","Pick image from gallery in fullscreen mode","<android><android-intent><android-gallery>","1","0","","",""
"5081500","1","5083566","","2011-02-22 17:19:52","0","3038","<p>First I thought that the problem will be very easy to solve, but it proved to be a challenge.</p><p><strong>Scenario</strong>One FrameLayout and two ImageViews, one over the other. The first images has a Translate animation and a onClick event. Let's translate this in something practical: the Framelayout has one Rabbit image and a Bush image. The Rabbit has a translate animation so it moves out of the bush. As soon as the rabbit becomes visible, the user can tap on it. Unfortunately this does not work as intended. Even if the rabbit is not visible (being behind the bush) if the user taps on the bush, the click event of the rabbit fires. I tried to add onClick event (that doesn't do anything) for the bush image, but now only this one fires, and the rabbit ones doesn't.</p><p><strong>Code</strong></p><p>Animation</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;translate    xmlns:android=""http://schemas.android.com/apk/res/android""    android:fromXDelta=""0%""    android:toXDelta=""100%""    android:fromYDelta=""0%""    android:toYDelta=""0%""    android:duration=""25000""    android:zAdjustment=""top"" /&gt;</code></pre><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:id=""@+id/layBackground""              android:orientation=""horizontal""              android:layout_width=""fill_parent""              android:layout_height=""fill_parent""              android:layout_weight=""1""              android:background=""@drawable/someimage""&gt;                       &lt;ImageView android:id=""@+id/imgAfterBush""                                 android:layout_width=""wrap_content""                                 android:layout_height=""wrap_content""                                 android:layout_gravity=""bottom|left""                                 android:layout_marginLeft=""50dip""                                 android:onClick=""imgAfterBushOnClick""/&gt;                      &lt;ImageView android:id=""@+id/imgBush""                                 android:layout_width=""wrap_content""                                 android:layout_height=""wrap_content""                                 android:src=""@drawable/bush""                                 android:layout_gravity=""bottom|left""                                /&gt;&lt;/FrameLayout&gt;</code></pre><p>I want the onClick event of the Rabbit image to fire only when it is visible. Any solutions  ? Thank you. </p>","379865","","","","","2011-02-22 20:28:14","FrameLayout onClick for overlapping images on Android","<android><onclick><framelayout>","2","0","","",""
"5081516","1","","","2011-02-22 17:20:53","0","2472","<p>In my application I want to use in my ListView items, which are different to each other.</p><p>Try to get an example.</p><p>I have an arraylist with actions, which do be executed.</p><p>Each action has starttime, endtime and the list of steps should be made to complete the action.</p><p>My idea was to setAdapter of my ListView with an ArrayAdapter filled with actions arraylist.And after that to add to each item dynamically textviews with step descriptions. </p><p>I do it in getView. As result scrolling throug list create new step descriptions.</p><p>How to avoid this?</p><p>Is to common that ListView has dynamic items?</p><p>Is it possible to create listview within listview?</p><p>Thank you</p>","408780","","","","","2011-02-22 17:34:33","addView in a ListView","<android><listview>","1","0","","",""
"5081663","1","","","2011-02-22 17:32:58","0","7272","<p>I already asked this question, but got answers that don't work and it counted as ""Answered"". Maybe someone knows how to design button in Eclipse for an Android app, so it takes you to a website ?Let's say this website.Thanks a lot.</p>","625561","","","","","2013-08-09 17:56:12","How design a button in Eclipse for Android App, so when you click, it takes you to a website","<android><button><website>","3","3","","",""
"5081688","1","","","2011-02-22 17:35:06","0","2084","<p>I am making an android app, and i am making an httprequest to get an XML document, my httpEntity does not return null, and i am trying to use the documentbuilderfactory to parse the file and get the data i need from the xml.  </p><p>I have:  </p><pre><code>        DefaultHttpClient httpclient = new DefaultHttpClient();        HttpGet httpPost = new HttpGet(URL);        httpPost.addHeader(""Authorization"", getAuthHeader());        HttpResponse response = httpclient.execute(httpPost);        HttpEntity entity = response.getEntity();           InputStream is = entity.getContent();        DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();        DocumentBuilder db = dbf.newDocumentBuilder();         Document doc = db.parse(is);</code></pre><p>at this point i get an error exception that looks like this</p><pre>org.xml.sax.SAXParseException: expected: /hr read: body (position:END_TAG @10:8 in java.io.InputStreamReader@40564d70)</pre><p>Has anyone seen this or know what i am doing i cannot find what the problem is, if this is not enough code i can provide more, not much more is being done, just the http request.the ""XML"" file that i am trying to get looks like this  </p><pre><code>&lt;ads&gt;  &lt;ad&gt;    &lt;id&gt;6&lt;/id&gt;    &lt;minViews&gt;10&lt;/minViews&gt;    &lt;duration&gt;4&lt;/duration&gt;    &lt;actionUrl&gt;URL&lt;/actionUrl&gt;    &lt;imageUrl&gt;URL&lt;/imageUrl&gt;    &lt;impressionCount&gt;0&lt;/impressionCount&gt;  &lt;/ad&gt;&lt;ads&gt;</code></pre><p>and that is all that is in the file. and i am trying to get the URL in both spots.</p>","591359","","591359","","2011-02-22 18:03:22","2013-09-18 22:27:05","how do i parse inputstream to document builder?","<java><android><xmlhttprequest>","2","3","","",""
"5081780","1","","","2011-02-22 17:45:34","0","46","<p>I want to design an android app for a websiteThe app will be downloaded through a unique link from my serverI want each user to download the app WITH HIS USERNAME LOGGED IN ALREADY FOR HIM</p><p>Is there a way to do that with an android app?</p><p>My aim is to let my users download an app and find themselves logged in without having to do it themselves</p>","628806","","1104926","","2011-12-19 13:46:36","2011-12-19 13:46:36","How can I create android apps that has a pre-loggedin feature?","<android><unique>","1","1","","",""
"5081826","1","","","2011-02-22 17:50:23","1","4767","<p>How would I modify the .xml and .java files so that a RadioButton shows one image when selected and another image when not selected?</p><p>Example for RadioButton I am learning from: <a href=""http://www.androidpeople.com/android-radiobutton-example/"" rel=""nofollow"">http://www.androidpeople.com/android-radiobutton-example/</a></p>","628143","","","","","2011-02-22 18:30:01","RadioButton Image","<android><radio-button>","2","0","","",""
"5081827","1","5082156","","2011-02-22 17:50:28","0","2576","<p>I have an editText that displays $0.00. When a user clicks on that, I want a numpad to come up. If they press 5, it should display $0.05, they press 3, it goes $0.53, they press 7 it goes $5.37, etc.</p><p>So far I have the editText displaying $0.00 and it brings up a numpad but you need to delete the numbers up to the $ sign and input the decimal yourself. I've had a few really complex ideas but I'm not sure I'm going about it the right way. Any suggestions?</p>","599116","","","","","2011-02-22 18:20:40","Android Currency Input?","<android>","2","0","","",""
"5081837","1","","","2011-02-22 17:51:07","1","2379","<p>Is there a way to bridge the network device of the Android emulator onto the host machine?</p><p>I have seen <a href=""http://www.anddev.org/advanced_networking_with_android-linux-t155.html"" rel=""nofollow"">these instructions</a>, but they are really old, the file names have changed, and my attempts to translate them to the current emulator haven't worked.  There are a few other similar examples around, but they're all from 2007-2008.  I must admit, my Linux- and especially networking-fu are not strong.  I could not get a second networking device (eth1) to show up in the emulator.</p><p>The reason I want to have the network device appear as a device on the host machine is that I need to be able to connect to the android device from a remote computer (not the host), through rsh (which I've been able to do, as shown in my <a href=""http://stackoverflow.com/questions/4033046/android-emulator-access-redir-port-from-other-host"">instructions here</a>), and then use ssh from within to connect to another remote computer.  I can get in to rsh, but I can not ssh out (or ping the remote computer).  (I've been provided with an image with rshd on it, and this works fine on an actual phone, but the emulator's network devices being hidden is causing problems)</p><p>If an eth1 could be created and bridged, that would be great.  I'm also open to bridging eth0 (but I'd want to change the IP to 172.x.x.x to be on the same subnet as the remote computers)</p><p>Thanks.  I'll try to clarify anything if you ask.</p>","598746","","598746","","2011-02-22 18:24:16","2014-02-27 19:56:05","How to bridge/tuntap a network device from the Android emulator to the host","<android><networking><emulator>","1","0","2","",""
"5081950","1","5082113","","2011-02-22 18:00:07","2","2498","<p>I have a ListActivity declared like this</p><pre><code>public class SelectSiteActivity extends ListActivity</code></pre><p>Then, I have a custom adapter like this</p><pre><code>public class SiteListAdapter extends ArrayAdapter&lt;SimpleSiteModel&gt;</code></pre><p>and my layout looks like 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""    android:padding=""10dp""    android:background=""#ffffff""&gt;    &lt;TextView        android:id=""@+id/siteName""        android:textColor=""#000000""        android:text=""Site Name""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:textSize=""16sp"" /&gt;    &lt;ImageView        android:id=""@+id/siteListMoreImage""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:src=""@drawable/expander_ic_minimized"" /&gt;&lt;/LinearLayout&gt;</code></pre><p>How do I get the <code>ImageView</code> to be pressed all the way over to the right so they are all aligned vertically and then the <code>TextView</code> takes up the rest of the row and so they are both aligned vertically in the center?</p>","107455","","","","","2011-02-22 18:15:40","android, show arrow icon in List item","<android><android-layout>","1","0","1","",""
"5081956","1","","","2011-02-22 18:00:28","2","2978","<p>I'm trying to load a new <code>layout</code> when I click a button, this layout has only a <code>webView</code> in it so my goal is, when the button is clicked that it opens the webView and directs the user to a pre-determined page. Right now I have</p><pre><code>Button codesBtn = (Button)findViewById(R.id.imagebutton1);    codesBtn.setOnClickListener(new OnClickListener() {        public void onClick(View v) {            setContentView(R.layout.codes);        }    });</code></pre><p>This is inside my <code>onCreate()</code> method in my main activity. I have a couple concerns:</p><p>1) is this the correct place to put this block of code into?<br>   2) Do I need to create a separate activity for the webView and what I want the button to do?<br>   3) If so, what is the basic structure of the activity needed?</p><p>Thanks in advance!</p>","611884","","1049263","","2012-12-12 13:50:14","2012-12-12 13:50:14","Android how to load a new layout","<java><android><button><activity><oncreate>","1","3","","",""
"5081997","1","","","2011-02-22 18:04:13","0","1014","<p>hey,i'm new to android and i'm having a little problem. I'm running an asynctask to fetch json data from the web in the background. this works well, however the app force closes when theres no internet connection or theres an error with the json parsing or the URL is malformed. is there a way to show a custom error instead of force closing the app? and of course keep the app open. here is my simplyfied code:</p><pre><code>public class Main extends Activity {    public static final int ACTIVITY_CREATE = 0;    protected void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        new LongOperation(Main.this).execute();    }    class LongOperation extends AsyncTask&lt;String, Void, String&gt; {        private Main longOperationContext = null;        private static final int ACTIVITY_CREATE = 0;        public LongOperation(Main context) {            longOperationContext = context;        }        @Override        protected String doInBackground(String... params) {            try {          //JSON Fetching and parsing here            } catch (MalformedURLException e) {                AlertDialog.Builder alertbox = new AlertDialog.Builder(Main.this);                alertbox.setTitle(""Error"");                alertbox.setMessage(""URL Exception"");                alertbox.setNegativeButton(""OK"", null);                alertbox.show();            } catch (IOException e) {                AlertDialog.Builder alertbox = new AlertDialog.Builder(Main.this);                alertbox.setTitle(""Error"");                alertbox.setMessage(""IO Exception"");                alertbox.setNegativeButton(""OK"", null);                alertbox.show();            } catch (JSONException e) {                AlertDialog.Builder alertbox = new AlertDialog.Builder(Main.this);                alertbox.setTitle(""Error"");                alertbox.setMessage(""JSON Exception"");                alertbox.setNegativeButton(""OK"", null);                alertbox.show();            }            return null;        }        @Override        protected void onPostExecute(String result) {        //...        }        protected void onPreExecute() {      //...        }        @Override        protected void onProgressUpdate(Void... values) {        //...        }    }}</code></pre><p>thanks in advance</p><p>EDIT:here is the logcat:</p><pre><code>02-22 19:33:47.881: WARN/dalvikvm(683): threadid=11: thread exiting with uncaught exception (group=0x40015560)02-22 19:33:47.881: ERROR/AndroidRuntime(683): FATAL EXCEPTION: AsyncTask #302-22 19:33:47.881: ERROR/AndroidRuntime(683): java.lang.RuntimeException: An error occured while executing doInBackground()02-22 19:33:47.881: ERROR/AndroidRuntime(683):     at android.os.AsyncTask$3.done(AsyncTask.java:200)02-22 19:33:47.881: ERROR/AndroidRuntime(683):     at java.util.concurrent.FutureTask$Sync.innerSetException(FutureTask.java:274)02-22 19:33:47.881: ERROR/AndroidRuntime(683):     at java.util.concurrent.FutureTask.setException(FutureTask.java:125)02-22 19:33:47.881: ERROR/AndroidRuntime(683):     at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:308)02-22 19:33:47.881: ERROR/AndroidRuntime(683):     at java.util.concurrent.FutureTask.run(FutureTask.java:138)02-22 19:33:47.881: ERROR/AndroidRuntime(683):     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1088)02-22 19:33:47.881: ERROR/AndroidRuntime(683):     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:581)02-22 19:33:47.881: ERROR/AndroidRuntime(683):     at java.lang.Thread.run(Thread.java:1019)02-22 19:33:47.881: ERROR/AndroidRuntime(683): Caused by: java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare()02-22 19:33:47.881: ERROR/AndroidRuntime(683):     at android.os.Handler.&lt;init&gt;(Handler.java:121)02-22 19:33:47.881: ERROR/AndroidRuntime(683):     at android.app.Dialog.&lt;init&gt;(Dialog.java:101)02-22 19:33:47.881: ERROR/AndroidRuntime(683):     at android.app.AlertDialog.&lt;init&gt;(AlertDialog.java:63)02-22 19:33:47.881: ERROR/AndroidRuntime(683):     at android.app.AlertDialog.&lt;init&gt;(AlertDialog.java:59)02-22 19:33:47.881: ERROR/AndroidRuntime(683):     at android.app.AlertDialog$Builder.create(AlertDialog.java:786)02-22 19:33:47.881: ERROR/AndroidRuntime(683):     at android.app.AlertDialog$Builder.show(AlertDialog.java:801)02-22 19:33:47.881: ERROR/AndroidRuntime(683):     at en.android.albumdownloader.Main$LongOperation.doInBackground(Main.java:130)02-22 19:33:47.881: ERROR/AndroidRuntime(683):     at en.android.albumdownloader.Main$LongOperation.doInBackground(Main.java:1)02-22 19:33:47.881: ERROR/AndroidRuntime(683):     at android.os.AsyncTask$2.call(AsyncTask.java:185)02-22 19:33:47.881: ERROR/AndroidRuntime(683):     at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:306)02-22 19:33:47.881: ERROR/AndroidRuntime(683):     ... 4 more02-22 19:33:47.881: WARN/ActivityManager(71):   Force finishing activity en.android.albumdownloader/.Main02-22 19:33:51.822: ERROR/WindowManager(683): Activity en.android.albumdownloader.Main has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView@4057bdf0 that was originally added here02-22 19:33:51.822: ERROR/WindowManager(683): android.view.WindowLeaked: Activity en.android.albumdownloader.Main has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView@4057bdf0 that was originally added here02-22 19:33:51.822: ERROR/WindowManager(683):     at android.view.ViewRoot.&lt;init&gt;(ViewRoot.java:258)02-22 19:33:51.822: ERROR/WindowManager(683):     at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:148)02-22 19:33:51.822: ERROR/WindowManager(683):     at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:91)02-22 19:33:51.822: ERROR/WindowManager(683):     at android.view.Window$LocalWindowManager.addView(Window.java:424)02-22 19:33:51.822: ERROR/WindowManager(683):     at android.app.Dialog.show(Dialog.java:241)02-22 19:33:51.822: ERROR/WindowManager(683):     at en.android.albumdownloader.Main$LongOperation.onPreExecute(Main.java:174)02-22 19:33:51.822: ERROR/WindowManager(683):     at android.os.AsyncTask.execute(AsyncTask.java:391)02-22 19:33:51.822: ERROR/WindowManager(683):     at en.android.albumdownloader.Main$1.onClick(Main.java:56)02-22 19:33:51.822: ERROR/WindowManager(683):     at android.view.View.performClick(View.java:2485)02-22 19:33:51.822: ERROR/WindowManager(683):     at android.view.View$PerformClick.run(View.java:9080)02-22 19:33:51.822: ERROR/WindowManager(683):     at android.os.Handler.handleCallback(Handler.java:587)02-22 19:33:51.822: ERROR/WindowManager(683):     at android.os.Handler.dispatchMessage(Handler.java:92)02-22 19:33:51.822: ERROR/WindowManager(683):     at android.os.Looper.loop(Looper.java:123)02-22 19:33:51.822: ERROR/WindowManager(683):     at android.app.ActivityThread.main(ActivityThread.java:3683)02-22 19:33:51.822: ERROR/WindowManager(683):     at java.lang.reflect.Method.invokeNative(Native Method)02-22 19:33:51.822: ERROR/WindowManager(683):     at java.lang.reflect.Method.invoke(Method.java:507)02-22 19:33:51.822: ERROR/WindowManager(683):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)02-22 19:33:51.822: ERROR/WindowManager(683):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)02-22 19:33:51.822: ERROR/WindowManager(683):     at dalvik.system.NativeStart.main(Native Method)</code></pre>","563020","","563020","","2011-02-22 18:35:31","2011-02-22 18:35:31","Force close if no internet connection or URL malformed while fetching JSON data","<android><json><exception-handling>","1","2","","",""
"5082070","1","","","2011-02-22 18:10:40","0","2065","<p>I am going through the tutorial for HelloFormStuff located <a href=""http://developer.android.com/resources/tutorials/views/hello-formstuff.html"" rel=""nofollow"">here</a>: </p><p>I am stuck on the first mini-tutorial on this page which is simply adding a button that uses the images to the right as different states and when clicked it displays a toast message.</p><p>I am getting this error in the main.xml layout file:</p><blockquote>  <p>error! Unable to resolve drawable  ""C:\Documents and Settings\Ray  James\workspace\HelloFormStuff\res\drawable\android_button.xml""  in attribute ""background"" Exception  details are logged in Window > Show  View > Error Log</p></blockquote><p>I have the following images saved in the res/drawable folder:</p><p>android_normal.pngandroid_focused.pngandroid_pressed.png</p><p>Here is the code for the different states of the button that is saved in res/drawable/android_button.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: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;</code></pre><p>Here is the code in 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;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><p>Here is the code for HelloFormStuff activity class:</p><pre><code>package com.example.HelloFormStuff;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 HelloFormStuff 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(HelloFormStuff.this, ""Beep Bop"", Toast.LENGTH_SHORT).show();            }        });    }}</code></pre><p>I have no other errors showing up in eclipse.  Any help would be greatly appreciated.</p><p>Project Properties:target: android 1.5 API 3Editor: Eclipse Version: 3.6.1</p><p>Any help would be greatly appreciated.  Thanks.</p>","450923","","1228","","2013-08-13 14:11:00","2013-08-13 14:13:06","Android Tutorial - HelloFormStuff - unable to resolve drawable error","<android>","1","0","","",""
"5082122","1","5082395","","2011-02-22 18:16:36","12","9367","<p>I'm hitting an external API that's returning JSON data (new dvd titles).  I'm able to parse out the JSON and list each dvd title and other dvd information into a ListView just fine.  I was also able to setup an onListItemClick method just fine for primitive data (title string).  I ended up writing something like so for the onListItemClick method:</p><p>Just to note, the productArray is a class var that's being set by another method that holds an array of JSONObjects.  </p><pre><code>protected void onListItemClick(ListView l, View v, int position, long id) {    super.onListItemClick(l, v, position, id);    Intent i = new Intent(DvdListingActivity.this, MovieProductActivity.class);    try {        JSONObject jsonObj = productArray.getJSONObject(position);        i.putExtra(""mTitle"", jsonObj.getJSONObject(""Title"").opt(""val"").toString());        i.putExtra(""mRelDate"", jsonObj.getJSONObject(""RelDate"").opt(""val"").toString());        i.putExtra(""mDesc"", jsonObj.getJSONObject(""Desc"").opt(""val"").toString());        i.putExtra(""mRating"", jsonObj.getJSONObject(""MPAA"").getJSONObject(""Rating"").opt(""val"").toString());        i.putExtra(""mActors"", jsonObj.getJSONObject(""Actors"").opt(""val"").toString());        i.putExtra(""mImage"", jsonObj.getJSONObject(""Image"").opt(""val"").toString());        startActivity(i);    } catch (JSONException e) {        // TODO Auto-generated catch block        e.printStackTrace();    }       }</code></pre><p>The above code all works, but I'm thinking there's GOTTA be a better way for me to pass in data to another Activity.  I was thinking that I would be able to pass a JSONObject that contains all the data for a dvd movie instead of setting each data point individually.  </p><p>I tried for a week and a half to figure out how to use Parcelable.  I tried instantiating a new JSONObject jsonObj  that implements Parcelable with no luck.  I kept getting an error in my LogCat that said that the object was un-parcelable.</p><p>I've tried reading the Android developer site and other blogs, but I couldn't apply their examples to what I needed to do.</p><p>Any help would be much appreciated</p>","473737","","","","","2011-03-14 15:04:07","Passing JSONObject into another activity","<android><activity><parcelable>","4","1","2","",""
"5082234","1","5082702","","2011-02-22 18:29:30","1","245","<p>i want the textView to be always on the top of each editbox,in all the device screen..firstly i tried to do it with relative layout but its not working..This try is with table layout.i would like your opinion for the best layout for this use!thanks</p><p>here is my code:</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=""2""  android:background=""@drawable/back""    &gt; &lt;TextView  android:id=""@+id/mathimatika""    android:layout_width=""fill_parent""     android:layout_height=""wrap_content""     android:text=""Mathimatika Kateuthinsis""    android:textColor=""#09074c""    android:textSize=""14px""    android:gravity=""center""    /&gt;    &lt;TableRow&gt;        &lt;TextView            android:layout_column=""1""            android:text=""Profwrika a""             android:padding=""13dip""               android:textColor=""#09074c""    android:textSize=""10px""            /&gt;        &lt;TextView            android:text=""Profwrika b""            android:gravity=""center""             android:textColor=""#09074c""    android:textSize=""10px""             /&gt;              &lt;TextView            android:text=""grapta""            android:gravity=""right""             android:padding=""13dip""               android:textColor=""#09074c""    android:textSize=""10px""            /&gt;    &lt;/TableRow&gt;    &lt;RelativeLayout&gt;  &lt;EditText android:id=""@+id/input11"" android:layout_width=""60px""        android:layout_height=""wrap_content"" android:textSize=""18sp""        android:numeric=""decimal|signed""                 android:layout_below=""@id/vathmos1""      android:layout_marginLeft=""13dip""&gt;    &lt;/EditText&gt;  &lt;EditText android:id=""@+id/input21"" android:layout_width=""60px""        android:layout_height=""wrap_content"" android:textSize=""18sp""        android:numeric=""decimal|signed""             android:layout_toRightOf=""@id/input11""               android:layout_below=""@id/vathmos1""            android:layout_marginLeft=""25px""&gt;    &lt;/EditText&gt;  &lt;EditText android:id=""@+id/input31"" android:layout_width=""60px""        android:layout_height=""wrap_content"" android:textSize=""18sp""        android:numeric=""decimal|signed""             android:layout_toRightOf=""@id/input21""               android:layout_below=""@id/vathmos1""            android:layout_marginLeft=""25px""&gt;    &lt;/EditText&gt;&lt;/RelativeLayout&gt;&lt;/TableLayout&gt;</code></pre>","519526","","519526","","2011-02-23 12:04:21","2011-02-23 12:04:21","layout help(relative/table)","<android><layout>","1","0","","",""
"5082255","1","5093867","","2011-02-22 18:31:23","0","928","<p>I am streaming a video in android and I decode frames in native code and then copy the pixels to a bitmap, then display the bitmap in Java using canvas.unlockandpost with a while loop for all the bitmaps.</p><p>Everything is fine, but the streaming of bitmaps is very slow and causes a crash. I only see a message on logcat saying that ""low memory no more background processes"". </p><p>I see on the allocation table from eclipse, that the bitmaps that I created are not getting deleted from memory, even though, I am overwritng the pixels everytime. Is there any way I can clean up the memory it is keeping.</p><p>My code is as follows. </p><p>C Code : </p><pre><code>AndroidBitmapInfo  info;void*              pixels;int                ret;if ((ret =AndroidBitmap_lockPixels(env, bitmap, &amp;pixels)) &lt; 0) {}memcpy(pixels, pictureRGB, 480*320);AndroidBitmap_unlockPixels(env, bitmap);</code></pre><p>Java Code</p><pre><code>     Bitmap mBitmap = Bitmap.createBitmap(480, 320, Bitmap.Config.RGB_565);     renderbitmap(mBitmap, 0);     canvas.drawBitmap(mBitmap, 0, 0, null);</code></pre>","574911","","574911","","2011-02-22 22:50:58","2011-02-23 16:37:40","android - rendering bitmaps from native code - nativeCreate bitmaps are not cleanedup from memory","<android><crash><bitmap><android-emulator><android-ndk>","1","0","1","",""
"5082419","1","5083466","","2011-02-22 18:44:01","0","221","<p>I need to put a control on my activity ( not a popup ) for choosing date. I read on net but all examples are with dialog, but I don't need that. Is there any embedded control in Android for that ? Does anybody have example for that ?</p>","486578","","","","","2011-02-22 20:20:50","Date picker in activity problem","<android>","1","0","","",""
"5082466","1","5082747","","2011-02-22 18:48:07","1","402","<p>I am a complete Android and C in general noob,</p><p>I have done a lot of web programming (which I am imagining is largely irrelevant here), some javascript (not jQuery just raw JS), I have also developed a .net app and done a course in java programming at uni last semester,</p><p>I know that Android uses Java in some places and C in others, I have looked at the SDK documentation here: <a href=""http://developer.android.com/guide/topics/appwidgets/index.html"" rel=""nofollow"">http://developer.android.com/guide/topics/appwidgets/index.html</a></p><p>My aim is to build a simple dashboard widget that pulls data on a minute-by-minute basis from a JSON/JSONP API, I have thus far struggled to find any decent tutorials for real Android noobs such as myself, especially in the app widget category, If anyone knows of any good resources (online or books are fine) consisting of basic good practises, start-up guides and quick tutorials to get me up to speed would be great as I have absolutely no idea where to start (especially in the C end of things), I have found the SDK documentation does have some good stuff but it isn't exactly what I am after (built on very old builds of Android and thus most of the cool new features aren't integrated or taken into account).</p><p>Any recommendations would be very much appreciated!</p><p>On a side note, If all goes well with Android I would also be looking to move onto iOS so Objective-C start-up and tutorials would be great (Visual Quick Pro guide style would be perfect!)</p>","571593","","571593","","2011-02-22 18:56:11","2011-02-22 19:15:43","Resources for Android absolute beginner","<java><android><objective-c><ios><android-widget>","2","0","3","",""
"5082531","1","","","2011-02-22 18:54:09","0","72","<p>I have an xml file contains a listview </p><p>I want load the different item from a database (SQL Query)</p><p>I have also an other xml file contains an an autocompletTextView</p><p>also i want link it with my data base (don't field it manually but by an SQL query</p><p>Thank you in advance</p>","616263","","526217","","2011-02-22 19:05:28","2011-03-16 23:17:46","autocompletTextView and ListView loaded from a database","<android><sql>","1","0","","",""
"5082703","1","5083066","","2011-02-22 19:11:00","4","13824","<p>I found Fedor's code <a href=""http://stackoverflow.com/questions/541966/android-how-do-i-do-a-lazy-load-of-images-in-listview"">here</a> and implemented it into my project. The only difference is that my application does not have a list view, rather, I am accessing 1 image at a time from the server. When the activity launches, i call ""DisplayImage(...)"" to show the first picture. Then there are 2 buttons (previous/next) that when clicked, they call ""DisplayImage(...)"". </p><p>It works fine for a little while, but then I get an Out of Memory error. At the top of his code, he comments that you may want to use SoftReference. I am assuming that would fix my problem, right? I played around with it a bit but when I tried modifying it to use SoftReference, the images never load. I have never used SoftReference before so I figure I'm just missing something. How would I modify that code (ImageLoader) to fix my OOM error? Is there a better way of caching the pictures as you browse them?</p><p><strong>UPDATE:</strong>Here is the code in case you don't want to view the other files in the source.</p><pre><code>package com.fedorvlasov.lazylist;import java.io.File;import java.io.FileInputStream;import java.io.FileNotFoundException;import java.io.FileOutputStream;import java.io.InputStream;import java.io.OutputStream;import java.net.URL;import java.util.HashMap;import java.util.Stack;import android.app.Activity;import android.content.Context;import android.graphics.Bitmap;import android.graphics.BitmapFactory;import android.widget.ImageView;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, Bitmap&gt; cache=new HashMap&lt;String, Bitmap&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(),""LazyList"");        else            cacheDir=context.getCacheDir();        if(!cacheDir.exists())            cacheDir.mkdirs();    }    final int stub_id=R.drawable.stub;    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();    }    private Bitmap getBitmap(String url)     {        //I identify images by hashcode. Not a perfect solution, good for the demo.        String filename=String.valueOf(url.hashCode());        File f=new File(cacheDir, filename);        //from SD cache        Bitmap b = decodeFile(f);        if(b!=null)            return b;        //from web        try {            Bitmap bitmap=null;            InputStream is=new URL(url).openStream();            OutputStream os = new FileOutputStream(f);            Utils.CopyStream(is, os);            os.close();            bitmap = decodeFile(f);            return bitmap;        } catch (Exception ex){           ex.printStackTrace();           return null;        }    }    //decodes image and scales it to reduce memory consumption    private Bitmap decodeFile(File f){        try {            //decode image size            BitmapFactory.Options o = new BitmapFactory.Options();            o.inJustDecodeBounds = true;            BitmapFactory.decodeStream(new FileInputStream(f),null,o);            //Find the correct scale value. It should be the power of 2.            final int REQUIRED_SIZE=70;            int width_tmp=o.outWidth, height_tmp=o.outHeight;            int scale=1;            while(true){                if(width_tmp/2&lt;REQUIRED_SIZE || height_tmp/2&lt;REQUIRED_SIZE)                    break;                width_tmp/=2;                height_tmp/=2;                scale*=2;            }            //decode with inSampleSize            BitmapFactory.Options o2 = new BitmapFactory.Options();            o2.inSampleSize=scale;            return BitmapFactory.decodeStream(new FileInputStream(f), null, o2);        } catch (FileNotFoundException e) {}        return null;    }    //Task for the queue    private class PhotoToLoad    {        public String url;        public ImageView imageView;        public PhotoToLoad(String u, ImageView i){            url=u;             imageView=i;        }    }    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();                        }                        Bitmap bmp=getBitmap(photoToLoad.url);                        cache.put(photoToLoad.url, bmp);                        Object tag=photoToLoad.imageView.getTag();                        if(tag!=null &amp;&amp; ((String)tag).equals(photoToLoad.url)){                            BitmapDisplayer bd=new BitmapDisplayer(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();    //Used to display bitmap in the UI thread    class BitmapDisplayer implements Runnable    {        Bitmap bitmap;        ImageView imageView;        public BitmapDisplayer(Bitmap b, ImageView i){bitmap=b;imageView=i;}        public void run()        {            if(bitmap!=null)                imageView.setImageBitmap(bitmap);            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 the same class after I tried to implement SoftReference. I don't think I did it right because this does not display the picture on the screen after loading. </p><pre><code>package com.mycompany.myapp;import java.io.File;import java.io.FileInputStream;import java.io.FileNotFoundException;import java.io.FileOutputStream;import java.io.InputStream;import java.io.OutputStream;import java.lang.ref.SoftReference;import java.net.URL;import java.util.HashMap;import java.util.Stack;import android.app.Activity;import android.content.Context;import android.graphics.Bitmap;import android.graphics.BitmapFactory;import android.widget.ImageView;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, SoftReference&lt;Bitmap&gt;&gt; cache=new HashMap&lt;String, SoftReference&lt;Bitmap&gt;&gt;();    private File cacheDir;    public ImageLoader(Context context){        //Make the background thread 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(),""MyApp/Temp"");        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)    {        if(cache.containsKey(url)){            imageView.setImageBitmap(null);            System.gc();            imageView.setImageBitmap(cache.get(url).get());        } else {            queuePhoto(url, activity, imageView);            imageView.setImageBitmap(null);            System.gc();            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();    }    private SoftReference&lt;Bitmap&gt; getBitmap(String url)     {        //I identify images by hashcode. Not a perfect solution, good for the demo.        String filename=String.valueOf(url.hashCode());        File f=new File(cacheDir, filename);        //from SD cache        SoftReference&lt;Bitmap&gt; b = decodeFile(f);        if(b!=null)            return b;        //from web        try {            SoftReference&lt;Bitmap&gt; bitmap=null;            InputStream is=new URL(url).openStream();            OutputStream os = new FileOutputStream(f);            Utils.CopyStream(is, os);            os.close();            bitmap = decodeFile(f);            return bitmap;        } catch (Exception ex){           ex.printStackTrace();           return null;        }    }    //decodes image and scales it to reduce memory consumption    private SoftReference&lt;Bitmap&gt; decodeFile(File f){        try {            //decode image size            BitmapFactory.Options o = new BitmapFactory.Options();            o.inJustDecodeBounds = true;            BitmapFactory.decodeStream(new FileInputStream(f),null,o);            //Find the correct scale value. It should be the power of 2.            final int REQUIRED_SIZE=1024;            int width_tmp=o.outWidth, height_tmp=o.outHeight;            int scale=1;            while(true){                if(width_tmp/2&lt;REQUIRED_SIZE || height_tmp/2&lt;REQUIRED_SIZE)                    break;                width_tmp/=2;                height_tmp/=2;                scale*=2;            }            //decode with inSampleSize            BitmapFactory.Options o2 = new BitmapFactory.Options();            o2.inSampleSize=scale;            return cache.get(BitmapFactory.decodeStream(new FileInputStream(f), null, o2));        } catch (FileNotFoundException e) {}        return null;    }    //Task for the queue    private class PhotoToLoad    {        public String url;        public ImageView imageView;        public PhotoToLoad(String u, ImageView i){            url=u;             imageView=i;        }    }    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();                        }                        SoftReference&lt;Bitmap&gt; bmp=getBitmap(photoToLoad.url);                        cache.put(photoToLoad.url, bmp);                        Object tag=photoToLoad.imageView.getTag();                        if(tag!=null &amp;&amp; ((String)tag).equals(photoToLoad.url)){                            BitmapDisplayer bd=new BitmapDisplayer(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();    //Used to display bitmap in the UI thread    class BitmapDisplayer implements Runnable    {        SoftReference&lt;Bitmap&gt; bitmap;        ImageView imageView;        public BitmapDisplayer(SoftReference&lt;Bitmap&gt; bmp, ImageView i){bitmap=bmp;imageView=i;}        public void run()        {            if(bitmap!=null){                imageView.setImageBitmap(null);                System.gc();                imageView.setImageBitmap(bitmap.get());            } else {                imageView.setImageBitmap(null);                System.gc();                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>","469194","","469194","","2011-02-22 20:06:11","2012-10-11 08:12:20","Android Out of Memory error with Lazy Load images","<android><caching><lazy-loading><out-of-memory>","4","3","5","",""
"5082730","1","5121504","","2011-02-22 19:13:45","0","2356","<p>I load images in webview and would like to switch between them by fling gesture, but implementing gesture detector in webview case all events are caugth by detector = webview function as zoom and mt dont work. Is there any solution? Filtering events and passing them dow to ontouch? Example code very apreciated.</p><p>Thanks to all.</p>","628939","","","","","2013-09-03 13:50:18","How implement fling gestures into webview?","<android><webview><onfling>","1","0","1","",""
"5082735","1","7890036","","2011-02-22 19:14:32","0","760","<p>I have an broadcast receiver registered in the manifest for intercepting calls, like this:</p><pre><code>    &lt;receiver android:name=""CallTracker""&gt;        &lt;intent-filter&gt;            &lt;action android:name=""android.intent.action.PHONE_STATE"" /&gt;        &lt;/intent-filter&gt;    &lt;/receiver&gt;</code></pre><p>Everything works fine and the receiver gets called.But after I restart the device or my AVD, the receiver doesn't get called anymore.</p><p>What do I have to do in order to get my broadcast receiver to work after reboot, too?Do I need PackageManager for that?I like the registration in the manifest, since the application doesn't have to be active in order for the app to intercept the call.</p>","1566878","","881229","","2014-04-01 19:05:24","2014-04-01 19:05:24","Broadcast Receiver not working after reboot","<android><broadcastreceiver>","1","2","","",""
"5082782","1","","","2011-02-22 19:18:15","0","476","<p>I have a View which draws a rectangle with a line of text inside of it.  The view uses break text to ensure that no text extends outside of the rectangle; it ignores any text that does.  This works fine for some characters, but often Strings made up of 'l's and 'f's extend outside of the rectangle.  So, I'm in need of a sanity check here: Is there some obvious flaw in my below code, or is it possible that Paint.breakText(...) is inaccurate?</p><pre><code>public void onDraw(Canvas canvas)    {        int MARGIN = 1;        int BORDER_WIDTH = 1;        Paint p = new Paint();        p.setAntiAlias(true);        p.setTextSize(12);        p.setTypeface(Typeface.create(Typeface.SERIF, Typeface.NORMAL));        RectF rect = getRect();        float maxWidth = rect.width() - MARGIN - BORDER_WIDTH * 2;        String str = getText();        char[] chars = str.toCharArray();        int nextPos = p.breakText(chars, 0, chars.length, maxWidth, null);        str = str.substring(0, nextPos);        float textX = MARGIN + BORDER_WIDTH;        float textY = (float) (Math.abs(p.getFontMetrics().ascent) + BORDER_WIDTH + MARGIN);        canvas.drawText(str, textX, textY, p);        p.setStrokeWidth(BORDER_WIDTH);        p.setStyle(Style.STROKE);        canvas.drawRect(rect, p);    }</code></pre>","426493","","426493","","2011-02-22 19:25:26","2011-05-17 17:42:18","Android: is Paint.breakText(...) inaccurate?","<android><paint><typeface>","1","0","","2014-04-03 14:26:19",""
"5082823","1","5084237","","2011-02-22 19:21:57","1","382","<p>working with Zxing in J2ME i had:</p><pre><code>MonochromeBitmapSource source = new LCDUIImageMonochromeBitmapSource(bitmapFile);</code></pre><p>I'm having no troubles working with it Zxing in Android except in this case, i don't know how to create the MonochromeBitmapSource given that there is no LCDUI.... class.</p><p>Any hint?</p><p>Thanks!</p>","495904","","","","","2011-02-22 21:32:19","Question regarding Zxing for Android","<java><android><qr-code><zxing>","1","0","","",""
"5082872","1","5082931","","2011-02-22 19:26:13","2","1621","<p>Assuming clear view of satellites, what accuracy in meters can I expect from GPS on Android Devices?</p><p>Is it different for network vs gps location providers?</p>","108495","","","","","2011-05-11 09:36:54","Expected Android GPS Accuracy","<android><gps>","2","0","","",""
"5082893","1","","","2011-02-22 19:27:35","4","488","<p>I'm making a feasibility research for a mobile app (<strong>iPhone</strong>, <strong>Android</strong> &amp; <strong>Blackberry</strong>) project. In short, there is a list of phone numbers, and if incoming call (caller id) is in that list, forward it to a specific(fixed) number (basic call forwarding). Has anyone made anything similar? Thank you in advance.</p>","488660","","","","","2011-03-11 17:25:50","Android iPhone Blackberry call forwarding","<iphone><android><blackberry><call><forwarding>","1","3","1","",""
"5082918","1","5083011","","2011-02-22 19:29:05","4","2400","<p>I have an XML layout file that contains an <code>EditText</code> and a <code>Button</code>. I would like to display the following validation message to provide feedback to the user:</p><blockquote>  <p>You must enter 4 numbers</p></blockquote><p>What's the best way to go about accomplishing this?</p>","616263","","244296","","2011-02-23 00:30:58","2011-03-13 12:48:15","Display Validation Message","<android><validation><edittext><android-edittext>","3","0","1","",""
"5082924","1","5083150","","2011-02-22 19:30:06","0","359","<p>I am currently working on an Android app, I have completed all the 'hard stuff', such as getting my database working, and so on. Now I need to make the UI look decent.I would like to make something that has a 'frame' layout that is clickable. You would click on a 'frame' to find out more information, a bit like the Amazon app.If anyone has any ideas, tutorials or good links, I would be very grateful.Thanks in advance.</p>","608750","","","","","2011-02-22 21:27:02","Android clickable panel UI","<android><android-layout>","1","0","","",""
"5082950","1","5083107","","2011-02-22 19:32:35","2","1897","<p>I have a phone number on my contact page and I want it to dial when someone taps it on a smartphone browser, Android and iPhone. Can someone tell me how that's done? Thanks! BTW, I'm using Cufon which is not selectable. Is that a problem here?</p>","265507","","","","","2013-01-28 17:46:23","How do I make a phone number recognizable to a smartphone?","<iphone><android><smartphone><cufon>","3","1","","",""
"5082956","1","","","2011-02-22 19:33:21","0","227","<p>I've got custom adapter class, which incapsulates SQLiteDatabase. Adapter manages db connection:</p><pre><code> public AutoDBAdapter(final Context context){    this.context=context;    checkDatabase();    try{       openDB();    }catch(Exception e){        e.printStackTrace();    }checkDatabase() </code></pre><p>method checks if DB exists and copies it from assets if necessary.</p><pre><code>private void openDB() throws SQLException{    if(db==null)         db=SQLiteDatabase.openDatabase(dbFileName, null, SQLiteDatabase.OPEN_READWRITE);}</code></pre><p>I create AutoDBAdapter class inside my Activities. I used this approach because I need my DB to be accessible from multiple activities. I know that that's not a good to do it.</p><p>My question: when should I close DB connection? Any suggestions would be useful. Thanks.</p>","468311","","","","","2011-02-22 19:59:20","Android handling static Database object","<android><sqlite><static-members>","1","0","","",""
"5083033","1","5087076","","2011-02-22 19:40:46","0","1352","<p>Thanks in advance for your efforts.</p><p>I have an Application that revolves around a ListActivity extended class.  Before the app starts, I want to check whether the user is registered, and if not tell him to and get some info from him.  So, I tried to call StartActivity in the OnCreate() method. When that loaded, I got a big black screen.I thought that it may be related to being run in the OnCreate so I let the Activity start as usual, and I tried to run it in an OnClick event, and I got the same result.In both cases, if I press escape, that Window goes away and the main app window comes back.</p><p>Here are the lines from where I call the new Activity       </p><pre><code>Intent emailIntent = new Intent(this, EmailAddressGetter.class);this.startActivity(emailIntent);</code></pre><p>Here is the code of the class</p><pre><code>/** *  */package com.kosherapp;import android.app.Activity;import android.os.Bundle;import android.widget.Toast;/** * @author Josh *  */public class EmailAddressGetter extends Activity {    public void OnCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.emailinput);    }}</code></pre><p>Here is the emailinput xml contents</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=""#ffffff""    android:textColor=""#000000""    android:layout_height=""fill_parent""    android:layout_width=""fill_parent""    android:text=""hello""&gt;&lt;/TextView&gt;</code></pre><p>And, here is the manifest contents</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.kosherapp""    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.INTERNET"" /&gt;    &lt;uses-permission        android:name=""android.permission.CALL_PHONE"" /&gt;    &lt;application        android:icon=""@drawable/icon""        android:label=""@string/app_name""    &gt;        &lt;activity            android:name="".KosherApp""            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;activity            android:name="".EmailAddressGetter""            android:label=""email Address Getter""        &gt;        &lt;/activity&gt;        &lt;activity            android:name="".GoogleMaps""            android:label=""Google Maps""        &gt;        &lt;/activity&gt;        &lt;uses-library            android:name=""com.google.android.maps"" /&gt;    &lt;/application&gt;&lt;/manifest&gt; </code></pre><p>Let me know if there's any other info you may need. Oh, I'm running this with the Google API 2.1-update</p><p>Thanks</p>","628986","","297762","","2011-02-22 19:45:58","2011-02-23 04:42:32","Getting Blank Screen when Calling StartActivity()","<android><android-emulator><android-layout><android-manifest>","3","2","","",""
"5083088","1","","","2011-02-22 19:45:56","0","2142","<p>I'm working on an application for android that does some real-time processing of audio from the mic. The sampling and playback is working effectively, but I am having difficulty with implementing the first audio effect - distortion. The audio comes in buffers of shorts, so each time one of these is received I attempt to map the values to the full size of a signed short, and then essentially clip these values if they are above a certain level. The audio that comes from this is certainly distorted, but not in a desirable way. I've included my code for accomplishing this. Can anyone see an error here?</p><pre><code>public void onMarkerReached(AudioRecord recorder) {            // TODO Auto-generated method stub            short max = maxValue(buffers[ix]);            short multiplier;            if(max!=0)                multiplier = (short) (0x7fff/max);            else                multiplier = 0x7fff;            double distLvl =.8;            short distLvlSho = 31000;            short max2 =100;        for(int i=0;i&lt;buffers[ix].length;i++){            buffers[ix][i]=(short) (buffers[ix][i]*multiplier);            if(buffers[ix][i]&gt;distLvlSho)                buffers[ix][i]=distLvlSho;            else if(buffers[ix][i]&lt;-distLvlSho)                buffers[ix][i]=(short)-distLvlSho;            buffers[ix][i]=(short) (buffers[ix][i]/multiplier);        }</code></pre><p>The buffers array is a 2D array of shorts, and the processing is to be done on just one of the array-within-arrays, here buffers[ix].</p>","628971","","","","","2011-02-24 17:03:46","Java audio effects - Distortion algorithm on Android","<java><android><audio><signal-processing>","2","0","1","",""
"5083155","1","5083287","","2011-02-22 19:52:30","0","472","<p>I'm building a mobile app for Android and I need to pool HTTP requests for each of my List adapters. I basically want an <code>ExecutorService</code> implementation that ""collapses,"" ie: it will use up to <em>n</em> threads, but as threads complete, they will immediately expire, making it really lightweight. If there's high demand, it'll just dump tasks into a queue which will wait for threads to become available. Is there a way to do this without writing an <code>ExecutorService</code> myself or should I just get my hands dirty and do it?</p>","128967","","","","","2011-02-22 20:05:46","Lightweight, collapsible Executor implementation?","<java><android><executorservice><executor>","1","2","","",""
"5083162","1","5084664","","2011-02-22 19:53:09","2","1444","<p>I recently compiled an Android app using FOP as I want to convert some XML into a PDF file. However I don't think the FOP JAR files are mean't to work on Android. Are there any versions of FOP available for Android? Or any other XML to PDF converter I could use within my app instead of connecting to a FOP enabled server on the Internet?</p><p>I've tried including fop.jar and the xmlgraphics.jar but even with those added to my project, the call to <code>FopFactory.newInstance()</code> fails.</p><p>Here's my code snippet for the button click that calls FOP:</p><pre><code>// Add button listenerbtnCreatePDF.setOnClickListener(new OnClickListener()        {            @Override            public void onClick(View v)            {                   FopFactory fopFactory = FopFactory.newInstance();                OutputStream out = new BufferedOutputStream(new FileOutputStream(new File(""/sdcard/test.pdf"")));                Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF, out);                TransformerFactory factory = TransformerFactory.newInstance();                Transformer transformer = factory.newTransformer();                Source src = new StreamSource(new File(""/sdcard/test.fo""));                Result res = new SAXResult(fop.getDefaultHandler());                transformer.transform(src, res);                out.close();            }        });</code></pre><p>The compiler is also giving a me a bunch of <code>Dxwarning: Ignoring InnerClasses attribute...</code> errors. Here's the error when I click the button to create the PDF:</p><pre><code>02-22 14:16:23.641: WARN/System.err(5590): java.lang.UnsupportedOperationException: Don't know how to handle ""application/pdf"" as an output format. Neither an FOEventHandler, nor a Renderer could be found for this output format.02-22 14:16:23.641: WARN/System.err(5590):     at org.apache.fop.render.RendererFactory.createFOEventHandler(RendererFactory.java:361)02-22 14:16:23.641: WARN/System.err(5590):     at org.apache.fop.fo.FOTreeBuilder.(FOTreeBuilder.java:105)02-22 14:16:23.641: WARN/System.err(5590):     at org.apache.fop.apps.Fop.createDefaultHandler(Fop.java:101)02-22 14:16:23.641: WARN/System.err(5590):     at org.apache.fop.apps.Fop.(Fop.java:79)02-22 14:16:23.641: WARN/System.err(5590):     at org.apache.fop.apps.FopFactory.newFop(FopFactory.java:271)02-22 14:16:23.641: WARN/System.err(5590):     at org.apache.fop.apps.FopFactory.newFop(FopFactory.java:248)02-22 14:16:23.641: WARN/System.err(5590):     at com.zebdor.signal88.ProposalCalculator$3.onClick(ProposalCalculator.java:158)02-22 14:16:23.641: WARN/System.err(5590):     at android.view.View.performClick(View.java:2501)02-22 14:16:23.641: WARN/System.err(5590):     at android.view.View$PerformClick.run(View.java:9107)02-22 14:16:23.641: WARN/System.err(5590):     at android.os.Handler.handleCallback(Handler.java:587)02-22 14:16:23.641: WARN/System.err(5590):     at android.os.Handler.dispatchMessage(Handler.java:92)02-22 14:16:23.641: WARN/System.err(5590):     at android.os.Looper.loop(Looper.java:123)02-22 14:16:23.641: WARN/System.err(5590):     at android.app.ActivityThread.main(ActivityThread.java:3812)02-22 14:16:23.641: WARN/System.err(5590):     at java.lang.reflect.Method.invokeNative(Native Method)02-22 14:16:23.641: WARN/System.err(5590):     at java.lang.reflect.Method.invoke(Method.java:507)02-22 14:16:23.641: WARN/System.err(5590):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:841)02-22 14:16:23.641: WARN/System.err(5590):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:599)02-22 14:16:23.641: WARN/System.err(5590):     at dalvik.system.NativeStart.main(Native Method)</code></pre>","628982","","628982","","2011-02-22 23:37:18","2011-02-22 23:37:18","FOP for Android?","<android><fop>","1","2","","",""
"5083219","1","","","2011-02-22 19:58:41","0","428","<p>how can i convert image to inputstream then to string , after that reversing the operations where to convert string to inputsrream then ti image format (drawable) in android ..?</p>","508377","","","","","2011-02-22 21:44:16","how to store image as string and then return it yo image using java?","<java><android><inputstream>","1","1","","",""
"5083269","1","","","2011-02-22 20:02:40","0","2334","<p>I'm having difficulty writing strings to and from files. Just your basic, internally created text files. For whatever reason, the IO code I've used with Java console programming doesn't seem to work, and the documentation on Android's I/O Streams for string files is skimpy at best.</p><pre><code>String String_1 = ""I'm"";  String String_2 = ""Getting"";  String String_3 = ""Frustrated"";  String String_4 = null;  String String_5 = null;  String String_6 = null;  FileOutputStream fOut = null;  OutputStreamWriter osw = null;  try{  fOut = openFileOutput(""user1Profile.txt"", 0);  osw = new OutputStreamWriter(fOut);  osw.write(String_1);  osw.write(String_2);  osw.write(String_3);  fOut.close()  }  catch(){}  </code></pre><hr><pre><code>FileInputStream fln = null;  InputStreamReader isr = null;  char[]inputBuffer = new char[1024];  fln = openFileInput(""user1Profile.txt"");  isr = new InputStreamReader(fln);  isr.read(inputBuffer);  String_4 = new String(inputBuffer);  isr.close();  fln.close();  </code></pre><p>Will all 3 strings be stored in String_4?  </p><p>How would I put String 1, 2, and 3 into 4, 5 and 6???<br>I've tried countless combination.</p>","629009","","244296","","2011-02-22 20:04:31","2012-10-21 10:51:22","ANDROID Input / Output FileStream","<android>","2","0","","",""
"5083286","1","","","2011-02-22 20:04:42","0","176","<p>I am doing one project which handles lots of images as backgrounds,buttons,etc....sometimes ""Out of Memory Error ""(BitMap size exceeded error) throws and it clears all the global variables.  So ,when I am referred to global variables my application crashes.  How to handle this situation?</p>","461972","","446746","","2011-02-22 20:53:08","2011-02-22 22:33:22","Memory Problem in Android","<android>","2","2","","",""
"5083372","1","5083413","","2011-02-22 20:12:18","0","202","<p>I'm looking to create a display similar to the following screenshot:</p><p><img src=""http://i.stack.imgur.com/cSZTX.png"" alt=""enter image description here""></p><p>The main point is that each list item can be ""expanded"" to show sub-items. How can I create this in Android? I'm not even sure how to have multiple types of list item renderers, let alone how to accomplish this, but I do know how to generally set up a ListView, its adapter, and the layout. </p>","128967","","","","","2011-02-22 20:15:40","How to create ""docked"" items in a ListView?","<android><android-layout><android-listview>","1","0","","",""
"5083378","1","5084157","","2011-02-22 20:12:46","0","2094","<p>I'm developing an Android 2.2 application.</p><p>I have the following Activity:</p><pre><code>public class StartActivity extends Activity {    private MediaPlayer mp;    @Override    protected void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.startpage);    }    @Override    protected void onResume() {        super.onResume();        ImageView ship = (ImageView)findViewById(R.id.greekShip);        ship.startAnimation(AnimationUtils.loadAnimation(this, R.anim.translate_right));        if (mp == null) {            mp = MediaPlayer.create(getApplicationContext(), R.raw.oceanwave);        }        else {            if (mp.isPlaying())                mp.stop();            mp.reset();            try {                mp.prepare();            } catch (IllegalStateException e) {                // TODO Auto-generated catch block                e.printStackTrace();            } catch (IOException e) {                // TODO Auto-generated catch block                e.printStackTrace();            }        }        mp.start();    }    @Override    protected void onPause() {        super.onPause();        if (mp != null) {            if (mp.isPlaying())                mp.stop();        }    }}</code></pre><p>If I press home button on my telephone, the sound stops. But if I restart the app, the mediaplayer starts but I can't hear anything.</p><p>Do you know where is the problem?</p>","68571","","","","","2013-05-08 08:32:05","MediaPlayer doesn't work after onPause and onResume","<android><activity><media-player><android-2.2-froyo>","1","0","","",""
"5083384","1","","","2011-02-22 20:13:16","0","382","<p>I have a simple aspx site that is styled for use on the android platform. i have some label that are numbers such as ""100>200"" or ""825"". The problem is that when ever one of these labels is touched the phone automatically opens the touched number in the dialer. These are not phone numbers and i do  not want the dialer to be opened. is there a way to avoid this problem..</p><p>thanks</p>","629031","","","","","2011-10-01 18:51:21","ASPX page loaded loaded in android browser, numbers in labels open phone dialer","<android>","0","2","","",""
"5083404","1","5083487","","2011-02-22 20:15:16","0","546","<p>I have the following method to handle when I touch the screen:</p><pre><code>public boolean onTouchEvent(MotionEvent event) {    boolean touchDown = true;    switch (event.getAction()) {        case MotionEvent.ACTION_DOWN:            Log.i(TAG,""touching the screen: YES"");        case MotionEvent.ACTION_UP:            touchDown = false;            Log.i(TAG,""touching the screen: NO"");    }    return touchDown;}</code></pre><p>The result of the Logcat when I touch the screen without removing my finger is:</p><pre><code>touching the screen: YEStouching the screen: NO</code></pre><p>I don't want show the second log until I release myfinger from the screen.</p><p>What I'm doing wrong?</p><p>Thanks.</p>","591452","","21960","","2011-02-23 00:29:40","2011-02-23 00:29:40","How to retain onTouchEvent while touching screen?","<java><android><ontouchevent>","1","0","","",""
"5083515","1","5083569","","2011-02-22 20:24:51","2","1063","<p>How do I test rotating an android device with an AVD?</p>","107455","","","","","2011-08-11 13:05:06","Android - Test Rotating Device in AVD","<android><android-emulator>","2","0","","",""
"5083524","1","","","2011-02-22 20:25:11","0","142","<p>Can anyone please help. </p><p>Im doing a small Android game where I have an emitter emitting a single particle in a random direction each tick of the game. I have a simple emitter, particle and main game class. In my main game class I declare an array of e.g 100 particles. My problem is that I use a for loop to loop through the array of particles each game tick to update that particles state. My problem is however, that the for loop loops through all the particles in one go each tick and all the particles are updated simultaneously, and therefore drawn on top of each other, giving the illuion that there is only 1 particle on the screen. I have tried different loop structures but with no luck. </p><p>Can anyone please sugest a solution or point me to a tutorial that might hekp me with this issue. I can post some code if neccessary. Thanks in advance. </p>","626819","","","","","2011-02-22 22:17:37","Looping through Particles in Android","<android><loops>","1","0","","",""
"5083557","1","5083689","","2011-02-22 20:27:38","0","209","<p>Of course I could write it myself, but I'm wondering if anyone knows of an open-source android component / example source code that will:</p><ul><li>Take a remote URL (http://www.example.com/foo.txt) and a local filename (/sdcard/ben/foo.txt)</li><li>If the local file exists, check date/filesize etc, against the remote version by doing a HEAD request</li><li>Download the file if missing or out of date</li></ul><p>Cheers!</p>","228109","","","","","2011-11-16 09:03:26","Android: Is there a component that can sync files with those on a web server?","<android><download><sync>","1","0","","",""
"5083609","1","","","2011-02-22 20:31:27","1","617","<p>This question has been posted before last year but the answers were not helpful to me.</p><p>Is there a way to make the RadioButton double-circle with green center to indicate selection not display? I want the user to just see a background image, instead of that image with the circle button over it. Thank you very much.</p>","628143","","","","","2012-01-24 07:47:08","Android RadioButton display","<android><radio-button>","1","0","","",""
"5083641","1","5085000","","2011-02-22 20:33:55","0","362","<p>I have been working on a pet project of mine that relies on a SQLite database to store information.  Recently, I have decided that I want the application to be password protected and for the database to be encrypted.  So far, no major problems.  In my design I have been trying to focus on the maximum possible security.  Yes, I know that the greatest security is fairly worthless considering that everything (I am talking salts and cypher text; password is in the user's brain) is stored on one device and anyone who knows what they are doing can likely break it if they possess the device.  So why bother?  Because I can.</p><p>So, to this end I have been contemplating where to store the decrypted version of my database while the application is running.  The most common suggestion online for temporary storage is to the the SD card.  This doesn't sit well with me as the data on the SD card will persist if the application abnormally terminates (enter the over-zealous user with a task manager) or is never terminated at all.</p><p>Lately I have been toying with the idea of storing the entire thing in memory, but this seems like very bad practice.  The database on my test device is absolutely tiny (less than 100K with a mountain of test data in it) but it still rubs me the wrong way that is it possible for a user to have a large database in the wild.  I am very well aware of the fact that as soon as anyone says ""the user will never do / have that"", some guy will beat that limitation into the ground.</p><p>So, posed in question form: where is the best place on an Android device to temporarily store a decrypted database?  Preferably somewhere volatile between application executions but, at this point, I am open to suggestions.</p><p>Thanks in advance.</p>","481075","","","","","2011-02-22 22:51:18","Temporary Storage for Decrypted Database on Android","<java><android><database><encryption>","1","0","","",""
"5083686","1","5085872","","2011-02-22 20:38:49","2","885","<p>I'm trying to localize an android app to Japanese.  I dropped in the japanese strings xml file and everything is pretty good except for Katakana characters with the two little dashes or the little circle in the top right.  For those characters the display takes up the width of 2 full characters.  </p><p>Here's a simple example showing the spacing problem with the word ""website"" in katakana:</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=""???????""               android:typeface=""normal""/&gt;&lt;/LinearLayout&gt;</code></pre><p>When it displays on the phone, the 3rd character takes up an extra space.  Any ideas what's going wrong?</p>","511543","","1079354","","2012-04-29 20:51:28","2012-04-29 20:51:28","Japanese Characters display weird spacing in Android TextView and Buttons","<android><utf-8><internationalization>","2","0","","",""
"5083704","1","","","2011-02-22 20:40:20","0","334","<p>I need a simple statement with an ""if condition"" that does this: ""if you didn't download from market then finish()"".If I understood well there are two types of control: I need that the control is done strictly everytime connecting to the Android market server,  storing data nowhere in the phone for further offline checks.Thanks, as usual, to the Stack citizens!</p>","489146","","80425","","2011-02-22 23:03:31","2011-04-27 20:21:05","LVL - A statement for: ""if you didn't download from market then finish()""","<android><authentication><google-play><strict><android-lvl>","2","0","","",""
"5083768","1","5084152","","2011-02-22 20:46:48","1","2793","<p>I was wondering if you can control input on an EditText to move from right to left?  The EditText would have to support insert/delete etc. from right to left as well.  Is there a way to do this?</p>","408079","","","","","2014-01-28 05:47:44","Can you make an EditText input from right to left?","<android><input><edittext><android-edittext>","4","3","","",""
"5083827","1","","","2011-02-22 20:51:39","2","182","<p>I am having trouble running my Emulator on the development machine. I am using a laptop with a USB Modem. The Emulator can access the internet, but cannot connect to my Apache server on the laptop. In resaearching the problem, I read the router could be the problem, do I need a router before this works, do I have one already? This is my first app and Im not sure where to go from here, below is the code I am using to connect to the Apache server from the App:</p><pre><code>HttpClient httpclient = new DefaultHttpClient();HttpPost httpPost = new HttpPost(""http://10.0.2.2:3128/YES_BUTTON.php"");httpclient.execute(httpPost);</code></pre><p>Apache is listening on port 3128.</p><p>I do not have a proxy setup or a firewall on the laptop.</p><p>Any ideas?</p><p>Much Appreciated,Graeme. </p>","627189","","212275","","2011-02-22 21:30:37","2011-02-22 21:30:37","Router needed for emulator?","<android><apache><emulator>","0","7","","",""
"5083958","1","","","2011-02-22 21:06:01","9","5723","<p>I am designing an app that can record short audio files on iPhone and Android that can be played back on both platforms, as well as hopefully any other smartphone.  </p><p>Right now I'm using *.caf with the iLBC codec, as I know the iPhone does not encode mp3. </p><p>Is there a file format/codec that I should use in this case?</p>","95956","","299797","","2012-10-29 11:18:24","2012-11-20 17:15:40","Which audio format can be recorded and played back by iPhone and Android?","<android><iphone><codec>","6","1","3","",""
"5083975","1","","","2011-02-22 21:08:12","1","2595","<p>I am using the AudioTrack class and have generated my own tones in my Android application. However, I want to be able to control the speed of playback, and I can't figure out how.</p><p>I see the setLoopPoints method but that doesn't seem to do what I want (if anyone has used it and can explain that method to me that would be great, the api documentation doesn't help me much).</p><p>What I want to do:</p><p>As a point (here, a touch on the screen) gets closer to a target on the screen, I want to increase speed of the tones I'm generating. For example, farther away I would, say, have the tone playing 1 time in 1 second, but very close to the target, 5 times in 1 second. I am struggling to find out the best way to do this with Android sounds (generated tones or even .wav files saved to my res/raw).</p><p>Any help would be much appreciated!</p><p>Shani</p>","629105","","","","","2013-09-17 13:29:46","how to set playback speed for android generated tones","<android><audio><playback><sounds>","1","0","1","",""
"5084019","1","5084505","","2011-02-22 21:11:42","0","941","<p>There's a situation I have that's related to the Activity stack but I'm new enough to Android dev to not now how to respond to it.</p><p>I have an application that works like a stopwatch. When you start it, an ongoing notification goes in the notification tray and remains ongoing until you stop the stopwatch. I've noticed that if my stopwatch is running in the foreground, and I touch the notification, it creates a new instance of my stopwatch's activity and slides the old one off screen. This creates problems with the back button (you press back and the new instance goes away to reveal the old instance). It makes sense why this happens, but I don't want it to happen like this. What can I do to prevent multiple instances of my application from running?</p>","160527","","21960","","2011-02-23 00:29:28","2011-02-23 00:29:28","Notifications opening activities and the back button? Restricting to one instance?","<android>","2","1","1","",""
"5084020","1","5084492","","2011-02-22 21:11:44","-3","580","<p>I hope make this website compatible with the webview</p><p><a href=""http://www.laposte.net/"" rel=""nofollow"">http://www.laposte.net/</a></p><p>I hope display it without horizontal scrollbar ( display it a mobile web site)</p><p>Tank you in advance</p>","616263","","","","","2011-02-22 22:25:38","Making a website compatible with WebView with android","<android><webview>","1","1","","",""
"5084217","1","","","2011-02-22 21:31:19","1","564","<p>Is it possible to rename a Android apk file extension programmatically without a rooted device? The goal is to disable a application from starting up, is this possible? </p>","629126","","","","","2011-04-06 10:58:40","Renaming Android apk Programmatically","<android>","2","1","","",""
"5084270","1","5084402","","2011-02-22 21:35:21","0","296","<p>I started with a standard local android service, and used Binders with Listeners to communicate. Then: I began noticing some serious issues with handling orientation changes, so I decided to skip the whole binder thing, and just go with broadcasting intents (and using startService exclusively) that contain all the data/commands that need to be passed.</p><p>My question is: what are some of the pitfalls I have to look out for when using this approach?</p><p>Are there any disadvantages?</p>","312499","","","","","2011-02-22 21:49:21","Android - Going from Binders to Broadcasts","<android><service>","1","0","1","",""
"5084293","1","5085113","","2011-02-22 21:39:02","1","297","<p>I have an editText that brings up the number keyboard. When you enter a number in, I want it to perform a calculation before it shows up in the box.</p><p>So the box initially reads $0.00, you click on it, hit 5, it does a calculation and shows up in the box as $0.05, if you then hit 4 it shows up as $0.54, hit 3 and it's $5.43, etc.</p><p>From what I understand, an addTextChangeListener TextWatcher is needed. I have one... but I don't understand how to manipulate the data before it appears in the box. I'm also having troubles with math calculations on what the TextWatcher provides. Can somebody please point me in the right direction?</p>","599116","","","","","2011-02-22 23:04:10","Real-time calc of editText?","<android>","1","0","","",""
"5084353","1","","","2011-02-22 21:45:15","0","298","<p>I am adding appointment into Google Calendar from Android phone. I want to set remider, but, I am stuck in getting actual id_ of a event, I would like to add reminder to. Best way I think is to get maximum _id and work with it. Do you know how to get maximum _id in Calendar Events?</p><p>Thanks</p>","513956","","","","","2011-02-22 21:45:15","Android Calendar get maximum event _id?","<android><calendar>","0","3","","",""
"5084355","1","","","2011-02-22 21:45:35","1","3872","<blockquote>  <p><strong>Possible Duplicate:</strong><br>  <a href=""http://stackoverflow.com/questions/1441871/passing-data-of-a-non-primitive-type-between-activities-in-android"">Passing data of a non-primitive type between activities in android</a>  </p></blockquote><p>hi...In my android i need to pass ArrayList object from first activity to a second activity through bundles and retrieve the same object in the second activity ...</p><p>pls help me with the code ...</p><p>thanks :)</p>","601142","","","","","2011-02-22 21:51:30","Passing ArrayList Objects through Bundle?","<android><eclipse><arraylist><bundles>","1","2","","2011-02-23 00:12:29",""
"5084462","1","5084871","","2011-02-22 21:54:53","11","3323","<p>I'm trying to allow multilingual support in my app which makes an HTTP post to upload new messages.  What do I need to do in order to support japanese &amp; other non latin based languages?  my code currently looks something like this:</p><pre><code>    //note the msg string is a JSON message by the time it gets here...private String doHttpPost(String url, String msg)        throws Exception {    HttpPost post = new HttpPost(url);    StringEntity stringEntity = new StringEntity(msg);    post.setEntity(stringEntity);    return execute(post);}</code></pre>","372405","","","","","2011-02-22 22:38:02","How to send unicode characters in an HttpPost on Android","<android><http><unicode><post><encoding>","1","0","3","",""
"5084559","1","","","2011-02-22 22:06:03","0","727","<p>I saw the other posts on this site and others but people have solved this different ways and none of them required an authentication to access the XML. </p><pre><code>DefaultHttpClient httpclient = new DefaultHttpClient();HttpGet httpGet = new HttpGet(""some web site"");httpGet.addHeader(""Authorization"", getAuthHeader());HttpResponse response = httpclient.execute(httpGet);DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();DocumentBuilder db = dbf.newDocumentBuilder();  Document doc = db.parse(response.getEntity().getContent());NodeList nodelst = doc.getElementsByTagName(""ad"");</code></pre><p>I know that my HTTP request is fine; its status is 200, but I get this  </p><pre><code>saxParserException: unexpected end of document</code></pre><p>at the line that I have spaced out. Does anyone know how to start from the begining or am I getting a blank file... how can I test for that?</p><p>Thanks for your help  </p><p>the XML looks like this. it is pretty simple  </p><pre><code>&lt;ads&gt;&lt;ad&gt;&lt;id&gt;6&lt;/id&gt;&lt;minViews&gt;10&lt;/minViews&gt;&lt;duration&gt;4&lt;/duration&gt;&lt;actionUrl&gt;some url&lt;/actionUrl&gt;&lt;imageUrl&gt;some url&lt;/imageUrl&gt;&lt;impressionCount&gt;0&lt;/impressionCount&gt;&lt;/ad&gt;&lt;/ads&gt;</code></pre>","591359","","591359","","2011-03-08 16:34:32","2011-03-08 16:34:32","How can I fix a unexpected End of Document Exception","<java><android><xml><http><parsing>","2","0","","",""
"5084572","1","","","2011-02-22 22:07:23","2","5670","<p>Background:In my Mac OSX 10.6 Snow Leopard, I've downloaded the Eclipse and Android SDKs. I started on a Hello World tutorial provided by Eclipse, but a dialog insists it can't find a JRE. </p><p>After a bit of searching the web, I learned that it should be in the eclipse/jre/ folder, but that folder does not exist on my system. I downloaded the Java for Mac OSX 10.6 package from the Apple Developer site, and still see no jre files. </p><p>Supposedly it is should be provided by Java. No use writing the file in eclipse.ini if I can't find the file in the first place. </p><p>This page indicates that the Max OS X already has the JRE, but I can't find the file to link to it: <a href=""http://www.eclipse.org/downloads/moreinfo/jre.php"" rel=""nofollow"">http://www.eclipse.org/downloads/moreinfo/jre.php</a> </p><p>I have installed Android, Eclipse, ADT, AVD, PhoneGap. </p><p>Summary:Need JRE. </p>","172145","","172145","","2011-02-22 23:31:28","2011-02-24 21:55:15","How do I get a JRE file for Eclipse?","<java><android><eclipse><jre>","3","0","","",""
"5084629","1","5085415","","2011-02-22 22:12:33","3","1392","<p>I have been creating Intents using putExtra() for quite a while now and just read in the Android documentation that I should be prefixing the 'name' with the package name.  So, instead of 'putExtra( ""ButtonText"", ""Ok"")' it should be more like 'putExtra( ""com.mycompany.myapplication.ButtonText"", ""Ok"" ).  </p><p>Is this really necessary? (seems to be OK without it).  </p><p>If it is necessary what is the advantage? </p><p>Also, is the package name the callers or the one being called?  If it is the callers the 'called Activity' has to know about the callers name which wouldn't be very generic.</p><p>Thanks</p>","625469","","","","","2011-02-23 07:51:13","Creating Intents with putExtra","<android><android-intent>","3","0","","",""
"5084636","1","5084696","","2011-02-22 22:13:08","1","298","<p>I have 2 bitmaps. I want to copy some content from bitmap 1 and some content of bitmap 2 and copy to a bigger bitmap. When i try to do that the smaller bitmap1 gets stretched in the larger bitmap. Is there a way to copy the contents using scaling?</p>","260298","","","","","2011-02-22 22:19:54","Copy contents of multiple bitmap to one without scaling","<android>","1","0","","",""
"5084647","1","","","2011-02-22 22:14:19","1","1408","<p>So I have an extended TextView that I'm trying to create a StaticLayout from so that I can detect if the text is going off-screen by calling getEllipsisCount. </p><p>So from within the TextView I'm constructing the staticlayout like so:</p><pre><code>layout = new StaticLayout(getText(), getPaint(), getWidth(), Alignment.ALIGN_NORMAL, 0f, 0f, false);</code></pre><p>But even though layout.getLineCount() returns the correct number of lines, getEllipsisCount(n) never returns > 0, even when I can clearly see it adding ellipsis.</p><p>So I'm guessing this has become a not-good way to detect if text has gone off the screen... so does anyone know of a more appropriate way, or how to get this to work?</p>","150020","","186636","","2013-08-26 19:00:36","2013-08-26 19:00:36","StaticLayout getEllipsisCount returning 0 when I know it's ellipsizing?","<android><android-layout><screen><textview>","1","3","","",""
"5084688","1","","","2011-02-22 22:19:23","3","916","<p>Is there a platform like <a href=""https://launchpad.net/"" rel=""nofollow"">Launchpad</a> (Canonical) for the Android platform?<br>I search at least a translation service for my app.<br>If not, It will be nice to be a Google service which provides it, because I see too many untranslated apps in the Market.</p>","629198","","377270","","2011-03-22 22:47:33","2013-05-18 12:51:37","Translation platform for Android Developers","<android><translation><launchpad>","7","0","1","2013-05-18 12:53:23",""
"5084746","1","5085308","","2011-02-22 22:25:25","0","634","<p>I'm very new to programming in Android, but have been struggling all day with a problem and would appreciate your help.</p><p>I'm trying to create a form to get user information (essentially a new contact) which is accessed from the menu.  When I click the button to create the new form, I get the following error:</p><blockquote>  <p>""Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@626fd5e0""</p></blockquote><p>This is my code:<br>The menu xml:</p><pre><code>&lt;menu xmlns:android=""http://schemas.android.com/apk/res/android""&gt;    &lt;item android:id=""@+id/search""        android:title=""@string/settings_search""        android:alphabeticShortcut=""@string/settings_shortcut_search"" /&gt;    &lt;item android:id=""@+id/new_contact""        android:title=""@string/settings_new""        android:alphabeticShortcut=""@string/settings_shortcut_new"" /&gt;&lt;/menu&gt;</code></pre><p>The code for calling the new activity:  </p><pre><code>@Overridepublic boolean onOptionsItemSelected(MenuItem item) {    switch (item.getItemId()) {        case R.id.new_contact:        //activities to create a new account        //startActivity(new Intent(this, Prefs.class));            Intent i = new Intent(MainActivity.this, NewContact.class);            startActivity(i);            //addSaver(""String"");            return true;        case R.id.search:            return true;    // More items go here (if any) ...    }    return false;}</code></pre><p>The view for the new contact activity:</p><pre><code>&lt;ScrollView 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_height=""wrap_content""        android:layout_width=""fill_parent""        android:layout_gravity=""top""&gt;        &lt;TextView            android:id=""@+id/text""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""            android:text=""This is a test\nsecond line\n""/&gt;       &lt;Button            android:id=""@+id/new_contact_button""            android:layout_height=""wrap_content""            android:text=""@string/submit"" /&gt;    &lt;/LinearLayout&gt;&lt;/ScrollView&gt;</code></pre><p>And the code for the new activity:</p><pre><code>public class NewContact extends Activity implements OnClickListener {    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.new_contact);        // Set up click listeners for all the buttons        View newContactButton = findViewById(R.id.new_contact_button);        newContactButton.setOnClickListener(this);    }</code></pre><p>Bizarrely if I comment out the button from the class and from the xml then it works correctly and opens up the new activity (but of course I can't do anything with that activity).</p>","629202","","512958","","2011-02-22 22:53:47","2011-02-22 23:31:06","Android: problem creating user form from a menu","<android>","1","2","","",""
"5084896","1","5233631","","2011-02-22 22:39:57","28","8506","<p>The <a href=""http://developer.android.com/guide/topics/providers/content-providers.html"">documentation on Android content providers</a> describes using a <code>ContentResolver</code>, obtained from <code>getContentResolver()</code>, to access the content.</p><p>However there is also a <code>ContentProviderClient</code>, which can be obtained from <code>getContentResolver().acquireContentProviderClient(authority)</code>.  It seems to provide more or less the same methods available in the <code>ContentResolver</code> for accessing content from the provider.</p><p>When should I use a <code>ContentProviderClient</code> instead of just using the <code>ContentResolver</code> directly?  What are the benefits?</p>","394431","","844882","","2012-06-27 17:55:42","2014-01-24 11:55:47","using ContentProviderClient vs ContentResolver to access content provider","<android><android-contentprovider><android-contentresolver>","4","0","17","",""
"5084938","1","5085266","","2011-02-22 22:44:28","0","990","<p>So far, all content provider tutorials I found, teach how to implement a content provider locally, on the Android device. The URI for such content providers always starts with <strong>content://</strong> as in:</p><pre><code>content://com.google.provider.NotePad/notes/23</code></pre><p>My question: is it possible to implement a content provider that is <strong>not</strong> on the Android device?</p><p>That is, a content provider that follows all the conventions and convenience of Android content providers but is rather located on a remote website, using MySQL for example, instead of SQLite3?</p><p>If so, how do I go about implementing such content provider? Where do I find information that teaches how to do that? Does such content provider's URI start with 'content://'?</p>","418055","","","","","2011-03-04 12:48:17","Android Content Provider *not* in Android?","<android><cloud><android-contentprovider>","2","0","","",""
"5084962","1","5085066","","2011-02-22 22:47:15","0","891","<p>I have this FrameLayout:</p><pre><code>&lt;FrameLayout    android:layout_width=""wrap_content""    android:layout_height=""wrap_content""    android:id=""@+id/searchresult_picture_layout""    android:background=""@drawable/img_bkgd_results_patch""&gt;    &lt;ProgressBar        android:layout_width=""20dp""        android:layout_height=""20dp""        android:layout_gravity=""center""        android:id=""@+id/searchresult_progressbar""        android:indeterminate=""true""        android:visibility=""gone""/&gt;    &lt;ImageView        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:id=""@+id/searchresult_picture""        android:layout_gravity=""center""        android:scaleType=""centerCrop""/&gt;&lt;/FrameLayout&gt;</code></pre><p>And I only want the FrameLayout to be as big as the background I'm passing it. If the ImageView is larger than the background for FrameLayout, I want the ImageView to be scaled to fit, not stretch the layout.</p><p>I attempted to make a custom layout, but I think I'm really. Here's where I got to:</p><pre><code>public class PolaroidFrameLayout extends FrameLayout {public PolaroidFrameLayout(Context context) {    super( context );}public PolaroidFrameLayout(Context context, AttributeSet attrs) {    super( context, attrs );}public PolaroidFrameLayout(Context context, AttributeSet attrs, int defStyle) {    super( context, attrs, defStyle );}@Overrideprotected void onMeasure( int widthMeasureSpec, int heightMeasureSpec ) {    Drawable background = getBackground();    int backgroundWidth = background.getMinimumWidth();    int backgroundHeight = background.getMinimumHeight();    setMeasuredDimension( backgroundWidth, backgroundHeight );    for (int i = 0; i &lt; getChildCount(); i++) {        View v = getChildAt( i );        int viewWidth = v.getWidth();        int viewHeight = v.getHeight();        v.measure( MeasureSpec.makeMeasureSpec( Math.min( backgroundWidth, viewWidth ), MeasureSpec.AT_MOST ), MeasureSpec.makeMeasureSpec( Math.min( backgroundHeight, viewHeight ), MeasureSpec.AT_MOST ) );    }}</code></pre><p>}</p><p>The layout stays the size I want, but the children are never drawn. What else do I need to override for this to work?</p><p>Thanks for any input.</p>","291827","","291827","","2011-02-23 15:54:09","2011-11-07 08:55:57","I need a FrameLayout that will ignore a child's measurement","<android><framelayout>","3","0","","",""
"5084983","1","","","2011-02-22 22:49:42","7","3313","<p>I am developing an app that contains many images.  I have noticed thatthe memory usage of my app is quite a bit higher in Android 2.3 thanin Android 2.2 - ultimately resulting in OutOfMemory errors whileloading bitmaps.  In researching this, I logged the result ofDebug.getNativeHeapAllocatedSize() in the onResume of the firstactivity.  In Android 2.2, this outputs 5MB.  In Android 2.3, thisoutputs 17MB.</p><p>I created a sample application to try to further narrow this down.The sample app has 2 activities:  the first has a small image and abutton to launch the second activity;  the second activity has severallarge images in a ScrollView.  You can download the sample here:<a href=""http://dl.dropbox.com/u/21709517/MemoryUsageExample.zip"" rel=""nofollow"">http://dl.dropbox.com/u/21709517/MemoryUsageExample.zip</a>When running this sample, Debug.getNativeHeapAllocatedSize() reports3MB allocated after starting the first activity in both 2.2 and 2.3.After launching the second activity, Android 2.2 still reports 3MBallocated while Android 2.3 reports 17MB allocated.  Running ""adbshell dumpsys meminfo test.example"" shows the same types of results.</p><p>Why is there such a dramatic difference between Android 2.2 and 2.3?And more importantly, what should I be doing differently to preventusing so much memory on Android 2.3?</p><p><strong>-----UPDATE-----</strong></p><p>After looking at the information Romain Guy posted, I decided to do a bit more playing with the various loading options.  The result shows that forcing the images to be loaded as RGB_565 does reduce the memory in Android 2.3, however it still uses more than 2.2.  In my example app, Android 2.3 now uses 10MB vs Android 2.2 using 3MB.  Further, I tried to force 32-bit by using ARGB_8888.  In this case, Android 2.3 uses 17MB, but Android 2.2 continues to only use 3MB.  The updated sample can be found here:  <a href=""http://dl.dropbox.com/u/21709517/MemoryUsageExample2.zip"" rel=""nofollow"">http://dl.dropbox.com/u/21709517/MemoryUsageExample2.zip</a></p><p>What is the cause for these differences?  Is there more that needs to be done to get the memory usage closer to Android 2.2?  Also, is there a way to force images created via xml layouts into a particular format?  Can this be set application-wide?  Thanks.</p><p><strong>-----UPDATE 2-----</strong></p><p>According to <a href=""http://stackoverflow.com/questions/5225562/how-to-change-the-size-of-bitmaps-when-loaded-from-xml"">this thread</a>, it is not possible to force images loaded via xml inflation to be a particular format.</p><p>I am still hoping for an answer on why Android 2.2 and Android 2.3 use different amounts of memory after forcing 16 or 32 bit.</p>","618740","","618740","","2011-03-09 18:57:25","2012-01-04 22:36:33","Memory usage between Android 2.2 and 2.3","<android><memory>","2","1","5","",""
"5085008","1","5100267","","2011-02-22 22:52:26","5","5829","<p>I'm writing a SMIL composer for a class, and I was planning on making the canvas support drap and drop, so you can place pictures and text however you want. I've looked through examples and did a few on my own, but when I go to implement the drag and drop in my project, it doesn't work. Here is the main code that matters:</p><pre><code>public class ComposerActivity extends Activity {    /** Called when the activity is first created. */    @Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.composer);    Button add = (Button)findViewById(R.id.addBtn);    ...    add.setOnClickListener(mClick);    ...}OnClickListener mClick = new OnClickListener() {    @Override    public void onClick(View v){                if(v.getId() == R.id.addBtn)        {            FrameLayout fl = (FrameLayout)findViewById(R.id.Canvas);             LayoutInflater inflater = (LayoutInflater)getSystemService(LAYOUT_INFLATER_SERVICE);            View itemView = inflater.inflate(R.layout.image_add, null);            View image = (View)itemView.findViewById(R.id.image);               image.setBackgroundResource(R.drawable.icon);             fl.addView(itemView, new FrameLayout.LayoutParams(40, 40));              image.setOnTouchListener(drag);        }        ...OnTouchListener drag = new OnTouchListener(){    @Override     public boolean onTouch(View v, MotionEvent event){         FrameLayout.LayoutParams par = (LayoutParams) v.getLayoutParams();         switch(v.getId()){//What is being touched             case R.id.image:{//Which action is being taken                 switch(event.getAction()){                     case MotionEvent.ACTION_MOVE:{                          par.topMargin = (int)event.getRawY() - (v.getHeight());                         par.leftMargin = (int)event.getRawX() - (v.getWidth()/2);                         v.setLayoutParams(par);                         break;                     }//inner case MOVE                     case MotionEvent.ACTION_UP:{                         par.height = 40;                         par.width = 40;                         par.topMargin = (int)event.getRawY() - (v.getHeight());                         par.leftMargin = (int)event.getRawX() - (v.getWidth()/2);                         v.setLayoutParams(par);                         break;                     }//inner case UP                     case MotionEvent.ACTION_DOWN:{                         par.height = 60;                         par.width = 60;                         v.setLayoutParams(par);                         break;                     }//inner case UP                 }//inner switch                 break;             }//case image        }//switch             return true;         }//onTouch     };//drag}</code></pre><p>Here is the composer.xml:</p><pre><code>...&lt;FrameLayout android:layout_width=""fill_parent""     android:layout_height=""fill_parent""     android:layout_below=""@+id/TopBar""     android:layout_above=""@+id/addBtn""     android:id=""@+id/Canvas""    android:layout_gravity=""top""&gt;&lt;/FrameLayout&gt;...</code></pre><p>and the image_add.xml:</p><pre><code>&lt;View android:id=""@+id/image""         android:layout_gravity=""top""        xmlns:android=""http://schemas.android.com/apk/res/android""/&gt; </code></pre><p>When I click the add button on my composer, it successfully adds the image to the canvas, and when I touch the image, it responds by getting bigger, from 40x40 to 60x60 like it should. But it doesn't follow my finger across the screen, and thats where I'm stuck.</p><p>Any input is appreciated. </p>","629232","","","","","2011-11-14 15:43:26","Android: Drag and Drop issue","<android><drag-and-drop>","2","0","5","",""
"5085139","1","","","2011-02-22 23:06:45","1","7322","<p>hi i am trying this code in my app i can get the contact list but when i press on contact name i didnt get any thing in my edittext which i expected to get the contact phone numbersorry about my poor english</p><pre><code>         public void doLaunchContactPicker(View view) {        Intent contactPickerIntent = new Intent(Intent.ACTION_PICK,                Contacts.CONTENT_URI);        startActivityForResult(contactPickerIntent, CONTACT_PICKER_RESULT);    }    @Override    protected void onActivityResult(int requestCode, int resultCode, Intent data) {        if (resultCode == RESULT_OK) {            switch (requestCode=RESULT_OK) {            case CONTACT_PICKER_RESULT:                Cursor cursor = null;                String phone = """";                try {                    Bundle extras = data.getExtras();                    Set&lt;String&gt; keys = extras.keySet();                    Iterator&lt;String&gt; iterate = keys.iterator();                    while (iterate.hasNext()) {                        String key = iterate.next();                        Log.v(DEBUG_TAG, key + ""["" + extras.get(key) + ""]"");                    }                    Uri result = data.getData();                    Log.v(DEBUG_TAG, ""Got a contact result: ""                            + result.toString());                    // get the contact id from the Uri                    String id = result.getLastPathSegment();                    cursor = getContentResolver().query(Phone.CONTENT_URI,                            null, Phone.CONTACT_ID + ""=?"", new String[] { id },                            null);                    int PhoneIdx = cursor.getColumnIndex(Phone.DATA);                    if (cursor.moveToFirst()) {                                                                        phone = cursor.getString(PhoneIdx);                        Log.v(DEBUG_TAG, ""Got number: "" + phone);                    } else {                        Log.w(DEBUG_TAG, ""No results"");                    }                } catch (Exception e) {                    Log.e(DEBUG_TAG, ""Failed to Number"", e);                } finally {                    if (cursor != null) {                        cursor.close();                    }                    EditText ponenumber = (EditText) findViewById(R.id.ednum);                    ponenumber.setText(phone);                    if (phone.length() == 0) {                        Toast.makeText(this, ""No number found for contact."",                                Toast.LENGTH_LONG).show();                    }                }                break;            }        } else {            Log.w(DEBUG_TAG, ""Warning: activity result not ok"");        }    }</code></pre>","620451","","","","","2013-05-14 08:19:36","Android Contact list getting phone number","<android><contact><picker>","4","0","1","",""
"5085147","1","","","2011-02-22 23:07:36","0","836","<p>the error is :</p><pre><code>02-22 22:58:11.208: ERROR/AndroidRuntime(498): FATAL EXCEPTION: main02-22 22:58:11.208: ERROR/AndroidRuntime(498): java.lang.NoClassDefFoundError: javax.imageio.ImageIO02-22 22:58:11.208: ERROR/AndroidRuntime(498):     at aynoo.forms.FreindMessagesActivity.convertInputStreamToString(FreindMessagesActivity.java:493)02-22 22:58:11.208: ERROR/AndroidRuntime(498):     at aynoo.forms.FreindMessagesA</code></pre>","508377","","","","","2011-02-22 23:10:15","what is this error im ImageIO class in java (android)?","<java><android><javax.imageio>","1","0","","",""
"5085186","1","","","2011-02-22 23:12:45","0","258","<p>I was wandering if it's possible to count how many times a person has clicked my widget or item. Lets say I wanted to start a Activity on one click but start another on two clicks. How would I do this?</p>","620335","","","","","2011-02-22 23:30:22","Android two clicks to start a different activity","<android>","2","1","1","",""
"5085190","1","5085220","","2011-02-22 23:13:48","7","1116","<p>I can't find this anywhere in the documentation:</p><p>Is a call to context.startService() synchronous or asynchronous?</p>","312499","","","","","2011-02-22 23:18:01","Android startService Synchronous?","<android><service>","1","0","","",""
"5085394","1","5085867","","2011-02-22 23:42:22","5","1601","<p>What are some possible attacks that I could face when I transfer a file via bluetooth? Also, are files transferred between Android phones via bluetooth encrypted?  </p>","552384","","","","","2011-02-23 00:47:07","Is Bluetooth File Exchange Completely Secure?","<android><security><encryption><bluetooth>","1","1","","2011-02-23 07:19:21",""
"5085481","1","","","2011-02-22 23:51:57","1","1987","<p>I'd like to convert an image into a byte array, then convert that byte array into a string. Also, I'd then like to convert that string back to a byte array, and finally back to an image in adroid . How might I go about accomplishing this? Any help will be appreciated.</p><p>this is to convert inputstream to string    </p><pre><code>private String convertInputStreamToString(InputStream in){        try {            byte[] b=new byte[8000];            in.read(b);            String base64String=Base64.encode(b);            return base64String;        } catch (IOException e) {            e.printStackTrace();            return """";        }    }</code></pre><p>and this to convert string to inputstream </p><pre><code>String imageString =Settings.getCurrentUserImage(c);// it is the encoded string                 byte[] bytearray = Base64.decode(imageString);                      InputStream is =new ByteArrayInputStream(bytearray);                Drawable dUser = Drawable.createFromStream(is , ""src"");                 userImg.setImageDrawable(dUser); </code></pre><p>is this correct ?!I have error in this line of code </p><pre><code>InputStream is =new ByteArrayInputStream(bytearray);</code></pre><p>where the error is ..</p><pre><code>02-22 23:31:30.268: ERROR/AndroidRuntime(611): FATAL EXCEPTION: main02-22 23:31:30.268: ERROR/AndroidRuntime(611): java.lang.NullPointerException02-22 23:31:30.268: ERROR/AndroidRuntime(611):     at java.io.ByteArrayInputStream.&lt;init&gt;(ByteArrayInputStream.java:58)02-22 23:31:30.268: ERROR/AndroidRuntime(611):     at aynoo.forms.FreindMessagesActivity.addMessage(FreindMessagesActivity.java:294)02-22 23:31:30.268: ERROR/AndroidRuntime(611):     at aynoo.forms.FreindMessagesActivity.getMessagesFromJSON(FreindMessagesActivity.java:459)02-22 23:31:30.268: ERROR/AndroidRuntime(611):     at aynoo.forms.FreindMessagesActivity.access$3(FreindMessagesActivity.java:433)02-22 23:31:30.268: ERROR/AndroidRuntime(611):     at aynoo.forms.FreindMessagesActivity$3.run(FreindMessagesActivity.java:190)02-22 23:31:30.268: ERROR/AndroidRuntime(611):     at android.os.Handler.handleCallback(Handler.java:587)02-22 23:31:30.268: ERROR/AndroidRuntime(611):     at android.os.Handler.dispatchMessage(Handler.java:92)02-22 23:31:30.268: ERROR/AndroidRuntime(611):     at android.os.Looper.loop(Looper.java:123)02-22 23:31:30.268: ERROR/AndroidRuntime(611):     at android.app.ActivityThread.main(ActivityThread.java:3647)02-22 23:31:30.268: ERROR/AndroidRuntime(611):     at java.lang.reflect.Method.invokeNative(Native Method)02-22 23:31:30.268: ERROR/AndroidRuntime(611):     at java.lang.reflect.Method.invoke(Method.java:507)02-22 23:31:30.268: ERROR/AndroidRuntime(611):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)02-22 23:31:30.268: ERROR/AndroidRuntime(611):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)02-22 23:31:30.268: ERROR/AndroidRuntime(611):     at dalvik.system.NativeStart.main(Native Method)</code></pre>","508377","","508377","","2011-02-23 00:02:13","2011-02-23 00:02:13","Image to Byte Array to String (and vice versa) in android?","<android>","1","0","1","",""
"5085526","1","5085708","","2011-02-22 23:59:28","0","80","<p>I'm working with a partner who has an app (App A) that wishes to call my app (App B). Once called App A will then wait for App B to finish what it's doing and collect some data.</p><p>In the exact scenario I'm working in, App A collects user info (name, phone) and then needs to pass it to App B. App B will do some stuff with that info and when finished, needs to notify App A that it succeeded (or didn't succeed) to perform operations for user name_phone.</p><p>What do our apps need to know about each other for this to work?  </p><p>I'm looking at <code>startActivityForResult</code> but I'm getting the impression that's something one would use within ones own application and not something App A can use to launch App B.</p><p>TIA</p>","59947","","264436","","2011-02-23 00:10:25","2011-02-23 00:21:34","How do I build a wrapper (or launcher and receiver upon completion) for an external app in Android?","<android>","1","0","","",""
"5085531","1","","","2011-02-22 23:59:57","0","373","<p>Is there any way to install some kind of policy/certificate that will restrict applications. Such as only allow application signed by google or not allowing any applications that require gps? </p>","629126","","","","","2011-02-23 00:19:31","Android Application Restriction","<android>","2","1","1","",""
"5085629","1","","","2011-02-23 00:11:39","2","4826","<p>Hello i am wanting to upload image from android emulator to asp.net server. The code below can communicate the server. When I tried to create a text file to see the data sent from android was successful or not . But no the file data didn't send across to the server. I tried sending the plain text to the server but the file I created on the server didn't print the text.</p><p>The code here:        HttpURLConnection conn = null;</p><pre><code>    String boundary = ""=============="";        try        {               String disposition = ""Content-Disposition: form-data; name=\""userfile\""; filename=\"""" + filename + "".jpg\"""";            String contentType = ""Content-Type: application/octet-stream"";            String t1   = ""Content-Disposition: form-data; name=\""test\"";"";            String t2 = ""Content-Type: text/plain"";            // This is the standard format for a multipart request            StringBuffer requestBody = new StringBuffer();            /*            requestBody.append(""--""+boundary);            requestBody.append('\n');            requestBody.append(disposition);            requestBody.append('\n');            requestBody.append(contentType);            requestBody.append('\n');            requestBody.append('\n');            requestBody.append(new String(getByteFromStream(stream)));            */            requestBody.append('\n');            requestBody.append('\n');            requestBody.append(""--""+boundary);            requestBody.append('\n');            requestBody.append(t1);            requestBody.append('\n');            requestBody.append(t2);            requestBody.append('\n');            requestBody.append('\n');            requestBody.append(""basdfsdafsadfsad"");            requestBody.append(""--""+boundary+""--"");            // Make a connect to the server            URL url = new URL(targetURL);            conn = (HttpURLConnection) url.openConnection();            // Put the authentication details in the request           /*             if (username != null) {                String usernamePassword = username + "":"" + password;                String encodedUsernamePassword = Base64.encodeBytes(usernamePassword.getBytes());                conn.setRequestProperty (""Authorization"", ""Basic "" + encodedUsernamePassword);            }            */            conn.setDoOutput(true);            conn.setDoInput(true);            conn.setUseCaches(false);            conn.setRequestMethod(""POST"");            conn.setRequestProperty(""MIME-Version:"", ""1.0"");            conn.setRequestProperty(""Content-Type"", ""multipart/mixed; boundary="" + boundary);            // Send the body            DataOutputStream dataOS = new DataOutputStream(conn.getOutputStream());            dataOS.writeBytes(requestBody.toString());            dataOS.flush();            dataOS.close();            // Ensure we got the HTTP 200 response code            int responseCode = conn.getResponseCode();            if (responseCode != 200) {                throw new Exception(String.format(""Received the response code %d from the URL %s"", responseCode, url));            }</code></pre><p>Is my request body layout not correctly ?</p>","186820","","","","","2011-05-10 17:58:48","Android image Upload problem","<android><image><upload>","2","2","3","",""
"5085732","1","5085768","","2011-02-23 00:26:11","3","2388","<p>Am very new to Android programming, so sorry if this is a simple problem.</p><p>I'm trying to create a form to input user data, and I keep getting the following error:</p><blockquote>  <p>""Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@6279d588""</p></blockquote><p>This is what my xml looks like for the layout:</p><pre><code>&lt;ScrollView xmlns:android=""http://schemas.android.com/apk/res/android""    android:orientation=""vertical""    android:isScrollContainer=""true""    android:layout_width=""fill_parent""    android:layout_height=""fill_parent""&gt;""    &lt;LinearLayout        android:orientation=""vertical""        android:layout_height=""wrap_content""        android:layout_width=""fill_parent""        android:layout_gravity=""top""&gt;        &lt;TextView            android:id=""@+id/text""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""            android:text=""This is a test\nsecond line\n""/&gt;       &lt;EditText android:id=""@+id/name""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""            android:inputType=""textPersonName""            android:maxLength=""30""            android:maxLines=""1""            android:hint=""@string/compose_name""&gt;&lt;/EditText&gt;                         &lt;Button            android:id=""@+id/new_contact_button""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""            android:text=""@string/submit"" /&gt;    &lt;/LinearLayout&gt;&lt;/ScrollView&gt;</code></pre><p>And here is what my class file looks like:</p><pre><code>    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.new_contact);        //Set up handlers for input text        //nameField = (EditText) findViewById(R.id.name);        //name = nameField.getText().toString();        final EditText nameField = (EditText) findViewById(R.id.name);        nameField.setOnKeyListener(new View.OnKeyListener() {            public boolean onKey(View v, int keyCode, KeyEvent event) {                if ((event.getAction() == KeyEvent.ACTION_DOWN) &amp;&amp;                (keyCode == KeyEvent.KEYCODE_ENTER)) {                    String strNicknameToSave = nameField.getText().toString();                    // TODO: Save Nickname setting (strNicknameToSave)                    return true;                }                return false;            }        });        submitButton = (Button) findViewById(R.id.new_contact_button);        // Set up click listeners for all the buttons        submitButton.setOnClickListener(this);    }</code></pre><p>If I get rid of the EditText field, then it works fine.  Also it ran perfectly just once, but I haven't been able to repeat that (all I did in the meantime was delete another layout that isn't being used).  </p><p>Thanks for your help.</p>","629202","","648313","","2012-12-22 11:36:46","2012-12-22 11:36:46","Problems with EditText field not showing up","<android><edittext>","1","5","1","",""
"5085760","1","","","2011-02-23 00:30:49","0","797","<p>I'm an Android noob. I'm working with MyEclipse, ADT, SDK, Android 2.2, API 8.</p><p>My Activity looks like this -</p><pre><code>package com.vvittal.relativelayout;import android.app.Activity;import android.os.Bundle;import android.view.ContextMenu;import android.view.Menu;import android.view.MenuInflater;import android.view.MenuItem;import android.view.View;import android.view.ContextMenu.ContextMenuInfo;import android.widget.AdapterView.AdapterContextMenuInfo;public class Login extends Activity {/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    registerForContextMenu(findViewById(R.id.uEntry));    registerForContextMenu(findViewById(R.id.pwdEntry));}@Overridepublic boolean onCreateOptionsMenu(Menu menu) {    MenuInflater inflater = getMenuInflater();    inflater.inflate(R.menu.login_menu, menu);    return true;}@Overridepublic boolean onOptionsItemSelected(MenuItem item){    switch (item.getItemId()){    case R.id.agency_item: System.out.println(""----------------"");     return true;    case R.id.prod_cat_item: System.out.println(""++++++++++++++++"");     return true;    default: return super.onOptionsItemSelected(item);    }}@Overridepublic void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo){    super.onCreateContextMenu(menu, v, menuInfo);    MenuInflater inflater = getMenuInflater();    inflater.inflate(R.menu.context_menu, menu);    //menu.f    //menu.setHeaderTitle(""Your Options"");}@Overridepublic boolean onContextItemSelected(MenuItem item){    AdapterContextMenuInfo info = (AdapterContextMenuInfo) item.getMenuInfo();    switch (item.getItemId()) {    case R.id.option1: ;    return true;    case R.id.option2:        return true;    default:        int i = item.getItemId();        return super.onContextItemSelected(item);    }}}</code></pre><p>And my AndroidManifest.xml look like this -</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.vvittal.relativelayout""  android:versionCode=""1""  android:versionName=""1.0""&gt;&lt;uses-sdk android:minSdkVersion=""8"" /&gt;&lt;application android:icon=""@drawable/icon"" android:label=""@string/app_name""&gt;    &lt;activity android:name="".Login""              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>The context_menu.xml is as below -</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;item android:id=""@+id/option1""      android:title=""@string/yes"" /&gt;&lt;item android:id=""@+id/option2""      android:title=""@string/no"" /&gt;&lt;/menu&gt;</code></pre><p>The menu on my emulator has an item called ""Input Method"", in addition to ""Yes"" and ""No"" that I have specified in XML.</p><p>I'd like to know where this additional item ""Input Method"" is coming from when I have not specified any in the xml? Also how to I remove it programmatically?</p>","629331","","","","","2011-02-23 00:36:01","ContextMenu shows item I have not specified in context_menu.xml","<android><contextmenu>","1","1","","",""
"5085773","1","","","2011-02-23 00:32:23","1","869","<p>Does anyone know how I can use <code>redir add tcp</code> command to try to get my emulator on port 5554 to communicate with my Apache Server on port 3128? I tried <code>redir add tcp:5554:3128</code>, but I got </p><p><strong>Error port already in use by another program</strong></p><p>I think its talking about the emulator on port 5554, but I think your supposed to run the command while the instance of the emulator is running. Basically my emulator does not connect to Apache, I think it might be the port mapping.</p><p>Any ideas?</p><p>Much Appreciated,Graeme.</p>","627189","","264436","","2011-02-23 00:46:42","2011-02-23 01:22:05","Using 'redir' command","<android><emulator><redirect>","1","0","","",""
"5085850","1","","","2011-02-23 00:44:12","1","111","<p>How to make a widget show up has a normal App?</p>","620335","","","","","2011-06-20 20:27:35","Make a widget show up has a normal App","<android>","1","1","","",""
"5085933","1","","","2011-02-23 01:02:46","0","241","<p>After many hours/days/weeks/millenia of attempting to get my app to display on all current Android devices with differing densities/resolutions I have found the best method for me is to write code to use a base-line of 320x480 for everything and then use 'Canvas.scale' to scale the output to the relevant device's screen width and height in pixels.Seems to work fine on all my Android devices (I have all of 2 of them (!), a Hero and a Desire HD), both return a frame rate of 60+.</p><p>My question is, does anyone have any caveats to this method as I don't have access to tablets/small form factor devices?</p><p>Many thanks for any thoughts/input/opinions!</p>","629351","","","","","2011-10-27 06:20:09","Android: Scaling for resolution fragmentation","<android>","0","5","","",""
"5085990","1","5086416","","2011-02-23 01:12:38","0","712","<p>Why isn't graphics acceleration turned on by default in Honeycomb? Are there any situations when it's better to leave it disabled?</p>","243225","","750987","","2011-05-29 06:43:58","2011-05-29 06:43:58","Why isn't graphics acceleration turned on by default in Honeycomb?","<android><android-3.0-honeycomb>","1","0","","",""
"5086083","1","","","2011-02-23 01:29:01","1","744","<p>HelloI'm working on an android program that uses a database. My database is going include about 300 to 400 records.</p><p>My question is what is be best way to work with the database.Should I create the database at run time via code and insert the records ""manually"" every time the program starts, or should I use an external database, that's located in the /assetes folder of the program?</p><p>If the second option is the way to go, could someone please give me an advice on how to do that, because I can't find any toturial that covers this subject.</p><p>Thank you!</p>","605693","","","","","2011-02-23 03:31:08","How to use SQLite - Android","<android><sql><database><sqlite>","2","0","0","",""
"5086120","1","5086366","","2011-02-23 01:36:35","1","1468","<p>I have two arrows drawn on my canvas using the canvas.DrawPath(). I'm using canvas.rotate() to rotate, but it is obviously rotating both arrows by the same amount. </p><p>Id like to be able to rotate one arrow one way, and rotate the other arrow in a different direction.</p><p>Is this possible?</p>","604469","","","","","2011-02-23 02:25:46","Rotating two seprate objects(paths) in Canvas","<android><canvas><rotation>","1","0","1","",""
"5086131","1","","","2011-02-23 01:38:12","2","1099","<p>I have a TextView which I dynamically add clickable links via Linkify (with a custom TransformFilter). This all works great. What I would like to do now is change the background color of the link when its clicked. In CSS it would be done via the <code>:active</code> pseudo-selector.</p><p>I would think I can specify this in styles.xml but I dont know what the parameter name is.</p>","25398","","25398","","2011-02-23 18:11:51","2011-11-06 16:07:24","Whats the Android Style attribute for selected link background color?","<android><android-layout>","2","2","","",""
"5086145","1","5539434","","2011-02-23 01:41:17","1","607","<p>The reason I'm asking this is that our app (The Elements) runs fine on a Droid and a Nexus One, our two test phones, but not correctly on our recently acquired Atrix 4G. What draws is a skewed version of what should draw, with all the colors being replaced with alternating lines of cyan, magenta, and yellow (approximately), which leads us to believe that one of the primary colors for the sand particles that should show up is missing based on which line it's on. I'm sorry for the unclear description, we had images but since this account doesn't have 10 reputation we couldn't post them.</p><p>Here is the code of our gl.c file, which does the texturing and rendering:</p><pre><code>/* * gl.c * -------------------------- * Defines the gl rendering and initialization * functions appInit, appDeinit, and appRender. */#include ""gl.h""#include &lt;android/log.h&gt;unsigned int textureID;float vertices[] ={0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, 1.0f, 1.0f};float texture[] ={0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, 1.0f, 1.0f};unsigned char indices[] ={0, 1, 3, 0, 3, 2};int texWidth = 1, texHeight = 1;void glInit(){    //Set some properties    glShadeModel(GL_FLAT);    glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_FASTEST);    //Generate the new texture    glGenTextures(1, &amp;textureID);    //Bind the texture    glBindTexture(GL_TEXTURE_2D, textureID);    //Enable 2D texturing    glEnable(GL_TEXTURE_2D);    //Disable depth testing    glDisable(GL_DEPTH_TEST);    //Enable the vertex and coord arrays    glEnableClientState(GL_VERTEX_ARRAY);    glEnableClientState(GL_TEXTURE_COORD_ARRAY);    //Set tex params    glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);    glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);    //Set up texWidth and texHeight texHeight, 0, GL_RGB, GL_UNSIGNED_BYTE, emptyPixels);    //Free the dummy array    free(emptyPixels);    //Set the pointers    glVertexPointer(2, GL_FLOAT, 0, vertices);    glTexCoordPointer(2, GL_FLOAT, 0, texture);}void glRender(){    //Check for changes in screen dimensions or work dimensions and handle them    if(dimensionsChanged)    {        vertices[2] = (float) screenWidth;        vertices[5] = (float) screenHeight;        vertices[6] = (float) screenWidth;        vertices[7] = (float) screenHeight;        texture[2] = (float) workWidth/texWidth;        texture[5] = (float) workHeight/texHeight;        texture[6] = (float) workWidth/texWidth;        texture[7] = (float) workHeight/texHeight;        glMatrixMode(GL_PROJECTION);        glLoadIdentity();        if (!flipped)        {            glOrthof(0, screenWidth, screenHeight, 0, -1, 1); //--Device        }        else        {            glOrthof(0, screenWidth, 0, -screenHeight, -1, 1); //--Emulator        }        dimensionsChanged = FALSE;        zoomChanged = FALSE;    }    else if(zoomChanged)    {        texture[2] = (float) workWidth/texWidth;        texture[5] = (float) workHeight/texHeight;        texture[6] = (float) workWidth/texWidth;        texture[7] = (float) workHeight/texHeight;        zoomChanged = FALSE;    }    //__android_log_write(ANDROID_LOG_INFO, ""TheElements"", ""updateview begin"");    UpdateView();    //__android_log_write(ANDROID_LOG_INFO, ""TheElements"", ""updateview end"");    //Clear the screen    glClear(GL_COLOR_BUFFER_BIT);    //Sub the work portion of the tex    glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, workWidth, workHeight, GL_RGB, GL_UNSIGNED_BYTE, colors);    //Actually draw the rectangle with the text on it    glDrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_BYTE, indices);}</code></pre><p>Any ideas as to what the difference is between the Atrix 4G and other phones in terms of OpenGL or why our app is doing what it is in general are much appreciated! Thanks in advance.</p><p>Here is an example of what it looks like: <a href=""http://imgur.com/Oyw64"" rel=""nofollow"">http://imgur.com/Oyw64</a></p>","257519","","257519","","2011-02-26 00:35:57","2011-04-04 15:40:39","What differences in OpenGl rendering are there between the Atrix 4G and other Android phones?","<android><opengl-es>","3","0","","",""
"5086234","1","","","2011-02-23 02:02:21","0","80","<p>New to Android.  Trying to find docs that show what Android classes expect to elicit changes. For example, to make a keyboard always visible, I could find some info searching Google, but not directly in the docs of the SDK.  Is there a source for more comprehensive docs on how Android works not just from the individual class level, but how it boots up and what to do to make small tweaks for an app.</p>","629409","","","","","2011-02-23 02:15:49","How to manipulate Android classes","<android>","1","0","","",""
"5086256","1","5086338","","2011-02-23 02:06:15","5","4168","<p>My activity implements KeyListener and my edittext has a key listener set. </p><pre><code>editor = new EditText(this);        editor.setMinLines(4);        editor.setMinimumWidth(400);        editor.setKeyListener(this);</code></pre><p>WHen the user types something and presses ""enter"" on the softkeyboard a textview's text is set to the users input.</p><pre><code>@Overridepublic int getInputType() {    return InputType.TYPE_TEXT_FLAG_MULTI_LINE;}@Overridepublic boolean onKeyDown(View view, Editable text, int keyCode,        KeyEvent event) {    if(keyCode == KeyEvent.KEYCODE_ENTER){        outview.setText(editor.getText());    }    return true;}</code></pre><p>Here outview is a TextView. My problem is that in this activity the physical back button doesn't work. Press it and nothing happens. ANy advice would be welcomed.</p>","485498","","","","","2011-02-23 02:20:42","Android Problem: EditText, KeyListener and the physical Back Button","<android><keylistener><android-softkeyboard><android-edittext>","1","0","","",""
"5086269","1","","","2011-02-23 02:08:53","7","1832","<p>Other than knowing Java, what Design Patterns I should learn before I start looking into Android SDK?</p><p><strong>Edit:</strong> The reason why I am asking this question, because after looking at the sdk, I <strong>think</strong>, not sure about that, that it is heavily using adapter pattern and I was wondering if I can know what other Patterns it is using and it can help in my learning process.</p><p>Thanks.</p>","146603","","146603","","2011-02-23 02:16:34","2011-02-23 03:05:28","What Design Patterns I Should learn before starting Android Development","<java><android><design-patterns>","6","0","2","",""
"5086444","1","5086544","","2011-02-23 02:39:42","5","4427","<p>I saw this post about using the new holographic themes on Honeycomb:<a href=""http://stackoverflow.com/questions/4865724/change-theme-according-to-android-version"">Change theme according to android version</a></p><p>In my app, I have minSdkVersion=""11"" and targetSdkVersion=""11"". By default, I get a solid black background with light text. If I explicitly set Theme.Holo, on either application or activity, I still get the solid black, using this:</p><p>android:theme=""@android:style/Theme.Holo""</p><p>However, I think Theme.Holo uses the gradient background I see in the HoneycombGallery example, set like this:</p><pre><code>  case R.id.toggleTheme:       if (mThemeId == android.R.style.Theme_Holo) {            mThemeId = android.R.style.Theme_Holo_Light;       } else {            mThemeId = android.R.style.Theme_Holo;  }</code></pre><p>If that's the real holographic theme, how do I get it?</p>","392140","","750987","","2011-05-29 06:43:47","2011-05-29 06:43:47","Setting the holographic theme in Honeycomb","<android><android-3.0-honeycomb>","1","0","5","",""
"5086446","1","","","2011-02-23 02:39:53","1","6917","<p>I'm developing an Android app using GreenDroid. The application is just for testing atm, so it all it contains is an ActionBar with a refresh button, three tabs, and an activity for each of those tabs. </p><p>All I'm trying to achieve at the minute is showing a toast message when the refresh button is pressed on the ActionBar, but I want the toast message to be called from within one of my activities, we'll call it Listener1Activity which is the activity that sits in the first tab ... this is because Listener1Activity will eventually contain a list that I want to reload when the ActionBar button is pressed, if I can get it working with a simple toast message for now then I can sort out that later. </p><p>I've looked into intents, broadcasts, but nothing seems to fit.</p><p>I <em>don't</em> want the activity starting new each time the button is pressed, I just want a method in it to call and show the toast. </p><p>So basically, it's just like having 2 activities running at the same time, and a button press in one calling a method in the other. Isn't it? Or have I got that wrong?</p><p>SenderActivity and Listener1Activity. </p><p>In iOS, I would just send an NSNotification from SenderActivity, and add an observer in Listener1Activity. What would be the best way to achieve this in Android?</p><p>Thanks!</p><p>Steven</p>","629438","","1193519","","2013-09-19 14:16:59","2013-09-19 14:16:59","Android - Calling a method in one activity from another, without starting new activity","<java><android><greendroid>","3","0","1","",""
"5086467","1","5086518","","2011-02-23 02:44:08","1","4776","<p>I'm trying to implement a password-protected preferences screen.  I press the menu button then the settings button and instead of the password screen showing up, it FCs and I receive this error:</p><pre><code>Uncaught handler: thread main exiting due to uncaught exceptionjava.lang.RuntimeException: Unable to start activity ComponentInfo{com.john.websafe/com.john.websafe.Preferences}: java.lang.RuntimeException: Your content must have a ListView whose id attribute is 'android.R.id.list'     &lt;snip&gt;Caused by: java.lang.RuntimeException: Your content must have a ListView whose id attribute is 'android.R.id.list'     at android.app.ListActivity.onContentChanged(ListActivity.java:236)     at android.preference.PreferenceActivity.onContentChanged(PreferenceActivity.java:160)     at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:312)     at android.app.Activity.setContentView(Activity.java:1626)     at com.john.websafe.Preferences.onCreate(Preferences.java:19)     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1123)     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2231)     ... 11 more</code></pre><p><code>Preferences.java</code> line 19:</p><pre><code>setContentView(R.layout.password);</code></pre><p>Password.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=""@string/password"" /&gt;&lt;EditText android:id=""@+id/password"" android:layout_width=""fill_parent""    android:layout_height=""wrap_content""    android:layout_weight=""1""    android:scrollbars=""vertical"" /&gt;&lt;Button android:id=""@+id/confirm""   android:text=""@string/confirm""    android:layout_width=""wrap_content""    android:layout_height=""wrap_content"" /&gt;&lt;/LinearLayout&gt;</code></pre><p>What is causing this error?  Why do I need a listview whose id is <code>android.R.list</code>?  I don't even <em>have</em> a <code>ListActivity</code>...  Does a <code>PreferenceActivity</code> include a <code>ListActivity</code>?</p>","467090","","467090","","2011-02-23 02:54:28","2011-02-23 03:22:50","Why must I have a listview?","<android><listview>","2","2","1","",""
"5086523","1","","","2011-02-23 02:53:40","2","605","<p>What is the maximum file size you can download through the marketplace over a cell connection.</p><p>For example, on the iphone the maximum size is 20MB, if the content is over 20MB then you must connected via wifi or itunes.</p><p>Does this limit exist for andriod?</p><p>Thanks</p>","629451","","","","","2011-12-05 02:35:18","What is the maximum file size you can download through the marketplace over a cell connection?","<android><download>","3","0","","",""
"5086530","1","5086572","","2011-02-23 02:54:50","0","1601","<p>Okay, I'm trying to create a simple app that will draw a shape (I'm trying a circle) wherever you click.  I have tried a couple times, but haven't gotten anything to work yet.  I would think that somebody has done this before, so if theres a link to a tutorial/source code of a similar project, that would help. What I think I'm stuck on is how to use threads, and how to update the onDraw() function.  If you haven't figured it out already, I'm pretty new to Android and even java.</p><p>Currently I have: </p><p>--Main.java--</p><pre><code>    public class MAIN extends Activity {        CustomDrawableView mCustomDrawableView;         /** Called when the activity is first created. */        @Override        public void onCreate(Bundle savedInstanceState) {            super.onCreate(savedInstanceState);            mCustomDrawableView = new CustomDrawableView(this);                    setContentView(mCustomDrawableView);        }//Implement a thread here that would somehow update the view everytime.  Everytime I try this though it doesn't work    }</code></pre><p>--CustomDrawableView.java--</p><pre><code>public class CustomDrawableView extends View {    //private ShapeDrawable mDrawable;    int x=0;    int y=0;    public CustomDrawableView(Context context) {        super(context);    }    protected void onDraw(Canvas canvas) {        Paint mPaint = new Paint();        mPaint.setColor(0xffff0000);        canvas.drawCircle(x, y, 5, mPaint);    }}</code></pre>","586680","","","","","2011-02-23 03:03:48","Android Simple Canvas Program","<android><canvas><updating>","1","0","","",""
"5086539","1","5086557","","2011-02-23 02:56:33","15","24332","<p>I'm trying to read in a text file of a bunch of words that I want to use for a word game I am writing. This list is stored in the assets directory and is a txt file. But, whenever I attempt to open it, it throws an exception.</p><pre><code>List&lt;String&gt;wordList = new ArrayList&lt;String&gt;();    BufferedReader br = null;    try {        br = new BufferedReader(new InputStreamReader(getAssets().open(""wordlist.txt""))); //throwing a FileNotFoundException?        String word;        while((word=br.readLine()) != null)        wordList.add(word); //break txt file into different words, add to wordList    }        catch(IOException e) {            e.printStackTrace();        }        finally {            try {                br.close(); //stop reading            }            catch(IOException ex) {                ex.printStackTrace();            }        }        String[]words = new String[wordList.size()];        wordList.toArray(words); //make array of wordList        for(int i=0;i&lt;words.length; i++)            Log.i(""Brian"", words[i]); //print out words in array}</code></pre><p>Here's the error log, in case that's any help: </p><pre><code>02-22 20:49:47.646: WARN/System.err(2351): java.io.FileNotFoundException: wordlist.txt02-22 20:49:47.646: WARN/System.err(2351):     at android.content.res.AssetManager.openAsset(Native Method)02-22 20:49:47.746: WARN/System.err(2351):     at android.content.res.AssetManager.open(AssetManager.java:299)02-22 20:49:47.746: WARN/System.err(2351):     at android.content.res.AssetManager.open(AssetManager.java:273)02-22 20:49:47.756: WARN/System.err(2351):     at com.bic.anagram.GameActivity.onCreate(GameActivity.java:40)02-22 20:49:47.756: WARN/System.err(2351):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)02-22 20:49:47.756: WARN/System.err(2351):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2521)02-22 20:49:47.756: WARN/System.err(2351):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2574)02-22 20:49:47.766: WARN/System.err(2351):     at android.app.ActivityThread.access$2400(ActivityThread.java:121)02-22 20:49:47.766: WARN/System.err(2351):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1925)02-22 20:49:47.766: WARN/System.err(2351):     at android.os.Handler.dispatchMessage(Handler.java:99)02-22 20:49:47.776: WARN/System.err(2351):     at android.os.Looper.loop(Looper.java:136)02-22 20:49:47.776: WARN/System.err(2351):     at android.app.ActivityThread.main(ActivityThread.java:4425)02-22 20:49:47.776: WARN/System.err(2351):     at java.lang.reflect.Method.invokeNative(Native Method)02-22 20:49:47.776: WARN/System.err(2351):     at java.lang.reflect.Method.invoke(Method.java:521)02-22 20:49:47.776: WARN/System.err(2351):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)02-22 20:49:47.776: WARN/System.err(2351):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)02-22 20:49:47.776: WARN/System.err(2351):     at dalvik.system.NativeStart.main(Native Method)02-22 20:49:47.776: WARN/dalvikvm(2351): threadid=3: thread exiting with uncaught exception (group=0x4001e280)</code></pre><p>Thanks everyone!</p>","253567","","","","","2013-07-23 07:15:25","Reading file from assets directory throws FileNotFoundException","<android><bufferedreader><filenotfoundexception><android-assets>","1","0","5","",""
"5086581","1","5086826","","2011-02-23 03:04:44","0","1546","<p>I recently followed the tutorial posted here:<a href=""http://stackoverflow.com/questions/4898838/howto-implement-adwhirl-in-an-android-project"">HowTo: Implement AdWhirl in an Android Project</a>In order to implement a change in advertising service to 'AdWhirl' (with Millennial Media and AdMob as sub-advertisers).</p><p>Since the switch my app (normally 1mb in size) can range in size due to Ad Caching by Millennial Media, it is very persistant.  Is there a way to delete the cache my app creates in the onDestroy() or finish() methods?</p><p>People are complaining that the app takes up too much space if they don't clear the cache on their own. Is there a way to stop it from caching those images (can't find anything in Millennial Media sdk)?</p><p>Suggestions are welcome, thanks in advance!</p>","251849","","643383","","2012-08-15 15:16:24","2012-08-15 15:16:24","Millenial Media (ads) causing data cache on Android, how do I clear the cache in my code?","<android><caching><advertising><millennial-media>","1","0","2","",""
"5086877","1","","","2011-02-23 04:04:36","1","456","<p>I have a source MP3 file, and it's unknown how many channels it has, or the sampling rate. I need to re-encode it so that the resulting file is mono and 8kHz samling rate. The format is unimportant, as long as MediaPlayer can play it. Is there anything in the SDK that allows me to do this.</p>","496854","","","","","2011-02-23 04:52:16","Is there a way to re-encode an MP3 or any other audio file in Android?","<android><audio><mp3><encode>","2","0","1","",""
"5086901","1","","","2011-02-23 04:10:07","3","849","<p>I want to build a small app for android and iphone, and since I'm familiar with actionscript and don't own a mac, AIR is starting to seem like a good option.</p><p>Are we talking code once deploy on both here or am I still facing some double-coding?</p><p>What are the pros and cons of such development, particularly regarding UI?</p><p>What do I need for development and is it free/has free alternative and same for both target platforms? Emulators, debuggers (MonsterDebugger?), packager for iPhone, IDE (FlashDevelop ok?)... Can I use Flex Builder Burrito to build for android and than package it for iPhone unchanged?</p><p>Also, do I still need mac for distribution via AppStore?</p>","455839","","","","","2012-04-09 18:51:11","Adobe AIR on mobile platforms","<iphone><android><ios><air>","3","2","1","",""
"5086955","1","","","2011-02-23 04:21:12","0","865","<p>I have a simple Preferences Activity that I populate via XML, defining the values as array resources.</p><p>In the MAIN Activity of the application, I get a handle to this via:</p><pre><code>mSharedPrefs = PreferenceManager.getDefaultSharedPreferences(this);</code></pre><p>In the XML for the only preference I have, which is a display setting, I have the following XML that defines the ListPreference:</p><pre><code>&lt;ListPreference        android:title=""@string/pref_title_sort""        android:summary=""@string/pref_summary_sort""        android:key=""@string/pref_key_sort""        android:defaultValue=""modified""        android:entries=""@array/sort_order""        android:entryValues=""@array/sort_order_values"" /&gt;</code></pre><p>You can see I am trying to set the default value to 'modified', which is a value found in @array/sort_order_values:</p><pre><code>&lt;string-array name=""sort_order_values""&gt;    &lt;item&gt;modified&lt;/item&gt;    &lt;item&gt;created&lt;/item&gt;    &lt;item&gt;name&lt;/item&gt;&lt;/string-array&gt;</code></pre><p>However, when the Preferences Activity is launched, none of the items are selected by default.</p><p>I've tried adding the following line to my Activity, but it did not change anything (where pref_main is the XML file that defines the preferences):</p><pre><code>PreferenceManager.setDefaultValues(this, R.xml.pref_main, false);</code></pre><p>Any help appreciated!</p><p>Paul</p>","357801","","","","","2011-12-14 14:23:55","Android: Default preference value not being set from XML","<android><default-value><android-preferences>","1","0","","",""
"5086962","1","5948819","","2011-02-23 04:22:23","4","14027","<p>how can we add our own SQLite database to an android project??</p>","620787","","","","","2013-04-23 03:03:09","adding your own SQLite database to an android application","<android>","1","5","7","",""
"5086985","1","5087340","","2011-02-23 04:26:10","4","1500","<p>I am having trouble finding out how to maintain the state of my Android app in development.</p><p>Just to clarify, I am not talking about maintaining activity state (i.e. keeping track of textbox values, checkboxes, etc on a specific activity). </p><p>Let's say for example my application has two activities <code>A</code> and <code>B</code>. When I start my app, it takes me to activity <code>A</code>, and pressing a button on it takes me to activity <code>B</code>. At this point, I press the home button on my phone to return to the main Android UI and exiting my app . However, if I choose to run my app again, it should take me to activity <code>B</code>, which is where I left off before pressing the home button, but instead it is taking me to activity <code>A</code>. </p><p>Does anyone know how I can rectify this? </p><p>(I am using a Samsung Vibrant in case if you need to know)</p>","629529","","68805","","2011-02-23 04:37:52","2013-10-07 09:16:14","Maintaining application state in Android","<android>","3","0","2","",""
"5086993","1","5087728","","2011-02-23 04:27:05","0","1638","<p>Hi i want to add the particular image for each listView item left side .but that is not included in the listview ,see the image from below link<a href=""http://i51.tinypic.com/6ntwdh.png"" rel=""nofollow"">Image</a></p>","479027","","","","","2011-04-29 08:20:12","add the image for each listview item in out of the listview","<android>","3","1","","",""
"5087049","1","5087294","","2011-02-23 04:36:18","0","1127","<p>I know this sounds strange earlier I asked about similar question in <a href=""http://stackoverflow.com/questions/5039500/android-overriding-home-key"">one of my question</a>I tried the way I was advised but after installing my app if I press home key then it opens up <strong>complete action using dialog</strong> with default launcher app and my app.</p><p>As asked in above question however in Car home app it never let you reach home screen though it never ask you to replace the launcher using complete action.</p><p>So my question is if its registering itself as launcher how it is bypassing that dialog.</p>","517247","","","","","2011-02-23 05:17:51","Android private API","<android><api>","1","0","","",""
"5087077","1","","","2011-02-23 04:42:33","0","116","<p>My proximity alert has been frustrating me for several minutes now and never gets to the receiver.</p><p>ProximityIntentReceiver.java<code><pre>public class ProximityIntentReceiver extends BroadcastReceiver{    @Override    public void onReceive(Context iContext, Intent iIntent) {</p><pre><code>    String key = LocationManager.KEY_PROXIMITY_ENTERING;    Boolean entering = iIntent.getBooleanExtra(key,false);    Log.d(Global.TAG,""--&gt;!!!!! Proximity onReceive:""+entering+""\n"");    }</code></pre><p>}</pre></code></p><p>Proximity.java<code><pre>public class Proximity {    public static String PROXIMITY_ALERT = ""com.atClass.ProximityIntentReceiver"";</p><pre><code>public ProximityIntentReceiver setProximityAlert(double iLat, double iLng) {    ProximityIntentReceiver lProximityIntentReceiver;    Log.d(Global.TAG,""--&gt;ProximityAlert set:"" + iLat + "","" + iLng);    String locService = Context.LOCATION_SERVICE;    LocationManager locationManager;    locationManager = (LocationManager)Global.gActivity.getSystemService(locService);    float radius = 1000f; //meters    long expiration = -1; //never expire    Intent intent = new Intent(PROXIMITY_ALERT);    PendingIntent proximityIntent = PendingIntent.getBroadcast(Global.gContext,-1,intent,0);    locationManager.addProximityAlert(iLat, iLng, radius, expiration, proximityIntent);    IntentFilter filter = new IntentFilter(PROXIMITY_ALERT);    lProximityIntentReceiver = new ProximityIntentReceiver();    Global.gContext.registerReceiver(lProximityIntentReceiver,filter);    return lProximityIntentReceiver;}</code></pre><p>}</pre></code></p><p>Give it a whirl:<code><pre>        ProximityTools.setupProximityList();        ProximityTools.clearProximityLocations();</p><pre><code>    Proximity lProximityAlert = new Proximity();    lProximityAlert.setProximityAlert(43.647995,-79.4953733);</code></pre><p></pre></code></p><p>Any help is greatly appreciated as usual!</p>","568508","","","","","2011-03-02 06:44:52","ProximityAlert never fires","<android>","1","0","","",""
"5087117","1","","","2011-02-23 04:48:49","0","1052","<p>A very good morning to all, I have a app in which the user will be clicking an 'add' button to add  new EditText s. By default there will be a few EditTexts (may be around 3).A replica of the default EditText group will be generated on the click event. I have set the xml as below:</p><pre><code>&lt;ScrollViewandroid:id=""@+id/scrollview1""android:layout_width=""320px""android:layout_height=""234px""android:isScrollContainer=""true""android:saveEnabled=""true""android:paddingBottom=""5px""&gt;&lt;LinearLayoutandroid:id=""@+id/tablelayout""android:layout_width=""320px""android:layout_height=""wrap_content""android:orientation=""vertical""&gt;&lt;TableRowandroid:id=""@+id/widget60""android:layout_width=""fill_parent""android:layout_height=""wrap_content""android:gravity=""center""&gt;&lt;EditTextandroid:id=""@+id/cname"" android:layout_height=""fill_parent"" android:layout_width=""fill_parent"" android:hint=""C Name""android:ems=""15""&gt;&lt;/EditText&gt;&lt;/TableRow&gt;&lt;TableRowandroid:id=""@+id/widget601""android:layout_width=""fill_parent""android:layout_height=""wrap_content""android:gravity=""center""&gt;&lt;EditTextandroid:id=""@+id/caddress"" android:layout_height=""fill_parent"" android:layout_width=""fill_parent"" android:hint=""C Address""android:ems=""15""&gt;&lt;/EditText&gt;&lt;/TableRow&gt;&lt;TableRowandroid:id=""@+id/widget60""android:layout_width=""fill_parent""android:layout_height=""wrap_content""android:gravity=""center""&gt;&lt;EditTextandroid:id=""@+id/total"" android:layout_height=""fill_parent"" android:layout_width=""fill_parent"" android:hint=""Total""android:ems=""15""&gt;&lt;/EditText&gt;&lt;/TableRow&gt;&lt;TableRowandroid:id=""@+id/widget60""android:layout_width=""fill_parent""android:layout_height=""wrap_content""android:gravity=""center""&gt;&lt;EditTextandroid:id=""@+id/m"" android:layout_height=""fill_parent"" android:layout_width=""fill_parent"" android:hint=""M""android:ems=""15""&gt;&lt;/EditText&gt;&lt;/TableRow&gt;&lt;TableLayoutandroid:id=""@+id/widget258""android:layout_width=""wrap_content""android:layout_height=""65px""android:orientation=""vertical""&gt;&lt;TableRowandroid:id=""@+id/widget60""android:layout_width=""wrap_content""android:layout_height=""wrap_content""android:gravity=""right""android:paddingRight=""2px""&gt;&lt;Buttonandroid:id=""@+id/cnew""android:layout_width=""35px""android:layout_height=""31px""android:layout_x=""77px""android:layout_y=""413px""android:clickable=""true""android:background=""@drawable/addbutton""&gt;&lt;/Button&gt;&lt;/TableRow&gt;&lt;/TableLayout&gt;&lt;/LinearLayout&gt;&lt;/ScrollView&gt;&lt;LinearLayoutandroid:id=""@+id/layout""android:layout_height=""wrap_content""android:layout_width=""wrap_content""android:gravity=""center""&gt;&lt;TableRowandroid:id=""@+id/widget42""android:layout_height=""fill_parent""android:layout_width=""fill_parent""android:gravity=""center""&gt;&lt;Buttonandroid:id=""@+id/done""android:layout_width=""wrap_content""android:layout_height=""41px""android:text=""Done""android:layout_x=""77px""android:layout_y=""313px""&gt;&lt;/Button&gt;&lt;/TableRow&gt;&lt;/LinearLayout&gt;</code></pre><p>And the codes for dynamic generation is as follows:</p><pre><code>LinearLayout newTableLayout=(LinearLayout)findViewById(R.id.tablelayout);    int i=0;        //New List        TableRow newTableRow1=new TableRow(this);        newTableRow1.setId(i+1);        TableRow newTableRow2=new TableRow(this);        TableRow newTableRow3=new TableRow(this);        TableRow newTableRow4=new TableRow(this);        TableRow newTableRow5=new TableRow(this);        EditText cName=new EditText(this);        cName.setId(i+2);        EditText cAddress=new EditText(this);        cAddress.setId(i+3);        EditText total=new EditText(this);        total.setId(i+4);        EditText m=new EditText(this);        m.setId(i+5);        Button newAddButton=new Button(this);        newAddButton.setId(i+6);        i++;        cName.setHint(""C Name"");        cAddress.setHint(""C Address"");        total.setHint(""Total "");        m.setHint(""M "");        newAddButton.setBackgroundColor(R.drawable.addbutton);        newTableRow1.addView(c Name);        newTableRow2.addView(c Address);        newTableRow3.addView(totalDebt);        newTableRow4.addView(m);        newTableRow5.addView(newAddButton);        newTableLayout.addView(newTableRow1);        newTableLayout.addView(newTableRow2);        newTableLayout.addView(newTableRow3);        newTableLayout.addView(newTableRow4);        newTableLayout.addView(newTableRow5);        newList.setBackgroundResource(R.drawable.deletebutton);        newList.setOnClickListener(delete);</code></pre><p>And my problem is :</p><p>The statement <code>newList.setBackgroundResource(R.drawable.deletebutton);</code> do not take effect</p><p>Could you please suggest a good way to make these working....</p><p>Thanks in advance...</p><p>Happy coding</p>","573700","","573700","","2011-02-23 05:24:17","2011-02-23 05:24:17","Setting attributes to dynamically generated buttons","<android><dynamic><widget>","0","3","","",""
"5087187","1","5096251","","2011-02-23 04:59:33","0","5634","<p>i have one activity in my android application in which a list of orders is populated. I want to implement a search functionality on this activity so that user can search for particular order. </p><p>I have read about the search box facility provided by adding a <code>searchable.xml</code> file in the application but I am not able to make it work for me?</p><p>I just want to add a search box in the activity and search for specific data in database.How can I do this?</p>","590849","","559070","","2011-02-23 05:13:22","2011-02-23 19:49:33","how to implement search box in my application in android?","<android>","2","2","","",""
"5087233","1","5294519","","2011-02-23 05:06:30","1","1892","<p>hey alli am using a webview in my android app. once i select text on a page i know i can use clipboardmanager to ""getText()"". But is there a listener that polls whenever a new text is selected?i want to trigger an event everytime a user selects a text.</p><p>thanks a lot :)</p>","1063062","","","","","2011-08-04 08:02:53","android webview text selection listener","<android><android-webview>","1","1","2","",""
"5087237","1","","","2011-02-23 05:07:20","1","4817","<p>I have created a <code>ListView</code> and on click on my first view I'm displaying a <code>GridView</code> of images. Now i want that when i click on any of that image it gets displayed on another page. </p><p>Can you nudge me towards the right direction? </p><p>This my code:</p><p>1:> Invoking Activity</p><pre><code>public class ImageExercise extends Activity{     /** Called when the activity is first created. */    public static int pos;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.image);        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)                                     {                                     Intent intent = new Intent(ImageExercise.this,FullImage.class);                                     pos=position;                                     startActivity(intent);                                   // finish();                                     }        });    }private void showImage(View view, int position) {    ImageView imgView = (ImageView) view;     imgView.setImageResource(position);     imgView.setId(position);}}class ImageAdapter extends BaseAdapter {public static Integer[] mThumbIds = {  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_8,    R.drawable.sample_9,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_8,    R.drawable.sample_9};    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;}</code></pre><p>2:-> Invoked Activity to which link is to be made:</p><pre><code>public class FullImage extends Activity{     @Override public void onCreate(Bundle savedInstanceState) {       // super.onCreate(savedInstanceState);        setContentView(R.layout.fullimage); }</code></pre><p>}</p>","617356","","617356","","2011-02-23 05:24:44","2014-04-06 10:47:52","On image click, link to another activity, displaying that image in full size","<android>","2","0","1","",""
"5087266","1","5087392","","2011-02-23 05:13:07","1","5347","<p>Well, I've got an application that crashes on load up because of a setContentView line.Now before you ask, its when I comment out the setContentView line on line 15 or so that I get a working app. But the moment I place it in, it errors. Now this is using 2.1-update1 android.</p><p>Java:</p><pre><code>package com.clark.listview;import android.app.ListActivity;import android.content.Intent;import android.os.Bundle;import android.view.View;import android.widget.ArrayAdapter;import android.widget.ListView;import android.widget.Toast;public class listview extends ListActivity {    /** Called when the activity is first created. */    public void onCreate(Bundle icicle) {        super.onCreate(icicle);        //setContentView(R.layout.main);        // Create an array of Strings, that will be put to our ListActivity        String[] names = new String[] { ""Linux"", ""Windows7"", ""Eclipse"", ""Suse"",                ""Ubuntu"", ""Solaris"", ""Android"", ""iPhone"", ""ClarkPhone"" };        // Use your own layout and point the adapter to the UI elements which        // contains the label        this.setListAdapter(new ArrayAdapter&lt;String&gt;(this, R.layout.rowlayout,                R.id.label, names));    }    @Override    protected 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();        if (keyword.startsWith(""Windows7"") || keyword.startsWith(""iPhone"")                || keyword.startsWith(""Solaris"")) {            launchTest();        }    }    protected void launchTest() {        Intent i = new Intent(this, home.class);        startActivity(i);    }}</code></pre><p>XML:</p><pre><code>&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;LinearLayout android:id=""@+id/main""    android:layout_width=""wrap_content""     android:layout_height=""wrap_content""    xmlns:android=""http://schemas.android.com/apk/res/android""    android:cacheColorHint=""#00000000""    android:background=""@drawable/bg""&gt;&lt;/LinearLayout&gt;</code></pre>","629572","","","","","2012-08-16 17:24:14","setContentView crashes Android Application in listview","<android>","2","2","1","",""
"5087374","1","","","2011-02-23 05:36:40","0","97","<p>I want to find the size of the image(eg 512KB) and so on ,how to find it??</p>","620903","","1023248","","2012-07-03 11:34:09","2012-07-03 11:34:09","How to find the size of a particular data in Android?","<android>","1","0","","",""
"5087385","1","","","2011-02-23 05:38:43","0","1772","<p>How can I save userId and Password?</p><p>I am developing an application which requires to store email id andpassword, so that the user can directly redirect to his home page if the user already exists.</p><p>Now Next time when the user logins, he is directed to his home page directly.He should not again type in his userId and pasword.</p>","627987","","-1","","2013-03-26 08:21:54","2013-03-26 08:21:54","How to presist Login credentials and do auto-login in Android","<android><login><persistence><autologin>","2","3","","",""
"5087447","1","5087532","","2011-02-23 05:49:16","2","5067","<pre><code>public class Check extends Activity implements OnClickListener {    //private check2 check2;    /** Called when the activity is first created. */    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        Button usemirror = (Button)findViewById(R.id.widget28);        usemirror.setOnClickListener(this);    }    public void onClick(View view){        Intent mi = new Intent(this , check2.class);        startActivity(mi);}}package com.exaple;import android.app.Activity;import android.os.Bundle;import android.widget.Toast;public class check2 extends Activity {    public void onCreate(Bundle savedInstanceState) {       // super.onCreate(savedInstanceState);       // setContentView(R.layout.main);        Toast.makeText(                this,                ""Welcome to second page"", Toast.LENGTH_LONG).show();        finish();      }}</code></pre><p>ANDROID manifest.xml</p><pre><code>&lt;activity android:name="".check2"" &gt;</code></pre><p>I am doing this but doesn't show me the message written in my other activities</p>","626122","","626122","","2012-05-17 03:46:31","2012-05-17 03:46:31","navigation from one screen to other screen in android","<android>","3","2","","",""
"5087472","1","5087976","","2011-02-23 05:53:11","0","518","<p>I am displaying the list of items in listview(assuming that main category), once i click the items, it shows the sub_category. and again i clicked the subcategory of item, it goes to next activity. My question is whenever i clicked the subcategory and again i click back button in emulator, items in main category will not be displayed. </p>","599841","","","","","2011-02-23 07:11:51","List view get item back","<android>","1","2","","",""
"5087509","1","","","2011-02-23 05:58:29","0","2763","<p>hii everyone.. I want to show local traffic conditions in my android app..like this</p><p><a href=""http://maps.google.com/maps?ie=UTF8&amp;hl=en&amp;layer=t&amp;ll=38.899049,-77.017593&amp;spn=0.268261,0.6427&amp;z=11"" rel=""nofollow"">http://maps.google.com/maps?ie=UTF8&amp;hl=en&amp;layer=t&amp;ll=38.899049,-77.017593&amp;spn=0.268261,0.6427&amp;z=11</a></p><p>i tried to use <code>mapview.setTraffic(true).</code> but this dosen't show me anything. just showing a simple map. how can i apply this traffic api in my app..if anyone knows..please guide me..</p><p>or can i show this as an intent...</p><p>thanks in advance..</p>","450601","","","","","2011-03-29 08:20:49","how to add google traffic api","<android><google-maps-api-3>","1","0","","",""
"5087526","1","8449200","","2011-02-23 06:01:37","0","447","<p>I'm implementing an Android activity.I am using a ListView in my application layout, and setting the views colors by setBackgroundResource in my inherited SimpleAdapter getView.</p><pre><code>public class SpecialAdapter extends SimpleAdapter {    public SpecialAdapter(Context context, List&lt;HashMap&lt;String, String&gt;&gt; items, int resource, String[] from, int[] to) {        super(context, items, resource, from, to);    }    @Override    public View getView(int position, View convertView, ViewGroup parent) {       View view = super.getView(position, convertView, parent);       if (mSensorsStatus[position].equals(mSensorStatus[SENSOR_STATUS_ALERT])) {          view.setBackgroundResource(R.color.red);       }       else if (mSensorsStatus[position].equals(mSensorStatus[SENSOR_STATUS_ARMED])) {          view.setBackgroundResource(R.color.light_grey);       }       return view;    }}</code></pre><p>My problem is that when I click one of the items, it is not colored in yellow/orange as it usually does (when removing the setBackgroundResource it works fine)</p><p>Some more info:I tried to set the background color by mListView.getChildAt(index).setBackgroundResource(R.color.red) instead of the getView implementation, and the result was the same.</p><p>appreciate your help</p>","541843","","541843","","2011-02-23 08:01:17","2011-12-09 17:16:03","ListView items are not marked when pressed","<android><listview>","2","2","","",""
"5087596","1","","","2011-02-23 06:10:12","0","246","<p>I am trying Text to speech convertion in android but not locally actually i want pass my text in to server and then server will give me the MP3 file which i have to handle so please any one can tell me how to do that. i very worried about that.</p>","343678","","","","","2011-02-23 06:57:39","TTS(Text to speech) for android using server","<android><text-to-speech>","1","1","","",""
"5087607","1","5087703","","2011-02-23 06:11:32","3","4539","<p>How can I use <code>goto</code> in Android?</p>","1004437","","63550","","2014-01-31 16:40:34","2014-01-31 16:52:55","How to use the goto statement in Android","<java><android>","2","4","2","2011-02-23 06:50:37",""
"5087620","1","","","2011-02-23 06:14:12","0","272","<p>I have an AppWidget which performs these tasks in order</p><ol><li>Get a user's current location. Use the coordinates &amp; send a request to an API server.</li><li>API server will send a response in JSON format.</li><li>Using JSONObject, I manage to send the result to display via RemoteViews.</li></ol><p>What I want to achieve here is that I want to implement a next &amp; previous button (something similar like the official Twitter AppWidget) to change/move to the next item from the result. How do I achieve this?</p>","558208","","","","","2011-09-23 02:49:46","Pagination in Android AppWidget","<android><appwidget>","1","0","","",""
"5087626","1","5087809","","2011-02-23 06:14:41","0","7544","<p>I want to show <code>Toast</code> message inside thread.. but I am getting </p><pre><code>RunTimeException:Can't create handler inside thread that has not called Looper.prepare()</code></pre><p>Please help me. Thanks in Advance.</p>","437833","","505893","","2012-01-27 14:17:07","2012-07-13 04:14:36","How to show Toast message inside thread?","<android><toast><runtimeexception>","2","0","1","",""
"5087628","1","5087691","","2011-02-23 06:14:45","9","3514","<p>I am from Java Swing background. May I know why using XML to create GUI is a good practice in Android? For instance, instead of writing the code in (Which makes me feel more comfortable with it as I use to Swing desktop application)</p><pre><code>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);       TextView tv = new TextView(this);       tv.setText(""Hello, Android"");       setContentView(tv);   }}</code></pre><p>We write the code in XML way.</p><pre><code>import android.app.Activity;import android.os.Bundle;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);    }}</code></pre><p>In tutorial, it states that, </p><blockquote>  <p>This structure makes it very easy to  quickly build up UIs, using a more  simple structure and syntax than you  would use in a programmatic layout.</p></blockquote><p>However, I don't really buy the idea, as I feel that creating a separate XML file is more cumbersome.</p><p>Can anyone give a real world example (in the sense of Android), why using XML to build GUI is more superior than bare Java code? </p><p><strong>If GUI programming through XML is really a good stuff, why it still hasn't become a common practice among GUI desktop application developers?</strong></p>","72437","","72437","","2011-02-23 08:58:49","2011-02-23 12:41:12","Why using XML to create GUI is a good practice in Android","<java><android>","7","0","3","",""
"5087680","1","5087881","","2011-02-23 06:21:35","0","352","<p>I have two different activity in one application and I am calling one activity on the top of other activity. My second activity is a ListView and is transparent, so i can see my fist activity as the background of second activity.  Now I want to gain the control of background activity without killing the above or second activity. I want to bring my background activity as foreground by a click on the second activity.</p><p>Any help or clue is highly appreciated.</p><p>Thanks,</p>","628090","","","","","2012-05-25 04:53:13","Gain the control on background activity by a click on foreground activiity","<android>","1","0","1","",""
"5087688","1","5099539","","2011-02-23 06:22:28","4","2997","<p>I have implement simple one simple database application in which I have used scrollview.Its work fine.But scrollview is not bounce.</p><p>Is it possible to enable bounce in scrollview?</p><p>Thanks in advance.</p>","352707","","","","","2011-02-24 02:24:23","How to implement bouncing in scrollview?","<android>","1","1","1","",""
"5087711","1","","","2011-02-23 06:26:33","0","802","<p>I am getting android.view.InflateException: Error inflating class and system crashed.</p><pre><code>08-02 16:57:58.570: E/AndroidRuntime(366): FATAL EXCEPTION: main08-02 16:57:58.570: E/AndroidRuntime(366): java.lang.RuntimeException: Unable to start activity ComponentInfo{org.raman.sing/org.raman.sing.setting}: android.view.InflateException: Binary XML file line #2: Error inflating class &lt;unknown&gt;08-02 16:57:58.570: E/AndroidRuntime(366):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1647)08-02 16:57:58.570: E/AndroidRuntime(366):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)08-02 16:57:58.570: E/AndroidRuntime(366):  at android.app.ActivityThread.access$1500(ActivityThread.java:117)08-02 16:57:58.570: E/AndroidRuntime(366):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)08-02 16:57:58.570: E/AndroidRuntime(366):  at android.os.Handler.dispatchMessage(Handler.java:99)08-02 16:57:58.570: E/AndroidRuntime(366):  at android.os.Looper.loop(Looper.java:123)08-02 16:57:58.570: E/AndroidRuntime(366):  at android.app.ActivityThread.main(ActivityThread.java:3683)08-02 16:57:58.570: E/AndroidRuntime(366):  at java.lang.reflect.Method.invokeNative(Native Method)08-02 16:57:58.570: E/AndroidRuntime(366):  at java.lang.reflect.Method.invoke(Method.java:507)08-02 16:57:58.570: E/AndroidRuntime(366):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)08-02 16:57:58.570: E/AndroidRuntime(366):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)08-02 16:57:58.570: E/AndroidRuntime(366):  at dalvik.system.NativeStart.main(Native Method)08-02 16:57:58.570: E/AndroidRuntime(366): Caused by: android.view.InflateException: Binary XML file line #2: Error inflating class &lt;unknown&gt;08-02 16:57:58.570: E/AndroidRuntime(366):  at android.view.LayoutInflater.createView(LayoutInflater.java:518)08-02 16:57:58.570: E/AndroidRuntime(366):  at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)08-02 16:57:58.570: E/AndroidRuntime(366):  at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:568)08-02 16:57:58.570: E/AndroidRuntime(366):  at android.view.LayoutInflater.inflate(LayoutInflater.java:386)08-02 16:57:58.570: E/AndroidRuntime(366):  at android.view.LayoutInflater.inflate(LayoutInflater.java:320)08-02 16:57:58.570: E/AndroidRuntime(366):  at android.view.LayoutInflater.inflate(LayoutInflater.java:276)08-02 16:57:58.570: E/AndroidRuntime(366):  at   com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:207)08-02 16:57:58.570: E/AndroidRuntime(366):  at android.app.Activity.setContentView(Activity.java:1657)08-02 16:57:58.570: E/AndroidRuntime(366):  at org.raman.sing.setting.onCreate(setting.java:88)08-02 16:57:58.570: E/AndroidRuntime(366):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)08-02 16:57:58.570: E/AndroidRuntime(366):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611)08-02 16:57:58.570: E/AndroidRuntime(366):  ... 11 more08-02 16:57:58.570: E/AndroidRuntime(366): Caused by: java.lang.reflect.InvocationTargetException08-02 16:57:58.570: E/AndroidRuntime(366):  at java.lang.reflect.Constructor.constructNative(Native Method)08-02 16:57:58.570: E/AndroidRuntime(366):  at java.lang.reflect.Constructor.newInstance(Constructor.java:415)08-02 16:57:58.570: E/AndroidRuntime(366):  at android.view.LayoutInflater.createView(LayoutInflater.java:505)08-02 16:57:58.570: E/AndroidRuntime(366):  ... 21 more08-02 16:57:58.570: E/AndroidRuntime(366): Caused by: java.lang.OutOfMemoryError: bitmap size exceeds VM budget08-02 16:57:58.570: E/AndroidRuntime(366):  at android.graphics.Bitmap.nativeCreate(Native Method)08-02 16:57:58.570: E/AndroidRuntime(366):  at android.graphics.Bitmap.createBitmap(Bitmap.java:477)08-02 16:57:58.570: E/AndroidRuntime(366):  at android.graphics.Bitmap.createBitmap(Bitmap.java:444)08-02 16:57:58.570: E/AndroidRuntime(366):  at android.graphics.Bitmap.createScaledBitmap(Bitmap.java:349)08-02 16:57:58.570: E/AndroidRuntime(366):  at android.graphics.BitmapFactory.finishDecode(BitmapFactory.java:498)08-02 16:57:58.570: E/AndroidRuntime(366):  at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:473)08-02 16:57:58.570: E/AndroidRuntime(366):  at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:336)08-02 16:57:58.570: E/AndroidRuntime(366):  at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:697)08-02 16:57:58.570: E/AndroidRuntime(366):  at android.content.res.Resources.loadDrawable(Resources.java:1709)08-02 16:57:58.570: E/AndroidRuntime(366):  at android.content.res.TypedArray.getDrawable(TypedArray.java:601)08-02 16:57:58.570: E/AndroidRuntime(366):  at android.view.View.&lt;init&gt;(View.java:1951)08-02 16:57:58.570: E/AndroidRuntime(366):  at android.view.View.&lt;init&gt;(View.java:1899)08-02 16:57:58.570: E/AndroidRuntime(366):  at android.view.ViewGroup.&lt;init&gt;(ViewGroup.java:286)08-02 16:57:58.570: E/AndroidRuntime(366):  at android.widget.AbsoluteLayout.&lt;init&gt;(AbsoluteLayout.java:47)08-02 16:57:58.570: E/AndroidRuntime(366):  ... 24 more</code></pre>","629653","","1269727","","2012-10-25 21:44:17","2012-10-25 21:44:17","Getting system crash with error ""Error inflating class<unknown>""","<android>","0","3","","",""
"5087720","1","","","2011-02-23 06:27:29","3","1663","<p>I am trying to tile a 20x20 background onto my Custom View but for some reason I am unable too.</p><pre><code>    BitmapDrawable background;    background = new BitmapDrawable(BitmapFactory.decodeResource(getResources(), R.drawable.back));    background.setTileModeXY(Shader.TileMode.REPEAT, Shader.TileMode.REPEAT);    background.draw(canvas);</code></pre><p>Does anyone have an idea why it isn't working?</p>","625935","","","","","2012-08-20 19:25:53","Android: BitmapDrawable.Draw(Canvas) Doesn't seem to work","<android><bitmap><draw>","3","0","1","",""
"5087753","1","5088381","","2011-02-23 06:32:12","1","2469","<p>When writing an application(in java) that you intend to open source, is it generally a good idea to have a lot of getters &amp; setters and make variables private? More specifically, if that were to be an <strong>android application</strong>, would the answer to the question above still hold?</p><p>Edit: If you guys could give me a concrete reason as to why its better, that would be awesome. </p>","552384","","477754","","2011-02-23 08:08:58","2011-02-23 10:25:21","Is having a lot of getters & setters a good idea?","<java><android><open-source><getter-setter>","3","6","","",""
"5087836","1","","","2011-02-23 06:48:24","1","1131","<p>I am taking opening the camera through intents and trying to save the image into a folder in SDCard. I can take the image and the image is getting saved.</p><p>But the problem is that is getting stored a thumbnail resolution image (160*120) size image. </p><p>This is what i am doing...</p><p>To open Camera</p><pre><code>mIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);    mIntent.putExtra(MediaStore.EXTRA_OUTPUT,            MediaStore.Images.Media.EXTERNAL_CONTENT_URI                    .toString());    mIntent.putExtra(MediaStore.EXTRA_VIDEO_QUALITY, 1);    startActivityForResult(mIntent, PHOTO_SELECT);</code></pre><p>And on Activity for result ...</p><pre><code>imageFileFolder = new File(Environment.getExternalStorageDirectory(),            ""MyApp"");    FileOutputStream out = null;    Calendar c = Calendar.getInstance();    String date = fromInt(c.get(Calendar.MONTH))            + fromInt(c.get(Calendar.DAY_OF_MONTH))            + fromInt(c.get(Calendar.YEAR))            + fromInt(c.get(Calendar.HOUR_OF_DAY))            + fromInt(c.get(Calendar.MINUTE))            + fromInt(c.get(Calendar.SECOND));    imageFileName = new File(imageFileFolder, date.toString() + "".jpg"");    try    {        out = new FileOutputStream(imageFileName);        bmp.compress(Bitmap.CompressFormat.JPEG, 100, out);        out.flush();        out.close();        scanPhoto(imageFileName.toString());        out = null;</code></pre><p>Can anyone please help in storing the high resolution image that i am taking... </p>","303155","","","","","2011-07-22 12:31:36","Couldnt' save image with max resolution from Camera intent","<android><camera><android-intent>","1","2","","",""
"5087856","1","5088184","","2011-02-23 06:52:30","1","1147","<p>I want to get the <code>/data/data/packagename/databases/test.db</code>, but i can not get it ""Permission denied"".</p><p>I use adb shell to access data folder, it shows:</p><pre><code>$ sudo adb shell$ cd data$ lsls: can't open '.': Permission denied</code></pre><p>why?? I can access /system folder </p>","354459","","71724","","2011-02-23 07:01:10","2012-03-08 03:41:17","Can not access android /data folder","<android>","1","3","","",""
"5087871","1","5087966","","2011-02-23 06:54:44","11","4439","<p>Anyone know about the detail? Any website or suggestion? </p>","595543","","","","","2011-02-23 07:10:31","Android - What is a secondary progress in ProgressBar?","<android><progress-bar>","2","1","","",""
"5087914","1","","","2011-02-23 07:01:56","2","5184","<p>I am adding google-maps-api for the my hellomapview progam for android appilication developement refering the website <em>[http://developer.android.com/guide/tutorials/views/hello-mapview.html][1]</em>.Before generating the api key it ask for md5-signature certificate.So when try to create md5 certificate using keytool via commandline in windows i got the following error.Please guide to this clear this error or how to set password and what is the default password for keytool.</p><p>Error:</p><p><em>C:\Documents and Settings\USER>keytool -list -keystore .android\debug.keystoreEnter keystore password:keytool error: java.io.IOException: Keystore was tampered with, or password wasincorrect</em></p><p>Output with image:<a href=""http://bit.ly/gOrcfG"" rel=""nofollow"">http://bit.ly/gOrcfG</a></p>","629691","","","","","2011-02-23 07:31:58","How to set the password for keytool in windows?","<java><android><google-maps-api-3><keytool>","2","1","","",""
"5087926","1","5092405","","2011-02-23 07:04:26","1","611","<p>The task seems fairly simple but I don't know what's the best way to implement it in Android.</p><p><strong>How it should look</strong></p><p>There should be a number of images on the screen (let's say 4-5 max) each image will have as a Background a FrameAnimation that's oneTime(false) (representing a running man). Each of these images need to have a random path to follow around the screen, calculated when it's first created. So the running man will go around the screen in different directions. Each image will have a onClick listener so when clicked on it, it will be removed from the screen.  </p><p>What is the best way to do this in Android starting with 1.6 without causing performance drops or Bitmap Memory leaks ? </p><p>I attach a image for exemplification. Thank you all for your time.</p><p><img src=""http://i.stack.imgur.com/QX5gm.png"" alt=""enter image description here""></p><p>Later Edit: the best solution seems to use a extended SurfaceView. I saw some samples with adding, moving the image around, but I don't know yet how could I intercept the onTouchEvent. I can override the onTouchEvent of the surfaceView. The solution that comes now in my mind is get x and y of the touched spot and then look in the animated images if any is under the x,y pressed spot. This seems pretty complicate.</p>","379865","","379865","","2011-02-23 10:35:38","2011-02-23 14:47:43","Animating a imageview on a random path in Android","<android><animation><custom-view>","1","0","","",""
"5088048","1","","","2011-02-23 07:21:23","0","494","<p>I am expecting output to be an array list filled with all items as ""thought""but instead, every time i add a value into arraylist, the previous value in list also gets update with new, hence resulting in duplicates. This behaviour goes on till end. Even though i have achieved the result by changing the approach, failure of my previous approach still bothers me. Any help or pointer will be really appreciated.</p><p><strong>My debugging observation:</strong> When a second add() method is  encountered, instead of just adding a new element to arraylist, somehow previous element gets altered too.</p><p>Below is xml snippet:</p><pre><code>&lt;Thoughts&gt;&lt;country&gt;    &lt;name&gt;India&lt;/name&gt;    &lt;item&gt;        &lt;itemId&gt;1&lt;/itemId&gt;        &lt;itemDetailImage&gt;detail.png&lt;/itemDetailImage&gt;        &lt;itemImage&gt;image1.png&lt;/itemImage&gt;        &lt;itemDesc&gt;Item Description 1&lt;/itemDesc&gt;        &lt;itemTitle&gt;Item Title 1&lt;/itemTitle&gt;    &lt;/item&gt;    &lt;item&gt;        &lt;itemId&gt;2&lt;/itemId&gt;        &lt;itemDetailImage&gt;detail2.png&lt;/itemDetailImage&gt;        &lt;itemImage&gt;image2.png&lt;/itemImage&gt;        &lt;itemDesc&gt;Item Description 2&lt;/itemDesc&gt;        &lt;itemTitle&gt;Item Title 2&lt;/itemTitle&gt;    &lt;/item&gt;&lt;item&gt;        &lt;itemId&gt;3&lt;/itemId&gt;        &lt;itemDetailImage&gt;detail3.png&lt;/itemDetailImage&gt;        &lt;itemImage&gt;image3.png&lt;/itemImage&gt;        &lt;itemDesc&gt;Item Description 3&lt;/itemDesc&gt;        &lt;itemTitle&gt;Item Title 3&lt;/itemTitle&gt;    &lt;/item&gt;</code></pre><p>Below is a method for my trial and error:</p><pre><code>private void printAll() throws XmlPullParserException, IOException{    XmlPullParserFactory factory = XmlPullParserFactory.newInstance();    factory.setNamespaceAware(false);    XmlPullParser parser = factory.newPullParser();    URL url = new URL(""http://192.168.1.3/DefaultXML.xml"");    URLConnection ucon = url.openConnection();    InputStream is = ucon.getInputStream();    parser.setInput(is, null);    int eventType = parser.getEventType();    String name;    while(eventType != parser.END_DOCUMENT){        if(eventType == parser.START_DOCUMENT){            Log.i(TAG,""Start document"");        }else if (eventType == parser.START_TAG ) {            name = parser.getName();            if(name.equalsIgnoreCase(NAME)){                this.cName = new Country();                this.cName.setName(parser.nextText());            }else if(name.equalsIgnoreCase(ITEM_DESC)){                this.thought.setItemDesc(parser.nextText());            }else if (name.equalsIgnoreCase(ITEM_ID)) {                this.thought.setItemID(parser.nextText());            }else if (name.equalsIgnoreCase(ITEM_DETAIL_IMAGE)) {                this.thought.setItemDetailImage(parser.nextText());            }else if (name.equalsIgnoreCase(ITEM_IMAGE)) {                this.thought.setItemImage(parser.nextText());            }else if (name.equalsIgnoreCase(ITEM_TITLE)) {                this.thought.setItemTitle(parser.nextText());            }        }else if (eventType == parser.END_TAG) {            name = parser.getName();            if(name.equalsIgnoreCase(ITEM)) {                this.cName.setThought(this.thought);                ctry.add(cName);                this.thought = new Thought();            }        }        eventType = parser.next();    }    //Log.i(TAG,""---"" + ctry.toString());}</code></pre><p><strong>Below is the Log info I get:</strong><br>    02-23 17:15:30.199: INFO/XmlPullParserActivity(726): Start document<br>02-23 17:15:30.299: INFO/XmlPullParserActivity(726): 4<br>02-23 17:15:30.299: INFO/XmlPullParserActivity(726): India<br>02-23 17:15:30.299: INFO/XmlPullParserActivity(726): Item Description 4<br>02-23 17:15:30.299: INFO/XmlPullParserActivity(726): detail4.png<br>02-23 17:15:30.309: INFO/XmlPullParserActivity(726): image4.png<br>02-23 17:15:30.309: INFO/XmlPullParserActivity(726): Item Title 4--------------<br>02-23 17:15:30.309: INFO/XmlPullParserActivity(726): 4<br>02-23 17:15:30.309: INFO/XmlPullParserActivity(726): India<br>02-23 17:15:30.309: INFO/XmlPullParserActivity(726): Item Description 4<br>02-23 17:15:30.319: INFO/XmlPullParserActivity(726): detail4.png<br>02-23 17:15:30.319: INFO/XmlPullParserActivity(726): image4.png<br>02-23 17:15:30.319: INFO/XmlPullParserActivity(726): Item Title 4--------------<br>02-23 17:15:30.319: INFO/XmlPullParserActivity(726): 4<br>02-23 17:15:30.319: INFO/XmlPullParserActivity(726): India<br>02-23 17:15:30.329: INFO/XmlPullParserActivity(726): Item Description 4<br>02-23 17:15:30.329: INFO/XmlPullParserActivity(726): detail4.png<br>02-23 17:15:30.329: INFO/XmlPullParserActivity(726): image4.png<br>02-23 17:15:30.339: INFO/XmlPullParserActivity(726): Item Title 4--------------<br>02-23 17:15:30.339: INFO/XmlPullParserActivity(726): 4<br>02-23 17:15:30.339: INFO/XmlPullParserActivity(726): India<br>02-23 17:15:30.349: INFO/XmlPullParserActivity(726): Item Description 4<br>02-23 17:15:30.349: INFO/XmlPullParserActivity(726): detail4.png<br>02-23 17:15:30.349: INFO/XmlPullParserActivity(726): image4.png<br>02-23 17:15:30.349: INFO/XmlPullParserActivity(726): Item Title 4--------------<br>02-23 17:15:30.349: INFO/XmlPullParserActivity(726): 4<br>02-23 17:15:30.349: INFO/XmlPullParserActivity(726): Australia<br>02-23 17:15:30.349: INFO/XmlPullParserActivity(726): Item Description 4<br>02-23 17:15:30.349: INFO/XmlPullParserActivity(726): detail4.png<br>02-23 17:15:30.349: INFO/XmlPullParserActivity(726): image4.png<br>02-23 17:15:30.349: INFO/XmlPullParserActivity(726): Item Title 4--------------  </p>","536379","","536379","","2011-02-23 11:55:38","2011-02-23 11:55:38","xmlpullparser(), whats wrong with my code?","<android><xml>","1","2","","",""
"5088060","1","","","2011-02-23 07:23:31","0","342","<p>please tell me is their any native api for contact database??</p>","573776","","","","","2011-02-23 12:19:12","can we call android native APIs","<android>","1","2","","",""
"5088069","1","5088141","","2011-02-23 07:25:27","5","214","<p>Was wondering if anyone knew of some third party android development toolkits.</p><p>I have found Basic4Android.</p><p>Was wondering what other options are available.Language does not matter.</p><p>Thanks</p>","542285","","","","","2011-02-23 07:48:58","Android development toolkits","<android>","2","0","1","",""
"5088079","1","","","2011-02-23 07:26:49","0","4727","<p>I need to implement a View which has five children, but only one is visible. When the user touch scrolls from right to left or left to right, the next or previous view should appear in sync with the scroll. If the touch is finished and scroll distance did not exceed a given distance, then then the new view which is partly shown should go back and the current view should be shown. If the touch is finished and scroll distance has exceeded a given distance, then new view should come &amp; current view should go. I tried with viewflipper, but it has only showNext() &amp; showPrevious() through which the new view can not be shown on sync with the scroll.</p>","607741","","","","","2011-12-13 17:37:26","Android Touch scroll animation for Page flip","<android><android-animation>","1","0","","",""
"5088143","1","5088759","","2011-02-23 07:36:52","4","3459","<p>What happens behind the scenes when I do a <code>repo sync</code> in my Android repository?</p><p>Is it equivalent to <code>repo forall -c ""git pull""</code> or maybe git fetch? Or does it do something more complex?</p><p>Thanks</p>","81398","","","","","2011-02-23 09:36:26","What happens behind the scenes when I do a repo sync?","<android><git><repository>","1","0","","",""
"5088192","1","5088339","","2011-02-23 07:42:06","0","287","<p>hi i am a new developer. i am trying to design an app. In my app i want to calculate the no of touches in a particular button. Is this can be calculated by onTouch process if yes can anyone give me an example or idea.</p>","596364","","","","","2011-02-23 08:03:38","how to calculate the number of touches on a button in android","<java><android>","2","1","","",""
"5088310","1","5088591","","2011-02-23 07:57:43","0","91","<p>I have following layout in my android application.</p><pre><code>&lt;LinearLayout 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""    android:background=""@drawable/bbg""&gt;    &lt;LinearLayout        android:orientation=""vertical""        android:layout_width=""fill_parent""        android:layout_height=""wrap_content""        android:layout_weight=""0""&gt;        &lt;TableLayout            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""            android:stretchColumns=""0""&gt;            &lt;TableRow&gt;                &lt;EditText                     android:id=""@+id/TestEdit""                    android:hint=""Test""                      android:layout_width=""fill_parent""                    android:layout_height=""fill_parent""/&gt;                &lt;Button                    android:id=""@+id/TestButtin""                    android:layout_width=""wrap_content""                    android:layout_height=""fill_parent""                    android:text = ""Test""/&gt;            &lt;/TableRow&gt;        &lt;/TableLayout&gt;    &lt;/LinearLayout&gt;    &lt;com.google.android.maps.MapView        android:id=""@+id/MapView"" android:clickable=""true""        android:layout_width=""fill_parent"" android:layout_height=""fill_parent""        android:apiKey=""KEY"" /&gt;&lt;/LinearLayout&gt;</code></pre><p>The problem is, that when I change text in EditText using setText() method, if text is too long EditText scratches and pushes Button out of screen. I don't want EditText to scrath, but I want it to be also I want it to be ""fill_parent"" by default/</p><p>How can I fix it? Thanks.</p>","629748","","629748","","2011-02-23 08:32:53","2011-02-23 08:37:30","Android Layout scrteching","<android>","2","0","","",""
"5088342","1","","","2011-02-23 08:02:20","1","865","<p>How do i create dynamic tabs in Android. From a list view, i click on an item and depending on the item i need to show n number of tabs. Each tabs should use the same activity used by the 1st tab. Any help is appreciated</p>","396543","","","","","2011-03-27 17:30:42","Dynamic Tabs in Android","<android>","1","0","","",""
"5088360","1","5088455","","2011-02-23 08:04:57","1","11240","<p>Im new to android and im facing some issues...</p><p>Im using a SurfaceView to extend my class.In my class i cant get width and height of the SurfaceView.It is always 0. Im trying to flick an image on the entire screen (surfaceView) but im unable to get its width and height.</p><p>Any suggestions?</p><p>Here is the code for SurfaceView in 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;test.MyClass android:id=""@+id/SurfaceView01""        android:layout_width=""fill_parent"" android:layout_height=""fill_parent""&gt;    &lt;/test.MyClass&gt;&lt;/LinearLayout&gt;</code></pre>","281092","","","","","2012-09-21 11:23:47","Android - SurfaceView (width, height) problem","<android><height><width><surfaceview>","4","0","","",""
"5088368","1","5088681","","2011-02-23 08:06:19","1","596","<p>I'm having thoughts abut my current app.I have this TabHost class with two tabs. Tab1 shows data from a WS in a Listview. Tab2 shows the same data as a diagram in a webview.</p><p>Of course, I'd rather not call the same webservice for the same data twice, so I was thinking of doing the WS call already in the TabHost class and then send the data as a JSONArray to both my tabs using putExtra.</p><p>Is that possible or simply stupid?Regards</p>","498112","","","","","2011-02-23 08:48:01","androids putExtra","<android><android-intent>","1","2","","",""
"5088474","1","5088733","","2011-02-23 08:21:36","11","43708","<p>I'm looking for help to get the UUID of my Android phone. I have searched the net and found one potential solution but it is not working in the emulator.</p><p>Here is the code:</p><pre><code>Class&lt;?&gt; c;try {    c = Class.forName(""android.os.SystemProperties"");    Method get = c.getMethod(""get"", String.class);    serial = (String) get.invoke(c, ""ro.serialno"");    Log.d(""ANDROID UUID"",serial);} catch (Exception e) {    e.printStackTrace();}</code></pre><p>Does anybody know why it isn't working, or have a better solution?</p>","593424","","366904","","2011-03-11 07:54:22","2013-03-21 16:45:45","How can I get the UUID of my Android phone in an application?","<android><uuid>","3","7","14","",""
"5088488","1","5088542","","2011-02-23 08:23:09","0","196","<p>I'm hitting a wall in an android SQL query, this is what I have so far:</p><pre><code>        mDb.query(false, DATABASE_TABLE, new String[] {KEY_ROWID, KEY_ROWONE, KEY_ROWTWO, KEY_ROWTHREE, KEY_ROWFOUR, KEY_ROWFIVE}, KEY_ROWONE +"" LIKE '?%'"", new String[] { letter }, null, null, null, null);</code></pre><p>Basically, I want the query to return all the rows in the table where KEY_ROWONE starts with the variable letter (a string containing one letter).</p><p>I get a force close when I'm running the code, and I'm really puzzled.</p><p>I promise to tick the best answer!</p>","567390","","","","","2011-02-23 09:50:42","Android SQL query problem","<java><android><sql>","2","0","","",""
"5088515","1","","","2011-02-23 08:26:53","0","131","<p>I am new to android. I implemented these steps to create a sqlite database,</p><pre><code>public void onCreate(Bundle icicle){    super.onCreate(icicle);    setContentView(R.layout.main);    SQLiteDatabase db;    db = openOrCreateDatabase(""TestData.db"", SQLiteDatabase.CREATE_IF_NECESSARY, null);   }</code></pre><p>but the the database not made i searched the database at every location (in packcage also), also checked with commands specified. <strong># ls /com/testproject/action.TestAction/databases</strong></p>","629802","","","","","2011-02-23 09:39:50","Problem in Android Database creation. Please help","<android><database><sqlite>","2","0","","",""
"5088718","1","","","2011-02-23 08:51:28","1","439","<p>While generating key, I gave validity as 11,000 days which means more than 25 years. But when I verify the apk using jarsigner, it shows ""This jar contains entries whose signer certificate will expire within six months"". Why it shows validity for only 6 months even if I gave it for 11,000 days? Please help</p>","536091","","","","","2012-02-15 02:13:25","This jar contains entries whose signer certificate will expire within six months","<android>","1","0","","",""
"5088739","1","5088963","","2011-02-23 08:54:10","1","557","<p>I have created the below layout using Linear Layout , its running fine but i have one doubt that it can be optimized because i have created this UI using nested Linear Layout , i think its not well. </p><p><strong>So Can you please help me to optimize this Linear Layout either by using Relative Layout or else ?</strong></p><p>I have defined a layout like:</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:padding=""6dip""&gt; &lt;LinearLayout        android:orientation=""vertical""        android:layout_width=""wrap_content""        android:layout_weight=""1""        android:layout_height=""fill_parent""        android:layout_marginLeft=""10dip""&gt;        &lt;TextView            android:id=""@+id/txtViewTitle""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""            android:layout_weight=""1""            android:gravity=""center_vertical""            android:textSize=""18dip""            android:text=""hello""        /&gt;        &lt;TextView            android:id=""@+id/txtViewDescription""            android:layout_width=""fill_parent""            android:layout_height=""wrap_content""            android:layout_weight=""1""            android:gravity=""center_vertical""            android:textSize=""14dip""            android:text=""hello""            /&gt;    &lt;/LinearLayout&gt;            &lt;ImageView      android:id=""@+id/image""      android:layout_width=""50dip""      android:layout_height=""fill_parent""       android:src=""@drawable/arrow""      android:layout_marginLeft=""3dip""      android:scaleType=""center""/&gt;&lt;/LinearLayout&gt;</code></pre>","379693","","379693","","2011-02-23 09:00:39","2011-03-04 00:20:40","Android - Want to optimize Layout","<android><android-layout><layout-optimization>","4","7","","",""
"5088796","1","","","2011-02-23 08:59:55","3","1883","<p>I am trying to test the insertion and retrieval methods for my <code>SQLiteOpenHelper</code> subclass in an Android application.  The SQLLiteHelper subclass exists in the app under test, and creates a database in the installation folder.  However, the unit test exists in a <code>InstrumentTestCase</code> in the test app, and I would like to create a test database in the test app. </p><p>Unfortunately, if I try to create / open a database in the test app, I get the following exception:</p><pre><code>android.database.sqlite.SQLiteException: unable to open database fileat android.database.sqlite.SQLiteDatabase.dbopen(Native Method)at android.database.sqlite.SQLiteDatabase.&lt;init&gt;(SQLiteDatabase.java:1584)at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:638)at android.database.sqlite.SQLiteOpenHelper.getReadableDatabase(SQLiteOpenHelper.java:168)at com.kizoom.android.mybus.storage.MyStopsDatabase.getMyStops(MyStopsDatabase.java:63)at com.kizoom.mybus.test.MyStopsDatabaseTest.testGetMyStops(MyStopsDatabaseTest.java:24)at java.lang.reflect.Method.invokeNative(Native Method)at android.test.InstrumentationTestCase.runMethod(InstrumentationTestCase.java:191)at android.test.InstrumentationTestCase.runTest(InstrumentationTestCase.java:181)at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:164)at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:151)at android.test.InstrumentationTestRunner.onStart(InstrumentationTestRunner.java:425)at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1520)The following information appears in LogCat.02-21 11:52:16.204: ERROR/Database(1454): sqlite3_open_v2(""/data/data/com.kizoom.mybus.test/databases/MyStops"", &amp;handle, 6, NULL) failed02-21 11:52:16.204: ERROR/SQLiteOpenHelper(1454): Couldn't open MyStops for writing (will try read-only):02-21 11:52:16.204: ERROR/SQLiteOpenHelper(1454): android.database.sqlite.SQLiteException: unable to open database file02-21 11:52:16.204: ERROR/SQLiteOpenHelper(1454):     at android.database.sqlite.SQLiteDatabase.dbopen(Native Method)02-21 11:52:16.204: ERROR/SQLiteOpenHelper(1454):     at android.database.sqlite.SQLiteDatabase.&lt;init&gt;(SQLiteDatabase.java:1584)02-21 11:52:16.204: ERROR/SQLiteOpenHelper(1454):     at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:638)</code></pre><p>Does anybody know why this would fail?</p>","626493","","559070","","2011-02-23 09:02:11","2012-10-03 07:30:08","cannot open database in android test app","<android>","3","1","4","",""
"5088805","1","","","2011-02-23 09:01:02","0","76","<p>I have three TableLayouts in my xml file which are enclosed in ViewFlipper.When i add layout_weight to only tablelayout it is working fine..But If i include ViewFlipper above tablelayout it is not working the way it should have been with only tablelayout.What should i do to avoid this????Thanks in advance</p>","622630","","","","","2011-02-23 09:01:02","Question related to Layout_weight in android","<android>","0","2","","",""
"5088823","1","","","2011-02-23 09:03:49","1","1402","<p>does anybody know how to serialize and deserialize a list of object arrays with flexjson?</p><p>What I have tried is this: </p><pre><code>@GET @Produces(MediaType.APPLICATION_JSON)@Path(""/getAllGeoData"")public String getAllGeoData(){    List&lt;Object[]&gt;l = geoMapService.getAllGeoData();    return new JSONSerializer().serialize(l);}</code></pre><p>Okay .. this works and when I call this webservice I get the following result: </p><p>[[50.0830292,8.2387331],[50.0830292,8.2387331],[50.0752003,8.2397125]]</p><p>In my Android Client I try to deserialize that List of Objects:</p><pre><code>List&lt;Object[]&gt; l=new  JSONDeserializer&lt;List&lt;Object[]&gt;&gt;().deserialize(jsonstring);</code></pre><p>and I get the following execption:</p><pre><code>02-23 09:45:30.911: WARN/dalvikvm(270): VFY: unable to resolve exception class 157 (Ljava/beans/IntrospectionException;)02-23 09:45:30.921: WARN/dalvikvm(270): VFY: unable to resolve exception class 157 (Ljava/beans/IntrospectionException;)02-23 09:45:30.921: WARN/dalvikvm(270): VFY: unable to find exception handler at addr 0x16a02-23 09:45:30.921: WARN/dalvikvm(270): VFY:  rejected Lflexjson/ObjectBinder;.bindIntoObject (Ljava/util/Map;Ljava/lang/Object;Ljava/lang/reflect/Type;)Ljava/lang/Object;02-23 09:45:30.921: WARN/dalvikvm(270): VFY:  rejecting opcode 0x0d at 0x016a02-23 09:45:30.931: WARN/dalvikvm(270): VFY:  rejected Lflexjson/ObjectBinder;.bindIntoObject (Ljava/util/Map;Ljava/lang/Object;Ljava/lang/reflect/Type;)Ljava/lang/Object;02-23 09:45:30.931: WARN/dalvikvm(270): Verifier rejected class Lflexjson/ObjectBinder;02-23 09:45:30.941: WARN/dalvikvm(270): threadid=15: thread exiting with uncaught exception (group=0x4001b188)02-23 09:45:30.941: ERROR/AndroidRuntime(270): Uncaught handler: thread Thread-8 exiting due to uncaught exception02-23 09:45:30.951: ERROR/AndroidRuntime(270): java.lang.VerifyError: flexjson.ObjectBinder02-23 09:45:30.951: ERROR/AndroidRuntime(270):     at flexjson.JSONDeserializer.createObjectBinder(JSONDeserializer.java:169)02-23 09:45:30.951: ERROR/AndroidRuntime(270):     at flexjson.JSONDeserializer.deserialize(JSONDeserializer.java:149)02-23 09:45:30.951: ERROR/AndroidRuntime(270):     at com.mobilesociato.services.RemoteServiceGeoData$GeoDataThread.run(RemoteServiceGeoData.java:76)02-23 09:45:30.951: ERROR/AndroidRuntime(270):     at java.lang.Thread.run(Thread.java:1096)</code></pre><p>Help would be appreciated</p><p>Greetings</p>","497419","","750987","","2012-01-07 08:01:58","2012-01-07 08:01:58","How to serialize and deserialize list of object arrays with flexjson?","<java><android><json><web-services><flexjson>","1","0","","",""
"5088827","1","5089217","","2011-02-23 09:04:28","0","452","<p>I'm developing an application about a local guide, this app has audios/videos.</p><p>After the installation i want to move these media resources to the external storage. How can i do that?</p><p>I want to avoid the ""Android Move To SD Card Feature"" if its possible.</p><p>If I use the <code>/resource/</code> folder (with <code>/res/raw/</code> I think it's impossible) <strong>can I move the files to SD Card and after delete them from the internal memory? How?</strong></p><p>Other way?</p><p>Thanks.</p><p>I see a similar question in stackoverflow (<a href=""http://stackoverflow.com/questions/3851712/android-how-to-create-a-directory-on-the-sd-card-and-copy-files-from-res-raw-to"">link</a>) but it's not exactly the same, and the there's no solution.</p>","584249","","","","","2011-02-23 09:47:13","How to move files to ExternalStorage after APK installation?","<android><memory-leaks>","1","0","","",""
"5088853","1","5091607","","2011-02-23 09:07:24","0","329","<p>i want to add audio control in my layout as available at <a href=""https://market.android.com/details?id=com.faithcomesbyhearing.android.bibleis&amp;feature=search_result"" rel=""nofollow"">https://market.android.com/details?id=com.faithcomesbyhearing.android.bibleis&amp;feature=search_result</a></p><p>is he used image or there is some inbuilt audio control which i can use ?</p>","512973","","","","","2011-02-23 13:35:05","audio control in layout","<android><android-ui>","1","0","","",""
"5088856","1","","","2011-02-23 09:07:54","8","3729","<p>What I would like to do:</p><ul><li>Detect the current layout orientation of the device (Portrait, Landscape-Left, Portrait(upside down), Landscape-Right)</li><li>Differentiate between the two possible landscape modes (leaning on the left side, leaning on the right side)</li><li>Support devices that have landscape as their natural state (<a href=""http://www.motorola.com/Consumers/US-EN/Consumer-Product-and-Services/Mobile-Phones/MOTOROLA-CHARM-with-MOTOBLUR-US-EN"">for example</a>, <a href=""http://android-developers.blogspot.com/2010/09/one-screen-turn-deserves-another.html"">discussed here</a>)</li><li>Support &lt; 2.2 (can't use <a href=""http://developer.android.com/reference/android/view/Display.html#getRotation%28%29"">getRotation()</a>)</li></ul><p>Just to clarify, I want to know what orientation the layout is currently in.  Which direction is the bottom of the layout?  Is it in portrait?  Is it in landscape?  Is the landscape left or right? etc.</p><p>The closest I can find is <a href=""http://developer.android.com/reference/android/content/res/Configuration.html#orientation"">Activity.getResources().getConfiguration().orientation</a>, but it only returns three possible values. ORIENTATION_LANDSCAPE, ORIENTATION_PORTRAIT, or ORIENTATION_SQUARE.  It does not say which type of landscape.</p><p>So, then I thought, well if I can get the orientation value (like 90, 180, 270, etc)  of the device and compare it to the above config value I could figure it out. For example, if the config value was ORIENTATION_LANDSCAPE and the orientation was 270, I could tell that it was in the reverse landscape mode.  However, there doesn't appear to be an easy way to get the orientation value.  I could implement an <a href=""http://developer.android.com/reference/android/view/OrientationEventListener.html"">OrientationEventListener</a>, but that seems overkill since I just need to get the value once at a specific time, not constantly.</p><p>There are two values in the Display class but <a href=""http://developer.android.com/reference/android/view/Display.html#getOrientation%28%29"">getOrientation</a> is deprecated and <a href=""http://developer.android.com/reference/android/view/Display.html#getRotation%28%29"">getRotation</a> is only available for 2.2 and above.</p><p>Now, even if I did get this value, there is still the issue of devices that are naturally landscape. Meaning their 0 value would be landscape instead of portrait.  So I also need a sure way to tell which (landscape-left, landscape-right or portrait) corresponds to 0.</p><p>There are a lot of posts on SO about orientation and similar issues, but I haven't seen any that take all of these issues into consideration.  Has anyone figured this out?</p><p>When all is said and done I would like something like Activity.getResources().getConfiguration().orientation but be able to tell which landscape mode it is.</p>","445348","","","","","2013-12-07 21:10:04","How to detect landscape left (normal) vs landscape right (reverse) with support for naturally landscape devices?","<android><rotation><orientation><landscape>","2","0","1","",""
"5088973","1","","","2011-02-23 09:22:11","1","1832","<p>I need to write an activity tht should open Fax screen in Android Application.</p>","629872","","179850","","2011-03-03 13:15:13","2011-03-03 13:15:13","How Send fax from Android device","<android>","2","0","1","",""
"5089001","1","","","2011-02-23 09:25:22","0","718","<p>I want to play mp3 radio stream using Android MediaPlayer via http protocol. From time to time [1 playing of 5 - that is actually quite often] I receive PVMFFailure like this:</p><pre><code>02-23 02:05:23.503: ERROR/PlayerDriver(91): Command PLAYER_INIT completed with an error or info PVMFFailure02-23 02:05:23.503: ERROR/MediaPlayer(2111): error (1, -1)02-23 02:05:23.533: ERROR/MediaPlayer(2111): stop called in state 002-23 02:05:23.533: ERROR/MediaPlayer(2111): error (-38, 0)</code></pre><p>There is no solution here or on google, so please if you do know how to debug this, please help :)</p><p>Here is my code for player:</p><pre><code> //start MediaPlayer player = new MediaPlayer(); player.setAudioStreamType(AudioManager.STREAM_MUSIC); player.setDataSource(address); player.prepare(); player.start(); //stop player.stop(); player.reset();</code></pre><p>I`m using Android 2.2 API. Thanks!</p>","620649","","","","","2011-08-15 09:37:21","android media player - PVMFFailure on mp3 http radio stream","<android><stream><media-player><radio>","1","0","1","",""
"5089020","1","","","2011-02-23 09:27:25","1","4665","<p>Here is my code:</p><p>1st activity::</p><pre><code>public class ImageExercise extends Activity {    /** Called when the activity is first created. */    public static int pos;    //static int[] mThumbIds;    //public static int[] mThumbIds;    @Override    public void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.image);        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) {                Intent intent = new Intent(ImageExercise.this,FullImage.class);                pos=position;                intent.putExtra(""pos"", pos);                startActivity(intent);                //finish();            }        });    }}class ImageAdapter extends BaseAdapter {    static int[] mThumbIds = {        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_8,        R.drawable.sample_9,R.drawable.sample_1,         R.drawable.sample_2,R.drawable.sample_3,        R.drawable.sample_4, R.drawable.sample_9,        R.drawable.sample_5, R.drawable.sample_6,        R.drawable.sample_7, R.drawable.sample_8    };    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;        }        /* ImageExercise obj = new ImageExercise();        obj.pos = position;*/        imageView.setImageResource(mThumbIds[position]);        return imageView;    }    // references to our images}</code></pre><p>2nd Activity::</p><pre><code>package com.ex.dp;import android.app.Activity;import android.os.Bundle;import android.widget.ImageView;public class FullImage extends Activity {    @Override    public void onCreate(Bundle savedInstanceState) {        //super.onCreate(savedInstanceState);        setContentView(R.layout.fullimage);        Bundle bundle= getIntent().getExtras();        ImageView image = (ImageView) findViewById(R.id.imageView1);        int pos = bundle.getInt(""pos"");        ImageAdapter obj = new ImageAdapter(this);        image.setImageResource(obj.mThumbIds[pos]);        /*if(pos==0)          {              image.setImageResource(pos);          }*/    }}</code></pre><p>Plz help me out</p>","617356","","496830","","2011-03-03 06:48:18","2011-03-03 06:48:18","I'm getting a SuperNotCalledException in my logcat","<android>","2","2","0","",""
"5089042","1","5089188","","2011-02-23 09:29:06","18","16081","<p>when I am signing the apk, I get ""jarsigner: unable to sign jar: java.util.zip.ZipException: invalid entry compressed size (expected 463 but got 465 bytes)"" this error message. The apk size is almost 1MB. When I reduce the size to 500KB, signing success. Why this so?..Any Idea?</p>","536091","","","","","2013-09-24 11:38:11","jarsigner: unable to sign jar: java.util.zip.ZipException: invalid entry compressed size (expected 463 but got 465 bytes)","<android>","4","0","5","",""
"5089122","1","","","2011-02-23 09:37:13","0","111","<p>Hot To Create A Table in database only once and insert data into that table multiple times in android using SQLite DB...??</p>","629891","","488433","","2011-02-23 10:15:37","2011-03-09 05:31:37","Regarding Android Database","<java><android><database><sqlite>","3","1","","",""
"5089174","1","5089307","","2011-02-23 09:42:43","0","302","<p>I am useing custom ListView and for each row of data I want to add specific Id to address it and work with it further. Is there any way, how to set Id in XML file something like @+id/idImageView +i, where i is i++? Is there any way?</p><p>Thanks</p>","513956","","","","","2011-02-23 17:24:34","Android - ID used dynamically","<android>","2","0","","",""
"5089184","1","5343432","","2011-02-23 09:43:38","4","5894","<p>I'm quite new to android dev and would like to know, how can I choose the current theme of the phone. I'm developing on the Galaxy Tab and the current theme is a nice white one (if I go into the settings menu for example). But the default theme in the sdk seems to be Android.Black.</p><p>I would prefer not to hardcode any choice and let the app use whichever one is chosen on the phone/tab...</p>","11421","","","","","2011-03-17 18:20:48","How to choose current theme on android","<android>","1","0","2","",""
"5089208","1","5379226","","2011-02-23 09:46:02","4","6359","<p>I am developing an Application using Phonegap on Android. Everything works fine on OS 2.1 but on OS 2.2 when we click on any input type text field the keyboard appears and whole window moves to UP side and the input type field becomes invisible. Can anybody tell me what exactly be the problem and can it be solved using javascript? How to stop windows resizing functionality on Android 2.2?</p><p>I found the same problem on <a href=""http://stackoverflow.com/questions/4305079/text-input-on-android-phone-is-not-in-view-when-the-keyboard-for-webview-comes-up"">Text Input on android phone is not in view when the keyboard for webview comes up?</a> also, but not the solution.</p>","202461","","202461","","2011-02-24 11:29:01","2014-01-23 17:14:31","Android 2.2 Web View windows moves up when Virtual Keyboard appears","<javascript><android><scrolling><phonegap>","5","0","5","",""
"5089300","1","5089424","","2011-02-23 09:56:12","19","67110","<p>I have just started learning android. And i don't know How can I change the image of an <code>ImageView</code>? ie it has some Image which was set in the layout but i want to change that image through coding how should i do it ?</p><p>Here is the xml file</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=""#cc8181"" &gt;&lt;ImageView  android:id=""@+id/image""  android:layout_width=""50dip""  android:layout_height=""fill_parent""   android:src=""@drawable/icon""  android:layout_marginLeft=""3dip""  android:scaleType=""center""/&gt;</code></pre><p></p><p>thanks for replying.</p>","626122","","626122","","2013-11-11 04:14:48","2014-01-27 05:30:20","How can I change the image of an ImageView?","<android><android-imageview>","3","1","1","",""
"5089351","1","5090450","","2011-02-23 10:00:51","0","9454","<p>Hey I'm trying this code to get connected to Google maps by passing source and destination co-ordinates to this URL and receive a <code>KML</code> file. However I'm not able to parse or get connected to this URL.</p><p>Can anybody see where I'm going wrong?</p><pre><code>public class RoutePath extends MapActivity {    MapView mapView;    GeoPoint gp1,gp2;    MapController mc;    public class MyOverLay extends Overlay {        private int mRadius=6;        private int mode=0;        private int defaultColor;        private String text="""";        private Bitmap img = null;        public MyOverLay() {        }        public MyOverLay(GeoPoint p1,GeoPoint p2,int mode) { // GeoPoint is a int. (6E)            gp1 = p1;            gp2 = p2;            this.mode = mode;            defaultColor = 999; // no defaultColor        }        public MyOverLay(GeoPoint p1,GeoPoint p2,int mode, int defaultColor) {            gp1 = p1;            gp2 = p2;            this.mode = mode;            this.defaultColor = defaultColor;        }        public void setText(String t) {            this.text = t;        }        public void setBitmap(Bitmap bitmap) {            this.img = bitmap;        }        public int getMode() {            return mode;        }        @Override        public boolean draw(Canvas canvas, MapView mapView, boolean shadow, long when) {            super.draw(canvas, mapView, shadow);               Point screenPts = new Point();            mapView.getProjection().toPixels(gp1, screenPts);            Bitmap bmp = BitmapFactory.decodeResource(            getResources(), R.drawable.pushpin);                        canvas.drawBitmap(bmp, screenPts.x, screenPts.y-50, null);             return true;        }        public boolean onTouchEvent(MotionEvent event, MapView mapView) {            // when user lifts his finger             if (event.getAction() == 1) {                Toast.makeText(getBaseContext(),""Distance"", Toast.LENGTH_SHORT).show();                 GeoPoint gp2 = mapView.getProjection().fromPixels(                (int) event.getX(),                (int) event.getY());                Toast.makeText(getBaseContext(), gp2.getLatitudeE6() / 1E6 + "","" + gp2.getLongitudeE6() /1E6 , Toast.LENGTH_SHORT).show();                double src_lat = 19.0552; // the testing source                double src_long =  72.8308;                //double dest_lat = 19.0800; // the testing destination                //double dest_long = 72.8545;                double dest_lat = gp2.getLatitudeE6()  / 1E6; // the testing destination                double dest_long = gp2.getLongitudeE6() /1E6;                GeoPoint gp1 = new GeoPoint((int) (src_lat * 1E6),(int) (src_long * 1E6));                DrawPath(gp1, gp2, Color.GREEN, mapView);            }            return true;        }    }    /** 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.myMapView1);        LinearLayout zoom = (LinearLayout)findViewById(R.id.myMapView);          View zoomView = mapView.getZoomControls();        double src_lat = 19.0552; // the testing source        double src_long =  72.8308;        gp1 = new GeoPoint(        (int) (src_lat * 1E6),         (int) (src_long * 1E6));        MyOverLay mapOverlay = new MyOverLay();        List&lt;Overlay&gt; listOfOverlays = mapView.getOverlays();        listOfOverlays.clear();        listOfOverlays.add(mapOverlay);        mapView.invalidate();        mc = mapView.getController();        mc.animateTo(gp1);        mc.setZoom(17);         mapView.invalidate();        mapView.getController().animateTo(gp1);        mapView.getController().setZoom(15);    }    private void DrawPath(GeoPoint src,GeoPoint dest, int color, MapView mMapView01) {        //Toast.makeText(getBaseContext(),""Drawpath initialized"", Toast.LENGTH_SHORT).show();         // connect to map web service        StringBuilder urlString = new StringBuilder();        urlString.append(""http://maps.google.com/maps?f=d&amp;hl=en"");        urlString.append(""&amp;saddr="");//from        urlString.append( Double.toString((double)src.getLatitudeE6()/1.0E6 ));        urlString.append("","");        urlString.append( Double.toString((double)src.getLongitudeE6()/1.0E6 ));        urlString.append(""&amp;daddr="");//to        urlString.append( Double.toString((double)dest.getLatitudeE6()/1.0E6 ));        urlString.append("","");        urlString.append( Double.toString((double)dest.getLongitudeE6()/1.0E6 ));        urlString.append(""&amp;ie=UTF8&amp;0&amp;om=0&amp;output=kml"");        //Toast.makeText(getBaseContext(),urlString, Toast.LENGTH_LONG).show();         Log.d(""xxx"",""URL=""+urlString.toString());        // get the kml (XML) doc. And parse it to get the coordinates(direction route).        Document doc = null;        HttpURLConnection urlConnection= null;        URL url = null;        try {             url = new URL(urlString.toString());            urlConnection=(HttpURLConnection)url.openConnection();            urlConnection.setRequestMethod(""GET"");            urlConnection.setDoOutput(true);            urlConnection.setDoInput(true);            //Toast.makeText(getBaseContext(),""connected"", Toast.LENGTH_SHORT).show();            urlConnection.connect();             //Toast.makeText(getBaseContext(),""connected"", Toast.LENGTH_SHORT).show();             DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();            DocumentBuilder db = dbf.newDocumentBuilder();            doc = db.parse(urlConnection.getInputStream());             if(doc.getElementsByTagName(""GeometryCollection"").getLength()&gt;0) {                //String path = doc.getElementsByTagName(""GeometryCollection"").item(0).getFirstChild().getFirstChild().getNodeName();                String path = doc.getElementsByTagName(""GeometryCollection"").item(0).getFirstChild().getFirstChild().getFirstChild().getNodeValue();                Log.d(""xxx"",""path=""+ path);                String [] pairs = path.split("" "");                 String[] lngLat = pairs[0].split("",""); // lngLat[0]=longitude lngLat[1]=latitude lngLat[2]=height                // src                GeoPoint startGP = new GeoPoint((int)(Double.parseDouble(lngLat[1])*1E6),(int)(Double.parseDouble(lngLat[0])*1E6));                mMapView01.getOverlays().add(new MyOverLay(startGP,startGP,1));                GeoPoint gp1;                GeoPoint gp2 = startGP;                 for(int i=1;i&lt;pairs.length;i++) { // the last one would be crash                    lngLat = pairs[i].split("","");                    gp1 = gp2;                    // watch out! For GeoPoint, first:latitude, second:longitude                    gp2 = new GeoPoint((int)(Double.parseDouble(lngLat[1])*1E6),(int)(Double.parseDouble(lngLat[0])*1E6));                    mMapView01.getOverlays().add(new MyOverLay(gp1,gp2,2,color));                    Log.d(""xxx"",""pair:"" + pairs[i]);                }                mMapView01.getOverlays().add(new MyOverLay(dest,dest, 3)); // use the default color            }         }        catch (MalformedURLException e) {            e.printStackTrace();        }        catch (IOException e) {            e.printStackTrace();        }        catch (ParserConfigurationException e) {            e.printStackTrace();        }        catch (SAXException e) {            e.printStackTrace();        }    }    @Override    protected boolean isRouteDisplayed() {        // TODO Auto-generated method stub        return true;    }}</code></pre><p>I have gone through all the suggested links n answers and have come to this stage wherein i am able to calculate distance but can not draw route, all i can get is a straight line between the last two points of the kml filehere is my code.....kindly lemme know how can i overcome this as i have to draw the complete travelling route from source to destination.</p><pre><code>public class RoutePath extends MapActivity {GeoPoint gp1;GeoPoint gp2;GeoPoint srcGeoPoint;GeoPoint destGeoPoint;double distance;public class MyOverLay extends com.google.android.maps.Overlay{    private int mRadius=6;    private int mode=0;    private int defaultColor;    public MyOverLay()    {    }    public MyOverLay(GeoPoint p1,GeoPoint p2,int mode) // GeoPoint is a int. (6E)    {        gp1 = p1;        gp2 = p2;        this.mode = mode;        defaultColor = 999; // no defaultColor    }    public MyOverLay(GeoPoint p1,GeoPoint p2,int mode, int defaultColor)    {        gp1 = p1;        gp2 = p2;        this.mode = mode;        this.defaultColor = defaultColor ;    }    public int getMode()    {        return mode;    }    @Override    public boolean draw(Canvas canvas, MapView mapView, boolean shadow, long when)    {        Projection projection = mapView.getProjection();        if (shadow == false)        {            Paint paint = new Paint();            paint.setAntiAlias(true);            Point point = new Point();            projection.toPixels(gp1, point);            // mode=1&amp;#65306;start            if(mode==1)            {                if(defaultColor==999)                    paint.setColor(Color.RED);                //Toast.makeText(getBaseContext(), ""mode1"", Toast.LENGTH_SHORT).show();                else                    paint.setColor(defaultColor);                RectF oval=new RectF(point.x - mRadius, point.y - mRadius,point.x + mRadius, point.y + mRadius);                // start point                canvas.drawOval(oval, paint);            }            // mode=2&amp;#65306;path            if(mode==2)            {                if(defaultColor==999)                    paint.setColor(Color.RED);                //Toast.makeText(getBaseContext(), ""mode2"", Toast.LENGTH_SHORT).show();                else                paint.setColor(defaultColor);                Point point2 = new Point();                projection.toPixels(gp2, point2);                paint.setStrokeWidth(5);                paint.setAlpha(120);                canvas.drawLine(point.x, point.y, point2.x,point2.y, paint);            }            /* mode=3&amp;#65306;end */            else if(mode==3)            {                //the last path                 if(defaultColor==999)                    {paint.setColor(Color.BLUE);                Toast.makeText(getBaseContext(), ""mode3"", Toast.LENGTH_SHORT).show();}                else                    paint.setColor(defaultColor);                Point point2 = new Point();                projection.toPixels(gp2, point2);                paint.setStrokeWidth(5);                paint.setAlpha(120);                canvas.drawLine(point.x, point.y, point2.x,point2.y, paint);                RectF oval=new RectF(point2.x - mRadius,point2.y - mRadius,point2.x + mRadius,point2.y + mRadius);                                      paint.setAlpha(255);                canvas.drawOval(oval, paint);            }        }        return super.draw(canvas, mapView, shadow, when);    }    @Override    public boolean onTouchEvent(MotionEvent event, MapView mapView)     {           //---when user lifts his finger---        if (event.getAction() == 1)        {                            GeoPoint destGeoPoint = mapView.getProjection().fromPixels(                (int) event.getX(),                (int) event.getY());            Toast.makeText(getBaseContext(),                     destGeoPoint.getLatitudeE6() / 1E6 + "","" +                     destGeoPoint.getLongitudeE6() /1E6 ,                     Toast.LENGTH_SHORT).show();           double src_lat = 19.0552; // the testing source            double src_long =  72.8308;            double dest_lat = destGeoPoint.getLatitudeE6()  / 1E6; // the testing destination            double dest_long = destGeoPoint.getLongitudeE6() /1E6;            gp1 = new GeoPoint((int) (src_lat * 1E6),(int) (src_long * 1E6));            gp2 = new GeoPoint((int) (dest_lat * 1E6),(int) (dest_long * 1E6));            Geocoder geoCoder = new Geocoder(                    getBaseContext(), Locale.getDefault());                try {                    List&lt;Address&gt; addresses = geoCoder.getFromLocation(                        gp2.getLatitudeE6()  / 1E6,                         gp2.getLongitudeE6() / 1E6, 1);                    String add = """";                    if (addresses.size() &gt; 0)                     {                        for (int i=0; i&lt;addresses.get(0).getMaxAddressLineIndex();                              i++)                           add += addresses.get(0).getAddressLine(i) + ""\n"";                    }                    Toast.makeText(getBaseContext(), add, Toast.LENGTH_SHORT).show();                   DrawPath(gp1, gp2 , Color.GREEN, mapView);                 }                catch (IOException e) {                                    e.printStackTrace();                }                   return true;        }        else                                          return false;    }  }/** Called when the activity is first created. */MapView mapView;@Overridepublic void onCreate(Bundle savedInstanceState){    super.onCreate(savedInstanceState);    setContentView(R.layout.main);    MapView mapView = (MapView) findViewById(R.id.myMapView1);    mapView.setBuiltInZoomControls(true);    double src_lat = 19.0552; // the testing source    double src_long =  72.8308;    gp1 = new GeoPoint(            (int) (src_lat * 1E6),             (int) (src_long * 1E6));    MyOverLay mapOverlay = new MyOverLay();        List&lt;Overlay&gt; listOfOverlays = mapView.getOverlays();        listOfOverlays.clear();        listOfOverlays.add(mapOverlay);    mapView.invalidate();    mapView.setSatellite(true);    mapView.getController().animateTo(gp1);    mapView.getController().setZoom(15);}@Overrideprotected boolean isRouteDisplayed() {// TODO Auto-generated method stub    return true;}private void DrawPath(GeoPoint src,GeoPoint dest, int color, MapView mMapView01){    double distance1=0;    // connect to map web service    StringBuilder urlString = new StringBuilder();    urlString.append(""http://maps.google.com/maps?f=d&amp;hl=en"");    urlString.append(""&amp;saddr="");//from    urlString.append( Double.toString((double)src.getLatitudeE6()/1.0E6 ));    urlString.append("","");    urlString.append( Double.toString((double)src.getLongitudeE6()/1.0E6 ));    urlString.append(""&amp;daddr="");//to    urlString.append( Double.toString((double)dest.getLatitudeE6()/1.0E6 ));    urlString.append("","");    urlString.append( Double.toString((double)dest.getLongitudeE6()/1.0E6 ));    urlString.append(""&amp;ie=UTF8&amp;0&amp;om=0&amp;output=kml"");    Log.d(""xxx"",""URL=""+urlString.toString());    // get the kml (XML) doc. And parse it to get the coordinates(direction route).    Document doc = null;    HttpURLConnection urlConnection= null;    URL url = null;    try    {         url = new URL(urlString.toString());        urlConnection=(HttpURLConnection)url.openConnection();        urlConnection.setRequestMethod(""GET"");        urlConnection.setDoOutput(true);        urlConnection.setDoInput(true);        // Toast.makeText(getBaseContext(), ""Before Connection"", Toast.LENGTH_SHORT).show();        urlConnection.connect();         // Toast.makeText(getBaseContext(), ""After Connection"", Toast.LENGTH_SHORT).show();        DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();        DocumentBuilder db = dbf.newDocumentBuilder();        doc = db.parse(urlConnection.getInputStream());         if(doc.getElementsByTagName(""GeometryCollection"").getLength()&gt;0)        {            String path = doc.getElementsByTagName(""GeometryCollection"").item(0).getFirstChild().getFirstChild().getFirstChild().getNodeValue() ;            Log.d(""xxx"",""path=""+ path);            String [] pairs = path.split("" "");             String[] lngLat = pairs[0].split("",""); // lngLat[0]=longitude lngLat[1]=latitude lngLat[2]=height            // src            GeoPoint startGP = new GeoPoint((int)(Double.parseDouble(lngLat[1])*1E6),(int)(Double.parseDouble(lngLat[0])*1E6));            //mMapView01.getOverlays().add(new MyOverLay(src,src,1));            GeoPoint gp1;            GeoPoint gp2 = startGP;            //Toast.makeText(getBaseContext(), ""Before Connection"", Toast.LENGTH_SHORT).show();            for(int i=1;i&lt;pairs.length;i++) // the last one would be crash            {                Location locationA = new Location(""Point A"");                locationA.setLatitude(startGP.getLatitudeE6()/1E6);                locationA.setLongitude(startGP.getLongitudeE6()/1E6);                lngLat = pairs[i].split("","");                gp1 = gp2;                gp2 = new GeoPoint((int)(Double.parseDouble(lngLat[1])*1E6),(int)(Double.parseDouble(lngLat[0])*1E6));                mMapView01.getOverlays().add(new MyOverLay(gp1,gp2,2,color));                mMapView01.invalidate();                Location locationB = new Location(""Point B"");                locationB.setLatitude(gp2.getLatitudeE6()/1E6);                locationB.setLongitude(gp2.getLongitudeE6()/1E6);               distance1 = + locationA.distanceTo(locationB);                Log.d(""xxx"",""pair:"" + pairs[i]);            }            distance = distance1/1000;            if(distance&lt;= 5.00)            {Toast.makeText(getBaseContext(), ""DISTANCE = ""+ distance, Toast.LENGTH_SHORT).show();}            else            {Toast.makeText(getBaseContext(), ""Location out of range"",Toast.LENGTH_SHORT).show();}        }     }    catch (MalformedURLException e)    {        e.printStackTrace();    }    catch (IOException e)    {        e.printStackTrace();    }    catch (ParserConfigurationException e)    {        e.printStackTrace();    }    catch (SAXException e)    {        e.printStackTrace();    }}}</code></pre>","576605","","1231359","","2012-11-14 04:20:30","2012-11-14 04:20:30","to draw route on google maps, android","<android>","1","1","1","",""
"5089374","1","","","2011-02-23 10:03:28","1","388","<p>How do I open of Drafts folder of Gmail? I can open the inbox.</p>","629941","","646382","","2011-08-24 07:07:50","2011-08-24 07:07:50","How to open the Drafts folder of Gmail in Android when a list is clicked?","<android><gmail>","1","1","","",""
"5089407","1","","","2011-02-23 10:06:06","5","1328","<p>Does anyone know if there is a possibility to send from Android App GPS position to external navigation system in order to navigate to this position? </p><p><em>Example:</em></p><p><em>I have an application with gas stations in my country. In application I have GPS positions of gas stations stored. By clicking some button I want to go to some navigation map app and I want for user to be navigated by voice and map to this gas stasion.</em></p><p>I know about Google Maps navigation, but it is in beta and works in US, if I know correctly.</p><p>Do you know any Navigation Maps that support external input of position to navigate to?</p>","249819","","","","","2011-03-15 22:39:07","Send GPS position from Android App to external Navigation Map and navigate there by voice","<android>","1","0","1","",""
"5089468","1","5118824","","2011-02-23 10:13:20","0","468","<p>I have an EditTextPreference that I want to show to the user in two different PreferenceScreens. It is supposed to be the exact same preference (let the android:key be ""myEditText""), just shown on two different screens.So, here's what it could look like (totally stripped down to show you an example):</p><pre><code>&lt;PreferenceScreen xmlns:android=""http://schemas.android.com/apk/res/android""&gt;    &lt;PreferenceCategory android:title=""@string/someCategory""&gt;        &lt;PreferenceScreen android:key=""someScreen""&gt;            &lt;PreferenceScreen android:key=""someSubScreen""&gt;                &lt;PreferenceCategory android:title=""@string/someSubCategory""&gt;                    &lt;EditTextPreference android:key=""myEditText""                    ....                    /&gt;                &lt;/PreferenceCategory&gt;            &lt;/PreferenceScreen&gt;        &lt;/PreferenceScreen&gt;    &lt;/PreferenceCategory&gt;    &lt;PreferenceCategory android:title=""@string/someOtherCategory""&gt;        &lt;PreferenceScreen android:key=""someOtherScreen""&gt;            &lt;PreferenceScreen android:key=""someOtherSubScreen""&gt;                &lt;PreferenceCategory android:title=""@string/someOtherSubCategory""&gt;                    &lt;EditTextPreference android:key=""myEditText""                    ....                    /&gt;                &lt;/PreferenceCategory&gt;            &lt;/PreferenceScreen&gt;        &lt;/PreferenceScreen&gt;    &lt;/PreferenceCategory&gt;&lt;/PreferenceScreen&gt;</code></pre><p>When I go to myEditText via someScreen and enter a text, it is not shown when I go back and open myEditText via someOtherScreen. I have to close the preferences and open it again. Then, both EditTexts show the same text.</p><p>So, what would be the best way to have the exact same Preference on different screens?</p><p>/Edit:</p><p>Why do I want to do that, anyway?The first PreferenceScreen is all about URL shortening. You can set options for shortening, select / reorder services you want to use and enter user credentials for bit.ly, goo.gl etc.</p><p>The second screen is for file upload services where you can do the same (setting options for file upload, selecting / reordering services, entering user credentials for upload services). </p><p>Now I'm integrating CloudApp which is both, a file AND a URL shortening service. So, the user might be epecting to find it on the URL shortening screen but he might also look for it at the file upload screen. So, I want to make it easy for him and just show it on both screens. They are not top-level screens, it's quite a deep structure.</p><p>So, besides this making sense or not: Is it possible?</p>","388826","","388826","","2011-02-23 13:03:21","2011-02-25 15:07:46","Android: Using the same preference several times in a preferences xml","<android><xml><preferences><android-preferences><sharedpreferences>","1","2","","",""
"5089480","1","5090306","","2011-02-23 10:14:15","4","1130","<p>When using <a href=""http://developer.android.com/guide/developing/projects/projects-eclipse.html"" rel=""nofollow"">Android Library Project</a> does anyone have a good solution for version control for projects that utilise these librarys?</p><p>For example if I have two apps, say a free version and paid, or phone and tablet, or any other scenario, and i want them to use some shared library's which are contained in an Android Lib Project, how can i safely add these projects to SVN? As they are seperate projects I have no way i know off enforcing that when one is committed the other (library one) is also.</p><p>I am using Eclipse with the Subclipse SVN plugin, does anyone know if there is a way to link the projects so a commit on one will commit the other?</p><p>Any tips here would be welcome - as I am relatively new to SVN - so may be thinking about this in the wrong way :)</p><p>Thanks</p>","236743","","236743","","2011-03-04 09:25:00","2011-03-04 09:25:00","Version control and Android Library Projects","<android><eclipse><svn><subclipse>","2","0","1","",""
"5089518","1","","","2011-02-23 10:17:50","2","906","<p>I have WCF services hosted on server that needs to accept encrypted value from various mobile platforms like Windows Mobile, Symbian, Android, BlackBerry, iPhone etc.</p><p>I am unable to get the cross platform AES encryption implementation (most of the time I am getting Padding is invalid and cannot be removed error) for .NET and all other mobile platforms.</p><p>Anyone who had developed such encryption solution that will work for .NET, .NET CF, Android, Symbian, BlackBerry, iPhone etc?</p>","469838","","","","","2011-05-23 19:25:47","Cross Platform AES Encryption for .NET WCF, .NET CF, Android, Symbian","<.net><android><encryption><compact-framework><symbian>","2","0","","",""
"5089531","1","5089942","","2011-02-23 10:18:44","0","468","<p>I am making an app for Android which is based on a big tree structure in which I need to change the values of the nodes. Basically the structure is:</p><pre><code>private class Node {    Fields;    List of child nodes;}</code></pre><p>I need to alter the value of the fields in different activities, so I need to be able to see my structure from most of my activities. My first thought was to implement this as a class, make my tree and pass the tree from activity to activity. But having read up on this, it does not seem to be a good (possible?) idea. Obviously I need to be able to both get and set all the fields of all the nodes.</p><p>Besides this tree I need another structure consisting of complex types (classes) which needs to be just as visible as the tree.</p><p>I will create the structures on startup, reading the values from a file.</p><p>Can anyone tell me how I can accomplish this?</p><p>Thanks in advance, </p><p>LordJesus</p>","1928874","","","","","2011-02-23 10:57:21","Global tree structure in Android","<android><data-structures>","1","0","","",""
"5089570","1","5089605","","2011-02-23 10:22:34","2","11567","<p>I m using share to Facebook using the following url and load that url in web view but i cant able to type comments and also some time post button is also not working.</p><pre><code> http://www.facebook.com/sharer.php?u=xxx&amp;t=yyy&amp;refsrc=http://m.facebook.com/sharer.php</code></pre><p>Can any one provide good solution or an alternative for this (plz give example for using api for facebook share and wall post).</p><p>Thank you.</p>","510491","","","","","2011-09-25 17:31:41","Android Facebook Share and wall post using share url in Webview not working","<android><facebook><webview><share>","1","0","","",""
"5089578","1","5089694","","2011-02-23 10:23:23","6","8401","<p>While searching for an answer in google, it seems that I'm not the only one stuck with a problem that seems impossible to solve.</p><p>I've managed to create a WebView with a custom WebViewClient - this makes it possible for me to have a processdialog and show an error message if an URL couldn't be loaded.</p><p>But this creates a problem with JavaScript. The URL I'm loading has some JavaScript which changes some HTML elements CSS styles (showing or hiding element) or redirects to another location onclick - or maybe even want's to show an alert box. But by using the WebViewClient none of those are working.</p><p>This is how I load a page:</p><pre><code>public void loadUrl(String url){    final ProgressDialog dialog = ProgressDialog.show(myActivity.this, """",  getString(R.string.loading), true);            final WebView myWebView = (WebView) findViewById(R.id.webview);            myWebView.setVerticalScrollBarEnabled(false);            myWebView.setHorizontalScrollBarEnabled(false);            WebSettings webSettings = myWebView.getSettings();            webSettings.setJavaScriptEnabled(true);                                                     myWebView.setWebViewClient(new WebViewClient()             {                @Override                public boolean shouldOverrideUrlLoading(WebView view, String url)                 {                    Toast.makeText(myActivity.this, url, Toast.LENGTH_SHORT).show(); //Debugging purposes                if (url.endsWith("".mp4""))                 {                        Intent intent = new Intent(Intent.ACTION_VIEW);                        intent.setDataAndType(Uri.parse(url), ""video/mp4"");                        view.getContext().startActivity(intent);                  }                else                {                                                   view.loadUrl(url);                    }                    return true;                }                public void onPageFinished(WebView view, String url)                 {                    //Toast.makeText(myActivity.this, ""Oh no!"", Toast.LENGTH_SHORT).show();                    dialog.dismiss();                }                public void onReceivedError(WebView view, int errorCode, String description, String failingUrl)                 {                    Toast.makeText(myActivity.this, description, Toast.LENGTH_SHORT).show();                    String summary = ""&lt;html&gt;&lt;body&gt;&lt;strong&gt;"" + getString(R.string.lost_connection) + ""&lt;/body&gt;&lt;/html&gt;"";                    myWebView.loadData(summary, ""text/html"", ""utf-8"");                   }                           }); //End WebViewClient            myWebView.loadUrl(url);             }</code></pre><p>This could probably be done in a smarter way, but I'm new at both Java and Android development...</p><p>Is it possible for me to enable the JavaScript for the WebViewClient at all?Removing the WebViewClient solves the problem, but then I can't catch events when the page errors or is finished loading.</p>","486900","","","","","2011-02-23 10:55:03","Enabling general JavaScript in WebViewClient","<android><webview><webviewclient>","2","0","","",""
"5089658","1","","","2011-02-23 10:30:17","0","1007","<p>Hi frinedsI am getting large or big value from webservice.I am using sax parser parsing the value and add it in arraylist.from arraylist I am adding to tablelayout with scrollview at the I am getting out of memory error in android can anybody tell what i will do to  solve the issue ?  is there anyway to do increase heap size or free heap memory? can anybody tell which parsing is best for parsing large xml file?</p><p>I have nearly 7000 to 10000 record like article details title </p><p>any help would be appreciated</p><p>my stack trace </p><pre><code>II/dalvikvm-heap(  992): Clamp target GC heap from 16.810MB to 16.000MBD/dalvikvm(  992): GC freed 4148 objects / 272832 bytes in 386msI/dalvikvm-heap(  992): Forcing collection of SoftReferences for 8704-byte allocationI/dalvikvm-heap(  992): Clamp target GC heap from 16.810MB to 16.000MBD/dalvikvm(  992): GC freed 0 objects / 0 bytes in 353msE/dalvikvm-heap(  992): Out of memory on a 8704-byte allocation.I/dalvikvm(  992): ""main"" prio=5 tid=3 RUNNABLEI/dalvikvm(  992):   | group=""main"" sCount=0 dsCount=0 s=N obj=0x4001b268 self=0xbd00I/dalvikvm(  992):   | sysTid=992 nice=0 sched=0/0 cgrp=default handle=-1344001384I/dalvikvm(  992):   at android.view.ViewGroup.addInArray(ViewGroup.java:~1918)I/dalvikvm(  992):   at android.view.ViewGroup.addViewInner(ViewGroup.java:1879)I/dalvikvm(  992):   at android.view.ViewGroup.addView(ViewGroup.java:1756)I/dalvikvm(  992):   at android.widget.TableLayout.addView(TableLayout.java:418)I/dalvikvm(  992):   at android.view.ViewGroup.addView(ViewGroup.java:1713)I/dalvikvm(  992):   at android.widget.TableLayout.addView(TableLayout.java:400)I/dalvikvm(  992):   at android.view.ViewGroup.addView(ViewGroup.java:1693)I/dalvikvm(  992):   at android.widget.TableLayout.addView(TableLayout.java:391)I/dalvikvm(  992):   at com.inquest.HomeSearchArticle$HomeSearchTask.onPostExecute(HomeSearchArticle.java:199)I/dalvikvm(  992):   at com.inquest.HomeSearchArticle$HomeSearchTask.onPostExecute(HomeSearchArticle.java:1)I/dalvikvm(  992):   at android.os.AsyncTask.finish(AsyncTask.java:417)I/dalvikvm(  992):   at android.os.AsyncTask.access$300(AsyncTask.java:127)I/dalvikvm(  992):   at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:429)I/dalvikvm(  992):   at android.os.Handler.dispatchMessage(Handler.java:99)I/dalvikvm(  992):   at android.os.Looper.loop(Looper.java:123)I/dalvikvm(  992):   at android.app.ActivityThread.main(ActivityThread.java:4363)I/dalvikvm(  992):   at java.lang.reflect.Method.invokeNative(Native Method)I/dalvikvm(  992):   at java.lang.reflect.Method.invoke(Method.java:521)I/dalvikvm(  992):   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)I/dalvikvm(  992):   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)I/dalvikvm(  992):   at dalvik.system.NativeStart.main(Native Method)I/dalvikvm(  992):I/System.out(  992): ######out of memory error is###java.lang.OutOfMemoryErrorI/dalvikvm-heap(  992): Clamp target GC heap from 17.270MB to 16.000MBD/dalvikvm(  992): GC freed 8418 objects / 744936 bytes in 468msI/dalvikvm-heap(  992): Clamp target GC heap from 17.471MB to 16.000MBD/dalvikvm(  992): GC freed 8605 objects / 481136 bytes in 428msI/dalvikvm-heap(  992): Clamp target GC heap from 17.583MB to 16.000MBD/dalvikvm(  992): GC freed 5050 objects / 297248 bytes in 413msI/dalvikvm-heap(  992): Clamp target GC heap from 17.595MB to 16.000MBD/dalvikvm(  992): GC freed 1927 objects / 77160 bytes in 515msI/dalvikvm-heap(  992): Forcing collection of SoftReferences for 1028-byte allocationI/dalvikvm-heap(  992): Clamp target GC heap from 17.594MB to 16.000MBD/dalvikvm(  992): GC freed 79 objects / 1264 bytes in 495msE/dalvikvm-heap(  992): Out of memory on a 1028-byte allocation.I/dalvikvm(  992): ""main"" prio=5 tid=3 RUNNABLEI/dalvikvm(  992):   | group=""main"" sCount=0 dsCount=0 s=N obj=0x4001b268 self=0xbd00I/dalvikvm(  992):   | sysTid=992 nice=0 sched=0/0 cgrp=default handle=-1344001384I/dalvikvm(  992):   at android.text.StaticLayout.generate(StaticLayout.java:~138)I/dalvikvm(  992):   at android.text.StaticLayout.&lt;init&gt;(StaticLayout.java:97)I/dalvikvm(  992):   at android.text.StaticLayout.&lt;init&gt;(StaticLayout.java:54)I/dalvikvm(  992):   at android.text.StaticLayout.&lt;init&gt;(StaticLayout.java:45)I/dalvikvm(  992):   at android.widget.TextView.makeNewLayout(TextView.java:4914)I/dalvikvm(  992):   at android.widget.TextView.onMeasure(TextView.java:5176)I/dalvikvm(  992):   at android.view.View.measure(View.java:7964)I/dalvikvm(  992):   at android.widget.TableRow.getColumnsWidths(TableRow.java:308)I/dalvikvm(  992):   at android.widget.TableLayout.findLargestCells(TableLayout.java:497)I/dalvikvm(  992):   at android.widget.TableLayout.measureVertical(TableLayout.java:462)I/dalvikvm(  992):   at android.widget.TableLayout.onMeasure(TableLayout.java:428)I/dalvikvm(  992):   at android.view.View.measure(View.java:7964)I/dalvikvm(  992):   at android.widget.ScrollView.measureChildWithMargins(ScrollView.java:893)I/dalvikvm(  992):   at android.widget.FrameLayout.onMeasure(FrameLayout.java:245)I/dalvikvm(  992):   at android.widget.ScrollView.onMeasure(ScrollView.java:276)I/dalvikvm(  992):   at android.view.View.measure(View.java:7964)I/dalvikvm(  992):   at android.widget.RelativeLayout.measureChildHorizontal(RelativeLayout.java:569)I/dalvikvm(  992):   at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:361)I/dalvikvm(  992):   at android.view.View.measure(View.java:7964)I/dalvikvm(  992):   at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3023)I/dalvikvm(  992):   at android.widget.FrameLayout.onMeasure(FrameLayout.java:245)I/dalvikvm(  992):   at android.view.View.measure(View.java:7964)I/dalvikvm(  992):   at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3023)I/dalvikvm(  992):   at android.widget.FrameLayout.onMeasure(FrameLayout.java:245)I/dalvikvm(  992):   at android.view.View.measure(View.java:7964)I/dalvikvm(  992):   at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3023)I/dalvikvm(  992):   at android.widget.FrameLayout.onMeasure(FrameLayout.java:245)I/dalvikvm(  992):   at android.view.View.measure(View.java:7964)I/dalvikvm(  992):   at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3023)I/dalvikvm(  992):   at android.widget.FrameLayout.onMeasure(FrameLayout.java:245)I/dalvikvm(  992):   at android.view.View.measure(View.java:7964)I/dalvikvm(  992):   at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3023)I/dalvikvm(  992):   at android.widget.FrameLayout.onMeasure(FrameLayout.java:245)I/dalvikvm(  992):   at android.view.View.measure(View.java:7964)I/dalvikvm(  992):   at android.widget.RelativeLayout.measureChildHorizontal(RelativeLayout.java:569)I/dalvikvm(  992):   at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:361)I/dalvikvm(  992):   at android.view.View.measure(View.java:7964)I/dalvikvm(  992):   at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3023)I/dalvikvm(  992):   at android.widget.FrameLayout.onMeasure(FrameLayout.java:245)I/dalvikvm(  992):   at android.view.View.measure(View.java:7964)I/dalvikvm(  992):   at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3023)I/dalvikvm(  992):   at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:888)I/dalvikvm(  992):   at android.widget.LinearLayout.measureHorizontal(LinearLayout.java:619)I/dalvikvm(  992):   at android.widget.LinearLayout.onMeasure(LinearLayout.java:280)I/dalvikvm(  992):   at android.view.View.measure(View.java:7964)I/dalvikvm(  992):   at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3023)I/dalvikvm(  992):   at android.widget.FrameLayout.onMeasure(FrameLayout.java:245)I/dalvikvm(  992):   at android.view.View.measure(View.java:7964)I/dalvikvm(  992):   at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3023)I/dalvikvm(  992):   at android.widget.FrameLayout.onMeasure(FrameLayout.java:245)I/dalvikvm(  992):   at android.view.View.measure(View.java:7964)I/dalvikvm(  992):   at android.view.ViewRoot.performTraversals(ViewRoot.java:763)I/dalvikvm(  992):   at android.view.ViewRoot.handleMessage(ViewRoot.java:1633)I/dalvikvm(  992):   at android.os.Handler.dispatchMessage(Handler.java:99)I/dalvikvm(  992):   at android.os.Looper.loop(Looper.java:123)I/dalvikvm(  992):   at android.app.ActivityThread.main(ActivityThread.java:4363)I/dalvikvm(  992):   at java.lang.reflect.Method.invokeNative(Native Method)I/dalvikvm(  992):   at java.lang.reflect.Method.invoke(Method.java:521)I/dalvikvm(  992):   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)I/dalvikvm(  992):   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)I/dalvikvm(  992):   at dalvik.system.NativeStart.main(Native Method)I/dalvikvm(  992):D/AndroidRuntime(  992): Shutting down VMW/dalvikvm(  992): threadid=3: thread exiting with uncaught exception (group=0x4001b188)E/AndroidRuntime(  992): Uncaught handler: thread main exiting due to uncaught exceptionI/dalvikvm-heap(  992): Clamp target GC heap from 17.609MB to 16.000MBD/dalvikvm(  992): GC freed 289 objects / 10728 bytes in 407msI/dalvikvm-heap(  992): Forcing collection of SoftReferences for 938-byte allocationI/dalvikvm-heap(  992): Clamp target GC heap from 17.609MB to 16.000MBD/dalvikvm(  992): GC freed 0 objects / 0 bytes in 402msE/dalvikvm-heap(  992): Out of memory on a 938-byte allocation.I/dalvikvm(  992): ""main"" prio=5 tid=3 RUNNABLEI/dalvikvm(  992):   | group=""main"" sCount=0 dsCount=0 s=N obj=0x4001b268 self=0xbd00I/dalvikvm(  992):   | sysTid=992 nice=0 sched=0/0 cgrp=default handle=-1344001384I/dalvikvm(  992):   at java.lang.AbstractStringBuilder.enlargeBuffer(AbstractStringBuilder.java:~97)I/dalvikvm(  992):   at java.lang.AbstractStringBuilder.append0(AbstractStringBuilder.java:131)I/dalvikvm(  992):   at java.lang.StringBuffer.append(StringBuffer.java:273)I/dalvikvm(  992):   at java.io.StringWriter.write(StringWriter.java:138)I/dalvikvm(  992):   at java.io.PrintWriter.doWrite(PrintWriter.java:711)I/dalvikvm(  992):   at java.io.PrintWriter.write(PrintWriter.java:686)I/dalvikvm(  992):   at java.io.PrintWriter.write(PrintWriter.java:661)I/dalvikvm(  992):   at java.io.PrintWriter.write(PrintWriter.java:729)I/dalvikvm(  992):   at java.io.PrintWriter.print(PrintWriter.java:492)I/dalvikvm(  992):   at java.io.PrintWriter.println(PrintWriter.java:623)I/dalvikvm(  992):   at java.lang.Throwable.printStackTrace(Throwable.java:316)I/dalvikvm(  992):   at android.util.Log.getStackTraceString(Log.java:234)I/dalvikvm(  992):   at com.android.internal.os.RuntimeInit.crash(RuntimeInit.java:315)I/dalvikvm(  992):   at com.android.internal.os.RuntimeInit$UncaughtHandler.uncaughtException(RuntimeInit.java:76)I/dalvikvm(  992):   at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:887)I/dalvikvm(  992):   at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:884)I/dalvikvm(  992):   at dalvik.system.NativeStart.main(Native Method)I/dalvikvm(  992):I/dalvikvm-heap(  992): Clamp target GC heap from 17.614MB to 16.000MBD/dalvikvm(  992): GC freed 64 objects / 5424 bytes in 447msI/dalvikvm-heap(  992): Forcing collection of SoftReferences for 754-byte allocationI/dalvikvm-heap(  992): Clamp target GC heap from 17.614MB to 16.000MBD/dalvikvm(  992): GC freed 0 objects / 0 bytes in 440msE/dalvikvm-heap(  992): Out of memory on a 754-byte allocation.I/dalvikvm(  992): ""main"" prio=5 tid=3 RUNNABLEI/dalvikvm(  992):   | group=""main"" sCount=0 dsCount=0 s=N obj=0x4001b268 self=0xbd00I/dalvikvm(  992):   | sysTid=992 nice=0 sched=0/0 cgrp=default handle=-1344001384I/dalvikvm(  992):   at java.lang.AbstractStringBuilder.enlargeBuffer(AbstractStringBuilder.java:~97)I/dalvikvm(  992):   at java.lang.AbstractStringBuilder.append0(AbstractStringBuilder.java:131)I/dalvikvm(  992):   at java.lang.StringBuffer.append(StringBuffer.java:273)I/dalvikvm(  992):   at java.io.StringWriter.write(StringWriter.java:138)I/dalvikvm(  992):   at java.io.PrintWriter.doWrite(PrintWriter.java:711)I/dalvikvm(  992):   at java.io.PrintWriter.write(PrintWriter.java:686)I/dalvikvm(  992):   at java.io.PrintWriter.write(PrintWriter.java:661)I/dalvikvm(  992):   at java.io.PrintWriter.write(PrintWriter.java:729)I/dalvikvm(  992):   at java.io.PrintWriter.print(PrintWriter.java:492)I/dalvikvm(  992):   at java.io.PrintWriter.println(PrintWriter.java:623)I/dalvikvm(  992):   at java.lang.Throwable.printStackTrace(Throwable.java:316)I/dalvikvm(  992):   at android.util.Log.getStackTraceString(Log.java:234)I/dalvikvm(  992):   at com.android.internal.os.RuntimeInit.crash(RuntimeInit.java:323)I/dalvikvm(  992):   at com.android.internal.os.RuntimeInit$UncaughtHandler.uncaughtException(RuntimeInit.java:76)I/dalvikvm(  992):   at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:887)I/dalvikvm(  992):   at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:884)I/dalvikvm(  992):   at dalvik.system.NativeStart.main(Native Method)I/dalvikvm(  992):I/Process (   60): Sending signal. PID: 992 SIG: 3I/dalvikvm(  992): threadid=7: reacting to signal 3I/dalvikvm(  992): Wrote stack trace to '/data/anr/traces.txt'D/dalvikvm(   60): GC freed 13970 objects / 689880 bytes in 201ms</code></pre><p>Thanks</p>","426344","","426344","","2011-02-23 13:22:54","2011-02-23 13:22:54","memory issue in application in android","<android>","1","1","","",""
"5089667","1","5089777","","2011-02-23 10:31:08","3","4771","<p>how can we display a dialogbox on click of a button in android??</p>","620787","","","","","2012-06-26 09:32:07","displaying a dialogbox on click of a button in android","<android>","2","1","","",""
"5089668","1","5091367","","2011-02-23 10:31:14","0","3111","<p>OS: Android</p><p>Given: User has stated that they wish to remain connected to app's server to receive updates, etc.</p><p>Goal: To ensure that users are connected to app's server even when app is in background state.</p><p>Question: One problem has been occasional disconnects from the network. If a user loses data network connectivity (loss of 2G, 3G, WiFi) and then later regains connectivity, our app is left without a connection. I am currently trying to make use of <a href=""http://developer.android.com/reference/android/telephony/PhoneStateListener.html"" rel=""nofollow""><code>PhoneStateListener</code></a>'s in order to detect various network changes and thereby restart connectivity with the server when appropriate. On my Nexus One (2.1), I find that <code>onSignalStrengthsChanged</code> and <code>onDataConnectionStateChanged</code> aren't called except when the listeners are originally registered, but not afterwards. The listeners are registered inside of a Service so they are continuously listening as long as the Service is alive (which we can assume to be 'forever' for purposes of this question).  Has anyone else had any issues with listening to the state of the Data Connection? </p><p><code>onServiceStateChanged</code> seems to be the most reliable so far, but I wanted to know if people have had success with the other listeners as well.</p>","299080","","299080","","2011-02-23 13:06:55","2011-05-31 13:51:24","Detecting network connectivity on Android?","<android><networking><data><wifi><connectivity>","4","0","","",""
"5089695","1","5089795","","2011-02-23 10:34:06","0","496","<p>hi i'm new to android. i have one simple doubt. when we run any application the ddms window shows the file explorer containing data, mnt and system folders. what is it? they have any physical existence in the system? and how can we get its content? pls answer my question... TIA</p>","617302","","","","","2011-02-23 11:25:19","Relevance of file explore in DDMS android","<android><ddms>","1","0","","",""
"5089700","1","5089738","","2011-02-23 10:34:44","-2","279","<p>I want to develop an application made in android and work like <code>mirror</code>. So i want to make screen which have <code>silver tinge</code>.</p><p>thanks</p>","626122","","626122","","2011-06-25 13:15:24","2011-06-25 13:15:24","How to get silver tinge like screen ","<android>","3","2","0","",""
"5089727","1","5743509","","2011-02-23 10:37:11","3","9565","<p>Has anyone got the Graphical Layout working correctly in either Eclipse 3.5 or 3.6 when using a Sliding Drawer?  </p><p>I keep getting the following error in both:</p><p><strong><em>error!<br>ClassCastException: com.android.layoutlib.bridge.MockView cannot be cast to android.view.ViewGroupException details are logged in Window > Show View > Error LogThe following classes could not be found:- SlidingDrawer</strong></em>  </p><p>I get this error with my code and any example code you can find around:</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=""#8CB69C""&gt;    &lt;SlidingDrawer        android:id=""@+id/drawer""        android:layout_width=""fill_parent""        android:layout_height=""fill_parent""        android:handle=""@+id/handle""        android:content=""@+id/content""&gt;    &lt;ImageView        android:id=""@id/drawerhandle""        android:layout_width=""wrap_content""        android:layout_height=""wrap_content""        android:src=""@drawable/drawerhandle""/&gt;    &lt;/SlidingDrawer&gt;&lt;/FrameLayout&gt;  </code></pre><p>When I run the app on a device it works fine without any problems so it's got to be a problem with either Android SDK 8, Eclipse 3.5 and 3.6 or my workspace, I've know idea yet.  If it works fine for others then it's got to be something local.  </p><p>Here's the exception stack details:</p><pre><code>java.lang.ClassCastException: com.android.layoutlib.bridge.MockView cannot be cast to  android.view.ViewGroupat android.view.LayoutInflater.rInflate(LayoutInflater.java:619)at android.view.LayoutInflater.rInflate(LayoutInflater.java:621)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.common.rendering.LayoutLibrary.createLegacySession(LayoutLibrary.java:382)at com.android.ide.common.rendering.LayoutLibrary.createSession(LayoutLibrary.java:276)at com.android.ide.eclipse.adt.internal.editors.layout.gle2.GraphicalEditorPart.renderWithBridge(Unknown Source)at com.android.ide.eclipse.adt.internal.editors.layout.gle2.GraphicalEditorPart.renderWithBridge(Unknown Source)at com.android.ide.eclipse.adt.internal.editors.layout.gle2.GraphicalEditorPart.recomputeLayout(Unknown Source)at com.android.ide.eclipse.adt.internal.editors.layout.gle2.GraphicalEditorPart.activated(Unknown Source)at com.android.ide.eclipse.adt.internal.editors.layout.LayoutEditor.pageChange(Unknown Source)at org.eclipse.ui.part.MultiPageEditorPart.setActivePage(MultiPageEditorPart.java:1067)at org.eclipse.ui.forms.editor.FormEditor.setActivePage(FormEditor.java:607)at com.android.ide.eclipse.adt.internal.editors.AndroidXmlEditor.selectDefaultPage(Unknown Source)at com.android.ide.eclipse.adt.internal.editors.AndroidXmlEditor.addPages(Unknown Source)at org.eclipse.ui.forms.editor.FormEditor.createPages(FormEditor.java:138)at org.eclipse.ui.part.MultiPageEditorPart.createPartControl(MultiPageEditorPart.java:348)at org.eclipse.ui.internal.EditorReference.createPartHelper(EditorReference.java:670)at org.eclipse.ui.internal.EditorReference.createPart(EditorReference.java:465)at org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:595)at org.eclipse.ui.internal.EditorReference.getEditor(EditorReference.java:289)at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched(WorkbenchPage.java:2863)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:2640)at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2604)at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2438)at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:671)at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:664)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)</code></pre><p>Thanks in advance!!</p>","498468","","578594","","2011-02-23 11:02:36","2013-10-09 12:58:48","ClassCastException in Eclpse 3.5 and 3.6 when in Graphical Layout with a SlidingDrawer","<android><eclipse><slidingdrawer>","6","4","1","",""
"5089779","1","5090198","","2011-02-23 10:41:06","0","1299","<p>I would like play media (video) from a network stream(http) directly, hence so I have to somehow feed Android MediaPlayer with the data.</p><p>I have FileOutputStream outstream = new FileOutputStream(outputfile); which I write into the outputfile by outstream.write(buffer, 0, count);</p><p>Is there any API which takes stream as input....???.... Please help...</p>","569547","","569547","","2011-02-23 11:08:51","2011-02-23 11:23:20","Play media (video) from a network stream(http) directly","<java><android><http><media-player><fileoutputstream>","1","0","2","",""
"5089783","1","5093127","","2011-02-23 10:41:56","33","16181","<p>I have some C code for Android that does lots of low-level number crunching. I'd like to know what settings I should use (e.g. for my Android.mk and Application.mk) files so that the code produced will run on all current Android devices but also takes advantage of optimisations for specific chipsets. I'm looking for good default Android.mk and Application.mk settings to use and I want to avoid having to litter my C code with #ifdef branches.</p><p>For example, I'm aware that ARMv7 has floating point instructions and some ARMv7 chips support NEON instructions and that the default ARM supports neither of these. Is it possible to set flags so that I can build ARMv7 with NEON, ARMv7 without NEON and the default ARM build? I'm know how to do the latter two but not all 3. I'm cautious about what settings I use as I assume the current defaults are the safest settings and what risks other options have.</p><p>For GCC specific optimisation, I'm using the following flags:</p><pre><code>LOCAL_CFLAGS=-ffast-math -O3 -funroll-loops</code></pre><p>I've checked all 3 of these speed up my code. Are there any other common ones I could add?</p><p>Another tip I have is to add ""LOCAL_ARM_MODE := arm"" to Android.mk to enable a speed up on newer arm chips (although I'm confused at exactly what this does and what happens on older chips).</p>","580100","","580100","","2011-02-23 11:10:43","2013-05-15 19:44:38","Producing optimised NDK code for multiple architectures?","<android><c><gcc><jni><android-ndk>","2","1","22","",""
"5089793","1","","","2011-02-23 10:42:49","1","1413","<p>I am following answer no 8 from the following post:</p><p><a href=""http://stackoverflow.com/questions/2020088/sending-email-in-android-using-javamail-api-without-using-the-default-android-app"">SMTP Sample Code</a></p><p>it is working fine for the gmail. but not working for hotmail and yahoo.i define following smtp server</p><pre><code>SMTP Server for hotmail:smtp.live.comSMTP Server for yahoo:plus.smtp.mail.yahoo.com</code></pre><p>how this code work for hotmail and yahoo?</p>","309990","","","","","2011-11-25 05:37:39","how to send email from hotmail and yahoo?","<android>","2","0","2","",""
"5089796","1","5096273","","2011-02-23 10:43:31","0","169","<p>I'm just learning android and java. </p><p>I find that I'm having difficulty in using the documentation. They all look gibberish. Are there any tips and tricks on how to use any OOP documentations?</p><p>So far I've used the following documentations without difficulty before:</p><p>PHP, Jquery, CodeIgniter</p><p>I find difficulty in the following documentations: </p><p>Yii, Android</p><p>Are there some techniques in reading OOP documentations?</p>","626365","","","","","2011-02-23 19:50:44","Learning to use OOP documentation","<java><android><oop><codeigniter><yii>","1","3","","",""
"5089829","1","5091502","","2011-02-23 10:46:01","0","312","<p>In my project after crash I got log like this</p><pre><code>I/DEBUG   ( 1133):  r0 0000deed  r1 00001234  r2 deedbeed  r3 00000000I/DEBUG   ( 1133):  r4 befab4c0  r5 00000007  r6 befab548  r7 4214cb20I/DEBUG   ( 1133):  r8 befab49c  r9 4214cb0c  10 4214caf8  fp 81da5368I/DEBUG   ( 1133):  ip 80003108  sp befab440  lr 845133d4  pc 844ed8f0  cpsr 60000010I/DEBUG   ( 1133):  d0  7165722068736175  d1  4320585858585865I/DEBUG   ( 1133):  d2  006f006900740073  d3  00200030003d0074I/DEBUG   ( 1133):  d4  4214e9804214e94c  d5  4214e9e84214e9b4I/DEBUG   ( 1133):  d6  3ce2000000000000  d7  000000424214ea84I/DEBUG   ( 1133):  d8  0000000000000000  d9  0000000000000000I/DEBUG   ( 1133):  d10 0000000000000000  d11 0000000000000000I/DEBUG   ( 1133):  d12 0000000000000000  d13 0000000000000000I/DEBUG   ( 1133):  d14 0000000000000000  d15 0000000000000000I/DEBUG   ( 1133):  d16 4050800000000000  d17 4050800000000000I/DEBUG   ( 1133):  d18 4018000000000000  d19 3fe00000000000b4I/DEBUG   ( 1133):  d20 3ff0000000000000  d21 8000000000000000I/DEBUG   ( 1133):  d22 0000000000000000  d23 ff00000000000000I/DEBUG   ( 1133):  d24 ff00000000000000  d25 ff00000000000000I/DEBUG   ( 1133):  d26 0100010001000100  d27 0100010001000100I/DEBUG   ( 1133):  d28 0100010001000100  d29 3ff0000000000000I/DEBUG   ( 1133):  d30 0000000000000000  d31 3ff0000000000000I/DEBUG   ( 1133):  scr 20000012I/DEBUG   ( 1133): I/DEBUG   ( 1133):          #00  pc 000ed8f0  libmyproject.soI/DEBUG   ( 1133):          #01  lr 845133d4  libmyproject.soI/DEBUG   ( 1133): I/DEBUG   ( 1133): code around pc:I/DEBUG   ( 1133): 844ed8d0 e52de004 e24dd014 e58d0004 e58d1000 I/DEBUG   ( 1133): 844ed8e0 e28d301c e58d300c e59d3004 e5933000 I/DEBUG   ( 1133): 844ed8f0 e593c238 e59d0004 e59d1000 e59d2018 I/DEBUG   ( 1133): 844ed900 e59d300c e12fff3c e28dd014 e49de004 I/DEBUG   ( 1133): 844ed910 e28dd008 e12fff1e e52de004 e24dd00c I/DEBUG   ( 1133): I/DEBUG   ( 1133): code around lr:I/DEBUG   ( 1133): 845133b4 e2433013 e58d3024 e59d0024 e3a01c12 I/DEBUG   ( 1133): 845133c4 e2811034 e59f212c e3a03000 ebff693d I/DEBUG   ( 1133): 845133d4 ebff5e4c e1a03000 e3530000 0a000008 I/DEBUG   ( 1133): 845133e4 ebff5e48 e1a03000 e1a00003 ebfffa85 I/DEBUG   ( 1133): 845133f4 e1a03000 e3530000 0a000001 e3a03001 I/DEBUG   ( 1133): I/DEBUG   ( 1133): stack:I/DEBUG   ( 1133):     befab400  00770518  I/DEBUG   ( 1133):     befab404  0000a000  I/DEBUG   ( 1133):     befab408  befab4a0  I/DEBUG   ( 1133):     befab40c  4214cafc  I/DEBUG   ( 1133):     befab410  0000abe0  I/DEBUG   ( 1133):     befab414  afd13663  /system/lib/libc.soI/DEBUG   ( 1133):     befab418  0000ce60  I/DEBUG   ( 1133):     befab41c  00770518  I/DEBUG   ( 1133):     befab420  befab548  I/DEBUG   ( 1133):     befab424  4214cb04  I/DEBUG   ( 1133):     befab428  0000ce60  I/DEBUG   ( 1133):     befab42c  00770518  I/DEBUG   ( 1133):     befab430  befab548  I/DEBUG   ( 1133):     befab434  81d48eb9  /system/lib/libdvm.soI/DEBUG   ( 1133):     befab438  e3a07077  I/DEBUG   ( 1133):     befab43c  ef900077  I/DEBUG   ( 1133): #00 befab440  00001234  I/DEBUG   ( 1133):     befab444  0000deed  I/DEBUG   ( 1133):     befab448  00000007  I/DEBUG   ( 1133):     befab44c  befab45c  I/DEBUG   ( 1133):     befab450  4214cb20  I/DEBUG   ( 1133):     befab454  845133d4  libmyproject.soI/DEBUG   ( 1133):     befab458  deedbeed  I/DEBUG   ( 1133):     befab45c  00000000  I/DEBUG   ( 1133):     befab460  000009f4  I/DEBUG   ( 1133):     befab464  4462e744  I/DEBUG   ( 1133):     befab468  000001c7  I/DEBUG   ( 1133):     befab46c  00000000  I/DEBUG   ( 1133):     befab470  40532730  I/DEBUG   ( 1133):     befab474  0000abe0  I/DEBUG   ( 1133):     befab478  befab4c8  I/DEBUG   ( 1133):     befab47c  81d68e49 I/DEBUG   ( 1133):     befab480  40532730  I/DEBUG   ( 1133):     befab484  0000deed  </code></pre><p>however my map file doesn't have values like 0x845133d4. I guess that I need to know value of offset. Where I can find it?</p><p><strong>EDIT</strong></p><p>I found clue (http://groups.google.com/group/android-ndk/browse_thread/thread/83012b9a9633a6d6) how to find this offset, however my /proc/maps is empty</p><p><strong>EDIT2</strong></p><p>on device with root privileges <code>adb shell cat /proc/&lt;pid&gt;/maps</code> gives me:</p><pre><code>...82000000-83665000 r-xp 00000000 b3:02 5603348    libmyproject.so83665000-836c6000 rwxp 01664000 b3:02 5603348    libmyproject.so...</code></pre><p>Could anyone confirm that this is possible only on rooted devices? Anyone know how do this without root?</p>","338581","","338581","","2011-02-23 12:03:20","2012-11-01 17:39:53","Offset of shared libries on android","<android><crash><shared-libraries><offset>","2","0","","",""
"5089844","1","","","2011-02-23 10:48:35","1","1224","<p>Is it possible to tell the Android Emulator to use external hardware?In my case, I want to use a Microphone for input for an app I'm developing...</p><p>I know about the Emulator start-up commands, but I can't seem to get these working...</p><p>Is there anybody who can tell me more about how to use the start-up commands trough Eclipse? Or how to determine which backend I have to specify when using let's say the <code>-audio-in &lt;backend&gt;</code> start-up command...</p><p>I really need this to work, as I can't debug on the phone I use to test my apps...</p>","603059","","","","","2011-02-23 14:29:50","How to tell the Android Emulator to use an external hardware device (e.g. a microphone)?","<android><external><microphone>","1","2","","",""
"5089891","1","","","2011-02-23 10:52:23","1","753","<p>How to upload the video or image file to php server.Anyone provide some sample app or source to upload the file in php server please.</p>","555806","","","","","2011-08-25 16:51:10","Android Video Upload to Php server?","<android><android-video-player>","1","0","","",""
"5089944","1","5090061","","2011-02-23 10:57:25","15","45262","<p>How to get Current System's Time and Date without using <code>Calender.getInstance()</code></p>","624069","","940096","","2012-06-12 11:53:24","2014-03-21 13:58:39","Get Current System Time","<android><datetime>","4","0","1","",""
"5089982","1","5090760","","2011-02-23 11:01:05","0","1568","<p>The problem is: Service send me a data every 1 hour and i need to start Activity1. If i do nothing, its all the time will create the same Activity1 and in a 5 hours in stack i will have 5 the same Activities...So, how to kill activity before new one will start ?Thanks !</p><pre><code>            Intent dialogIntent = new Intent(getBaseContext(), someClass.class);            getApplication().startActivity(dialogIntent);</code></pre>","602011","","602011","","2011-02-23 11:06:25","2011-04-03 20:57:22","Android: Service start Activity","<android>","2","1","1","",""
"5089985","1","","","2011-02-23 11:01:19","0","422","<p>I've got a Samsung Galaxy Tab, which likes to dim the light on the device after about half a minute. When I touch the screen, it turns on the light again, but it also sends the touch event to whatever view is located where I touched, so I end up clicking on something I didn't mean to click.</p><p>Is there any way to know that the screen has dimmed the lights, so the touch events shouldn't be sent through to the views?</p><p>Update:I use the flag keep_screen_on for each activity, but I don't really want to. Auto-dimming restrains battery use, so if it's possible I'd like to do something else.</p>","397060","","397060","","2011-02-24 12:32:45","2011-02-24 12:32:45","Android touch events when screen is dark(ish)?","<android><screen><touch-event><dark>","1","1","","",""
"5089991","1","5090140","","2011-02-23 11:01:31","0","2549","<p>I am just tring to access the contact Content Provider. for that i wrote following code</p><pre><code>Cursor cur= getContentResolver().query(ContactsContract.Contacts.CONTENT_URI, null,null,null,null);    startManagingCursor(cur);    String[] result=new String[cur.getCount()];    if(cur.moveToFirst())    {        int nameidx=cur.getColumnIndexOrThrow(ContactsContract.Contacts.DISPLAY_NAME);        int Ididx=cur.getColumnIndexOrThrow(ContactsContract.Contacts._ID);        String strName=cur.getString(nameidx);        String strId=cur.getString(Ididx);        result[cur.getPosition()]=strName+""(""+strId+"")"";    }while(cur.moveToNext());   stopManagingCursor(cur);}</code></pre><p>but its showing only one contact name i want to show all contact available please tell me how do that.</p>","573776","","578594","","2011-02-23 11:05:44","2011-02-23 11:15:43","Accessing the contact Content Provider","<android>","1","3","","",""
"5090259","1","5090355","","2011-02-23 11:28:34","1","262","<p>For example, i have write GUI. I have a SeekBar, i change the progress but if i rotate android phone the progress is droped as default. Why it's happend and how could i fixe it?</p>","590952","","590952","","2011-02-23 11:40:12","2011-02-23 11:40:12","Why if rotate my android phone my application gui settings has droped?","<java><android><gui>","2","1","","",""
"5090285","1","5090356","","2011-02-23 11:31:19","14","32088","<p>I want to have a <code>View</code> that initially is invisible and when I press a button, it becomes visible with a fade in animation. I'm using the <code>AlphaAnimation</code> for the fading effect. The problem is that if I make the view invisible the animation can't be seen.</p><p>Thanks a lot,</p><p>Gratzi</p>","460611","","592025","","2012-06-12 09:17:09","2012-06-12 09:17:09","Using fade in animation for a view","<android><android-animation>","2","0","3","",""
"5090290","1","","","2011-02-23 11:31:53","4","2634","<p>I am trying to tile a 20x20 background onto my Custom View but for some reason I am unable too.</p><pre><code>    BitmapDrawable background;    background = new BitmapDrawable(BitmapFactory.decodeResource(getResources(), R.drawable.back));    background.setTileModeXY(Shader.TileMode.REPEAT, Shader.TileMode.REPEAT);    background.draw(canvas);</code></pre><p>Does anyone have an idea why it isn't working?</p>","625935","","","","","2012-04-25 01:06:41","Android: BitmapDrawable.Draw(Canvas) Doesn't seem to work","<android><bitmap><draw>","3","0","1","",""
"5090327","1","","","2011-02-23 11:36:07","0","285","<p>I have a project which need to transfer photo from handphone to pc through wifi. I using FTP to transfer. Everything was fine, I can transfer without any problems, but the problems is my applications took 10 ~ 12 to connect to the FTP server which is very long.By the way..i am using org.apache.commons.net.ftp Anyone can help me on reduce the connection time?Thanks in advanced</p><pre><code>FTPClient client =new FTPClient();client.connect(“hostAddress”,port); client.login(username, password);</code></pre>","630067","","","","","2011-02-23 11:36:07","How to Reduce FTP Connection Delay in android?","<android><ftp>","0","4","","",""
"5090361","1","","","2011-02-23 11:38:30","0","693","<p>I'd like to create a sliding view showing facebook contacts at the bottom of the screen.</p><p>When clicking on the facebook logo, as shown in top image, I'll show a facebook login form, and once logged in, clicking on the facebook logo will slide in/out the view (bottom image shows view after slide out). The view will contain pictures of some selected facebook contacts (not all, say up to 10), so the view should be scrollable to be able to see selected contacts.</p><p>I found SlidingDrawer, but it seems it requires two separate children views, one for handle, another for content, while I want one view, with only a selected area shown when slidden in.</p><p>Any suggestion on the best way to achieve this?</p><p>Thank you</p><p><img src=""http://i.stack.imgur.com/a14KA.png"" alt=""slidemenu1""></p><p><img src=""http://i.stack.imgur.com/lMfew.png"" alt=""slidemenu2""></p>","326849","","","","","2011-02-23 12:01:13","Scrollable sliding view in Android","<android><view><slide><scrollable>","2","0","0","",""
"5090364","1","","","2011-02-23 11:38:42","1","216","<p>read PDF with structure not only text.. I had used PDFbox but it only extract texts???? huh.</p>","","Jazz","","","","2011-02-23 11:38:42","read PDF with tables and all","<android>","0","4","1","",""
"5090452","1","5098501","","2011-02-23 11:47:53","0","109","<p>I am having troubles with Threading ;)</p><p>I have done an script about my class as follow:</p><pre><code>class Test{TextToSpeech mTts = new TextToSpeech();boolean volatile mVarGlobal = false;class T1 extends Thread{    public void run(){        doSomething(){            mVarGlobal = false;            // network working...Take a while            mTts.speak(...) //Speech information received from Network            mVarGlobal = true;        }    }     T1 t = new T1();    t.start();class CheckVarGlobal extends Thread{    public void run(){          if(!mVarGlobal) {            text2Speech.speak(""something"");        }    postAtTime(this, 3000);    } }CheckVarGlobal c = new CheckVarGlobal ();c.start();</code></pre><p>}</p><p>As you can see I have 2 Threads running, one which is getting network information and a second one which is cheking if the information from network has been received. The boolean variable mVarGlobal will be true, and then the Thread which is checking ""CheckVarGlobal"" will stop as the condition (!mVarGlobal) is false.</p><p>The problem is that once i get the information in the 1st Thread from network and speech the information, 2nd Thread still is running and speeching ""something"". I guess the 2nd Thread has not realize that CheckVarGlobal is true... I have typed the variable as volatile as it is used from 2 threads. </p><p>Any idea why is it happening, and how to solve it?</p><p>Thanks a lot,</p><p>Best.David.</p>","588925","","","","","2011-02-28 03:26:41","Having fun with Threads","<android><multithreading>","2","3","0","",""
"5090494","1","5090608","","2011-02-23 11:51:35","2","3533","<pre><code>String quote = ""Now is the time for all good ""+               ""men to come to the aid of their country."";</code></pre><p>I want to detect break line in run time when I click on button I want to know new line comes..because in TEXTVIEW i want output same as like this String nothing change.. so tell me some idea or logic or source code of this....</p>","1004437","","276052","","2011-02-23 11:59:44","2011-02-23 12:13:13","how to detect new line in this type of string","<java><android>","2","5","","",""
"5090495","1","5285452","","2011-02-23 11:51:49","1","2800","<p>Have done some Android Dev in the past but it has been a while - want to build an app that uses Orientation and Proximity Sensors. so...</p><pre><code>mSensorManager = (SensorManager) getSystemService(SENSOR_SERVICE);    mSensorManager.registerListener(this, mSensorManager.getDefaultSensor(Sensor.TYPE_ALL) , SensorManager.SENSOR_DELAY_GAME);</code></pre><p>So set up listener - listened to all sensors - wonder should I just listen to two? (would this save battery?)</p><pre><code>Sensor mySensor = event.sensor;    // if (mySensor.getType() != Sensor.TYPE_ORIENTATION) return;    if (mySensor.getType() == Sensor.TYPE_ORIENTATION)    {        float x = event.values[0];        float y = event.values[1];        float z = event.values[2];        tv.setText(""Rotation around X, Azimuth = "" + x);        tv1.setText(""Rotation around Y, Pitch = "" + y);        tv2.setText(""Rotation around Z, Roll = "" + z);    }    if (mySensor.getType() == SensorManager.SENSOR_PROXIMITY)    {        float p = event.values[0];        tv3.setText(""Proximity = "" + p);    }</code></pre><p>Then in onSensorChanged - see above</p><p>on my LG Optimus One I can get it to display the values in the TextViews of the Orientation sensor (this phone doesn't have a proximity sensor)</p><p>But running the same code on my Nexus One leads to a lovely blank screen!?</p><p>Sorry for the long question! but any help would be good and if you need more infor just ask,LG phone is 2.2 Nexus One is 2.2.2Thanks,</p><p>David</p>","630118","","630118","","2011-02-23 12:03:29","2011-03-12 20:59:35","Android Sensors - Problem getting Proximity Sensor Values and problems with using different phones","<android><accelerometer><sensor><proximity>","1","3","","",""
"5090522","1","","","2011-02-23 11:54:14","2","4804","<p>I want to develop a FAX application.I searched on google and found some links ,applications for developing FAX apps on android.But I want to develop application using native app from android.In some sites i read free web services are available for sending/receiving fax using android mobile application.But I don't want to use Third party services due to security reasons.Was android provided any native app?otherwise please give me advise which way is better to develope application?</p>","486216","","","","","2014-01-08 17:01:40","Is there any native app for Android FAX?","<android><fax>","4","0","1","",""
"5090621","1","","","2011-02-23 12:01:38","0","654","<ol><li>I want to write simple test program to record audio stream from input jack (microphone?). </li><li>I must calculate the audio latency information and show it.</li></ol><p>I must use NDK or SDK?Does there exist a simple source code that does this for me?</p><p>In the end, how I can start to write it?</p>","369058","","366898","","2012-07-30 09:59:19","2012-07-30 09:59:19","Android: Record an audio stream and retrieve the latency information","<android><sdk><android-ndk><low-latency>","1","0","","",""
"5090636","1","5090726","","2011-02-23 12:03:06","2","1014","<p>in my app i have three editText where the user can place a number.then.when the user press a button,i get the result of my calculation into another editext.</p><p>this is my code,but the app forces down..any help please?</p><p>code:</p><pre><code> float result = (float) ((((new Double(input11.getText().toString())                                                    + new Double(input21.getText().toString()))/2)*0.3)+ (new Double(input31.getText().toString())*0.7));                                    vprosvasis.setText(Float.toString(result));}</code></pre><p>calculation:</p><pre><code> float genikosvathmos = (float) ((new Double(vprosvasis.getText().toString())+new Double(vprosvasis7.getText().toString())+ new Double(vprosvasis2.getText().toString())+new Double(vprosvasis3.getText().toString())                                                        +new Double(vprosvasis4.getText().toString())+new Double(vprosvasis5.getText().toString())+new Double(vprosvasis6.getText().toString()))/7);                                 float moria=(float) (((new Float ((genikosvathmos*8)+(""vprosvasis * 1.3"")+(""vprosvasis2 * 0,7""))*100)));                                        Toast.makeText(thetiki.this, ""Genikos vathmos""+moria , Toast.LENGTH_SHORT).show();</code></pre><p>logCat:</p><pre><code>02-23 13:57:50.255: WARN/dalvikvm(20923): threadid=1: thread exiting with uncaught exception (group=0x4001d7d0)02-23 13:57:50.364: ERROR/AndroidRuntime(20923): FATAL EXCEPTION: main02-23 13:57:50.364: ERROR/AndroidRuntime(20923): java.lang.NumberFormatException: 02-23 13:57:50.364: ERROR/AndroidRuntime(20923):     at org.apache.harmony.luni.util.FloatingPointParser.parseFltImpl(Native Method)02-23 13:57:50.364: ERROR/AndroidRuntime(20923):     at org.apache.harmony.luni.util.FloatingPointParser.parseFloat(FloatingPointParser.java:321)02-23 13:57:50.364: ERROR/AndroidRuntime(20923):     at java.lang.Float.parseFloat(Float.java:291)02-23 13:57:50.364: ERROR/AndroidRuntime(20923):     at java.lang.Float.&lt;init&gt;(Float.java:111)02-23 13:57:50.364: ERROR/AndroidRuntime(20923):     at kostas.menu.moria.thetiki$8.onClick(thetiki.java:372)02-23 13:57:50.364: ERROR/AndroidRuntime(20923):     at android.view.View.performClick(View.java:2461)02-23 13:57:50.364: ERROR/AndroidRuntime(20923):     at android.view.View$PerformClick.run(View.java:8888)02-23 13:57:50.364: ERROR/AndroidRuntime(20923):     at android.os.Handler.handleCallback(Handler.java:587)02-23 13:57:50.364: ERROR/AndroidRuntime(20923):     at android.os.Handler.dispatchMessage(Handler.java:92)02-23 13:57:50.364: ERROR/AndroidRuntime(20923):     at android.os.Looper.loop(Looper.java:123)02-23 13:57:50.364: ERROR/AndroidRuntime(20923):     at android.app.ActivityThread.main(ActivityThread.java:4627)02-23 13:57:50.364: ERROR/AndroidRuntime(20923):     at java.lang.reflect.Method.invokeNative(Native Method)02-23 13:57:50.364: ERROR/AndroidRuntime(20923):     at java.lang.reflect.Method.invoke(Method.java:521)02-23 13:57:50.364: ERROR/AndroidRuntime(20923):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:858)02-23 13:57:50.364: ERROR/AndroidRuntime(20923):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)02-23 13:57:50.364: ERROR/AndroidRuntime(20923):     at dalvik.system.NativeStart.main(Native Method)02-23 13:57:50.399: WARN/ActivityManager(2944):   Force finishing activity kostas.menu.moria/.thetiki</code></pre>","519526","","1465910","","2012-09-29 09:07:18","2012-09-29 09:07:18","make calculation and toast it---error","<android><toast>","3","1","","",""
"5090671","1","","","2011-02-23 12:06:22","0","275","<p>I developed web service that works on windows using vs2005 .can I run it on android mobile?</p>","499858","","","","","2011-02-23 12:09:48","Run web application on android","<android>","1","3","","",""
"5090698","1","5091202","","2011-02-23 12:09:35","1","529","<p>I have one WCF web service hosted on https. which android versions supports https. I know that Android 2.2 supports https. Any code for older version??</p>","","Nimit ","","Nimit ","2011-02-23 12:49:03","2011-02-23 12:55:07","Which version of Android supports HTTPS","<android>","2","1","","",""
"5090719","1","","","2011-02-23 12:11:21","-2","1195","<p>Anybody have this file pls give me link.</p><p>Thanks in advance.</p>","487253","","","","","2011-09-09 11:36:14","system.img file for android 2.1 and 2.2","<android><system>","1","0","","",""
"5090814","1","","","2011-02-23 12:18:53","0","2270","<p>Can any one provide any example of StackView in Android 3.0 HoneyComb , it wll be a gr8 help for me .. thnxxx....</p>","630159","","750987","","2011-05-29 06:43:37","2011-05-29 06:43:37","StackView in Android 3.0 HoneyComb","<android><android-3.0-honeycomb><stackview>","1","0","","",""
"5090838","1","5090958","","2011-02-23 12:20:07","1","220","<p>there is an error while i am running my application? can anybody tell me why this error appeared and how to resolve it.</p><p>ERROR IS :[2011-02-23 17:46:48 - diffrentviews] W/ResourceType( 4072): Bad XML block: header size 166 or total size 0 is larger than data size 0[2011-02-23 17:46:48 - diffrentviews] C:\Documents and Settings\a.singh\workspace\diffrentviews\res\menu\main_menu.xml:7: error: No resource identifier found for attribute 'alphabeticShortcuts' in package 'android'</p>","552027","","168233","","2011-02-23 12:47:29","2011-02-23 12:47:29","Error while running programe?","<android><android-layout>","1","1","","",""
"5090889","1","","","2011-02-23 12:24:58","-1","837","<pre><code>HttpClient hc = new DefaultHttpClient();        HttpPost post = new HttpPost(""http://www.yahoo.com.hk"");        HttpResponse rp = hc.execute(post);        if(rp.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {            String str = EntityUtils.toString(rp.getEntity());            Log.e(""STRING:"",str);            }</code></pre><p>It is not printing error message also. It is giving launch timeout warning. Give me the code to connect with yahoo or google servers.</p>","630173","","1108213","","2012-03-10 12:21:49","2012-03-10 12:21:49","httpclient android","<android><httpclient>","1","3","","",""
"5090915","1","5091454","","2011-02-23 12:27:47","3","1880","<p>I want to show songs from sdcard in listview but it gives Force Close.Can any one help me for this.Code:</p><pre><code>package com.ex.imageGallery;import java.io.File;import android.app.Activity;import android.content.Intent;import android.graphics.drawable.ColorDrawable;import android.net.Uri;import android.os.Bundle;import android.os.Environment;import android.view.View;import android.widget.AdapterView;import android.widget.AdapterView.OnItemClickListener;import android.widget.ArrayAdapter;import android.widget.ImageView;import android.widget.ListView;import java.io.FilenameFilter;public class audioList extends Activity{ @Override    public void onCreate(Bundle savedInstanceState) {     Uri[] mUrls;    String[] mFiles=null;         super.onCreate(savedInstanceState);        setContentView(R.layout.audio_list);        ListView lv;        lv = (ListView)findViewById(R.id.LV);        /*File home = Environment.getDataDirectory();        File[] audioList = home.listFiles(new FilenameFilter() {            public boolean accept(File dir, String name) {                // TODO Auto-generated method stub                return(name.endsWith("".mp3""));            }        });        mFiles = new String[audioList.length];        for(int i=0;i&lt;audioList.length;i++)        {            mFiles[i] = audioList[i].getAbsolutePath();        }        mUrls = new Uri[mFiles.length];        for(int i=0;i&lt;mFiles.length;i++)        {            mUrls[i] = Uri.parse(mFiles[i]);        }        lv.setAdapter(new ArrayAdapter&lt;String&gt;(audioList.this,R.layout.new_list,mFiles));        lv.setDividerHeight(2);        lv.setTextFilterEnabled(true); */ } }</code></pre>","621380","","379693","","2011-02-23 13:00:06","2011-09-27 09:08:40","show songs from SDCARD","<android>","2","1","1","",""
"5091004","1","5091353","","2011-02-23 12:37:34","0","875","<p>I am trying to programmatically add and remove application shortcuts from the app drawer. I understand the app drawer knows which applications should be presented by using an intent filter with the LAUNCHER category.</p><p>I would like to be able to add/remove shortcuts to specific activities in my application, according to dynamic conditions, which is why I can't have them simply in my manifest file.</p><p>Thank you.</p>","609444","","","","","2011-02-23 13:11:08","Add / Remove App Drawer Shortcuts","<android><drawer>","1","0","","",""
"5091055","1","5091667","","2011-02-23 12:43:13","0","763","<p>Hello I have one ImageButton with single image. I have added onclick event and normally it works fine.When Imagebutton is clicked my add entry function works. </p><p>Now when user continously clicks my imagebutton, My add entry functions executes that many times with same data. I want to prevent it. Such that, Imagebutton should not queue up to process next click event until my function gets executed completely.</p><p>I tried to <code>myImageButton.setEnable(false)</code> as soon as OnClick event executes. And Doing </p><p><code>myImageButton.setEnable(true)</code> after my data entry function.</p><p>I also tried to put this code in <code>myImageButton.isEnabled()</code> but didnt work.</p><p>How to ignore such queued click events? Is there any other way (than <code>setEnable()</code>) to ignore/eat click processing?</p><p>I have checked by putting println statements that each click event is in sync...means all code executes in order.</p><p><strong>EDIT</strong></p><pre><code>   private OnClickListener m_AddClickHandler = new OnClickListener()    {        public void onClick(View v)        {            if(m_bDoAdd)            {                m_bDoAdd = false;                new AddTask().execute();            }            else                logData(""Add::OnClick::not clicked"");        }    };private class AddTask extends AsyncTask&lt;Void, Void, Integer&gt;     {        @Override        protected Integer doInBackground(Void... params)         {            logData(""doinbg, start""+m_bDoAdd);            int iStatus =Add(m_data);            logData(""doinbg, start end, status=""+iStatus+""flag=""+m_bDoAdd);            return iStatus;        }        @Override        protected void onPostExecute(Integer result)         {            logData(""onpostExec, start""+m_bDoAdd);            int iStatus = result;            if (iStatus == 0)            {                Toast.makeText(getApplicationContext(), R.string.strAdded, Toast.LENGTH_SHORT).show();            }            else if (iStatus == 1)            {                Toast.makeText(getApplicationContext(), R.string.strAlreadyExists, Toast.LENGTH_SHORT).show();            }            else            {                Toast.makeText(getApplicationContext(), R.string.strAddFailed, Toast.LENGTH_SHORT).show();            }            m_bDoAdd = true;            logData(""onpostExec, end""+m_bDoAdd);        }    }    void Add()    {       // Add info to db (takes few msecs)    }</code></pre><p>I am still not getting ""Add::OnClick::not clicked"" in log.</p><p>Any further clue?</p>","465751","","465751","","2011-02-24 11:51:25","2011-02-24 11:51:25","Android GUI :: Continuous click events hangs","<android><imagebutton>","3","1","","",""
"5091114","1","","","2011-02-23 12:47:54","0","382","<p>I see that most of you have the ""invalid key"" issue.</p><p>For me, it works fine with the androiddebugkey. But the errors appears when I sign apk with my own key (I did it many times with many keys).</p><p>This would mean that the generated hash from my own key is bad. Actually, everithing was good when generating the hash (alias, passwords...). The hash generated is the same when I use keytool and Cygwin on Windows (XP).</p><p>Do you have an easy way to generate this hash (small tutorial for mac) ???</p><p>thanks.</p>","630179","","630179","","2011-02-23 13:09:49","2011-02-23 13:09:49","Facebook sdk : Hash generation on Windows","<java><android><facebook><sdk>","0","3","","",""
"5091279","1","","","2011-02-23 13:03:04","0","96","<p>In My application there are 3 tabs for Tab Host which contains activities .These activities are downloading some images and videos from server.The problemis when I frequently click the tabs I get force close due to many exceptions. If I solve oneanother exception arise. so I want to introduce a progress dialog on tab click so that the user unable to click the other tabs.I tried including progress bar at the starting of onCreate() and onTabChanged() but its no use please help me regard this. </p><p>If this information is not eno</p>","607717","","","","","2011-02-23 13:14:49","Trouble With TabActivity on Frequent Clicking The Tabs","<android>","1","0","","",""
"5091333","1","5091443","","2011-02-23 13:08:58","0","1642","<p>I've been keen to learn about triggers in Android and SQLite. I found a great tutorial at:</p><p><a href=""http://android-pro.blogspot.com/2010/10/using-sqlite-database-with-android.html"" rel=""nofollow"">http://android-pro.blogspot.com/2010/10/using-sqlite-database-with-android.html</a></p><p>However, having imported their project into Eclipse and tried running it, I get the error:</p><pre><code>android.database.SQLiteException: no such column EmployeeName while compiling: SELECT _id,EmployeeName, Age, DeptName FROM ViewEmps WHERE DeptName=?</code></pre><p>This occurs when trying to view information from the database after selecting an items foreign key. e.g. add person to dept IT. Go to view screen, select IT and the error occurs.</p><p>The author of the tutorial has tried to solve the issue by saying increase the database version but this doesn't seem to have worked for anyone. The part of the code which causes the error seems to be this:</p><pre><code>db.execSQL(""CREATE VIEW ""+viewEmps+"" AS SELECT ""+employeeTable+"".""+colID+"" AS _id,""+"" ""+employeeTable+"".""+colName+"",""+"" ""+employeeTable+"".""+colAge+"",""+"" ""+deptTable+"".""+colDeptName+""""+"" FROM ""+employeeTable+"" JOIN ""+deptTable+"" ON ""+employeeTable+"".""+colDept+"" =""+deptTable+"".""+colDeptID);</code></pre><p>I have tried chopping and changing bits and tried to debug myself but have gotten nowhere with it. If anyone has any ideas then it would be greatly appreciated. If anyone could download the code from the website above and try it to see their results would be really helpful as it seems to only be happening to a few people. If any more information is required then let me know and I will try to help.</p><p>EDIT: if anyone wants to download the source then I have also uploaded it to MediaFire as some people have been having problems with the other mirror. Grab it at: <a href=""http://www.mediafire.com/?2ya4jsbcuiyq3m5"" rel=""nofollow"">http://www.mediafire.com/?2ya4jsbcuiyq3m5</a></p>","319940","","319940","","2011-02-23 14:45:48","2011-11-20 02:02:46","Android SQLite with Triggers tutorial debugging","<android><sqlite><triggers>","2","1","","",""
"5091349","1","5091838","","2011-02-23 13:11:02","1","655","<p>I have a webview in which a local html page is show. It all works fine , but in landscape mode i can use zoom controls but pinch zoom cannot be done</p><p>Please help</p>","450487","","450487","","2011-02-24 13:31:47","2011-02-24 13:31:47","Pinch zoom not working in landscape mode when webview is not full screen","<android><webview><pinch>","1","2","","",""
"5091472","1","","","2011-02-23 13:23:15","1","3168","<p>how can we look at the Browser's code and see how it plays videos embedded using the  tag?Please help</p>","527933","","","","","2012-01-06 11:35:46","Android browser code","<android>","4","0","","",""
"5091571","1","5094442","","2011-02-23 13:31:25","0","823","<p>as in title.  Have TTS reading out received messages.  But if the message exceeds 160 characters, it will no read the rest (which I assume is technically a second text, linked into one ""big"" message by the network provider) How can I modify my code so that if the sms is bigger than the standard single message, I can read it all out?Here is a snippet of my code</p><pre><code>public void onReceive(Context context, Intent intent) {            int n;             Bundle bundle = intent.getExtras();            Object messages[] = (Object[]) bundle.get(""pdus"");            SmsMessage smsMessage[] = new SmsMessage[messages.length];            for (n = 0; n&lt;messages.length; n++){                    smsMessage[n] =             SmsMessage.createFromPdu((byte[])messages[n]);             }            String sms1 = smsMessage[0].getMessageBody();                   /**Send variable to the class handling TTS, to be read out-loud by the corresponding method */            SpeakerActivity.speakSMS(sms1);</code></pre>","600423","","168868","","2012-01-01 21:55:19","2012-01-01 21:55:19","TTS reads out received sms, if sms exceeds normal 160 characters - will stop","<android><sms><text-to-speech>","2","5","","",""
"5091598","1","5092010","","2011-02-23 13:34:29","1","948","<p>I have read that it will allow creating an Android app without (much) programming skill.</p><p>I am a programmer and have already developed some apps for the Android. Is the App Inventor worth while for me to learn for one of</p><ul><li>Converting <strong>completed</strong> apps over to App Inventor</li><li>Converting <strong>in progress</strong> apps over to App Inventor</li><li>Starting <strong>new</strong> apps with App Inventor</li></ul><p>And what are the general limitations?</p>","463304","","","","","2011-04-12 19:46:34","Android App Inventor: Is it worth learning (yet)?","<android><app-inventor>","2","0","","",""
"5091634","1","7357095","","2011-02-23 13:37:36","2","481","<p>I'm working on a game that obscures part of image, player then guesses what's hidden and finally the obscured part is revealed, so player can see if he guessed correctly.</p><p>At the moment I just draw a black box above the obscured part, but it would be nice if I could pixelate the obscured area to a huge pixel size, then decrease the pixelation size until the image is clearly visible, in an animation. </p><p>Is it possible to somehow utilize Android's support for animations (I have used it in one game, to animate on screen stuff), or would I need to implement this entirely on my own using some kind of timer and drawing on Canvas myself? Or is there something handy that will help me?</p>","72746","","","","","2011-09-09 04:16:15","Android animated pixelation","<android><bitmap><2d><pixelate>","1","0","","",""
"5091674","1","","","2011-02-23 13:41:28","6","21627","<p>I'd like to create custom layout for Android 2.3 keyboard. Where do I start? Currently I don't have any experience in Android platform.</p><p>Is it possible to hack the existing keyboard layout so that I will not have to create a new one from scratch?</p>","48461","","48461","","2011-02-23 16:59:23","2013-02-03 18:50:53","creating custom android keyboard layout","<android><layout><keyboard>","3","2","4","",""
"5091748","1","","","2011-02-23 13:50:06","0","1067","<p>I have a tabhost that contains 5 tab (Monday .... Friday).I want to change the indicators dynamically from other activities (using a button)Does any one have a solution Thanks in advance   </p>","630293","","508666","","2012-01-29 13:18:23","2013-10-04 13:54:16","How Do I change the indicator of a tabhost dynmaicly from an other activity","<android><dynamic><android-tabhost><indicator>","2","1","","",""
"5091842","1","","","2011-02-23 13:57:56","4","2714","<p>Is there an eBook (ePub version of the android developer's guide available somewhere so I can carry it around and read parts without always carrying my laptop?</p><p>ThanksP.S. I understand that such a product would not be as dynamic as the online version, but I am  looking for portability.</p>","630301","","1228","","2013-08-02 14:49:18","2013-08-02 14:49:18","Is there an eBook (ePub) version of the android user guide","<android><epub><user-guide>","5","1","1","2013-08-02 11:16:03",""
